Skip to main content

(V0.1) Cancel all of the calling account's resting orders on one instrument.

POST 

/v1/orders/cancel_all

Cancels every resting order the calling account holds on a single instrument_id. instrument_id is REQUIRED — V0.1 mass cancel is deliberately per-instrument; there is no all-instruments / account-wide kill form, and it does not enter a kill-switch state (spec §6.6).

Backed by a single MassCancel SBE event. The sweep itself is asynchronous: a deep book may take a while to drain, so this endpoint returns 202 Accepted immediately rather than blocking. The engine then, in one sequenced apply pass:

  • emits one OrderCanceled per affected order — each lands in the audit orders table (so GET /v1/orders/{order_id} reflects the cancellation) and drives the public orderbook_delta WS channel; then
  • emits a terminating MassCancelComplete, surfaced on the authenticated account WS channel as a mass_cancel_complete event carrying the authoritative canceled_count.

Correlate the 202 response with the WS completion event via the shared correlation_id. estimated_count is a best-effort hint taken from the live engine snapshot at request time; the WS event carries the actual count.

V0.1 reference: market_maker/PLAN.md §16.2 item 5.

Request

Responses

Mass-cancel sequenced; per-order cancels + completion arrive via WS.