{ "topic": "orderbookupdate@SPOT_BTC_USDT@50", "ts": 1618826337580, // when ws sends the data "data": { "s": "SPOT_BTC_USDT", // symbol "prevTs":1618826337380, // orderbook generation system time of the previously sent message "asks": [ // delta updates on the ask side [ "56749.15", "3.92864" ], [ "56749.8", "0" ], ... ], "bids": [ // delta updates on the bid side [ "56745.2", "1.03895025" ], [ "56744.6", "1.0807" ], ... ], "ts": 1618826337570 // orderbook generation time }}
Public Market Data
Orderbook update
Copy
{ "topic": "orderbookupdate@SPOT_BTC_USDT@50", "ts": 1618826337580, // when ws sends the data "data": { "s": "SPOT_BTC_USDT", // symbol "prevTs":1618826337380, // orderbook generation system time of the previously sent message "asks": [ // delta updates on the ask side [ "56749.15", "3.92864" ], [ "56749.8", "0" ], ... ], "bids": [ // delta updates on the bid side [ "56745.2", "1.03895025" ], [ "56744.6", "1.0807" ], ... ], "ts": 1618826337570 // orderbook generation time }}
Start processing any updates where prevTs = timestamp in the snapshot
Check prevTs of each newly processed update is the same as the ts of the previous update
If you receive a price level with 0 size, delete that price level
If you receive a price level that does not exist, insert that price level and size
If you receive a price level that already exists, update that price level with the new size
Copy
{ "topic": "orderbookupdate@SPOT_BTC_USDT@50", "ts": 1618826337580, // when ws sends the data "data": { "s": "SPOT_BTC_USDT", // symbol "prevTs":1618826337380, // orderbook generation system time of the previously sent message "asks": [ // delta updates on the ask side [ "56749.15", "3.92864" ], [ "56749.8", "0" ], ... ], "bids": [ // delta updates on the bid side [ "56745.2", "1.03895025" ], [ "56744.6", "1.0807" ], ... ], "ts": 1618826337570 // orderbook generation time }}