SelfTradeWashGuard
Prevents Polytraders from trading against itself.
What it does
Prevents Polytraders from trading against itself. If an outgoing OrderIntent would cross with one of our own resting orders on the same market and outcome, SelfTradeWashGuard rejects it (full overlap) or downsizes it (partial overlap). This protects against wash-trade exposure and inadvertent self-fills.
Pipeline placement
Applies to: Per OrderIntent
Why it matters
| If this fails | Consequence |
|---|---|
| Wash-trade liability | Crossing your own orders is treated as wash trading by most regulators and by Polymarket's own terms; even unintentional self-trades are a compliance risk. |
| Inventory churn | Self-fills move money from one account to another (or from one strategy book to another) while paying maker+taker fees both sides — pure deadweight loss. |
| Strategy interference | Two Polytraders strategies disagreeing on direction should not silently fund each other's positions through self-fills. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Outgoing OrderIntent (price/size/side/market_id/outcome) | Strategy bot | required | The order under review. |
| Resting orders snapshot (ours) | OrderLifecycleManager | required | All currently-resting Polytraders orders, indexed by (market_id, outcome_id, side). |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| OrderLifecycleManager state | exec.order_lifecycle_manager | required | Source of truth for our own resting book. |
Authority
What this bot is permitted to do
State
Readiness
Spec ready
Status
planned
Class
Guardrail
Default mode
shadow
Developer owner
Risk pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| RISK_SELF_TRADE | P1 | Risk Self Trade | See decision output and developer log for context. |
| RISK_SELF_TRADE_DOWNSIZED | P1 | Risk Self Trade Downsized | See decision output and developer log for context. |
Related bots in Risk Guardrail
Used by
Reverse index — strategies that currently reference risk.self_trade_wash_guard. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| NBA props — line-shop | demo-wired | last triggered 44m ago |
Showing 1 of 1 · demo-wired ≠ production-live
Why this matters
Risk Guardrail bots does NOT propose intents or sign orders; only permits or blocks. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →