深度频道
描述
获取深度数据
订阅成功后,会直接推送一次全量数据(depthType=SNAPSHOT),后续推送为增量数据(depthType=CHANGED)
请求参数
| 参数名 | 参数类型 | 是否必须 | 描述 | 
|---|---|---|---|
| event | String | 是 | 操作, subscribe unsubscribe | 
| channel | String | 是 | 频道名.产品ID.depth 如: depth.{contractId}.{depth} | 
depth 参数
| value | description | 
|---|---|
| 15 | 15档 | 
| 200 | 200档 | 
请求示例
{
  "event": "subscribe",
  "channel": "depth.cmt_btcusdt.15"
}
返回参数
| 返回字段 | 参数类型 | 字段说明 | 
|---|---|---|
| event | String | 操作, subscribed unsubscribed | 
| channel | String | 频道名 | 
订阅返回示例
{
  "event": "subscribed",
  "channel": "depth.cmt_btcusdt.15"
}
推送数据参数
| 返回字段 | 参数类型 | 字段说明 | 
|---|---|---|
| event | String | 推送数据动作 | 
| channel | String | 频道名 | 
| data | List | 订阅的数据 | 
| >startVersion | String | 开始订单簿版本号 | 
| >endVersion | String | 结束订单簿版本号 | 
| >level | String | 深度档位 | 
| >depthType | String | 盘口深度类型 | 
| >symbol | String | 产品ID | 
| >asks | String | ask列表 | 
| >>price | String | 价格 | 
| >>size | String | 数量 | 
| >bids | String | bid列表 | 
| >>price | String | 价格 | 
| >>size | String | 数量 | 
推送返回示例
{
  "event": "payload",
  "channel": "depth.cmt_btcusdt.15",
  "data": [
    {
      "startVersion": "3644174246",
      "endVersion": "3644174270",
      "level": 15,
      "depthType": "CHANGED",
      "symbol": "cmt_btcusdt",
      "asks": [
        {
          "price": "103436.1",
          "size": "0.91500"
        },
        {
          "price": "103436.3",
          "size": "1.95800"
        },
        {
          "price": "103436.5",
          "size": "0"
        },
        {
          "price": "103436.6",
          "size": "1.08300"
        },
        {
          "price": "103436.7",
          "size": "7.64700"
        },
        {
          "price": "103436.9",
          "size": "7.23100"
        },
        {
          "price": "103437.0",
          "size": "0"
        },
        {
          "price": "103437.2",
          "size": "0"
        }
      ],
      "bids": [
        {
          "price": "103435.9",
          "size": "2.40500"
        },
        {
          "price": "103435.7",
          "size": "0"
        },
        {
          "price": "103435.6",
          "size": "0.32700"
        },
        {
          "price": "103435.5",
          "size": "0"
        },
        {
          "price": "103435.2",
          "size": "3.19400"
        },
        {
          "price": "103434.8",
          "size": "10.25000"
        },
        {
          "price": "103434.5",
          "size": "11.13900"
        }
      ]
    }
  ]
}