Skip to main content

Depth Channel

Get the order book depth data

Request Parameters

ParameterTypeRequiredDescription
opstringYesOperation, subscribe unsubscribe
argslistYesList of channels to request subscription
> instTypestringYesProduct type
> channelstringYesChannel name (books1 ~ books20)
> instIdstringYesProduct ID E.g. BTCUSDT

Note: The channel name determines the depth size. Use books1 to books20 where the number indicates the depth level (1-20).

Request Example

{
"op": "subscribe",
"args": [
{
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
]
}

Response Parameters

ParameterTypeDescription
eventstringEvent
argobjectSubscribed channels
> instTypestringProduct type
> channelstringChannel name
> instIdstringProduct ID E.g. BTCUSDT
codestringError code
msgstringError message

Response Example

{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
}

Push Parameters

ParameterTypeDescription
actionstringPush data action
argobjectChannels with successful subscription
> instTypestringProduct type
> channelstringChannel name
> instIdstringProduct ID E.g. BTCUSDT
dataobjectSubscription data
> askslistAsk orders [price, size]
> bidslistBid orders [price, size]
> tsnumberTimestamp

Push Data

{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
},
"data": {
"asks": [
["27001.0", "0.5"],
["27002.0", "1.2"],
["27003.0", "0.8"],
["27004.0", "2.1"],
["27005.0", "0.3"]
],
"bids": [
["27000.0", "0.7"],
["26999.0", "1.5"],
["26998.0", "0.9"],
["26997.0", "2.3"],
["26996.0", "0.6"]
],
"ts": 1695716760565
},
"ts": 1695716761589
}