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:updatebooks1: 1st level of depth. Pushsnapshoteach timebooks5: 5 depth levels. Pushsnapshoteach timebooks15: 15 depth levels. Pushsnapshoteach 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| op | String | Yes | Operation, subscribe unsubscribe |
| args | List<Object> | Yes | List of channels to request subscription |
| > instType | String | Yes | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > channel | String | Yes | Channel name: books/books1/books5/books15 |
| > instId | String | Yes | Product ID |
Response Example
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| event | String | Event, |
| arg | Object | Subscribed channels |
| > instType | String | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > channel | String | Channel name, books/books1/books5/books15 |
| > instId | String | Product ID, e.g. ETHUSDT |
| msg | String | Error message |
| code | String | Error 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
| Parameter | Type | Description |
|---|---|---|
| arg | Object | Channels with successful subscription |
| > instType | String | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > channel | String | Channel name, books/books1/books5/books15 |
| > instId | String | Product ID |
| action | String | Push data action, Incremental push data or full volume push data |
| data | List<Object> | Subscription data |
| > asks | List<String> | Seller depth |
| > bids | List<String> | Buyer depth |
| > ts | String | Match engine timestamp(ms), e.g. 1597026383085 |
| > seq | Long | Serial number. It increases when the order book is updated and can be used to determine whether there is out-of-order packets. |
| > pseq | String | The 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. |
| ts | String | Data streaming time |