Skip to main content
The userOrders query returns all active orders for your account — resting orders and untriggered conditional orders — within one Market Deployer or across every Market Deployer the account has joined. You can filter the results to a specific contract by passing its contractId, or set it to 0 to retrieve orders across all contracts. Use the returned id field to reference orders in cancel or modify actions.

Request

string
required
type (required) — Must be "userOrders".
string
required
accountId (required) — Your account ID, obtained from the registerAccount action.
integer
required
marketDeployerId (required) — 0 returns orders across every Market Deployer the account has joined; a positive value returns orders within that Market Deployer only.
integer
contractId — Filter orders by contract. Use 0 or omit to return orders across all contracts. Pass a positive integer to restrict results to that specific contract.

Response

string
Always "userOrders".
string
The account ID from the request.
integer
The marketDeployerId from the request.
integer
The contractId filter from the request; 0 means all contracts.
boolean
Always present. false means orders is the complete set. true means the response has an upper bound on the number of orders and orders was cut at an order boundary, so it is not the complete set; no partial order is returned. To read the complete set, query each Market Deployer separately (list them with userMarketDeployers) or narrow the query with contractId.
object[]
The active orders. Ordinary orders and untriggered conditional orders share the fields below; conditional orders carry two additional fields (see Conditional orders).

Order Fields

string
Exchange-assigned order ID (int64 as a decimal string). Use this value in cancel and modify actions to reference the order.
string
Your client-assigned order ID set at placement time (the c field), as an int64 decimal string. "0" means no client ID was assigned.
string
The account that placed the order.
integer
The Market Deployer the order belongs to.
integer
The settlement coin of the order.
integer
The contract this order is placed on. Cross-reference with configs for the contract name and scales.
integer
Market ID; currently equal to contractId.
string
An account-level command sequence number (int64 decimal string). It is not the signature nonce from the POST /exchange envelope, which is not stored on the order; for an account that trades only through signed requests it is "0". To correlate a request with its order, use clientOrderId.
string
"C" for cross margin, "I" for isolated margin, or "Unset".
string
"OneWay" for one-way mode, "L" for the hedge-mode long side, or "S" for the hedge-mode short side.
string
"B" for a buy (bid) order; "S" for a sell (ask) order.
string
string
Order duration policy: "Gtc" (Good Till Cancel), "Ioc" (Immediate Or Cancel), "Alo" (Add Liquidity Only / post-only), or "Fok" (Fill Or Kill).
string
Order price as a raw integer string. Divide by 10^priceScale from configs to get the display value.
string
Remaining quantity as a raw integer string — it decreases as the order fills. This is not the quantity you originally submitted. Divide by 10^qtyScale from configs to get the display value.
string
The quantity originally submitted, raw and unchanging. Filled quantity is originalSize − size — use the pair to render a “filled of total” column.
string
The conditional order’s own trigger price (raw, scaled by priceScale). "0" for an ordinary resting order. Not the same as triggerPrice inside the tp / sl objects.
integer
Price source of triggerPrice: 0 for mark price, 1 for oracle price.
boolean
true if this order can only reduce an existing position; false if it can also open or increase one.
boolean
true for a liquidation order; false otherwise.
boolean
true for an auto-deleveraging order; false otherwise.
boolean
true for a system order that is not matched against the book; false otherwise.
boolean
true when the order is a position-level TP/SL, whose closing direction follows the position automatically. false for an ordinary order or a standalone trigger order. It corresponds one-to-one with the isPositionTpsl parameter of the tpSl action.
string
Leverage applied to this order at placement time.
string
Current order status: "Open" (resting), "Filled" (fully matched), "Canceled" (removed from book), or "Untriggered" (a conditional order that has not triggered).
integer
Cancel reason code. 0 means the order has not been canceled.
integer
Placement time in Unix milliseconds.
string
Account that the order’s fees are attributed to. "0" means the placing account itself.
string
Builder account that receives the builder fee. "0" means none.
integer
Builder fee rate, scaled by 1e5.
string
When this order is a TP/SL child, the ID of its parent order. Otherwise "0".
object
Take-profit attached to this order at placement. Present whether or not the order has filled, so a resting order can display its armed exit. Contains:
  • isSet (boolean) — whether a take-profit is armed. The invariant isSet == (triggerPrice > 0) always holds, so this single field is enough to test for presence.
  • triggerPrice (string) — trigger price (raw). "0" when isSet is false.
  • price (string) — order price used after triggering (raw). "0" means close at market.
  • triggerType (int) — price source: 0 for mark price, 1 for oracle price. Only these two values are returned.
  • orderType (int) — order type placed when the take-profit triggers: 1 limit, 2 market. 0 when no take-profit is set.
  • size (string) — quantity to close (raw). "0" closes the whole position.
object
Stop-loss attached to this order at placement. Same fields as tp.

Conditional orders

An untriggered conditional order carries every field above plus two more:
boolean
Present only on conditional order entries, and always true.
string
Present only on conditional order entries. The parent order ID; it carries the same value as tpslParentOrderId.
Read a conditional order’s own trigger price from the top-level triggerPrice and triggerPriceType — not from its tp / sl object. Those objects describe a take-profit or stop-loss attached to the order placed after triggering. An ordinary resting order reports "0" for the top-level triggerPrice.
Three fields have no value until a conditional order triggers, and report their unset value while status is "Untriggered": When it triggers, the conditional order becomes an ordinary order under the same id, and these fields carry real values. Track an untriggered conditional order by id or parentOrderId.
The same tp / sl objects appear on order entries pushed by the orderUpdates channel, field for field, so one parser handles both.