I use code like that to get the best price
public void allBookTickSubscription(){
BinanceClient.spotSubsptClient.onAllBookTickersEvent(bookTickerEvent -> {
HashMap map = new HashMap();
map.put(BeanConstant.BEST_ASK_PRICE,bookTickerEvent.getAskPrice());
map.put(BeanConstant.BEST_ASK_Qty,bookTickerEvent.getAskQuantity());
map.put(BeanConstant.BEST_BID_PRICE,bookTickerEvent.getBidPrice());
map.put(BeanConstant.BEST_BID_QTY,bookTickerEvent.getBidQuantity());
MarketCache.tickerMap.put(bookTickerEvent.getSymbol(),map);
String symbol = "BTCUSDT";
if(MarketCache.tickerMap.containsKey(symbol))
System.out.println(MarketCache.tickerMap.get(symbol).get(BeanConstant.BEST_ASK_PRICE));
});
}
but the BTCUSDT price I get from code is quite different(48654 vs 48534) from the web.