Skip to main content

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)​

FieldTypeRequiredDescription
pairsarray[string]YesTrading pair list, case-insensitive
lintYesFutures subscriptions support 25 levels.
Spot subscriptions support 25, 50, 100, or 200 levels.

Push Fields (data)​

FieldTypeDescription
sstringTrading pair
lintDepth level count
barray[array[string,string]]Bid side (bids), [[price, qty], ...], ordered from high to low
aarray[array[string,string]]Ask side (asks), [[price, qty], ...], ordered from low to high
tlongSnapshot timestamp (milliseconds)
qlongsequence number

Push and Reconnection Rules​

  • snapshot and incremental datadepth Each entry is a complete snapshot of the best bid and ask up to l, directly overwriting the local corresponding level.
  • sequence number Client should track sequence number q per trading pair. Its value may repeat or skip.
  • disconnection and reconnection Resubscribe to depth using 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
}
}