NegRisk Arbitrage Lab
When the prices do not add up, does the trade still work?
One event. Three outcomes.
Mirassol FC vs. CR Flamengo
| Outcome | YES ask | Shares |
|---|---|---|
| Mirassol FC | $0.10 | 5.50 |
| Draw | $0.26 | 13.00 |
| CR Flamengo | $0.53 | 988.97 |
Estimated net edge in this fixture
Historical quote illustration · estimated edge is not realized profit
Overview
NegRisk Arbitrage Lab asks whether inconsistent prices across mutually exclusive prediction-market outcomes remain actionable after execution constraints. It discovers Polymarket baskets, maintains their order books, and compares two routes in isolated paper accounts.
Problem
A basket can appear underpriced without offering a practical trade. Fees reduce the edge, the thinnest leg limits size, and a position held for settlement ties up capital. A positive closed-trade result can also hide losses in unresolved inventory.
Approach
Separate discovery, quote calculation, and simulation. Public Gamma metadata defines the outcome set; CLOB REST and WebSocket data supply prices. A candidate must survive a fresh REST repricing before the simulator records a fill.
How it works
The scanner evaluates NO-share combinations. Converting m selected NO legs returns (m − 1) shares of collateral plus YES shares for each unselected outcome. The simulator sells the resulting YES legs, starting with the thinnest bid. An alternative strategy buys every YES outcome and holds for resolution.
- 01Gamma event discovery
- 02CLOB books & updates
- 03Basket pricing
- 04REST revalidation
- 05Paper fills & SQLite
Strategy & methodology
Instant-conversion accounts use 0.5%, 1%, and 2% minimum net-edge thresholds. Buy-All-YES accounts use 0.5% and 2%. Sizing is capped by available cash, the weakest required ask or bid, and minimum-order constraints.
The model applies the configured taker-fee curve and a 0.5% slippage buffer. Incomplete or augmented hold baskets, malformed books, duplicate snapshots, and insufficient liquidity are rejected. Unsold conversion outputs remain open fallback positions.
Implementation
Python modules separate quote arithmetic (negrisk.py), stream updates (market_stream.py), scanning, simulation, and SQLite persistence. FastAPI serves the local API and dashboard; HTTPX and websockets handle public market feeds.
The included public fixture contains a three-outcome basket with a $0.89 raw ask cost. Fees and the slippage buffer reduce its estimated edge to $0.07897 per share, with a 5.5-share depth cap. This is a quote calculation, not realized performance.
Results & output
The retained 54.35-hour experiment contains 3,607 decisions and 31 paper trades. Combined mark-to-market P&L was −$24.54334 across five independent accounts. Seventeen closed trades were positive, but 14 open trades carried −$26.02317 in unrealized P&L.
The experiment_summary.json export preserves the aggregate results. Thin liquidity limited instant-conversion gains, while unresolved Buy-All-YES holdings dominated the combined loss.
16–18 August 2026 · five independent paper accounts · 14 trades unresolved at the end. This short sample does not establish a deployable strategy.
Technical challenges
Execution depends on both entry and exit depth. Fresh repricing and explicit fallback positions prevent the simulator from silently assuming that every quoted exit can fill.
Top-of-book fills still omit queue position, market impact, shared liquidity consumption, and explicit network latency. The retained decision data are not a complete raw-book replay archive.
Takeaways
The project demonstrates cost-aware basket pricing and careful separation of realized and unrealized outcomes. Its strongest finding is that a visible price discrepancy and a profitable executable strategy are different claims.