Prediction Market Arbitrage: Backtest Polymarket vs Kalshi
A price difference is only an arbitrage candidate. It becomes a testable trade after the contracts, decision time, displayed size, two-leg execution, fees and settlement paths are aligned.
Prediction-market arbitrage seeks a bounded payout by combining positions whose total executable cost is below their matched settlement value. Between Polymarket and Kalshi, the difficult part is not subtracting two prices: it is proving that the contracts resolve identically, synchronizing both order books, walking available depth, modeling leg risk and including every fee and funding constraint.
Test both legs
Replace the price gap with an executable replay
Match the contract rules, freeze both books at the decision time, and walk the displayed ladders. Then stress the second leg before deciding whether the apparent spread survives.
- 2
- venue books per decision
- L2
- size-aware fills
- ASOF
- time-safe matching
Apparent spread versus executable arbitrage
| Test | What must be true | Why a screen can be wrong |
|---|---|---|
| Contract equivalence | The same event, cutoff, source and resolution rule | Similar titles can settle differently |
| Complementary payoff | The chosen legs cover the intended outcome set | Yes/no labels are not enough across different contracts |
| Same decision time | Both books were observable before either simulated order | A later quote creates look-ahead bias |
| Executable size | Displayed depth supports the stake on both legs | Best prices may contain only trivial size |
| Net economics | Combined payout exceeds fills, fees and operational costs | Headline price gaps ignore friction |
| Completion path | The model prices partial fills and legging delay | One filled leg can leave directional exposure |
Match resolution rules before matching prices
Create a contract-mapping record before calculating a spread. Preserve each venue's event, market and outcome identifiers; exact market wording; close and determination times; resolution source; cancellation treatment; and payout unit. A shared subject such as an election, rate decision or crypto threshold does not by itself make two contracts interchangeable.
Classify every pair as exact, conditional or rejected. Exact means the payoff states and resolution path are demonstrably equivalent. Conditional means a documented edge case could break equivalence and must be modeled. Rejected pairs stay out of the backtest. Human review of this mapping is part of the research process, not an optional cleanup step.
Normalize the books without erasing venue evidence
Normalize both venues into explicit outcome, side, price and size arrays while retaining the native identifiers and raw fields. Convert prices to one payout basis only after recording the venue representation. For Kalshi, inspect the native yes/no order-book response and its reciprocal relationship; for Polymarket, map the correct outcome token to its CLOB book.
Use the ask ladder for a simulated purchase and the bid ladder for a simulated sale. Do not treat a midpoint, last trade or complementary display price as an executable quote. A cross-venue comparison should report the exact observed book timestamp and staleness for each leg.
Use one as-of decision clock
Choose a decision timestamp, then select only the latest eligible book at or before that time for each venue. Apply a maximum-age threshold separately to both observations. If either book is missing or stale, the opportunity is unavailable; forward-filling through the gap would manufacture evidence.
The conservative replay should freeze both input books at the decision time, submit the first simulated leg, apply an explicit latency or legging-delay assumption, and then reprice the second leg using the next eligible observation. A simultaneous-book scenario can be a useful upper bound, but it should not be labeled as the only execution result.
Walk both ladders at the intended size
For each leg, consume displayed levels until the target size is filled or depth is exhausted. Record the depth-weighted average price, fillable quantity and worst consumed level. The viable trade size is capped by the weaker leg, not by the venue showing the larger headline gap.
Run several stake sizes. An apparent edge may survive at ten contracts and disappear at one thousand. Report both gross edge per unit and total net edge so a tiny top-of-book quote does not dominate the opportunity ranking.
Model fees, capital and settlement timing
Keep venue fees, deposit or withdrawal costs, network costs when relevant, currency conversion and funding time as separate inputs. Use current official venue schedules for a live decision; a historical study should use the schedule that applied during its test window when that record is available.
Capital can remain locked until both markets determine and settle. Report return on committed capital and exposure duration, not only the payout minus purchase prices. A positive nominal edge can still be unattractive after friction, settlement delay or the cost of pre-positioning funds on both venues.
Treat leg risk as a first-class result
Cross-venue orders are not atomic. The first leg can fill while the second moves, rejects, partially fills or becomes stale. Test at least an immediate-completion case, a delayed second-leg case and an abandon-or-hedge rule. Record unhedged exposure and worst observed completion cost rather than hiding failed pairs.
A realistic implementation also defines venue availability checks, maximum quote age, minimum remaining edge, per-market size limits and a kill condition. These controls should be fixed before the holdout period so the backtest does not optimize itself around known outcomes.
A reproducible backtest protocol
- Create and version a manually reviewed contract-equivalence table.
- Define the eligible market universe, date range and decision cadence before inspecting returns.
- Use only order books observed at or before each decision timestamp.
- Reject stale or missing legs instead of forward-filling them into trades.
- Walk both ladders, cap size by the weaker leg and retain partial-fill evidence.
- Apply venue-specific fees, funding constraints and settlement duration.
- Stress the second leg with delay, price movement, rejection and partial fills.
- Separate development and holdout periods, then forward-test the frozen rules with virtual capital.
- Publish the opportunity, exclusion and simulated-fill ledgers beside aggregate performance.
Minimal opportunity calculation
The arithmetic below is only the final step after contract matching and as-of book selection. Each cost must be the depth-weighted executable cost for the same quantity. The buffer represents all explicit fees plus the researcher's required margin for delay and model uncertainty.
const matchedPayout = 1.00;
const grossEdge = matchedPayout - (polymarketVwap + kalshiVwap);
const netEdge = grossEdge - polymarketFees - kalshiFees - fundingCosts;
const tradable = contractsEquivalent && bothBooksFresh &&
filledQuantity >= targetQuantity && netEdge > riskBuffer;Failure modes that invalidate the result
| Failure mode | False conclusion | Required control |
|---|---|---|
| Title-only matching | The contracts have identical payouts | Compare complete rules and resolution sources |
| Mixed timestamps | Both quotes were available together | Strict as-of selection and freshness limits |
| Top-of-book arithmetic | The full target size earns the displayed edge | Depth-walk both legs |
| Atomic-fill assumption | Both orders complete at once | Delay, rejection and partial-fill scenarios |
| Current fee schedule applied backward | Historical net returns are exact | Versioned fees or a disclosed conservative proxy |
| Survivor-only reporting | Every identified opportunity was tradable | Publish exclusions and failed completion attempts |
Key takeaways
- 01A cross-venue price gap is a candidate, not proof of arbitrage.
- 02Contract equivalence and settlement rules must be reviewed before price comparison.
- 03Both legs need strict as-of books, freshness limits and depth-aware fills.
- 04Fees, funding time, partial fills and legging delay belong in net results.
- 05The opportunity and exclusion ledgers are as important as aggregate returns.
Test a matched pair against the recorded ladders before treating a displayed spread as tradable. Free Explorer tier, no card.
Open Backtest LabView pricing