# Depth Channel

### Description

This is the channel to get the depth data<br/>Default data push frequency for `books`, `books5`, `books15` is **150ms**<br/>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.

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="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&lt;Object&gt; | Yes | List of channels to request subscription                                                                            |
| &gt; instType | String | Yes | Product type<br/>`USDT-FUTURES` USDT-M Futures<br/>`COIN-FUTURES` Coin-M Futures<br/>`USDC-FUTURES` USDC-M Futures  |
| &gt; channel | String | Yes | Channel name: `books/books1/books5/books15`                                                                         |
| &gt; instId | String | Yes | Product ID                                                                                                          |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Response Example"
{
    "event": "subscribe",
    "arg": {
        "instType": "USDT-FUTURES",
        "channel": "books5",
        "instId": "BTCUSDT"
    }
}
```

### Response Parameters

| Parameter | Type | Description                                                                                                         | 
| :---- | :---- |:--------------------------------------------------------------------------------------------------------------------|
| event | String | Event,                                                                                                              |
| arg | Object | Subscribed channels                                                                                                 |
| &gt; instType | String | Product type<br/>`USDT-FUTURES` USDT-M Futures<br/>`COIN-FUTURES` Coin-M Futures<br/>`USDC-FUTURES` USDC-M Futures  |
| &gt; channel | String | Channel name, `books/books1/books5/books15`                                                                         |
| &gt; instId | String | Product ID, e.g. ETHUSDT                                                                                            |
| msg | String | Error message                                                                                                       |
| code | String | Error code, returned only on error                                                                                  |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="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                                                                                              |
| &gt; instType    | String             | Product type<br/>`USDT-FUTURES` USDT-M Futures<br/>`COIN-FUTURES` Coin-M Futures<br/>`USDC-FUTURES` USDC-M Futures                 |
| &gt; channel     | String             | Channel name, `books/books1/books5/books15`                                                                                        |
| &gt; instId      | String             | Product ID                                                                                                                         |
| action           | String             | Push data action, Incremental push data or full volume push data                                                                   |
| data             | List&lt;Object&gt; | Subscription data                                                                                                                  |
| &gt; asks        | List&lt;String&gt; | Seller depth                                                                                                                       |
| &gt; bids        | List&lt;String&gt; | Buyer depth                                                                                                                        |
| &gt; ts          | String             | Match engine timestamp(ms), e.g. 1597026383085                                                                                     |
| &gt; seq         | Long               | Serial number.<br/>It increases when the order book is updated and can be used to determine whether there is out-of-order packets. |
| &gt; pseq        | String             | The serial number of the previous push.<br/>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                                                                                                                |

</div>
