Skip to main content
Get orderbook data. Two channels are available: orderbookupdate pushes incremental updates, orderbook10 pushes a 10-level snapshot.

Pushing Rules

  1. No user login required
  2. orderbookupdate: incremental updates, RPI orders are not included. orderbookupdaterpi: incremental updates including both non-RPI and RPI orders
  3. orderbook10: a 10-level snapshot pushed every 200ms

Orderbook Update

Request

Request
Topic Format: orderbookupdate@<symbol>@<depth>
  • symbol: Trading pair, such as PERP_BTC_USDT
  • depth: Depth level, support 50, 200 or 500

Response

Response
Return data description:

How to correctly maintain a copy of OrderBook locally:

  1. Subscribe to orderbookupdate@<symbol>@<depth> and buffer the messages received
  2. Request the snapshot via REST GET /v3/public/orderbook?symbol=<symbol>&maxLevel=<depth>
  3. Start processing the buffered messages whose prevTs equals the timestamp of the snapshot
  4. For each newly processed message, check that its prevTs equals the ts of the previous message. If not, a message was missed, request the snapshot again and rebuild
  5. If a price level has quantity 0, delete that price level
  6. If a price level does not exist, insert it with the quantity
  7. If a price level already exists, update it with the new quantity

Orderbook 10

Request

Request
Topic Format: orderbook10@<symbol>
  • symbol: Trading pair, such as PERP_BTC_USDT

Response

Response
Return data description: Each push is the full 10 levels.

Orderbook Update (RPI)

Subscribe to the delta updates of the order book with both non-RPI and RPI orders.

Request

Request
Topic Format: orderbookupdaterpi@<symbol>@<depth>
  • symbol: Trading pair, such as PERP_BTC_USDT
  • depth: Depth level, support 50, 200 or 500. The push interval is the same as orderbookupdate

Response

The response format is the same as orderbookupdate, with topic being orderbookupdaterpi@PERP_BTC_USDT@50.

How to correctly maintain a copy of OrderBook locally:

  1. Subscribe to orderbookupdaterpi@<symbol>@<depth> and buffer the messages received
  2. Request the snapshot via REST GET /v3/public/orderbook?symbol=<symbol>&maxLevel=<depth>&rpi=true
  3. Follow steps 3 to 7 of the orderbookupdate procedure above