Class OkexMarketDataService

All Implemented Interfaces:
BaseService, MarketDataService

public class OkexMarketDataService extends OkexMarketDataServiceRaw implements MarketDataService
Author: Max Gao (gaamox@tutanota.com) Created: 08-06-2021
  • Constructor Details

  • Method Details

    • getOrderBook

      public OrderBook getOrderBook(Instrument instrument, Object... args) throws IOException
      Description copied from interface: MarketDataService
      Get an order book representing the current offered exchange rates (market depth)
      Specified by:
      getOrderBook in interface MarketDataService
      Parameters:
      args - Optional arguments. Exchange-specific
      Returns:
      The OrderBook, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getTrades

      public Trades getTrades(Instrument instrument, Object... args) throws IOException
      Description copied from interface: MarketDataService
      Get the trades recently performed by the exchange
      Specified by:
      getTrades in interface MarketDataService
      Parameters:
      args - Optional arguments. Exchange-specific
      Returns:
      The Trades, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getTicker

      public Ticker getTicker(Instrument instrument, Object... args) throws IOException
      Description copied from interface: MarketDataService
      Get a ticker representing the current exchange rate
      Specified by:
      getTicker in interface MarketDataService
      Returns:
      The Ticker, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getCandleStickData

      public CandleStickData getCandleStickData(CurrencyPair currencyPair, CandleStickDataParams params) throws IOException
      Description copied from interface: MarketDataService
      Get the CandleStickData for given currency between startDate to endDate.
      Specified by:
      getCandleStickData in interface MarketDataService
      Parameters:
      currencyPair - currencyPair.
      params - Params for query, including start(e.g. march 2022.) and end date, period etc.,
      Returns:
      The CandleStickData, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getFundingRate

      public FundingRate getFundingRate(Instrument instrument) throws IOException
      Description copied from interface: MarketDataService
      Get the FundingRate for specific instrument.
      Specified by:
      getFundingRate in interface MarketDataService
      Parameters:
      instrument - Instrument to get the funding rate.
      Returns:
      The FundingRate, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data