Skip to main content

Full Orderbook

Subscribe to the full orderbook stream. Delivers delta-only updates for deep, full-depth market data.

Covers: Spot / USDT contract / USDC contract / Inverse contract

info

Release Schedule

ProductTestnetMainnet
SpotJuly 6, 2026July 16, 2026
Futures (linear & inverse)Est.July 13, 2026not determined

Push frequency

Linear, inverse & spot:
Full depth data, push frequency: 200ms

Topic:
orderbook.full.{symbol} e.g., orderbook.full.BTCUSDT

Reset scenarios (u=1)
ScenarioWS payloadREST snapshotClient action
Service restartu=1u may also reset to 1Overwrite local book with snapshot
Symbol delistu=1, b=[], a=[]Returns emptyClear local book, mark as unavailable
Before pre-market auctionu=1, delta emptyMay return emptyKeep book empty, treat as NO_BOOK
Auction → continuous tradingu=1, delta emptyReturns valid snapshotPull snapshot, then continue with deltas
Lot / tick configuration changeu=1, delta can be emptySnapshot ready when applicableClear and re-sync local book

Response Parameters

ParameterTypeComments
topicstringTopic name
typestringData type. Always delta
tsnumberThe timestamp (ms) that the system generates the data
dataobjectObject
> sstringSymbol name
> barrayBid delta entries. Sorted by price in descending order
>> b[0]stringBid price
>> b[1]stringBid size. 0 means this price level should be deleted
> aarrayAsk delta entries. Sorted by price in ascending order
>> a[0]stringAsk price
>> a[1]stringAsk size. 0 means this price level should be deleted
> uintegerUpdate ID
  • Always incremental within a session
  • When u=1, it is a re-initialization signal — overwrite your local order book with a fresh REST snapshot
> seqintegerCross sequence. Use this to compare across different orderbook levels — a smaller seq means the data was generated earlier
ctsnumberThe timestamp from the matching engine when this orderbook data is produced. It can be correlated with T from public trade channel

Subscribe Example


Response Example


Full Order Book Synchronization Procedure

Use the REST endpoint to fetch an Order Book (OB) snapshot, then subscribe to OB delta updates via WebSocket to maintain a complete local order book. Both the OB snapshot and OB delta messages include two fields — seq and u — for data matching and sequencing.

  • seq: The matching engine version number. It is monotonically increasing but not guaranteed to be consecutive — adjacent delta packets for the same symbol may have non-contiguous seq values.
  • u: The update ID. It is consecutive — the u value of each delta packet increments by one from the previous (u+1). However, when the system restarts or the tick size is adjusted, u resets to 1 and delta numbering starts over.
  1. Open a market data WebSocket connection and subscribe to the full-depth order book channel.
  2. Buffer all deltas received from the stream, recording the seq and u values of the first delta.
  • If a discontinuity in u is detected, clear the buffer and restart buffering.
  • If seq is detected to have decreased, discard that delta packet.
  1. Fetch the full-depth order book snapshot from the REST endpoint.
  2. Compare the snapshot's seq and u against the buffered deltas:
  • If the snapshot's seq is strictly less than the first buffered delta's seq, repeat step 3 until a sufficiently recent snapshot is obtained.
  • In the buffered deltas, discard all deltas whose seq is less than the snapshot's seq.
  • If the snapshot's seq equals the delta's seq but their u values differ, repeat step 3 until a sufficiently recent snapshot is obtained.
  1. Once the snapshot's seq and u both match the delta's seq and u, initialize the local order book with the snapshot. Set the local order book version to the snapshot's u value.
  2. Apply all remaining buffered deltas to the local order book as described below, then continue processing subsequent real-time deltas.

Order Book Update Procedure

For each incoming delta event:

  1. Validate Event Continuity
  • If the event's u is less than the local order book's u, ignore the event.
  • If the event's u is greater than the local order book's u + 1, one or more events have been missed. In this case:
    • Discard the local order book.
    • Restart the synchronization process from the beginning.
  • Under normal circumstances, the next event's u should equal the previous event's u + 1.
  • If the event's u = 1, then restart the sync procedure
  1. Apply Price Level Updates

For every price level in bids (b) and asks (a):

  • If the price level does not exist in the local order book, insert it with the specified quantity.
  • If the quantity is zero, remove the price level from the local order book.
  • Otherwise, update the quantity of the existing price level.
info

The REST snapshot endpoint returns a maximum of 10,000 price levels per side. As a result, price levels outside the initial snapshot range are unknown unless they subsequently appear in delta updates.

Therefore, quantities for levels beyond the snapshot depth may not represent the complete state of the order book. For most trading and market analysis use cases, however, the available depth (typically more than 10,000 levels per side) is sufficient to provide an accurate view of market liquidity and trading conditions.