Reason-code registry
Every reason code that a bot may emit. New codes go through review — free-text reasons are not allowed in production.
Rules
- Codes are SCREAMING_SNAKE_CASE, prefixed by family.
- Every emitted ReportEnvelope must carry a code from this registry.
- Adding a code is a PR against this page plus the schema; it is reviewed by Risk and Governance.
- Removing a code is a deprecation, not a delete — codes never get reused for a different meaning.
Risk family RISK_*
| Code | Meaning |
|---|---|
RISK_KILL_SWITCH_ACTIVE | Kill switch is active; no orders may be submitted. |
RISK_DRAWDOWN_BREACH | Intraday or weekly drawdown threshold exceeded. |
RISK_PORTFOLIO_LIMIT | Portfolio exposure cap would be breached. |
RISK_MARKET_LIMIT | Per-market exposure cap would be breached. |
RISK_LIQUIDITY_INSUFFICIENT | Order book lacks the liquidity to absorb this size. |
RISK_STALE_BOOK | Order book snapshot is older than max_orderbook_age_ms. |
RISK_MARKET_HALTED | Market is paused, resolving, resolved, or invalid. |
RISK_SELF_TRADE | Order would self-cross another bot's resting order. |
RISK_FEE_GAS_HEADROOM | Estimated fees + gas exceed the configured headroom. |
RISK_CORRELATION_SHOCK | Correlated portfolio shock detected; trading paused. |
RISK_MODEL_DRIFT | Strategy's model has drifted past the warning band. |
RISK_TAIL_LOSS_BREACH | Tail-loss simulator says this trade exceeds the worst-case envelope. |
RISK_FLATTEN | Risk has demanded the position be flattened immediately. |
Execution family EXEC_*
| Code | Meaning |
|---|---|
EXEC_LATENCY_BUDGET_EXCEEDED | Execution path exceeded its latency budget. |
EXEC_PARTIAL_FILL_HANDLED | Partial fill processed; remaining size resubmitted or cancelled. |
EXEC_AMEND_REJECTED | Order amend rejected by the exchange. |
EXEC_CANCEL_TIMEOUT | Cancel request timed out; assume order is still resting. |
EXEC_SLIPPAGE_BREACH | Realised slippage exceeded the configured cap. |
EXEC_FEE_OVERRUN | Realised fees exceeded the estimate by more than the configured tolerance. |
EXEC_FILL | Order filled by the exchange. |
EXEC_RESTING | Order is resting on the book. |
EXEC_CANCELLED | Order cancelled by the exchange. |
EXEC_REJECTED | Order rejected by the exchange. |
EXEC_BAD_ENVELOPE | EIP-712 v2 envelope failed shape validation. |
EXEC_BAD_INTENT | OrderIntent failed structural validation. |
EXEC_BAD_SIZE | Order size is invalid (negative, zero, or out of range). |
EXEC_BAD_PRICE | Order price is invalid (not on tick, out of [0,1]). |
EXEC_BAD_SIDE | Order side is not BUY or SELL. |
EXEC_BAD_TIF | Time-in-force not one of GTC, IOC, FOK. |
EXEC_BAD_REQUEST | Transport-level request failed validation. |
EXEC_INTERNAL | Internal exchange-side error. |
EXEC_NO_LIQUIDITY | No liquidity available to fill this order. |
EXEC_FOK_NOT_FULLY_FILLABLE | FOK order cannot be fully filled at submit time. |
EXEC_UNKNOWN_MARKET | Market ID not present on the venue. |
EXEC_UNKNOWN_ORDER | Order ID not present in the venue's order book. |
EXEC_UNKNOWN_ROUTE | Unknown HTTP route or in-process method. |
EXEC_ORDER_TERMINAL | Order is already in a terminal state; no further action allowed. |
EXEC_AMEND_OK | Order amend acknowledged by the exchange. |
EXEC_AMEND_INFLIGHT | Order amend is in flight; awaiting acknowledgement. |
EXEC_AMEND_UNKNOWN | Order amend outcome is unknown. |
EXEC_AMEND_TIMEOUT | Order amend timed out before acknowledgement. |
EXEC_CANCEL_OK | Order cancel acknowledged by the exchange. |
EXEC_COST_ESTIMATED | Execution cost estimate produced from live inputs. |
EXEC_COST_FALLBACK | Execution cost estimate used the safe fallback. |
EXEC_COST_FEE_SCHEDULE_STALE | Execution cost estimate used a stale fee schedule. |
EXEC_BUILDERCODE_MISSING | Outbound envelope lacked the required builderCode. |
EXEC_OPERATOR_MANUAL_CASHOUT | Operator manually closed the position; cash-out submitted at current mid. |
Strategy family STRAT_*
| Code | Meaning |
|---|---|
STRAT_NO_EDGE | Model edge fell below min_edge_bps; no intent emitted. |
STRAT_EDGE_DETECTED | Model edge above threshold; intent emitted. |
STRAT_PARAMETER_OUT_OF_DOMAIN | Input value outside the model's training domain; abstain. |
STRAT_RESHAPED_BY_RISK | OrderIntent was reshaped by Risk before submission. |
Intelligence family INTEL_*
| Code | Meaning |
|---|---|
INTEL_FEED_STALE | Upstream feed exceeded its freshness budget. |
INTEL_FEED_DEGRADED | Upstream feed is degraded but still within tolerance. |
INTEL_LIQUIDITY_DECAY | Quoted depth has decayed below acceptable levels. |
INTEL_MARKET_RESOLVING_SOON | Market is in or approaching its resolution window. |
Security family SEC_*
| Code | Meaning |
|---|---|
SEC_WALLET_FUNDING_SHORT | Wallet pUSD balance below configured floor. |
SEC_APPROVAL_MISSING | ERC-1155 approval missing or revoked. |
SEC_CONTRACT_ADDRESS_DRIFT | On-chain contract address differs from approved registry. |
SEC_SIGNATURE_TYPE_INVALID | Wallet signature type not on the allow-list. |
Governance family GOV_*
| Code | Meaning |
|---|---|
GOV_CONFIG_DRIFT | Live config differs from approved config. |
GOV_API_DEGRADED | Polymarket API latency or error rate above warning. |
GOV_RECONCILE_MISMATCH | On-chain state does not reconcile with internal state. |
GOV_AUDIT_REPLAY_DIVERGED | Replay simulator diverged from production decision. |
GOV_BUILDER_ATTRIBUTION_OK | Order carried the correct builderCode. |
GOV_API_OK | Polymarket API health probe within tolerance. |
GOV_API_DOWN | Polymarket API is unresponsive or returning errors. |
GOV_API_UNKNOWN | Polymarket API health probe inconclusive. |
GOV_CONFIG_DRIFT_DETECTED | Config drift detected against the approved baseline. |
GOV_CONFIG_DRIFT_RESOLVED | Config drift resolved; live matches approved. |
GOV_CONFIG_DRIFT_UNKNOWN | Config drift check inconclusive. |
GOV_EXPOSURE_NARRATIVE | Exposure narrative emitted with no anomalies. |
GOV_EXPOSURE_CONCENTRATION_FLAG | Exposure narrative flagged a concentration anomaly. |
GOV_EXPOSURE_FALLBACK | Exposure narrative used the safe fallback. |
GOV_RECONCILE_OK | On-chain state reconciles with internal state. |
GOV_REPLAY_MATCH | Replay simulator output matched production decision. |
GOV_REPLAY_ABORTED | Replay simulator aborted before completion. |
GOV_REPLAY_NO_NETWORK_VIOLATION | Replay simulator confirmed no network-policy violation. |