⚠ 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

AntiToxicFill

exec.antitoxicfill
Execution beta Limited live frozen

AntiToxicFill detects toxic order-flow patterns on the target market immediately before order submission and reshapes or cancels the ExecutionPlan to

What it does

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.

Pipeline placement

runs after: SmartRouter (ExecutionPlan assembled) and ObservationReport ingestion AntiToxicFill runs before: Order signing and CLOB V2 submission

Applies to: Every pending ExecutionPlan where toxic-flow signals or adverse RiskVotes are present on the target market

Why it matters

If this failsConsequence
Toxic sweep not detected before submissionThe system fills against an informed counterparty that has just swept the book on privileged news, resulting in immediate adverse mark-to-market on the filled position.
Cancel-storm ignored on opposite sideMass cancellations on the opposite side of the book signal that the market is repricing. Submitting a resting order into this environment leads to a fill at a price that is immediately stale.
Post-fill drift not tracked across rolling windowSystematic adverse drift after fills indicates chronic toxic flow on the market. Without reshaping, the strategy will continue to be adversely selected until cumulative losses exceed risk limits.
News-window cooldown not appliedNews events arriving within ±30 seconds of a fill represent the highest toxicity risk. Filling in this window without a cooldown leads to significant slippage on information-driven price moves.

Inputs

Polymarket inputs

InputSourceRequiredUse
CLOB V2 order book — top 10 levels both sidesclob_publicrequiredDetect one-sided sweeps (>3 levels consumed in 5s) and cancel-storms on the opposite side.
Recent trade tape (last 100 fills on market)ws_marketrequiredCompute realised post-fill drift over the rolling drift_window_s.
Market metadata (tick size, neg-risk flag)clob_publicrequiredTick-align the widened requote price after applying requote_widen_bps.

Internal inputs

InputSourceRequiredUse
ObservationReport — toxic-flow signalsinternal bus (polytraders.reports.execution)requiredReceive structured toxic-flow observations: sweep_detected, cancel_storm_detected, drift_bps, news_event_at_ms.
RiskVote — adverse risk signal from guardrail pipelinerisk guardrail pipelinerequiredIf any RiskVote carries RESHAPE with a toxicity reason, apply downsize_factor to the order size.
KillSwitch active flagKillSwitchrequiredAbort order and emit no ExecutionReport if KillSwitch is active.
NewsIngest adverse-event feedinternal NewsIngest serviceoptionalDetect news events within ±news_window_s of the planned fill; enter cooldown_s pause if hit.

Authority

What this bot is permitted to do

Reshape

State

Readiness

Limited live

Status

beta

Class

Execution Utility

Default mode

limited_live

Developer owner

Polytraders core — Execution pod

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
ANTITOXICFILL_PASSINFONo toxic-flow signals detected; ExecutionPlan passes through unchanged.Forward ExecutionPlan to signing without modification.
ANTITOXICFILL_RESHAPERESHAPEOne or more toxic-flow signals (sweep, cancel-storm, or drift) or an adverse RiskVote detected. Price widened by requote_widen_bps and size reduced by downsize_factor.Apply widen and downsize to ExecutionPlan; forward reshaped plan to signing.
ANTITOXICFILL_NEWS_COOLDOWNHARD_REJECTAn adverse news event was detected within ±news_window_s of the planned fill. Order cancelled; market enters cooldown.Cancel ExecutionPlan; apply cooldown_s to market_id in Redis; emit no order.
ANTITOXICFILL_SWEEP_CANCEL_STORMHARD_REJECTSimultaneous one-sided sweep (>3 levels) and cancel-storm on the opposite side detected. Highest toxicity combination; order cancelled and market enters cooldown.Cancel ExecutionPlan; apply cooldown_s to market_id; emit no order.
ANTITOXICFILL_COOLDOWN_ACTIVEEXPLAINThis market is currently in a toxicity cooldown from a prior event. New ExecutionPlans are held until the cooldown expires.Hold ExecutionPlan; re-evaluate after cooldown TTL expires.
ANTITOXICFILL_SIZE_FLOOR_APPLIEDWARNdownsize_factor computation would have produced a size below the hard floor (10% of original). Size clamped to 10% of original.Set reshaped_size_usd = original_size_usd * 0.1; log warning.
ANTITOXICFILL_FEED_UNAVAILABLEWARNws_market or clob_public feed unavailable; conservative fallback defaults applied (widen 40 bps, downsize 0.5).Apply fallback reshape parameters; do not block order entirely.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active; no orders may proceed.Discard ExecutionPlan; emit no order.
MARKET_CLOSEDHARD_REJECTTarget market is closed or resolved; ExecutionPlan is invalid.Discard ExecutionPlan; log and emit no order.

Used by

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

StrategyStateActivity
BTC weekly — close-aware quotesdemo-wiredlast triggered 40m ago
Fed Rates — surprise driftfrozenlast triggered 47m ago

Showing 2 of 2 · 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…