Skip to main content
The ZLL Trading API places two order types: LIMIT and MARKET. Side is the sign of 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

The max_slippage_deci_bps field on a market order is in deci-basis-points, where 1 deci-bps = 0.001%.
ValueMeaning
unset / u16::MAXUse the default
1000Default, 1%
5000Maximum, 5%
Values above the maximum are rejected. The slippage math truncates toward zero. Conditional orders — stop, stop-limit, take-profit, trailing — are not available. There is no REST endpoint to place them. 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 an OrderFlags struct with four fields.
expiry
integer (u64)
Time-in-force, encoded as a 64-bit little-endian integer. See Time-in-force below.
post_only
boolean
When set, the order only adds liquidity. It is rejected if it would cross the book.
reduce_only
boolean
When set, the order may only reduce an existing position, never open or increase one.
stp
integer
Self-trade-prevention strategy. Accepted on the wire but not enforced — see below.
A market order uses 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

The stp 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

The expiry field encodes time-in-force as a single 64-bit integer. Four cases:
expiry valueTime-in-forceBehavior
0IOCImmediate-or-cancel. Fills what it can now, cancels the rest.
1FOKFill-or-kill. Fills completely now or is cancelled entirely.
max u64 valueGTCGood-till-cancelled. Rests until you cancel it.
any other valueGTTGood-till-time. The value is the expiry, in nanoseconds since the Unix epoch.
Only GTT orders carry a tracked expiry timestamp. IOC, FOK, and GTC report none. Order query responses surface the category as 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):
StatusResting?Meaning
OPENyesOn the book, unfilled.
PARTIALLY_FILLEDyesOn the book, partly filled.
FILLEDnoFully filled.
CANCELEDnoCancelled before fully filling.
EXPIREDnoA GTT order passed its expiry.
REJECTEDnoNot accepted onto the book.
UNTRIGGEREDyesConditional order awaiting its trigger — not available today.
A resting order is one in 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:
  • CancelPOST /api/v1/trading/order/cancel, body CancelOrder.
  • UpdatePOST /api/v1/trading/order/update, to reduce or replace a resting order.