Cancel a single order
Field-name conventions across the orders API:
- The cancel request and response use
orderId. - List/read endpoints (
GET /api/orders/open,/api/orders/history,/api/orders/{id}) return the same value underid. - The unfilled remainder is
remainingQtyeverywhere it surfaces (cancel response, order list/read). TreatorderIdandidas the same identifier for lookup; the variance is purely a request-vs-response convention.
Cancel a batch by ID
Cancel up to 100 orders by id in one request withPOST /api/orders/cancel-batch. Built for an MM re-quote tick: it collapses
N single cancels into one round-trip (one advisory-lock acquire, one COMMIT)
instead of N.
cancelled and notCancelled:
Duplicate ids are de-duplicated (cancelled once, reported once). Rate limited
at 5 req/sec/wallet. No KYC / deposit-tier gating — cancellation is
always permitted.
Cancel all your open orders
marketId to cancel every open order for the authenticated
wallet (authenticated associatedWallet or the API-key’s associatedWallet).
Response — cancelled is the array of cancelled order ids (breaking
change 2026-06; previously a count):
Scope filters — marketId, side, outcome
All three are optional and combine freely. Empty body = wallet-wide cancel.
/api/orders/open client-side and firing N cancel calls. Common
MM use case: a price spike on outcome 0 means “pull all my asks on
outcome 0 of this one market” without touching outcome-1 asks or any
buys — single call.
Under the hood
- Server calls
matcher.cancelOrderover gRPC.NOT_FOUNDis treated as idempotent success. - PG authoritative flip in a single tx:
UPDATE orders SET status='CANCELLED' WHERE id=$1 AND status IN ('PENDING','OPEN','PARTIAL')refundResidualLocked()— sums remaining locked, refunds to available.
- Double-cancel protection via the conditional WHERE.