Skip to main content

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

ParameterTypeComments
topicstringTopic name
dataarrayObject
> symbolstringSymbol name
> orderIdstringOrder ID
> orderLinkIdstringUser customised order ID
> sidestringSide. Buy,Sell
> orderTypestringOrder type. Market,Limit. For TP/SL order, it means the order type after triggered
> stopOrderTypestringStop order type
> pricestringOrder price
> qtystringOrder qty
> blockTradeIdstringBlock trade ID
> timeInForcestringTime in force
> orderStatusstringOrder status
> positionIdxintegerPosition index. Used to identify positions in different position modes
> cancelTypestringCancel type
> rejectReasonstringReject reason
> avgPricestringAverage filled price. If unfilled, it is ""
> takeProfitstringTake profit price
> stopLossstringStop loss price
> tpslModestringTP/SL mode, Full: entire position for TP/SL. Partial: partial position tp/sl
> tpLimitPricestringThe limit order price when take profit price is triggered
> slLimitPricestringThe limit order price when stop loss price is triggered
> tpTriggerBystringTake profit price trigger by
> slTriggerBystringStop loss price trigger by
> triggerPricestringTrigger price
> triggerDirectioninteger0: rise, 1: fall
> triggerBystringTrigger by
> reduceOnlybooleanReduce only. true means reduce the position
> closeOnTriggerbooleanClose on trigger
> leavesQtystringRemaining order qty waiting to be executed
> leavesValuestringThe remaining value not executed
> lastExecQtystringLast executed qty
  • If order status is Filled or Partially Filled, then this field means Executed qty
  • If the orders status is Cancelled, then this field means leaves qty
> lastExecPricestringLast executed price
> cumExecFeestringCumulative executed trading fee
> cumExecQtystringCumulative executed qty
> cumExecValuestringCumulative executed value
> smpTypestringSMP execution type
> smpGroupintegerSmp group ID. If the uid has no group, it is 0 by default
> smpOrderIdstringThe counterparty's orderID which triggers this SMP execution
> createdTimestringOrder created timestamp (ms)
> updatedTimestringOrder 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": ""
}
]
}