Polymarket Arbitrage Bot — Two-Leg Execution and the Infrastructure That Makes It Work
Arbitrage bots fire two legs at the speed of light to lock in cross-market or cross-venue spreads. The hard part is not the arithmetic — it is the infrastructure: cross-venue scanning, synchronized execution, reverse-on-partial logic, and reconciliation across different settlement timelines.
What is a Polymarket arbitrage bot?
A Polymarket arbitrage bot watches for two kinds of pricing mistakes. The first is intra-market arb: when YES and NO on the same Polymarket contract sum to less than $1 (after fees and slippage). The second is cross-venue arb: when Polymarket's YES on an event trades at a different price than Kalshi's YES, or Limitless's YES, on a resolution-identical contract.
When the bot finds a profitable spread, it fires both legs simultaneously — usually as fill-or-kill (FOK) orders — and locks in the spread regardless of which way the underlying event resolves. The "bot" part is doing this thousands of times a day faster than a human can react.
The work that makes this real is not the arithmetic. The arithmetic is trivial: profit = $1 - leg_1_cost - leg_2_cost - fees - slippage. The work is the infrastructure that detects the spread in real time, fires both legs in under a second, handles the case where one leg fills and the other does not, and reconciles results across two different venue settlement timelines.
Why building a Polymarket arb bot yourself is hard
Directional bots are forgiving: place an order, wait, take the fill. Arb bots are unforgiving. If you mis-execute, you do not just miss a trade — you take unintended directional exposure on a position you sized for guaranteed return.
- Cross-venue market-data ingestion — you connect to Polymarket, Kalshi, and/or Limitless websockets, normalize their orderbook formats, and maintain a synchronized fair-value view across all of them.
- Stale-market detection — a Polymarket market that resolved 20 seconds ago might still show stale quotes; an arb against a stale quote is not an arb, it is a free loss to whoever fills you.
- Order-book depth checks — both venues need cumulative depth at your target price greater than your order size, or you self-impact the price and turn the arb into a loss.
- Two-leg synchronized firing — both legs fire in the same async task; if one returns a 5xx and the other returns 200, you have a partial fill problem.
- Reverse-on-partial logic — when leg-1 fills and leg-2 does not within a 2-3 second timeout, the bot fires a reverse market order on leg-1 to flatten exposure. Get this wrong and you pile up directional positions.
- EIP-712 order signing — on Polymarket; Kalshi has its own API auth; Limitless has its own. Each venue's signing/auth layer is different and has to be re-derived per execution.
- Fee-aware edge calculation — Polymarket's 2% withdrawal fee, Kalshi's per-contract trading fee, and Limitless's spread fee all reduce net edge. The scanner has to filter pre-fee opportunities that look profitable but are not.
- VPS hosting + scheduling — arb opportunities last 15-45 seconds on liquid markets. A scanner that runs once a minute misses 90% of them; a 24/7 websocket-driven scanner catches them.
- Monitoring + reconciliation — you reconcile fills against the orderbook, settle the directional exposure, and book the realized PnL — across two settlement timelines that may resolve hours apart.
- Retry systems — transient 5xx on one venue should trigger a leg-1 cancel and reset, not retry the same partial fill.
Building yourself vs PredictEngine
The build-vs-buy split for arbitrage:
| Layer | Building yourself | PredictEngine |
|---|---|---|
| Cross-venue scanner | You wire 2-3 websockets + normalize | Built-in across Polymarket, Kalshi, Limitless |
| Order signing per venue | Polymarket EIP-712 + Kalshi auth + Limitless auth | Handled per venue |
| Two-leg synchronized firing | You write the async coordination | Built-in arb executor |
| Reverse-on-partial | You write the state machine | Built-in unwind logic |
| Fee-aware edge filter | You maintain per-venue fee schedules | Configured per venue |
| Depth + slippage check | You write the pre-fire guard | Built-in depth utilization cap |
| VPS hosting | You run a server 24/7 | Hosted near venue APIs |
| Reconciliation across venues | You write the post-trade ledger | Per-arb settlement tracking |
How PredictEngine handles arbitrage execution
PredictEngine's arbitrage bot watches Polymarket, Kalshi, and Limitless simultaneously via websocket-driven scanners. When net edge after fees and slippage clears the configured threshold, the executor fires both legs in a single async task with FOK semantics. If leg-1 fills and leg-2 does not within a configurable timeout (default 2.5 seconds), the bot fires a reverse market order on leg-1 to flatten — surfacing the recovered position to the user with a small loss recorded rather than an unintended directional bet.
For intra-Polymarket arb (YES + NO < $1), the same logic applies inside one venue — both legs against the Polymarket CLOB, both signed under the same EIP-712 domain, both reconciled against the same orderbook.
For the user, the configuration is three numbers: minimum-edge threshold (default 1.5% net of fees), maximum position size per trade, and the venues to scan. The signing, scanning, depth-checking, two-leg firing, and reverse-on-partial are all platform internals.
Where arb opportunities actually come from
The sources of cross-venue mispricing that produce most arb opportunities:
- News-driven repricing lag — Polymarket's crypto-native user base reacts to news first; Kalshi's US-retail base reacts second. The gap opens an arb window.
- Liquidity asymmetry — large orders that move Kalshi's thinner book by 5% may not move Polymarket's deeper book at all, opening a spread.
- Settlement-timing mismatches — Polymarket resolves on oracle confirmation; Kalshi resolves on scheduled events. Pre-resolution divergences are arb opportunities.
- Cross-chain frictions — Limitless on Base vs Polymarket on Polygon. Bridging is not instant; information shocks open longer-lasting arb windows on the slower side.
- User-base priors — Polymarket users price election markets with a different prior than Kalshi users. Same event, two fair-value estimates.
When to build a custom arb bot vs use PredictEngine
Build your own arb bot when you need sub-100ms cross-venue execution, when you have proprietary signal infrastructure that informs your fair-value estimate before public data hits, or when you are running enough capital that the operational cost is negligible.
Use PredictEngine for everything else — validating the strategy, running arb at modest capital levels, scanning venues without operating multiple websocket clients. Net edge per arb (typically 1-5%) is small enough that operational overhead matters; not running a server fleet is real money.
Run an arb bot without the websocket fleet.
PredictEngine scans Polymarket, Kalshi, and Limitless simultaneously and fires synchronized two-leg orders with reverse-on-partial protection. Set an edge threshold and a position size; the platform handles the rest.