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
| Field | Type | Description |
|---|---|---|
s | string | Trading pair |
U | number | Starting update ID (firstUpdateId) |
u | number | Ending update ID (lastUpdateId) |
t | number | Timestamp (milliseconds) |
b | array | Bid changes [[price, quantity], ...], quantity 0 means delete |
a | array | Ask changes [[price, quantity], ...], quantity 0 means delete |
Usage (Gate.io Style)
- Subscribe to
depth@{symbol},{level}first to get the full snapshot and record itsu(lastUpdateId). - Then subscribe to
depth_update@{symbol}to receive incremental updates. - Find the first delta event satisfying
U <= lastUpdateId+1 && u >= lastUpdateId+1and start applying from it. - For subsequent deltas, apply the update if
u > local lastUpdateId. - If
U > local lastUpdateId+1is 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.