Class BinanceMarketDataService
java.lang.Object
org.knowm.xchange.service.BaseExchangeService<E>
org.knowm.xchange.service.BaseResilientExchangeService<BinanceExchange>
org.knowm.xchange.binance.service.BinanceBaseService
org.knowm.xchange.binance.service.BinanceMarketDataServiceRaw
org.knowm.xchange.binance.service.BinanceMarketDataService
- All Implemented Interfaces:
BaseService
,MarketDataService
public class BinanceMarketDataService extends BinanceMarketDataServiceRaw implements MarketDataService
-
Field Summary
Fields inherited from class org.knowm.xchange.binance.service.BinanceBaseService
apiKey, binance, binanceFutures, LOG, signatureCreator
Fields inherited from class org.knowm.xchange.service.BaseResilientExchangeService
resilienceRegistries
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
Constructors Constructor Description BinanceMarketDataService(BinanceExchange exchange, ResilienceRegistries resilienceRegistries)
-
Method Summary
Modifier and Type Method Description static OrderBook
convertOrderBook(BinanceOrderbook ob, Instrument pair)
FundingRate
getFundingRate(Instrument instrument)
Get the FundingRate for specific instrument.FundingRates
getFundingRates()
Get the FundingRates for all perpetual contracts of the platform.OrderBook
getOrderBook(Instrument instrument, Object... args)
Get an order book representing the current offered exchange rates (market depth)Ticker
getTicker(Instrument instrument, Object... args)
Get a ticker representing the current exchange rateTrades
getTrades(Instrument instrument, Object... args)
optional parameters provided in the args array: 0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.Methods inherited from class org.knowm.xchange.binance.service.BinanceMarketDataServiceRaw
aggTradesAllProducts, aggTradesPermits, binanceTime, depthPermits, getBinanceFundingRate, getBinanceFundingRates, getBinanceOrderbookAllProducts, klines, klines, lastKline, ping, ticker24hAllProducts, ticker24hAllProducts, tickerAllBookTickers, tickerAllPrices, tickerPrice
Methods inherited from class org.knowm.xchange.binance.service.BinanceBaseService
getExchangeInfo, getFutureExchangeInfo, getRecvWindow, getSystemStatus, getTimestampFactory
Methods inherited from class org.knowm.xchange.service.BaseResilientExchangeService
decorateApiCall, rateLimiter, rateLimiter, retry, retry
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.knowm.xchange.service.marketdata.MarketDataService
getCandleStickData, getOrderBook, getOrderBook, getTicker, getTickers, getTrades, getTrades
-
Constructor Details
-
BinanceMarketDataService
public BinanceMarketDataService(BinanceExchange exchange, ResilienceRegistries resilienceRegistries)
-
-
Method Details
-
getTrades
optional parameters provided in the args array:- 0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.
- 1: Long startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
- 2: Long endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
- 3: Integer limit optional, Default 500; max 500.
- Specified by:
getTrades
in interfaceMarketDataService
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
Description copied from interface:MarketDataService
Get a ticker representing the current exchange rate- Specified by:
getTicker
in interfaceMarketDataService
- 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
-
getOrderBook
Description copied from interface:MarketDataService
Get an order book representing the current offered exchange rates (market depth)- Specified by:
getOrderBook
in interfaceMarketDataService
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
-
getFundingRates
Description copied from interface:MarketDataService
Get the FundingRates for all perpetual contracts of the platform.- Specified by:
getFundingRates
in interfaceMarketDataService
- Returns:
- The FundingRates, 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
Description copied from interface:MarketDataService
Get the FundingRate for specific instrument.- Specified by:
getFundingRate
in interfaceMarketDataService
- 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
-
convertOrderBook
-