Orders
All order actions are signed by your trading key — see Authentication & Signing for the domain and encoding rules.
Submit orders
The endpoint is a batch: 1–20 independently signed legs per request, all for the same account_id.
Order types
Trigger orders
trigger_price— the raw mark-price threshold that arms the fire (no slippage applied).is_market—truefires an IOC order atlimit_price. Onlyis_market: trueis supported today; trigger-limit (false) is rejected.tpsl—TPorSL. The server rejects a trigger already past the mark on its fire side.size: "0"on a reduce-only trigger means close the full position at fire time.
Signing an order
Typed data — Order(bytes32 account,string market,string side,string orderType,string size,string limitPrice,string timeInForce,bool reduceOnly,uint256 leverage,uint256 nonce,string triggerPrice,bool isMarket,string tpsl):
Non-trigger orders must still sign the trigger tail with triggerPrice: "0", isMarket: false, tpsl: "". A market-fire trigger signs timeInForce: "IOC" even though the JSON body omits time_in_force. The signed strings must byte-match the body fields.
Response
data is an array index-aligned with your legs; top-level success is true only if every leg was SUBMITTED:
Legs are independent — one REJECTED (with reason) never cancels the others. SUBMITTED means validated and queued; the order then advances asynchronously.
Order lifecycle
Poll GET /orders/{orderId}:
A TRIGGER order stays SUBMITTED while armed and moves to ACCEPTED only when its trigger fires — long-lived SUBMITTED triggers are normal.
GET /orders/{orderId} can briefly return 404 right after submit — orders persist asynchronously. Retry with backoff.
Cancel an order
Signed as Cancel(address account,string orderId,string orderType,uint256 nonce) — note account here is your 20-byte wallet address, not the 32-byte account id:
order_type is LIMIT (resting order) or TRIGGER (armed trigger); it is part of the signed payload. Returns status: SUBMITTED | REJECTED; 403 when the signature does not authorize the account.
Cancel in batch
1–20 legs, each signing its own Cancel. Per-leg status is SUBMITTED or FAILED (with reason); legs are independent.
Modify an order
Signed as Modify(bytes32 account,string orderId,string clientOrderId,string limitPrice,string size,string triggerPrice,uint256 nonce):
client_order_idmust be new — reusing the modified order’s id is rejected.- Only price, size, and trigger price can change;
market,side,time_in_force,reduce_only,leverage, andorder_typeare inherited. - For a limit order send
trigger_price: "0"; for a trigger orderlimit_priceis the fire price. size: "0"(full-position close) is allowed only on TP/SL triggers.- Success returns the new order’s
order_id. If a trigger modify races the trigger firing (or an open-order-cap check at apply time), the modify is dropped and the original order is untouched.
Next: Account Data