Skip to main content
Intention supports market, limit, stop, and take-profit orders, with GTC, IOC, and post-only time in force and a reduce-only option. TWAP, scale, trailing stop, and chase orders are coming soon. Orders do not expire.

Order types

Order options

Each order has one time in force. Fill-or-kill is not supported.

How they work

Market orders are converted to IOC limit orders with a price bound, so they never fill past your slippage limit (10% by default). See Market orders. Stop and take-profit orders wait off the book until they trigger. You choose whether the trigger watches the last trade price or the mark price. You can attach them to a new order or to a position you already hold; when one side triggers, the other is cancelled. A triggered market order uses a fixed 10% slippage limit. See Take-profit and stop-loss. Reduce-only orders larger than your position are rejected. See Reduce-only. No order expires. A GTC order you forget about stays on the book, so cancel what you no longer want.

Client order IDs

For API trading. Attach your own ID to every order (client_order_id). You know it the moment you send the order, before the chain assigns its order ID, so you can cancel or modify the order by it.
  • Format. 0x followed by 32 lowercase hex characters (16 bytes). Uppercase, the wrong length, and all zeros are rejected. The field is optional.
  • Unique per sub-account among open orders, stops and take-profits included. Reusing the ID of an open order is rejected (DUPLICATE_CLIENT_ORDER_ID). Each order in a batch needs its own. Once the order closes, the ID can be reused.
  • Cancel or modify by ID. An unknown ID returns CLIENT_ORDER_ID_NOT_FOUND. Changing the ID in a modify re-places the order. See Modify orders.
  • Kept in the record. Filled and cancelled orders keep their ID, so you can match your records to the chain’s.
  • Generate IDs randomly, not from a counter. A restart that loses the counter collides with orders still open.
When a submission times out, do not resend it with the same ID: check by transaction hash or order events first, because the original may have landed. To cancel an order that has not landed yet, send DexOrders.noop() with its nonce; the original is then discarded (NONCE_ALREADY_USED). Once it has landed, cancel it by ID.