订单频道
描述
订阅订单频道
请求参数
| 参数名 | 参数类型 | 是否必须 | 描述 |
|---|---|---|---|
| event | String | 是 | 操作, subscribe unsubscribe |
| channel | String | 是 | 频道名 |
请求示例
{
"event": "subscribe",
"channel": "orders"
}
返回参数
| 返回字段 | 参数类型 | 字段说明 |
|---|---|---|
| event | String | 操作, subscribed unsubscribed |
| channel | String | 频道名 |
订阅返回示例
{
"event": "subscribed",
"channel": "orders"
}
推送数据参数
| 返回字段 | 参数类型 | 字段说明 |
|---|---|---|
| id | String | 委托单id。取值大于0 |
| coinId | String | 所属抵押品币种id |
| contractId | String | 所属合约id |
| marginMode | String | 保证金模式 |
| separatedMode | String | 分仓模式 |
| separatedOpenOrderId | String | 分仓仓位创建委托单id,仅 separated_mode=SEPARATED 时存在 |
| positionSide | String | 仓位方向 (单向持仓模式必为UNKNOWN) |
| orderSide | String | 买卖方向 |
| price | String | 委托价格(最差可接受的价格) |
| size | String | 委托数量 |
| clientOrderId | String | 客户自定义id,用于幂等校验 |
| type | String | 委托单类型 |
| timeInForce | String | 委托单执行策略。type为 LIMIT/STOP_LIMIT/TAKE_PROFIT_LIMIT 时有意义 |
| reduceOnly | String | 是否是只减仓委托 |
| triggerPrice | String | 触发价格。type为 STOP_LIMIT/STOP_MARKET/TAKE_PROFIT_LIMIT/TAKE_PROFIT_MARKET 时有意义。如果为0代表字段为空。 |
| triggerPriceType | String | 价格类型。最新市价[默认],标记价格。type为 STOP_LIMIT/STOP_MARKET/TAKE_PROFIT_LIMIT/TAKE_PROFIT_MARKET 时有意义。 |
| isPositionTpsl | String | 是否为仓位止盈止损单 |
| orderSource | String | 订单来源 |
| openTpslParentOrderId | String | 开仓止盈单,止损单的开仓单orderId |
| isSetOpenTp | String | 是否设置开仓止盈 |
| openTpParam | String | 开仓止盈参数 |
| isSetOpenSl | String | 是否设置开仓止损 |
| openSlParam | String | 开仓止损参数 |
| leverage | String | 下单时开仓杠杆倍数 |
| takerFeeRate | String | 下单时taker手续费率 |
| makerFeeRate | String | 下单时maker手续费率 |
| feeDiscount | String | 下单时手续费折扣率 |
| liquidateFeeRate | String | 下单时清算手续费率 |
| status | String | 委托单状态 |
| triggerTime | String | 条件单触发时间 |
| triggerPriceTime | String | 条件单触发价格时间 |
| triggerPriceValue | String | 条件单触发价格值 |
| cancelReason | String | 委托单取消原因 |
| latestFillPrice | String | 当前委托单最新成交价格 |
| maxFillPrice | String | 当前委托单最高成交价格 |
| minFillPrice | String | 当前委托单最低成交价格 |
| cumFillSize | String | 累计撮合后成交数量 |
| cumFillValue | String | 累计撮合后成交价值 |
| cumFillFee | String | 累计撮合后成交手续费 |
| cumLiquidateFee | String | 累计强平清算费 |
| cumRealizePnl | String | 累计已实现盈亏 |
| createdTime | String | 创建时间 |
| updatedTime | String | 更新时间 |
推送返回示例
{
"type": "trade-event",
"channel": "orders",
"event": "payload",
"msg": {
"msgEvent": "OrderUpdate",
"version": 46654,
"data": {
"order": [
{
"id": "617414920861909658",
"coinId": "USDT",
"contractId": "cmt_btcusdt",
"marginMode": "SHARED",
"separatedMode": "COMBINED",
"separatedOpenOrderId": "0",
"positionSide": "LONG",
"orderSide": "BUY",
"price": "0.0",
"size": "0.10000",
"clientOrderId": "1747203186927fpiZrpAEkOlH3ygdwfJpowP0HeXVer7JFxxmIohyCMPXqKCz74s",
"type": "MARKET",
"timeInForce": "IMMEDIATE_OR_CANCEL",
"reduceOnly": false,
"triggerPrice": "0",
"triggerPriceType": "UNKNOWN_PRICE_TYPE",
"orderSource": "WEB",
"openTpslParentOrderId": "0",
"leverage": "20",
"takerFeeRate": "0.0006",
"makerFeeRate": "0.0002",
"feeDiscount": "1",
"liquidateFeeRate": "0.01",
"status": "PENDING",
"triggerTime": "0",
"triggerPriceTime": "0",
"triggerPriceValue": "0",
"cancelReason": "UNKNOWN_ORDER_CANCEL_REASON",
"latestFillPrice": "0",
"maxFillPrice": "0",
"minFillPrice": "0",
"cumFillSize": "0",
"cumFillValue": "0",
"cumFillFee": "0",
"cumLiquidateFee": "0",
"cumRealizePnl": "0",
"createdTime": "1747203188148",
"updatedTime": "1747203188148",
"positionTpsl": false,
"setOpenTp": false,
"setOpenSl": false
}
]
},
"time": 1747203188148
}
}