Skip to main content

Depth Channel

Depth Channel

Description

This is the channel to get the depth data
Default data push frequency for books, books5, books15 is 150ms
Default data push frequency for books1:10ms

Use books for snapshot data, book1 for 1 depth level, book5 for 5 depth levels, book15 for 15 depth levels

  • books: All levels of depth. First update pushed is full data: snapshot, and then push the update data: update
  • books1: 1st level of depth. Push snapshot each time
  • books5: 5 depth levels. Push snapshot each time
  • books15: 15 depth levels. Push snapshot each time

Explanation of seq

  • The seq of update incremental messages is incrementing except during symbol maintenance.
Request Example
{
"op": "subscribe",
"args": [
{
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
]
}

Request Parameters

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsList<Object>YesList of channels to request subscription
> instTypeStringYesProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> channelStringYesChannel name: books/books1/books5/books15
> instIdStringYesProduct ID
Response Example
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
}

Response Parameters

ParameterTypeDescription
eventStringEvent,
argObjectSubscribed channels
> instTypeStringProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> channelStringChannel name, books/books1/books5/books15
> instIdStringProduct ID, e.g. ETHUSDT
msgStringError message
codeStringError code, returned only on error
Push Data
{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
},
"data": [
{
"asks": [
[
"27000.5",
"8.760"
],
[
"27001.0",
"0.400"
]
],
"bids": [
[
"27000.0",
"2.710"
],
[
"26999.5",
"1.460"
]
],
"seq": 123,
"pseq": 122,
"ts": "1695716059516"
}
],
"ts": 1695716059516
}

Push Parameters

ParameterTypeDescription
argObjectChannels with successful subscription
> instTypeStringProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> channelStringChannel name, books/books1/books5/books15
> instIdStringProduct ID
actionStringPush data action, Incremental push data or full volume push data
dataList<Object>Subscription data
> asksList<String>Seller depth
> bidsList<String>Buyer depth
> tsStringMatch engine timestamp(ms), e.g. 1597026383085
> seqLongSerial number.
It increases when the order book is updated and can be used to determine whether there is out-of-order packets.
> pseqStringThe serial number of the previous push.
For the books channel: non-zero when pushing incremental update data. For books1, books5, and books15 channels: always 0. Can be used to determine whether there is packet loss.
tsStringData streaming time

How was your Reading Experience with us?