Order Book
Subscription Example
{
"op": "sub",
"ts": 1780372400759,
"tid": "depth-sub-1",
"tps": [{
"t": "depth",
"ch": "linear",
"p": { "pairs": ["SOLUSDT"], "l": 25 }
}]
}
Subscription Parameters (p)
| Field | Type | Required | Description |
|---|---|---|---|
pairs | array[string] | Yes | Trading pair list, case-insensitive |
l | int | Yes | Futures subscriptions support 25 levels. Spot subscriptions support 25, 50, 100, or 200 levels. |
Push Fields (data)
| Field | Type | Description |
|---|---|---|
s | string | Trading pair |
l | int | Depth level count |
b | array[array[string,string]] | Bid side (bids), [[price, qty], ...], ordered from high to low |
a | array[array[string,string]] | Ask side (asks), [[price, qty], ...], ordered from low to high |
t | long | Snapshot timestamp (milliseconds) |
q | long | sequence number |
Push and Reconnection Rules
- snapshot and incremental data
depthEach entry is a complete snapshot of the best bid and ask up tol, directly overwriting the local corresponding level. - sequence number Client should track sequence number
qper trading pair. Its value may repeat or skip. - disconnection and reconnection Resubscribe to
depthusing the original parameters. Upon receiving the first push, the local order book can be rebuilt.
Push Example
{
"ts": 1780372401000,
"tps": {
"t": "depth",
"ch": "linear",
"p": { "pairs": ["BTCUSDT"], "l": 25 }
},
"data": {
"s": "BTCUSDT",
"l": 25,
"b": [["65000.10", "1.5"], ["65000.00", "2.0"]],
"a": [["65000.20", "0.8"]],
"t": 1780372401000,
"q": 123456789
}
}