quantity, time-in-force packs into a single integer, and every order moves through
a small set of statuses. The integer scales behind price and quantity live in
Markets, assets, and precision; what fills do
to your account lives in Positions, leverage, and funding.
Order placement is a signed write: pack the body, sign it, send the envelope. The
byte layout and signing rules are in the signed payload envelope.
Order types you can place
Limit
POST /api/v1/trading/order/place/limit, body PlaceLimitOrder. You set
price and quantity. Rests on the book until it fills, expires, or is cancelled.Market
POST /api/v1/trading/order/place/market, body PlaceMarketOrder. No price.
The exchange derives an effective limit from the current mark/index price plus a
slippage bound, then executes it as an IOC limit order. Buy fills are protected
upward, sells downward.Market slippage bound
Themax_slippage_deci_bps field on a market order is in deci-basis-points, where
1 deci-bps = 0.001%.
| Value | Meaning |
|---|---|
unset / u16::MAX | Use the default |
1000 | Default, 1% |
5000 | Maximum, 5% |
place/limit and place/market are the
only order-placement routes today.
Side is the sign of quantity
There is no separate side field on a new order.quantity is a signed integer in
the asset’s smallest unit (atoms), and its sign is the side:
- positive quantity = long / buy
- negative quantity = short / sell
quantity is a 64-bit signed little-endian integer.
price and quantity are raw integers with no decimals. Build each by multiplying
the human value by the per-asset scale and flooring. The exchange truncates toward
zero and does not round to your nearest tick, so align price to the market tick and
quantity to the step before you sign.
Order flags
A limit order carries anOrderFlags struct with four fields.
Time-in-force, encoded as a 64-bit little-endian integer. See
Time-in-force below.
When set, the order only adds liquidity. It is rejected if it would cross the book.
When set, the order may only reduce an existing position, never open or increase one.
Self-trade-prevention strategy. Accepted on the wire but not enforced — see below.
MarketOrderFlags instead. It has fill_or_kill,
reduce_only, and stp. It has no post_only, because a market order always
takes liquidity.
Self-trade-prevention is not enforced yet
Thestp field accepts a strategy code (Decrement, CancelTaker, CancelMaker,
CancelBoth), but the exchange does not act on it. Do not rely on self-trade
prevention to stop your own orders from matching each other.
Time-in-force
Theexpiry field encodes time-in-force as a single 64-bit integer. Four cases:
expiry value | Time-in-force | Behavior |
|---|---|---|
0 | IOC | Immediate-or-cancel. Fills what it can now, cancels the rest. |
1 | FOK | Fill-or-kill. Fills completely now or is cancelled entirely. |
max u64 value | GTC | Good-till-cancelled. Rests until you cancel it. |
| any other value | GTT | Good-till-time. The value is the expiry, in nanoseconds since the Unix epoch. |
IOC, FOK, GTC, or GTT.
A market order is always immediate-or-cancel by construction. The expiry encoding
above applies to limit orders.
Order lifecycle
An order query returns one of these statuses (serialized in upper snake case):| Status | Resting? | Meaning |
|---|---|---|
OPEN | yes | On the book, unfilled. |
PARTIALLY_FILLED | yes | On the book, partly filled. |
FILLED | no | Fully filled. |
CANCELED | no | Cancelled before fully filling. |
EXPIRED | no | A GTT order passed its expiry. |
REJECTED | no | Not accepted onto the book. |
UNTRIGGERED | yes | Conditional order awaiting its trigger — not available today. |
OPEN, PARTIALLY_FILLED, or UNTRIGGERED. Since
conditional orders are not placeable, you will only see UNTRIGGERED once they ship.
A signed write returns 200 OK even when the exchange rejects it, so always read the
RequestAck body — see the error model.
Managing resting orders
Two write actions operate on orders already on the book:- Cancel —
POST /api/v1/trading/order/cancel, bodyCancelOrder. - Update —
POST /api/v1/trading/order/update, to reduce or replace a resting order.