reduce_only, which constrains exposure but does not halt an account.
Raw workflow
- Stop local create and replace producers.
- Record a cutoff
max_ts. - Send cancel-all with that cutoff.
- Keep the order-control or orders WebSocket open until terminal events arrive.
- Re-fetch complete account state and reconcile.
max_ts can still race with the cancel. Watch the orders stream and refetch:
tpluspy
OrderBookClient(use_ws_control=True), send create, replace, and cancel through the same /control channel so responses carry the same connection context. On reconnect, do not resume from memory: fetch open orders, positions, inventory, margin, and recent user trades before restarting quoting.
The /control channel also accepts CancelAllOrdersRequest, CancelAllOrdersForAssetRequest, and BatchCancelRequest raw messages, or v1 envelopes with request_id. Bulk cancel messages are acknowledged as submitted; reconcile individual order state through the orders stream and REST snapshots.
Reconciliation checklist
For market makers on sync books, also watch
/sync/pending_settlements; a stopped quoting loop can still have settlement obligations for fills that already happened.