⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

ChainStateVerifier

sec.chainstateverifier
Security planned Spec started frozen

Cross-check every order’s chain-derived inputs (nonce, balance, allowance) against multiple sources before signing.

What it does

Cross-check every order’s chain-derived inputs (nonce, balance, allowance) against multiple sources before signing.

Pipeline placement

runs after: RPCFailoverManager elects primary provider ChainStateVerifier runs before: Order signing

Applies to: Every order before signing — verifies chain-derived fields against multiple RPC sources

Why it matters

If this failsConsequence
Single RPC source used for nonce/balance without cross-checkingA stale or compromised RPC causes double-spend attempts or orders built on wrong nonce.
Reorg not detected before signingAn order signed on top of a reorged block may reference a state that no longer exists, causing failed settlement.
Balance check skippedOrders submitted without sufficient pUSD collateral fail at settlement, wasting gas and degrading UX.

Inputs

Polymarket inputs

InputSourceRequiredUse
pUSD balance of trading walletonchainrequiredVerify wallet has sufficient collateral before signing.
Latest block number and block hashonchainrequiredCross-check across providers to detect reorg or fork.

Internal inputs

InputSourceRequiredUse
Elected primary RPC provider from RPCFailoverManagerRPCFailoverManagerrequiredDetermine which provider to use as primary; verify against secondary.
KillSwitch active flagKillSwitchrequiredBlock all chain reads during global pause.

Authority

What this bot is permitted to do

Reject Pause

State

Readiness

Spec started

Status

planned

Class

Guardrail

Default mode

shadow_only

Developer owner

Polytraders core

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active.Immediately return DENY.
CHAIN_STATE_MISMATCHHARD_REJECTBlock hash disagreement across providers, reorg detected, or insufficient wallet balance.Return DENY; emit alert.
RPC_QUORUM_LOSTHARD_REJECTFewer than require_quorum providers responded.Return DENY; defer to RPCFailoverManager.
CHAIN_STATE_REORG_WARNWARNReorg depth approaching reorg_depth_alert threshold.Emit warn; continue checking.
CHAIN_STATE_OKINFOAll checks passed; chain state verified.Emit RiskVote(APPROVE).

Used by

Reverse index — strategies that currently reference sec.chainstateverifier. If you change this bot's authority or reason codes, these strategies must re-pass shadow.

StrategyStateActivity
NBA H2H — moneyline market-makedemo-wiredlast triggered 41m ago

Showing 1 of 1 · demo-wired ≠ production-live

Why this matters

Security bots does NOT propose or execute trades; only guards signing and wallet operations. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…