Hi there, I tried to connect to futures stream thru websocket to retrieve a real time data for the contract price. I’m doing ethusdt perpetual contract. What I noticed is that the price between the websocket feed (wss://fstream.binance.com/ws/ethusdt@bookTicker) and the price I get from API endpoint (/fapi/v1/depth) are not the same. What could be causing this price inconsistency?
API responses are typically more outdated than WebSocket streams, especially for GET /fapi/v1/depth
. Compare "lastUpdateId"
in API responses with "u"
in @bookTicker
to see how different the state is. Typically GET /fapi/v1/ticker/bookTicker
is more up-to-date, but it’s still better to use WebSocket streams.