CTFExchange contract. When pausing is active, the orderbook rejects all new orders globally until trading resumes. This is distinct from a single market being Paused — the global pause halts every market at once.
What triggers it
The flag flips when the on-chainTradingPaused or TradingUnpaused event is observed on the CTF Exchange. The orderbook’s indexer routes the event and the gateway updates its in-memory flag.
There are three reasons the orderbook will emit a trading_state_changed frame — see the source field below.
REST: GET /trading-state
Out-of-band query for the current state. Always 200 with Cache-Control: no-store:
Order placement while paused
POST /order and POST /orders return 503 Service Unavailable with a typed error body and a Retry-After: 60 header:
error: "trading_paused" code lets clients branch deterministically:
Retry-After: 60 is an advisory floor, not a guarantee — the real unpause time is unknown.
WebSocket: trading_state_changed
Emitted on all three channels (/ws/market, /ws/user, /ws) regardless of your current subscription. The event bypasses per-channel filters because it’s protocol-wide.
Fields
source values
Client-side handling
Recommended pattern:- At startup, either poll
GET /trading-stateonce or wait for the initialsnapshotframe on the WS handshake. Store the currentstate. - Subscribe to any WS channel to receive future transitions.
- On
state=paused:- Stop submitting new orders. They’ll get 503-rejected anyway.
- Existing resting orders are retained during a global pause — they don’t get mass-cancelled the way they do on a per-market terminal transition. Matching is frozen until
state=active. - Optionally cancel your own resting orders if you don’t want exposure when trading resumes.
- On
state=active: resume order entry. - Treat
snapshotframes as idempotent — only act on a state change.
Difference from per-market Paused
Both are non-terminal: orders stay on the book and the market can resume to normal trading. See Market lifecycle for the per-market state diagram.