Bregman-Projection Arb
Bregman-Projection Arb detects when the joint probability distribution implied by a neg-risk multi-outcome market's order book diverges from the close
What it does
Bregman-Projection Arb detects when the joint probability distribution implied by a neg-risk multi-outcome market's order book diverges from the closest valid (simplex-constrained) distribution by more than kl_divergence_threshold nats. It uses a Frank-Wolfe iterative projection to find the nearest valid distribution, measures the KL-divergence of the observed book from that projection, and emits a set of up to max_legs_per_trade OrderIntents to exploit the divergence. This is a user-controlled execution tool for multi-outcome neg-risk markets. It never trades standard 2-outcome binary markets (those are handled by Sum-to-One Arb). No performance claims are made; the tool automates the mechanical detection and sizing of Bregman-projection violations.
Pipeline placement
Applies to: Negative-risk multi-outcome CLOB markets where the joint order-book distribution deviates from the nearest Bregman-proje
Why it matters
| If this fails | Consequence |
|---|---|
| KL-divergence computed on stale snapshots | The divergence measurement reflects an order book that no longer exists. Emitting OrderIntents based on stale data incurs slippage on all legs and may produce a net loss. |
| Frank-Wolfe projection does not converge within frank_wolfe_iters | The nearest valid distribution is not found; the measured divergence is an upper bound, not the true value. The bot may under-size or skip genuinely profitable trades. |
| Leg count exceeds max_legs_per_trade while liquidity is thin | In a 10-outcome market, all legs may be needed to fully capture the divergence. Capping legs leaves residual exposure that does not hedge cleanly. |
| NegRisk market settled via DVM while legs are open | If a disputed NegRisk outcome enters a 24-48h UMA DVM vote, open positions cannot be settled immediately. The bot must detect the dispute flag and halt new legs on affected markets. |
| feeRateBps present on signed order (V1 pattern) | CTFExchangeV2 rejects orders with feeRateBps. Fees are operator-set at match time. No leg intent may contain this field. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Full order book for all outcome tokens in the neg-risk market | ws_market (CLOB WebSocket) | required | Build observed joint distribution from best-ask prices across all outcome legs. |
| Market condition ID, outcome token IDs, negRisk flag, NegRiskAdapter address | clob_public / onchain | required | Confirm market uses NegRiskAdapter and identify all outcome token IDs for the projection. |
| Top-of-book depth for each outcome leg | clob_public | required | Size each leg to min(depth_available, liquidity_cap_usd / n_legs). |
| Market open/closed/resolved/dispute status | clob_public | required | Skip markets in UMA DVM dispute or resolution; halt new legs immediately. |
| Historical co-movement matrix (internal feed) | internal | optional | Optional prior for initialising the Frank-Wolfe projection; speeds up convergence. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| KillSwitch active flag | KillSwitch | required | Abort all intent emission immediately if KillSwitch is active. |
| Builder code bytes32 | internal config | required | Injected into builder field on every signed V2 OrderIntent for attribution. |
Authority
What this bot is permitted to do
State
Readiness
Limited live
Status
beta
Class
Alpha Strategy
Default mode
limited_live
Developer owner
Polytraders core — Strategy pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| BREGMAN_ARB_EDGE_DETECTED | INFO | KL-divergence from the nearest valid simplex distribution exceeds kl_divergence_threshold. Multi-leg OrderIntents emitted. | Emit per-leg FOK OrderIntents. |
| BREGMAN_ARB_NO_EDGE | INFO | KL-divergence is below the 0.003 nats absolute hard floor. No trade opportunity exists after fees. | Skip; emit DecisionReport intent_emitted=false (sampled 1/100). |
| BREGMAN_ARB_DIVERGENCE_MARGINAL | WARN | KL-divergence is between the hard floor (0.003) and the warning threshold (0.015). Trade is marginal. | Emit OrderIntents at 50% leg size; log warning. |
| BREGMAN_ARB_PROJECTION_MARGINAL | WARN | Frank-Wolfe iteration count is below the warning threshold; projection may not have fully converged. | Emit with caution; log warning for ops review. |
| BREGMAN_ARB_DEPTH_INSUFFICIENT | WARN | Top-of-book depth on one or more selected legs is below minimum viable trade size (5 pUSD). | Skip affected leg; reduce n_legs; emit DecisionReport. |
| STALE_MARKET_DATA | HARD_REJECT | Book snapshot is older than 3 seconds or market is in UMA DVM dispute. | Skip; no OrderIntent emitted. |
| MARKET_CLOSED | HARD_REJECT | Market is closed, resolved, disputed, or is not a neg-risk market. | 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. | Reject config change; do not apply. |
Related bots in Strategy
Used by
Reverse index — strategies that currently reference strat.bregman-projection-arb. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| NBA H2H — moneyline market-make | demo-wired | last triggered 8m ago |
| US Elections — sentiment fade | demo-wired | last triggered 15m ago |
| BTC weekly — close-aware quotes | demo-wired | last triggered 22m 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 →