Skip to main content
POST
xo-orderbook-client-rs

Body

application/json
order
object
required

EIP-712 signed order. Wire fields are camelCase. Sign over domain name="XO Market CLOB", version="1", chainId=<XO chain id>, verifyingContract=<CTF Exchange address>. XO Privy/ZeroDev smart accounts use signatureType = 3; direct EOA integrations use signatureType = 0.

Orders do not carry a fee rate. Fetch the market category rate with GET /fee-rate and see the Fees guide for the conviction curve. Legacy wire keys taker and feeRateBps are ignored on parse and must not be used for signing (the typehash changed).

orderType
enum<string>
required
  • GTC - Good-Till-Cancel; rests on the book until filled or cancelled.
  • GTD - Good-Till-Date; requires non-zero expiration in the signed order.
  • FOK - Fill-Or-Kill; fills the entire signed takerAmount (BUY) / makerAmount (SELL) at the signed price or rejects with no fills.
  • FAK - Fill-And-Kill (a.k.a. IOC); fills as much as the book supports at the signed price; cancels any unfilled remainder.

Market-style execution. There is no dedicated MARKET value. Submit a signed CTFOrder at an aggressive cap price (e.g. 0.99 for BUY, 0.001 for SELL), then choose FAK for immediate partial fill or FOK for all-or-nothing execution. The matching logic can also use economically compatible YES/NO liquidity.

Available options:
GTC,
FAK,
FOK,
GTD
postOnly
boolean
default:false

Envelope flag — not part of the signed EIP-712 order. When true, the order must rest without taking any liquidity. The engine rejects it (HTTP 400) if it would match at placement via COMPLEMENTARY, MINT, or MERGE.

Requires orderType of GTC or GTD. FAK / FOK with postOnly: true returns {"error": "postOnly orders must use orderType GTC or GTD"}. A crossing GTC/GTD returns {"error": "post-only order would cross resting liquidity"}.

Omitted or false is a normal order.

Response

OK

Wire shape uses camelCase (orderID, errorMsg, makingAmount, takingAmount, transactionsHashes, tradeIds) to satisfy polymarket-client-sdk deserialisation. The struct's Rust source is #[serde(rename_all = "camelCase")] with explicit rename = "orderID" and rename = "transactionsHashes".

success
boolean
required
errorMsg
string | null
required

null when success: true. Populated with a stable failure message when success: false (e.g. "FOK could not fill at signed price").

makingAmount
string
required

Total maker-side amount across all fills, decimal string. USDC micro-units for a BUY, human-share tokens for a SELL. "0" when the order rested with no fills.

takingAmount
string
required

Total taker-side amount across all fills, decimal string. Opposite-side unit of makingAmount. "0" when no fills.

orderID
string
required

0x-prefixed EIP-712 order hash digest. Same hash the SDK signed.

status
enum<string>
required
  • live — resting on the book (GTC/GTD with remainder).
  • matched — fully filled.
  • delayed — queued, FOK could not fill at signed price, or otherwise not yet matched. Matches the canonical py-clob-client status strings (NOT "cancelled").
Available options:
live,
matched,
delayed
transactionsHashes
string[]
required

0x-prefixed on-chain settlement tx hashes (one per matched batch).

tradeIds
string[]
required

0x-prefixed 32-byte trade ids for fills produced by this order.