Order
Subscribe to the order stream to see new orders, when an order's order status changes, etc.
Covers: USDT Perpetual, Inverse Perpetual, Inverse Future
Push frequency: real-time
Topic:
user.order.contractAccount
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| topic | string | Topic name |
| data | array | Object |
| > symbol | string | Symbol name |
| > orderId | string | Order ID |
| > orderLinkId | string | User customised order ID |
| > side | string | Side. Buy,Sell |
| > orderType | string | Order type. Market,Limit. For TP/SL order, it means the order type after triggered |
| > stopOrderType | string | Stop order type |
| > price | string | Order price |
| > qty | string | Order qty |
| > blockTradeId | string | Block trade ID |
| > timeInForce | string | Time in force |
| > orderStatus | string | Order status |
| > positionIdx | integer | Position index. Used to identify positions in different position modes |
| > cancelType | string | Cancel type |
| > rejectReason | string | Reject reason |
| > avgPrice | string | Average filled price. If unfilled, it is "" |
| > takeProfit | string | Take profit price |
| > stopLoss | string | Stop loss price |
| > tpslMode | string | TP/SL mode, Full: entire position for TP/SL. Partial: partial position tp/sl |
| > tpLimitPrice | string | The limit order price when take profit price is triggered |
| > slLimitPrice | string | The limit order price when stop loss price is triggered |
| > tpTriggerBy | string | Take profit price trigger by |
| > slTriggerBy | string | Stop loss price trigger by |
| > triggerPrice | string | Trigger price |
| > triggerDirection | integer | 0: rise, 1: fall |
| > triggerBy | string | Trigger by |
| > reduceOnly | boolean | Reduce only. true means reduce the position |
| > closeOnTrigger | boolean | Close on trigger |
| > leavesQty | string | Remaining order qty waiting to be executed |
| > leavesValue | string | The remaining value not executed |
| > lastExecQty | string | Last executed qty
|
| > lastExecPrice | string | Last executed price |
| > cumExecFee | string | Cumulative executed trading fee |
| > cumExecQty | string | Cumulative executed qty |
| > cumExecValue | string | Cumulative executed value |
| > smpType | string | SMP execution type |
| > smpGroup | integer | Smp group ID. If the uid has no group, it is 0 by default |
| > smpOrderId | string | The counterparty's orderID which triggers this SMP execution |
| > createdTime | string | Order created timestamp (ms) |
| > updatedTime | string | Order updated timestamp (ms) |
Stream Example
{
"topic": "user.order.contractAccount",
"data": [
{
"symbol": "ETHUSDT",
"orderId": "e62a3099-eced-499f-bd81-185e8747187f",
"side": "Buy",
"orderType": "Market",
"stopOrderType": "UNKNOWN",
"price": "1622.55",
"qty": "0.2",
"timeInForce": "ImmediateOrCancel",
"orderStatus": "Filled",
"triggerPrice": "0.00",
"orderLinkId": "",
"createdTime": "1675999655229",
"updatedTime": "1675999655232",
"takeProfit": "0.00",
"stopLoss": "0.00",
"tpslMode": "Full",
"tpLimitPrice": "",
"slLimitPrice": "",
"tpTriggerBy": "UNKNOWN",
"slTriggerBy": "UNKNOWN",
"triggerBy": "UNKNOWN",
"reduceOnly": false,
"closeOnTrigger": false,
"triggerDirection": 0,
"leavesQty": "0",
"lastExecQty": "0.2",
"lastExecPrice": "1545.30",
"cumExecQty": "0.2",
"cumExecValue": "309.06",
"avgPrice": "1545.30",
"blockTradeId": "",
"cancelType": "UNKNOWN",
"cumExecFee": "0.185436",
"leavesValue": "0",
"positionIdx": 1,
"rejectReason": "EC_NoError",
"smpType": "None",
"smpGroup": 0,
"smpOrderId": ""
}
]
}