Matrix
GTD is not a separate enum value. The request schema accepts
timeInForce: 'gtc' | 'ioc' | 'fok' only. Sending "timeInForce": "gtd"
is rejected at request validation with 400 invalid_request (timeInForce must be one of the following values: gtc, ioc, fok).
To place a Good-Til-Date order, submit timeInForce: "gtc" with a non-zero
expiry timestamp.GTC — Good Till Cancelled
Default forLIMIT orders (type: "limit", timeInForce: "gtc", expiry: 0).
Rests on the book indefinitely until:
- cancelled by the user (
POST /api/orders/cancel,/cancel-batch, or/cancel-all), - cancelled by self-trade prevention,
when an aggressive
marketorder from the same wallet comes to it, - filled by counterparty orders,
- the market closes or resolves (cancelled by the platform with
CANCELLED).
GTD — Good Till Date (via GTC + Expiration)
To place an order that rests on the book but automatically expires at a future cutoff:- Set
timeInForce: "gtc"(or omittimeInForce, which defaults to"gtc"). - Set
expiryin the request body to the desired Unix timestamp (in seconds), which signs asOrder.expirationin the EIP-712 struct.
Expiration safety threshold (order_expiry_too_soon)
Settlement is asynchronous: off-chain matches are batched and broadcast to
CTFExchange by match-submitter. Because an on-chain submission can take tens
of seconds during high chain load, an order that expires before the transaction
mines would cause the entire batch match to revert with MatchFailed(OrderExpired).
To protect against this:
- On
POST /api/orders/placeandPOST /api/orders/place-batch, any non-zeroexpirymust be more than 60 seconds after current server time (a 30-secondORDER_EXPIRY_SAFETY_SECONDSpre-broadcast settlement buffer plus a 30-second gateway placement margin). - An order with
0 < expiry <= now + 60sis refused with HTTP400code: order_expiry_too_soon. The error response carrieserror.details.minExpirationindicating the earliest acceptable Unix timestamp. - On
POST /api/orders/place-batch, a near-expiry entry is rejected in its own slot with{ success: false, status: "REJECTED", code: "order_expiry_too_soon", details: { minExpiration, ... } }, while valid sibling orders in the batch proceed normally. - If an order’s signed expiry has already elapsed when it arrives and the signature
is valid for your wallet, it is also refused with
400 order_expiry_too_soon(rather thanbad_signature).
Expiry lifecycle and pastDeadline
When an open or partially filled GTD order reaches its expiration timestamp:
- The matching engine releases the order and stops matching it.
- Before platform cleanup sweeps the order row, read endpoints (
GET /api/orders/open,GET /api/orders/history,GET /api/orders/{id}) return the order with an additive flag:pastDeadline: true. - The background reconciler janitor updates the order to its terminal state
status: "EXPIRED"and releases all locked collateral back toavailable.
IOC — Immediate Or Cancel
Executes whatever is immediately available at the requested price; the unfilled remainder is cancelled, not rested. ALIMIT + IOC order
whose price reaches one of your own resting orders is REJECTED with
code: self_cross_blocked and takes nothing, even from better-priced
orders of other participants (see
Self-trade prevention).
FOK — Fill Or Kill
All-or-nothing. If the full quantity isn’t immediately available at the price, nothing fills and status isCANCELLED. A LIMIT + FOK
order whose price reaches one of your own resting orders is not
cancelled but REJECTED with code: self_cross_blocked (see
Self-trade prevention).
MARKET orders
MARKET + IOC — sweep the book starting from the best price until
quantity is exhausted or the price slippage cap is hit.
MARKET + FOK — all-or-nothing within the price slippage cap. If the
book cannot fill the full quantity at or better than price, nothing
fills and the order ends CANCELLED with no trades. Otherwise it fills
completely, sweeping the book like MARKET + IOC. Your own resting
orders do not count toward the full quantity. A FOK order (LIMIT or
MARKET) whose fill would need more than 512 entries in one answer (fills,
self-trade cancels and expired makers together) is also cancelled with
nothing filled.
When a market order’s sweep comes to one of your own resting orders,
it cancels that order (reason: "self_trade_prevention") and keeps
filling against other participants’ orders. See
Self-trade prevention.
Post-only orders (postOnly: true)
Post-only guarantees that an order only enters the book as a maker quote and
never takes liquidity:
- Eligible orders:
postOnly: trueis strictly permitted only forLIMITorders withGTCtime-in-force. - Invalid combinations: Pairing
postOnly: truewithtype: 'market'or withtimeInForce: 'ioc'/'fok'is rejected withcode: post_only_invalid_order_type. OnPOST /api/orders/placethis is an immediate HTTP400; onPOST /api/orders/place-batchit returns HTTP201with an entry-level rejection{ success: false, status: "REJECTED", code: "post_only_invalid_order_type" }. - Crossing protection: In continuous matching, if a post-only order’s price
crosses or touches the opposite side of the book, it is rejected with
{ status: "REJECTED", code: "post_only_would_cross" }without executing.
Which to pick
All supported combinations are accepted by
POST /api/orders/place and POST /api/orders/place-batch: pass
type + timeInForce in the body. Both fields are optional; defaults
are limit + gtc.