⚠ 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

QueueWarden

exec.queuewarden
Execution live General live frozen

QueueWarden polices the rate at which orders and cancel-replace operations are sent to the Polymarket CLOB V2 and manages the maker queue position of

What it does

QueueWarden polices the rate at which orders and cancel-replace operations are sent to the Polymarket CLOB V2 and manages the maker queue position of resting orders. It enforces a cap on cancel-replace operations per minute to avoid CLOB rate-limit rejections, monitors drift between the resting quote price and the best bid/ask, and cancels stale resting orders that have not been filled within the stale_ttl_s window. QueueWarden also injects builderCode (bytes32) into cancel-replace messages to maintain builder attribution continuity across order lifecycle events.

Pipeline placement

runs after: NonceShepherd (nonce assigned) and SmartRouter (ExecutionPlan assembled) QueueWarden runs before: Order submission to CLOB V2 (cancel-replace actions)

Applies to: All resting maker orders on Polymarket CLOB V2 that are subject to quote drift or TTL management

Why it matters

If this failsConsequence
Excessive cancel-replace ratePolymarket CLOB V2 enforces per-API-key rate limits. Exceeding them causes 429 rejections, breaking the order submission pipeline and potentially leaving the strategy with unintended open positions.
Quote drift not correctedA resting order priced more than drift_ticks_threshold ticks away from the current best bid/ask is no longer competitive; it accumulates adverse-selection risk without filling.
Stale resting order not cancelledAn order sitting in the book beyond stale_ttl_s may fill at a price that no longer reflects the strategy's current view, creating unintended exposure.
builderCode absent from cancel-replace messageBuilder attribution is broken for the replacement order; maker rebates may not be correctly attributed.

Inputs

Internal inputs

InputSourceRequiredUse
Active resting order registryinternal order state storerequiredTrack all resting orders with their price, side, placed_at_ms, and queue position.
CLOB V2 order book snapshot (best bid/ask)clob_auth (authenticated book endpoint)requiredCompute drift between resting order price and current best bid/ask in ticks.
Cancel-replace rate counterinternal sliding-window counter (Redis)requiredEnforce cancel_replace_per_min_cap by tracking ops in the last 60s.
ExecutionPlan for replacement orderexec.smart_routerrequiredReceive the updated quote parameters when a cancel-replace is triggered.

Authority

What this bot is permitted to do

Reshape

State

Readiness

General live

Status

live

Class

Execution Utility

Default mode

general_live

Developer owner

Polytraders core

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
QUEUE_WARDEN_HOLDINFOResting order is within drift tolerance, below stale TTL, and queue position is acceptable.No action. Emit QueueDecision.HOLD.
QUEUE_WARDEN_DRIFT_EXCEEDEDRESHAPEOrder price has drifted more than drift_ticks_threshold ticks from the current best bid/ask.Cancel and replace order at current best price with refreshed builderCode.
QUEUE_WARDEN_STALE_ORDERRESHAPEResting order has exceeded stale_ttl_s without being filled.Cancel order without replacement. Emit QueueDecision.CANCEL_STALE.
QUEUE_WARDEN_QUEUE_DEGRADEDRESHAPEMaker queue position has worsened beyond min_queue_position threshold.Cancel and replace to re-enter at the front of the queue.
QUEUE_WARDEN_RATE_CAP_HITWARNcancel_replace_per_min_cap has been reached; excess operations are queued for the next rate window.Enqueue op in rate-deferred queue. Emit WARN. Do not block non-cancel-replace ops.
QUEUE_WARDEN_BOOK_UNAVAILABLEHARD_REJECTCLOB V2 book endpoint is unreachable; drift cannot be computed for this order.Cancel order as safe fallback. Emit QueueDecision.CANCEL_STALE.
QUEUE_WARDEN_STATE_UNAVAILABLEHARD_REJECTInternal order registry is unreachable; evaluation cannot proceed.Pause all evaluation. Emit WARN. Resume when state store reconnects.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active; all resting orders are cancelled immediately.Cancel all resting orders. Emit no replacement orders.

Used by

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

StrategyStateActivity
Crypto Q2 — basket rebalancefrozenlast triggered 16m ago
US Elect — book-builderdemo-wiredlast triggered 23m ago
NBA H2H — moneyline market-makedemo-wiredlast triggered 30m ago

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

Why this matters

Execution bots does NOT propose new positions; only routes and shapes approved intents. 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…