openOrders channel is the best starting point for managing an account’s order state in real time. On subscribe, the server immediately pushes a complete snapshot of every currently active order — both regular open orders and untriggered conditional (TP/SL) orders. All subsequent changes are delivered as incremental update messages using the same compact format as orderUpdates. This combination means you can always maintain a fully consistent local view of active orders.
Pass the account’s wallet address (not the numeric account ID) as the user parameter.
Subscribing
Initial snapshot
Immediately after subscribing, the server sends anOpenOrdersSnapshot message:
data array contains one object per active order. An empty array means the account has no open orders at subscription time.
Snapshot field reference
string
Unique order ID assigned by the exchange.
string
Client-assigned order ID.
"0" if not set when placing the order.string
Numeric account ID that owns this order.
number
The contract this order is placed on.
string
Margin mode:
"C" = cross margin, "I" = isolated margin.string
Position side:
"OneWay" for one-way mode; "Long" or "Short" for hedge mode.string
"B" = buy (bid), "S" = sell (ask).string
"L" = limit, "M" = market.string
"Gtc" (good-till-cancel), "Ioc" (immediate-or-cancel), "Alo" (add-liquidity-only / post-only), or "Fok" (fill-or-kill).string
Order price (raw string).
string
Remaining unfilled size (raw string).
string
Leverage applied to this order at placement time.
string
"Open" for a regular active order; "Untriggered" for a pending conditional order.boolean
true if this order can only reduce an existing position.Incremental update messages
After the snapshot, subsequent state changes arrive asOpenOrdersUpdate messages:
orderUpdates — see the orderUpdates field reference for the full mapping.
Maintaining local order state
1
Subscribe and wait for the snapshot
Subscribe and buffer any incoming
OpenOrdersUpdate messages until you receive the OpenOrdersSnapshot. This prevents a race condition where an update arrives before the snapshot.2
Seed your local state from the snapshot
Store every order in the snapshot keyed by
id. Orders with "status": "Untriggered" are pending conditional orders.3
Apply buffered and incoming updates
For each
OpenOrdersUpdate, update or remove orders from your local map: upsert if the order is new or modified; remove if "st": "Filled" or "st": "Canceled".Pending conditional orders appear in the snapshot with
"isConditional": true and "status": "Untriggered". When a conditional order triggers, it is removed from the open orders state and a new regular order appears with a new id.