订单簿全量快照
订阅定时推送的完整合约订单簿快照。
订阅格式
{symbol}@order_book{N}[@speed]
- N: 档位深度,可选值: 5, 10, 20, 50, 100
- speed: 推送频率,可选值: 100ms, 1000ms
示例
BTCUSD@order_book20- 20档深度,默认频率BTCUSD@order_book20@100ms- 20档深度,100毫秒推送一次
订阅请求
{
"action": "subscribe",
"streams": ["BTCUSD@order_book20"]
}
推送数据字段
| 字段 | 类型 | 说明 |
|---|---|---|
| event | string | 事件类型: data |
| channel | string | 频道: order_book |
| data.symbol | string | 合约标识 |
| data.bids | array | 买盘 [价格, 数量] |
| data.asks | array | 卖盘 [价格, 数量] |
| data.timestamp | int64 | 快照时间戳 |
| time | int64 | 推送时间戳 |
推送示例
{
"event": "data",
"channel": "order_book",
"data": {
"symbol": "BTCUSD",
"bids": [
["50100.00", "10"],
["50090.00", "5"]
],
"asks": [
["50120.00", "8"],
["50130.00", "12"]
],
"timestamp": 1736163000000
},
"time": 1736163000000
}