Skip to main content
XO has a protocol-wide pause flag on the on-chain 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-chain TradingPaused 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:
or
Useful at startup to learn the initial state without waiting for the snapshot WS frame.

Order placement while paused

POST /order and POST /orders return 503 Service Unavailable with a typed error body and a Retry-After: 60 header:
The stable 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:
  1. At startup, either poll GET /trading-state once or wait for the initial snapshot frame on the WS handshake. Store the current state.
  2. Subscribe to any WS channel to receive future transitions.
  3. 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.
  4. On state=active: resume order entry.
  5. Treat snapshot frames 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.