Sum-to-One Arb
Sum-to-One Arb detects when the combined cost of buying both YES and NO tokens on a standard binary market falls below $1.
What it does
Sum-to-One Arb detects when the combined cost of buying both YES and NO tokens on a standard binary market falls below $1.00 pUSD, net of platform fees and a configurable fee buffer. When edge (in basis points) exceeds min_edge_bps, the bot emits a pair of OrderIntents — one for YES and one for NO — sized to the smaller of the two books up to max_leg_size_usd. Both legs fill to produce a guaranteed $1.00 settlement regardless of outcome. This is a user-controlled execution tool that exploits CLOB pricing dislocations in standard 2-outcome markets. It does not touch negative-risk or multi-outcome events; those are handled by neg-risk-sum-arb.
Pipeline placement
Applies to: All standard binary (2-outcome YES/NO) CLOB markets where best_ask_YES + best_ask_NO < 1.00 pUSD net of fee buffer
Why it matters
| If this fails | Consequence |
|---|---|
| Edge is measured incorrectly (ignores fees) | Platform fee C×feeRate×p×(1-p) peaks at p=0.5. Entering without fee buffer eats the edge entirely and turns a positive-expectation trade into a loss. |
| Slippage consumes one leg between intent generation and fill | If the YES leg fills but the NO leg moves before submission, the combined cost may exceed $1.00 and the guaranteed profit becomes a guaranteed loss. |
| Market closes or resolves between the two legs | Submitting a GTC order for the second leg on a market that has resolved or halted leaves an open order with no offsetting settlement path. |
| feeRateBps hardcoded on signed order (V1 pattern) | CLOB V2 rejects orders with feeRateBps present. Fees are operator-set at match time. The signed order must not contain this field. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Best ask on YES and NO token IDs | ws_market (CLOB WebSocket) | required | Compute sum_of_asks = best_ask_YES + best_ask_NO and measure edge against 1.00 pUSD. |
| Top-of-book depth for both legs | clob_public | required | Size each leg to the minimum of depth available and max_leg_size_usd. |
| Market condition ID, outcome token IDs, negRisk flag | clob_public / internal | required | Confirm market is binary (negRisk=false) and not closed or resolved. |
| Platform fee rate for market category | onchain (CTFExchangeV2 fee config) | required | Estimate fee drag C×feeRate×p×(1-p); crypto ≤1.80%, sports 0.75%, geopolitical free. |
| Market open/closed/resolved status | clob_public | required | Skip closed or resolved markets immediately. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| KillSwitch active flag | KillSwitch | required | Abort intent emission if KillSwitch is active. |
| Builder code bytes32 | internal config | required | Injected into builder field on every signed V2 order for attribution. |
Authority
What this bot is permitted to do
State
Readiness
General live
Status
live
Class
Alpha Strategy
Default mode
general_live
Developer owner
Polytraders core — Strategy pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| SUM_TO_ONE_ARB_EDGE_PRESENT | INFO | Net edge after fee and slippage buffers meets or exceeds min_edge_bps. OrderIntent pair emitted. | Emit YES + NO OrderIntents. |
| SUM_TO_ONE_ARB_NO_EDGE | INFO | Net edge is below the 5 bps absolute hard floor. No trade opportunity exists after fees. | Skip; emit DecisionReport with intent_emitted=false (sampled 1/100). |
| SUM_TO_ONE_ARB_EDGE_MARGINAL | WARN | Edge is between the hard floor (5 bps) and the warning threshold (15 bps). Trade is marginal. | Emit OrderIntents at 50% leg size; log warning. |
| SUM_TO_ONE_ARB_DEPTH_INSUFFICIENT | WARN | Top-of-book depth on one or both legs is below the minimum viable trade size (10 pUSD). | Skip; emit DecisionReport with intent_emitted=false. |
| STALE_MARKET_DATA | HARD_REJECT | Book snapshot or market metadata is older than 5 seconds. | Skip; no OrderIntent emitted. |
| MARKET_CLOSED | HARD_REJECT | Market is closed, resolved, or has neg_risk=true (wrong strategy). | Skip immediately; no OrderIntent emitted. |
| KILL_SWITCH_ACTIVE | HARD_REJECT | Global kill switch is active. | Skip all markets; no OrderIntents emitted. |
| PARAMETER_CHANGE_REQUIRES_APPROVAL | HARD_REJECT | A config change would push a parameter past its locked hard limit (e.g. max_leg_size_usd > 1000). | Reject config change; do not apply. |
Related bots in Strategy
Used by
Reverse index — strategies that currently reference strat.sum-to-one-arb. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| Crypto Q2 — basket rebalance | frozen | last triggered 19m ago |
| US Elect — book-builder | demo-wired | last triggered 26m ago |
| NBA H2H — moneyline market-make | demo-wired | last triggered 33m ago |
Showing 3 of 3 · demo-wired ≠ production-live
Why this matters
Strategy bots does NOT sign, route, or directly submit orders to the chain. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →