⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Organization ABCDE/Bot Library/Strategy/Bregman-Projection Arb
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

Bregman-Projection Arb

strat.bregman-projection-arb
Strategy beta Limited live frozen

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

runs after: Market scanner / opportunity feed Bregman-Projection Arb runs before: Risk guardrail pipeline

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 failsConsequence
KL-divergence computed on stale snapshotsThe 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_itersThe 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 thinIn 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 openIf 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

InputSourceRequiredUse
Full order book for all outcome tokens in the neg-risk marketws_market (CLOB WebSocket)requiredBuild observed joint distribution from best-ask prices across all outcome legs.
Market condition ID, outcome token IDs, negRisk flag, NegRiskAdapter addressclob_public / onchainrequiredConfirm market uses NegRiskAdapter and identify all outcome token IDs for the projection.
Top-of-book depth for each outcome legclob_publicrequiredSize each leg to min(depth_available, liquidity_cap_usd / n_legs).
Market open/closed/resolved/dispute statusclob_publicrequiredSkip markets in UMA DVM dispute or resolution; halt new legs immediately.
Historical co-movement matrix (internal feed)internaloptionalOptional prior for initialising the Frank-Wolfe projection; speeds up convergence.

Internal inputs

InputSourceRequiredUse
KillSwitch active flagKillSwitchrequiredAbort all intent emission immediately if KillSwitch is active.
Builder code bytes32internal configrequiredInjected into builder field on every signed V2 OrderIntent for attribution.

Authority

What this bot is permitted to do

Trade

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

CodeSeverityMeaningAction
BREGMAN_ARB_EDGE_DETECTEDINFOKL-divergence from the nearest valid simplex distribution exceeds kl_divergence_threshold. Multi-leg OrderIntents emitted.Emit per-leg FOK OrderIntents.
BREGMAN_ARB_NO_EDGEINFOKL-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_MARGINALWARNKL-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_MARGINALWARNFrank-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_INSUFFICIENTWARNTop-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_DATAHARD_REJECTBook snapshot is older than 3 seconds or market is in UMA DVM dispute.Skip; no OrderIntent emitted.
MARKET_CLOSEDHARD_REJECTMarket is closed, resolved, disputed, or is not a neg-risk market.Skip immediately; no OrderIntent emitted.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active.Skip all markets; no OrderIntents emitted.
PARAMETER_CHANGE_REQUIRES_APPROVALHARD_REJECTA config change would push a parameter past its locked hard limit.Reject config change; do not apply.

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.

StrategyStateActivity
NBA H2H — moneyline market-makedemo-wiredlast triggered 8m ago
US Elections — sentiment fadedemo-wiredlast triggered 15m ago
BTC weekly — close-aware quotesdemo-wiredlast 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 →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…