Skip to main content

Order Compatibility

TL;DR

Not every combination of type, time-in-force, and execution attribute makes sense. This page is the validity matrix; read it before assembling an order programmatically.

Type × Time in Force

TypeGTC / GTT (rests)IOCFOK
limitYes, the standard resting ordern/a (use ioc)n/a (use fok)
iocNo; IOC never restsYesn/a
fokNo; FOK never restsn/aYes

Time-in-force on Darknyx is carried by the order type plus expiry_slot: a resting order is a limit with an expiry; an immediate order is ioc or fok. See Time in Force.

Type × Execution Attributes

Typemin_fill_sizeAll-or-none (min_fill_size = amount)
limitYesYes, rests until a batch can fill it whole
iocYesYes, takes whole-or-nothing immediately, residual cancels
fokRedundantImplicit; FOK is already whole-or-nothing

Type × Price field

Typeprice_limit
limitRequired, the worst acceptable price.
ioc (bid)Required, the price cap (a "market bid" is an IOC with a cap).
ioc (ask)Optional; 0 accepts any clearing price (a "market ask").
fokRequired, the whole order must clear at this price or better.

A bid always needs a positive price_limit (a buy at price zero is meaningless, and the collateral must cover the worst case). An ask may set price_limit = 0 to sell into any clearing price.

Modifiability

ActionSupported
Cancel a resting orderYes, Cancel Order
Modify a resting order (atomic cancel + replace)Yes, Modify Order
Top up a resting order's anchor poolYes, Anchor Top-Up

IOC and FOK orders do not rest, so there is nothing to cancel, modify, or top up after they execute.

Quick validity examples

IntentTypePricemin_fill_sizeExpiry
Resting bid at a price (GTC)limitrequired0far
Resting bid, good for 10 min (GTT)limitrequired0deadline slot
Resting bid, fill-whole-or-wait (AON)limitrequired= amountfar
Cross now up to a cap (market bid)ioccap0n/a
Sell now at any price (market ask)ioc00n/a
Immediate, whole, or nothingfokrequiredn/an/a