计划委托频道
描述
订阅计划委托
请求示例
{
"op": "subscribe",
"args": [
{
"instType": "SPOT",
"channel": "orders-algo",
"instId": "default"
}
]
}
请求参数
| 参数名 | 参数类型 | 是否必须 | 描述 |
|---|---|---|---|
| op | String | 是 | 操作, subscribe unsubscribe |
| args | List<Object> | 是 | 请求订阅的频道列表 |
| > channel | String | 是 | 频道名 |
| > instType | String | 是 | 产品类型 |
| > instId | String | 否 | 交易对或default |
订阅返回示例
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "orders-algo",
"instId": "default"
}
}
返回参数
| 返回字段 | 参数类型 | 字段说明 |
|---|---|---|
| event | String | 事件 |
| arg | Object | 订阅的频道 |
| > channel | String | 频道名 |
| > instType | String | 产品类型 |
| > instId | String | 产品ID |
| code | String | 错误码 |
| msg | String | 错误消息 |
推送返回示例
{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"channel": "orders-algo",
"instId": "default"
},
"data": [
{
"instId": "BTCUSDT",
"orderId": "1",
"clientOid": "1",
"triggerPrice": "27000.000000000",
"triggerType": "fill_price",
"stpMode": "cancel_taker",
"planType": "amount",
"price": "27000.000000000",
"size": "0.020000000",
"actualSize": "0.000000000",
"orderType": "market",
"side": "buy",
"status": "live",
"executePrice": "0.1",
"enterPointSource": "web",
"cTime": "1695719197612",
"uTime": "1695719197612"
}
],
"ts": 1695719197733
}
推送数据参数
| 返回字段 | 参数类型 | 字段说明 |
|---|---|---|
| action | String | 推送动作 |
| arg | Object | 订阅成功的频道 |
| > channel | String | 频道名 |
| > instType | String | 产品类型 |
| > instId | String | 产品ID |
| data | List<Object> | 订阅的数据 |
| > instId | String | 产品ID |
| > orderId | String | 策略订单ID |
| > clientOid | String | 自定义策略订单id |
| > triggerPrice | String | 触发价格 |
| > triggerType | String | 触发类型 fill_price成交价格 mark_price标记价格 |
| > planType | String | Websocket planType,ws计划委托类型amount 金额total 数量 |
| > price | String | 委托价格 |
| > size | String | 原始委托数量,以币为单位 |
| > actualSize | String | 实际委托数量 以币为单位 |
| > orderType | String | 订单类型 limit 限价单, market 市价单 |
| > side | String | 订单方向 |
| > status | String | 订单状态 |
| > executePrice | String | 执行价 |
| > enterPointSource | String | 客户端: WEB/API/SYS/ANDROID/IOS |
| > uTime | String | 订单更新时间,Unix时间戳的毫秒数格式,如 1597026383085 |
| > stpMode | String | STP模式 none 不设置STP cancel_taker 取消taker单 cancel_maker 取消maker单 cancel_both 两者都取消 |