Skip to main content
Cancel-on-disconnect (COD) automatically cancels your mmp: true orders and quotes when a WebSocket connection drops — protecting you from stale orders resting on the book after a network failure. On graceful server shutdown, COD-enabled connections are cancelled as well. COD only cancels what was sent on the connection that dropped:
  • Orders placed with mmp: true are cancelled.
  • RFQ quotes are cancelled.
  • Orders without mmp: true are not cancelled — they stay on the book.
  • Trigger and algo orders are never cancelled, whatever their mmp flag. Cancel them yourself with private/cancel_all_trigger_orders and private/cancel_all_algo_orders.
Set mmp: true on every order you want COD to cancel. Enabling COD alone does not protect orders placed without the flag.
COD is a persisted account setting, not a per-frame flag. Enable or disable it with private/set_cancel_on_disconnect:
  • The setting is stored against the wallet’s account settings and applied to every new connection at login — so once enabled it persists across reconnects until you disable it.
  • Calling private/set_cancel_on_disconnect requires a session key with the Trade(All) protocol scope that covers all subaccounts, since the setting is wallet-wide (see Authentication). A read-only JWT session cannot toggle it.
  • The current value is reported on your account (cancel_on_disconnect) via the account read methods.
In v2 this was a family of enable/disable/set RPCs. In v3 there is a single private/set_cancel_on_disconnect method taking an enabled boolean, gated by the Trade(All) scope. If your integration references the older method names, migrate to this one.