Polytraders Dev Guide
internal
v3 spine Phase 1 · Shared contracts 9 demo-wired · 0 shadow-ready · 0 production-live · 100 pending · 109 total 15/33 infra tasks the plan status board
HomeBy ClassExecution Utility

Execution Utility

13 bots · 4 live · 1 beta · 8 planned · 1 reference

Bots that shape an approved order — price, timing, order type, size within constraints. They never change direction or strategy intent and never override a Risk decision.

Class rules

Bots in this class

Grouped by layer. Reference bots first, then live, then alphabetical within each layer.

Execution · 13 in this class

2.1 Execution LIVE v3.5 · wired
SmartRouter reference
SmartRouter translates an approved strategy intent into a concrete executable order by selecting the appropriate order type (FOK, GTC, or GTD), price, and timing. It may split a large order into iceberg child orders to reduce market impact. SmartRouter cannot change the direction of the trade, the target market, or the strategy intent — it is not permitted to flip the side (buy/sell), alter the outcome leg, or override any constraint set by the Risk guardrail pipeline. The only transformations it may make are to price, size scheduling, order type, and submission timing.
Execution Utility General live
2.5 Execution LIVE
GasOracle
GasOracle continuously monitors the Polygon network gas-price environment and advises the execution layer on whether on-chain operations (order submission, cancel-and-replace, neg-risk conversions) are economically viable at the current gas price. It defers non-urgent operations when gas is above the rolling percentile threshold, and never defers risk-critical operations such as emergency cancellations.
Execution Utility General live
2.4 Execution LIVE
NonceShepherd
NonceShepherd manages the on-chain nonce sequence for the Polytraders signing wallet on Polygon, ensuring that every V2 EIP-712 signed order carries a valid, non-colliding nonce. It detects nonce gaps (caused by dropped or reverted transactions), resequences pending orders when a gap is found, and enforces a ceiling on the number of pending signed-but-unposted orders. NonceShepherd also tracks CLOB ClobAuth credential TTLs and triggers re-authentication before they expire.
Execution Utility General live
2.3 Execution LIVE
QueueWarden
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.
Execution Utility General live
2.2 Execution BETA
AntiToxicFill
AntiToxicFill detects toxic order-flow patterns on the target market immediately before order submission and reshapes or cancels the ExecutionPlan to avoid being adversely selected. It monitors three primary toxicity signals: one-sided sweeps through more than three book levels in the last 5 seconds, a cancel-storm on the opposite side, and realised post-fill drift over a rolling window. If an adverse news event is detected within ±30 seconds of a planned fill, the bot enters a cooldown. Depending on signal severity, AntiToxicFill either widens the limit price by requote_widen_bps, reduces the order size by downsize_factor, or cancels the order outright. It cannot alter the trade direction, market, or outcome leg.
Execution Utility Limited live
2.9 Execution PLANNED
CancelReplaceOptimizer
CancelReplaceOptimizer selects the cheapest path to modify a resting order: amend-in-place if queue priority is preserved, or cancel-then-replace if the delta exceeds the amend threshold. It enforces rate-limit budgets across cancel and amend operations.
Execution Utility Spec started
2.13 Execution PLANNED
DustAndRoundingCleaner
DustAndRoundingCleaner prevents creation of dust positions — holdings so small that their eventual pUSD value at settlement is less than the transaction cost of acquiring or selling them. It rounds order sizes to economically viable minimums and sweeps existing dust positions on a configurable cron schedule.
Execution Utility Spec started
2.11 Execution PLANNED
ExchangeStatusMonitor
ExchangeStatusMonitor treats Polymarket itself as a degradable dependency. It polls CLOB V2 endpoint health, watches for reject-rate spikes, and parses public maintenance signals. When degradation is confirmed, it emits ObservationReports that trigger pause or de-risk actions across the exec layer.
Execution Utility Spec started
2.7 Execution PLANNED
FillQualityAnalyzer
FillQualityAnalyzer scores every completed fill on price slippage, execution latency, and post-fill toxicity relative to the original intent. Low-scoring fills generate WARN annotations; systematic poor scores feed back to strategy tuning.
Execution Utility Spec started
2.10 Execution PLANNED
LatencyProfiler
LatencyProfiler continuously measures round-trip order submission latency by route and surfaces regressions. It probes each configured route at probe_interval_s and emits ObservationReports when p95 or p99 thresholds are breached.
Execution Utility Spec started
2.6 Execution PLANNED
OrderLifecycleManager
OrderLifecycleManager is the single source of truth for every order's state machine, tracking transitions from intent through terminal state. It reconciles local state against the CLOB V2 user-state endpoint, detects stuck-in-flight and orphaned orders, and emits ExecutionReports on every transition.
Execution Utility Spec started
2.8 Execution PLANNED
PartialFillHandler
PartialFillHandler decides what to do with the unfilled remainder after a partial fill: hold and wait, cancel the remainder, or chase the market by submitting a new order. It respects the strategy's declared partial-fill policy and current book state.
Execution Utility Spec started
2.12 Execution PLANNED
PriceBandValidator
PriceBandValidator is a fat-finger and decimal-shift catcher. It rejects or warns on any order priced outside a sanity band relative to the current top-of-book mid, preventing obviously erroneous prices from reaching the CLOB V2 signing step.
Execution Utility Spec started