Skip to main content

Order Book Delta

Subscribe to order book incremental updates for a specified futures trading pair (Gate.io style).

  • Channel Format: depth_update@{symbol}
  • Push Frequency: 100 ms throttled
  • Access: Public

Subscribe Request

{
"op": "subscribe",
"args": ["depth_update@BTC_USDT"]
}

Unsubscribe

{
"op": "unsubscribe",
"args": ["depth_update@BTC_USDT"]
}

Push Example

{
"ch": "depth_update@BTC_USDT",
"d": {
"s": "BTC_USDT",
"U": 12345,
"u": 12346,
"t": 1768205315200,
"b": [
["48999", "0"]
],
"a": [
["49001", "1.5"]
]
}
}

Push Fields

FieldTypeDescription
sstringTrading pair
UnumberStarting update ID (firstUpdateId)
unumberEnding update ID (lastUpdateId)
tnumberTimestamp (milliseconds)
barrayBid changes [[price, quantity], ...], quantity 0 means delete
aarrayAsk changes [[price, quantity], ...], quantity 0 means delete

Usage (Gate.io Style)

  1. Subscribe to depth@{symbol},{level} first to get the full snapshot and record its u (lastUpdateId).
  2. Then subscribe to depth_update@{symbol} to receive incremental updates.
  3. Find the first delta event satisfying U <= lastUpdateId+1 && u >= lastUpdateId+1 and start applying from it.
  4. For subsequent deltas, apply the update if u > local lastUpdateId.
  5. If U > local lastUpdateId+1 is detected, there is a gap and you must fetch a new snapshot.

See "Local Order Book Sync" for the full local order book maintenance workflow.