The SDK handles EIP-712 signing and submission for you. If you prefer the REST
API directly, see Authentication for constructing the
required headers and the API Reference for full endpoint
documentation including the raw order object fields and request/response schemas.
Order Types
| Type | Behavior | Use Case |
|---|---|---|
| GTC | Good-Til-Cancelled — rests on the book until filled or cancelled | Default for limit orders |
| GTD | Good-Til-Date — active until a specified expiration time | Auto-expire before known events |
| FOK | Fill-Or-Kill — must fill immediately and entirely, or cancel | All-or-nothing market orders |
| FAK | Fill-And-Kill — fills what’s available immediately, cancels the rest | Partial-fill market orders |
- GTC and GTD are limit order types — they rest on the book at your specified price.
- FOK and FAK are market order types — they execute against resting liquidity immediately.
- BUY: specify the dollar amount you want to spend
- SELL: specify the number of shares you want to sell
Limit Orders
The simplest way to place a limit order — create, sign, and submit in one call:Two-Step Sign Then Submit
For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic:GTD Orders
GTD orders auto-expire at a specified time. Useful for quoting around known events.There is a security threshold of one minute on GTD expiration. To set an
effective lifetime of N seconds, use
now + 60 + N. For example, for a
30-second effective lifetime, set the expiration to now + 60 + 30.Market Orders
Market orders execute immediately against resting liquidity using FOK or FAK types:- FOK — fill entirely or cancel the whole order
- FAK — fill what’s available, cancel the rest
price field on market orders acts as a worst-price limit (slippage protection), not a target execution price.
One-Step Market Order
For convenience,createAndPostMarketOrder handles creation, signing, and submission in one call:
Post-Only Orders
Post-only orders guarantee you’re always the maker. If the order would match immediately (cross the spread), it’s rejected instead of executed.- Only works with GTC and GTD order types
- Rejected if combined with FOK or FAK
Batch Orders
Place up to 15 orders in a single request:Order Options
Every order requires two market-specific options:tickSize and negRisk. For details on signature types (0 = EOA, 1 = POLY_PROXY, 2 = GNOSIS_SAFE), see Authentication.
Tick Sizes
Your order price must conform to the market’s tick size, or the order is rejected.| Tick Size | Precision | Example Prices |
|---|---|---|
0.1 | 1 decimal | 0.1, 0.2, 0.5 |
0.01 | 2 decimals | 0.01, 0.50, 0.99 |
0.001 | 3 decimals | 0.001, 0.500, 0.999 |
0.0001 | 4 decimals | 0.0001, 0.5000, 0.9999 |
Negative Risk
Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. PassnegRisk: true for these markets.
Prerequisites
Before placing an order, your funder address must have approved the Exchange contract to spend the relevant tokens:- BUY orders: pUSD allowance >= spending amount
- SELL orders: conditional token allowance >= selling amount
Sports Markets
Sports markets have additional behaviors:- Outstanding limit orders are automatically cancelled once the game begins, clearing the entire order book at the official start time
- Marketable orders have a 1-second placement delay before matching
- Game start times can shift — monitor your orders closely, as they may not be cleared if the start time changes unexpectedly
Response
A successful order placement returns:Statuses
| Status | Description |
|---|---|
live | Order resting on the book |
matched | Order matched immediately with a resting order |
delayed | Marketable order subject to a matching delay |
unmatched | Marketable but failed to delay — placement still successful |
Error Messages
| Error | Description |
|---|---|
INVALID_ORDER_MIN_TICK_SIZE | Price doesn’t conform to the market’s tick size |
INVALID_ORDER_MIN_SIZE | Order size below the minimum threshold |
INVALID_ORDER_DUPLICATED | Identical order already placed |
INVALID_ORDER_NOT_ENOUGH_BALANCE | Insufficient balance or allowance |
INVALID_ORDER_EXPIRATION | Expiration timestamp is in the past |
INVALID_POST_ONLY_ORDER_TYPE | Post-only used with FOK/FAK |
INVALID_POST_ONLY_ORDER | Post-only order would cross the book |
FOK_ORDER_NOT_FILLED_ERROR | FOK order couldn’t be fully filled |
INVALID_ORDER_ERROR | System error inserting the order |
EXECUTION_ERROR | System error executing the trade |
ORDER_DELAYED | Order match delayed due to market conditions |
DELAYING_ORDER_ERROR | System error while delaying the order |
MARKET_NOT_READY | Market not yet accepting orders |
Heartbeat
The heartbeat endpoint maintains session liveness. If a valid heartbeat is not received within 10 seconds (with a 5-second buffer), all open orders are cancelled.- Include the most recent
heartbeat_idin each request. Use an empty string for the first request. - If you send an expired ID, the server responds with
400and the correct ID. Update and retry.
Next Steps
Cancel Orders
Cancel single, multiple, or all open orders
Order Attribution
Attribute orders to your builder account for volume credit