associatedWallet requirement, and rate-limit buckets.
Request body
forbidNonWhitelisted). Any extra field
returns 400 invalid_request, and error.details.fields[] names the
offending property, for example:
{ "field": "foo", "constraint": "whitelistValidation", "message": "property foo should not exist" }.
Field bounds, checked at request validation (after authentication, rate limits and account gates, before any market, price or signature check) on place and on every entry
of place-batch (one entry out of bounds refuses the whole batch with
400 invalid_request; RND-3929, RND-3943, RND-4156, RND-4196, RND-5379):
Send
feeRateBps with the value you signed. If the market fee changed
after you fetched it, the order is rejected with status: REJECTED,
code: stale_fee_quote and a message giving the current rate. Re-fetch
feeTakerBps, then re-sign. If you omit the field, the signature is still
checked against the current fee, and a stale fee comes back as
bad_signature.
The platform never receives the struct you signed. It rebuilds the
on-chain Order from your request fields and recovers your signature
against that rebuild. So the struct you sign must always contain:
signer= the wallet you authenticate as (your key’sassociatedWallet, or theX-User-Walletfor amulti_walletkey)maker= that wallet’s vault of the market’s generation (GET /api/me/vaultvaults[]), never the EOAsignatureType=1(VAULT).0(EOA) is deprecated. The platform and the exchange contract both reject it, even whenmaker == signer.salt= the bodynonce,expiration=expiry,feeRateBps= the market’sfeeTakerBps,taker=0x0,tokenId= the token foroutcome,side=0BUY /1SELLmakerAmount/takerAmountderived fromprice/quantity(CEIL on BUY notional, FLOOR on SELL)- the EIP-712 domain of the market’s exchange:
market.exchangeAddress, or when it isnullthe binary or the neg-risk exchange according to the market’snegRiskEligible
On a generation-2 market (
contractGeneration: 2), verifyingContract is the market’s exchangeAddress and maker is your generation-2 vault. See Placing orders on gen-2 markets.maker field is only an ownership check. It must be your wallet
or one of its vaults (anything else is rejected with maker_mismatch, an HTTP
401 on /place), and the platform verifies against your vault of the market’s generation in both
cases. If the signature is not in canonical 65-byte (r, s, v) form (RND-2432)
or does not recover to your wallet, the order comes back as status: REJECTED,
code: bad_signature (HTTP 201), not as an HTTP 400; see Response shape.
If a non-zero expiry is within the 60s safety window or has passed,
the request is refused with HTTP 400 order_expiry_too_soon.
Validation rules
Except where a row shows an HTTP status, every rule in this table is checked as a business rule. A failure comes back as a REJECTED envelope, not an HTTP error: an HTTP201 body
{ status: "REJECTED", code, message } on /place, or an entry with
success: false on /place-batch. Branch on status / code, not on
the HTTP status. (Shape errors, such as a non-numeric price or an
unknown field, fail request validation first with 400 invalid_request.)
Worked example — BUY 10 YES at 0.42
Response shape
trades[].price is the price per outcome token in your own outcome frame. On
the taker leg of a MINT (your BUY crossed with a BUY of the other outcome),
it is what you actually paid: 1 - maker price, at or below your signed
limit. The chain charges the signed limit and refunds the difference, so this
matches the price GET /api/orders/{id}/fills reports for the same leg
(RND-2522). In the rare case the service cannot cross-check a MINT leg,
price keeps your signed limit.
On code: bad_signature, details takes one of two shapes (RND-2432): if the
signature is not in canonical 65-byte (r, s, v) form (v = 27 or 28 and low
s), details contains { expected_signer, signature_form } (such as
length_64, v_00, high_s); if the signature is canonical 65 bytes, details
contains recovered (the address your signature recovers to against the
platform’s struct), expected_signer (the acting wallet: your key’s
associatedWallet, or the X-User-Wallet on multi_wallet keys), and
platform_canonical_struct (the exact Order the platform verified). Compare
platform_canonical_struct field by field with the struct you signed. If your
non-zero expiry has already passed or is within the 60s safety window, the
order is refused with 400 order_expiry_too_soon (or REJECTED with
order_expiry_too_soon on batch), so bad_signature indicates an encoding or
cryptographic verification failure.
See bad_signature diagnostic hints.
The clientOrderId field is echoed verbatim when the request supplied
one — present on every shape (success, REJECTED, idempotent replay). Use
it to correlate the server-issued orderId to your own client-side handle
without a follow-up GET /api/orders/{id}. The same value is also carried
on the order_placed and order_cancelled frames of the user_orders
channel on /ws/user, so partners that drive their state machine off the WS feed get
the correlation key on both surfaces.
Batch placement
Submit up to 10 orders in one request withPOST /api/orders/place-batch.
Each entry is the exact same body as single placement; the
batch is processed sequentially in array order with independent
per-order outcomes — one rejected order never aborts the rest, and there
is no all-or-nothing atomicity. Request validation is the exception: if
any entry is malformed (for example a non-numeric price, an unknown
field or a missing signature), or the array holds 0 or more than 10
entries, the whole request fails with 400 invalid_request and no entry
is processed.
PlaceOrderResp (identical to single place) plus a success flag:
Partner trade limits accumulate across the batch. For users who
trade through a partner sign-in (
partner_sso), the partner trade cap
is charged against the running total of the entries accepted earlier in
the same batch, so a batch can never admit more exposure than the same
orders sent one at a time.Finding an order after a timeout
When a place request times out or answers 5xx you don’t have theorderId, but you hold two keys for the order: the clientOrderId you
sent, and its orderHash, the EIP-712 digest of the struct you signed
(see EIP-712 signing).
Look the order up by either one:
- Pass exactly one of the two; neither or both answers
400 invalid_request. - The answer is the same
Orderobject asGET /api/orders/{id}. clientOrderIdis matched exactly (case-sensitive, not trimmed). URL-encode it: a raw+in a query string reads as a space.orderHashis accepted in any case.- An unknown key and an order of another wallet both answer
404 order_not_found. - The server-generated
srv-*key comes back indetails.clientOrderIdon a singlePOST /api/orders/place503 (placement_unknown,placement_matched(the order traded),placement_resting(it rests on the book); do not sign a new order on any of them), and indetails.clientOrderIds(request order;nullfor an entry refused before it was sent) on aplace-batch503 placement_unknown. Every otherplace-batch5xx carries no keys, so set your ownclientOrderIdon every batch entry, or look the order up byorderHash. - Ended orders with no trade are archived after 30 days.
GET /api/orders/{id}continues to find archived orders byorderIdand returns them withorderSource: "archive"(final; on rows archived before the archive kept them,expiration,feeRateBps,maker, andsignerarenull, andorderHashmay benull).GET /api/orders/lookup(clientOrderId/orderHash) only searches live unarchived orders, so a/lookup404for an archived order says nothing about it.
/place has its own limit of 20 req/sec/wallet. For the full table,
see Rate limits. KYC deposit-tier gating applies, same
as single place.
Post-only orders
SetpostOnly: true to guarantee an order only ever rests on the book
and never matches on entry. It’s the maker-side guarantee market makers need
to avoid paying taker fees. (No order of yours ever trades against your
own quotes, post-only or not: a limit order that would reach them is
rejected, and a market order cancels the ones it comes to; see
Self-trade prevention.)
gtc time-in-force (optionally with
expiry). Omit it (or send false) for today’s behavior.
Self-trade prevention
A wallet never trades with itself. When a new order would meet one of your own resting orders, the platform stops that match. What it stops depends on the new order’stype:
For a
limit order, “reaches” means a BUY priced at or above your
lowest resting SELL, or a SELL priced at or below your highest resting
BUY; an equal price counts. Quoting both sides with a spread between
them is always allowed.
- YES and NO share one book. On a binary market, buying NO at
pis the same as selling YES at1 − p, so your orders on both outcomes are checked together. A BUY YES and a BUY NO reach each other when their prices add up to1.00or more; a SELL YES and a SELL NO when they add up to1.00or less. With your BUY NO at0.40resting, a BUY YES at0.60isself_cross_blockedand a BUY YES at0.55is not. Different markets never block each other, including the questions of one multi-outcome event. - Checked first. The check runs before the post-only and
fill-or-kill checks. A
postOnlyorder that reaches your own order getsself_cross_blocked, notpost_only_would_cross, and aLIMIT + FOKorder comes backREJECTEDwithself_cross_blocked, notCANCELLED. ALIMIT + IOCorder that reaches your own order takes nothing, not even better-priced orders of other participants. - Batches.
place-batchentries are processed in array order. Alimitentry that reaches an order an earlier entry of the same batch left resting is rejected withself_cross_blocked, and the earlier entry is unaffected. Amarketentry cancels that order instead, as described above. - Pre-market. While a market is
PRE_MARKET, an order that would cross another wallet’s resting order is rejected withcode: pre_market_crossing_order(see Market status). The self-trade check runs first, so an order that reaches one of your own resting orders, including one an earlier entry of the sameplace-batchleft resting, comes back asself_cross_blockedinstead. An order you send withpostOnly: truethat would cross getspost_only_would_cross. - Just-expired orders. One of your orders whose
expiryhas just passed can still count for a few seconds, until the platform removes it from the book. - Per wallet. Orders from two different wallets are never blocked
or cancelled against each other, even when they belong to the same
multi_walletAPI key: they match like any two participants. Trading between wallets you control is still subject to market surveillance.
- Rejected
limitorder.POST /api/orders/placeanswers HTTP201withstatus: "REJECTED",code: "self_cross_blocked"and a realorderId(onplace-batch, that entry withsuccess: false). Only this response names the code. On theuser_ordersWebSocket channel you get the usualorder_placedframe, thenorder_cancelledwithreason: "matcher_rejected"(notorder_rejected), andGET /api/orders/{id}readsREJECTED. - Resting order cancelled by your
marketorder. Anorder_cancelledframe onuser_orderswithreason: "self_trade_prevention". It can arrive withoutclientOrderId,originalQuantityandremainingQty, so key it byorderId.GET /api/orders/{id}readsCANCELLED, and the order’s locked funds are released as with any cancel. Themarketorder’s own response doesn’t list the orders it cancelled.
Sell orders
Same shape;side: 'sell'. No USDC is locked for a SELL order.
Instead, the order reserves its quantity of the outcome token
(ERC-1155), which must already sit in the vault, not the EOA.
Tokens reserved by one open SELL cannot back another; cancelling or
expiry releases the reservation for the unfilled remainder. Position
resolution is keyed by maker (the vault), which is why on-chain splits (USDC → YES + NO) must be initiated by
vault.splitPosition(...) rather than by the EOA directly. See
Vaults for the split flow.
Placing orders on gen-2 markets (API market makers)
The endpoints, theOrder struct and the domain name / version are
the same on both generations. Three values change: the vault, the
verifyingContract, and which markets you quote.
1. Find generation-2 markets
GET /api/markets has no generation filter; an unknown query parameter
such as contractGeneration=2 does not narrow the list. Page through it
and filter on the client:
limitis 1 to 500 (default 50). Page with the defaultsort=kickoff: the other sorts can shift between pages. The list can change while you page, so deduplicate bysymbol.PRE_MARKETmarkets aretradable: truetoo, but accept only restinglimit+gtcorders that do not cross. See Market status.- Send your API key on these reads. A market hidden by the liquidity gate
is left out of the list for everyone except registered market makers,
and
GET /api/markets/{slug}answers others404 market_unavailable. Any other market that is not public is not listed and answers404 market_not_found. New markets are listed as they open, so refresh the list. - Decide the generation from
contractGeneration, not from whetherexchangeAddressis set. See Detect a market’s generation.
2. Pick the vault and the domain
Cash and positions are held per vault: the order locks USDC or outcome
tokens of the generation-2 vault only. No generation-2 vault yet? See
Upgrade.
Build the rest of the struct, sign it and send it exactly as in the
worked example above on this page, with this
maker and domain. The
types are in EIP-712 signing.
3. Check every entry of a batch
HTTP201 on POST /api/orders/place-batch means the batch was
processed, not that orders were placed. The response array matches the
request 1:1; read success, then status, then code of each entry:
A batch sent once in which every entry is
REJECTED (without the
exceptions above) leaves no order on the book. To confirm what exists:
GET /api/orders/open: a resting order shows your generation-2 vault asmaker. Page untilnextCursorisnull.GET /api/orders/lookup?clientOrderId=…: one order by your key. A404right after a timeout is not proof; see Finding an order after a timeout.
Troubleshooting
On/place the HTTP errors below carry their fields in error.details.
On /place-batch each is that entry’s own REJECTED slot with the same
code, and the fields are in the entry’s details.
Next
Time-in-force
GTC vs IOC vs FOK behaviour.
Cancelling orders
Single-order and cancel-all flows.