openOrders channel gives you a starting point for an account’s order state. On subscribe, the server pushes one snapshot of every currently active order — both regular open orders and untriggered conditional (TP/SL) orders. The channel sends nothing after that snapshot. To track subsequent changes, subscribe to orderUpdates on the same connection.
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 is an object, not an array: it is the complete response body of userOrders, passed through unchanged. The orders are in data.orders. The order entry above is abridged; every order carries the full field set documented on userOrders. An empty orders array means the account has no active orders at subscription time.
data.orders lists resting orders first, then untriggered conditional orders.
Snapshot field reference
string
Always
"userOrders".boolean
Always present. The snapshot covers every Market Deployer of the account and is subject to a size cap.
true means the snapshot is not the complete set of active orders; false means it is. When it is true, query userOrders once per Market Deployer to fill the gap — do not treat an order missing from the snapshot as gone.array
The active orders. Each element carries the fields below, plus the remaining fields documented on
userOrders.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; "L" (long) or "S" (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
The quantity originally submitted, raw and unchanging. Filled quantity is
originalSize − size.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; false if it can open or increase one.boolean
Present only on untriggered conditional orders, and then always
true. Absent on regular orders.string
Present only on untriggered conditional orders. Same value as
tpslParentOrderId.No incremental updates
openOrders pushes only the subscribe-time snapshot. Changes after that — new orders, fills, cancellations, triggers — are delivered on orderUpdates, never on this channel.
Maintaining local order state
1
Subscribe to both channels
Subscribe to
orderUpdates and openOrders for the same address. Buffer orderUpdates entries until the OpenOrdersSnapshot arrives.2
Seed your local state from the snapshot
Store every order in
data.orders keyed by id. Orders with "status": "Untriggered" are pending conditional orders. If data.truncated is true, complete the set with userOrders.3
Apply buffered and incoming orderUpdates entries
Upsert an order on each
orderUpdates entry; remove it when st is "Filled" or "Canceled". See orderUpdates for the entry kinds and their fields.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.