Market Lifecycle
Market modes that control which order operations are accepted
Mode Progression
Markets progress through a linear lifecycle:
post_only → trading → wind_down → halted → delisting → delisted
(build book) (normal) (close pos) (freeze) (force-close) (gone)Transitions move left-to-right. The mode field on the Market object returns the current mode as a string.
Gating Matrix
| Mode | Place (regular) | Place (market maker) | Cancel | Price update | Liquidation | Visible |
|---|---|---|---|---|---|---|
post_only | post-only only | post-only only | yes | yes | yes | yes |
trading | all order types | all order types | yes | yes | yes | yes |
wind_down | reduce-only only | reduce-only + post-only | yes | yes | yes | yes |
halted | blocked | blocked | yes | blocked | blocked | yes |
delisting | blocked | blocked | yes (by admin) | blocked | blocked | yes |
delisted | blocked | blocked | blocked | blocked | blocked | no |
Market maker status is a flag on the wallet record, set by admin operations.
Mode Details
post_only — Pre-Launch
Used before a market goes live. Only post-only (maker) orders are accepted. Builds the order book without any fills occurring.
trading — Normal
All order types, all users. Standard operating mode.
wind_down — Closing
Market is winding down. Users can only close existing positions via reduce-only orders. Market makers retain the ability to place post-only orders so there is counterparty liquidity available for users closing positions.
| User type | Allowed |
|---|---|
| Regular | reduce-only |
| Market maker | reduce-only + post-only |
halted — Emergency Freeze
No new orders. Cancellations still work so users can remove resting orders. Price updates and liquidation are stopped — prices may be unreliable during an emergency. Used for emergencies (oracle issues, exploit mitigation, etc).
delisting — Force-Close In Progress
Market is being delisted. All open orders are canceled and remaining positions are closed at a pre-announced fixed price. Price updates and liquidation are stopped during this process. Users can still see their positions and receive WebSocket updates until all positions are closed.
delisted — Removed
Market permanently gone. All operations blocked including cancellations. Market hidden from active listings.
Error Messages
When an operation is rejected due to mode:
| Error message | Mode |
|---|---|
only post-only orders are allowed in {id} market | post_only |
market {id} is in wind-down mode, only reduce-only orders allowed | wind_down |
market {id} is halted | halted |
market {id} is being delisted | delisting |
market {id} has been delisted | delisted |
Legacy Boolean Flags
For backward compatibility, the enabled and post_only boolean flags remain on the Market object. Prefer mode for new integrations.
mode | enabled | post_only |
|---|---|---|
trading | true | false |
post_only | true | true |
wind_down | false | false |
halted | false | false |
delisting | false | false |
delisted | false | false |
Visibility
visible is independent of mode. When false, the market is hidden from default UI listings but remains reachable via direct mkt_id queries. Trading behavior is unchanged.