Prediction Market Arbitrage Scanner (Kalshi & Polymarket) avatar

Prediction Market Arbitrage Scanner (Kalshi & Polymarket)

Pricing

from $0.50 / 1,000 market_pairs

Go to Apify Store
Prediction Market Arbitrage Scanner (Kalshi & Polymarket)

Prediction Market Arbitrage Scanner (Kalshi & Polymarket)

Cross-venue fee-adjusted, depth-verified arbitrage scanner for Kalshi and Polymarket prediction markets.

Pricing

from $0.50 / 1,000 market_pairs

Rating

0.0

(0)

Developer

Jiro

Jiro

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Features

Limited permissions

Share

A high-precision, fee-adjusted, and order-book-verified cross-venue arbitrage scanner for Kalshi and Polymarket.


Why Most Prediction Market "Arbitrage Finders" Fail

If you look at raw top-of-book prices across prediction markets, you will find dozens of apparent "arbitrage" opportunities. In reality, 99% of them are mirages that will lose you money:

  1. Taker Fees Devour the Spread: Both legs of an arbitrage trade cross the spread and pay taker fees.
    • On Kalshi, taker fees follow a quadratic formula: $\text{Fee} = 0.07 \times \text{Contracts} \times P \times (1 - P)$. At $P = $0.50$, you pay ~1.75¢ per contract plus balance rounding fees.
    • On Polymarket, dynamic fee schedules apply to taker orders (up to 7% on crypto, 4–5% on politics/sports/finance).
    • Result: A apparent 2.0¢ price gap is an instant loss after fees.
  2. Top-of-Book Illusion (Lack of Depth): A quote might show 10¢ on Polymarket and 15¢ on Kalshi, but only 3 contracts may exist at 10¢. If you attempt to trade 100 contracts, your average fill price (VWAP) slides deeper into the book.
  3. Semantic False Matches (Dangerous Unhedged Bets):
    • Template Collisions: Two markets might share 95% of their question words ("Will [Candidate] win the next presidential election?") while referring to completely different people in different countries.
    • Entity Collisions: Two markets mention the same person ("Will Jensen Huang become a trillionaire?" vs "Will Jensen Huang rejoin Nvidia?"), but ask totally unrelated questions.
    • Resolution Date Divergence: A market resolving in 2026 cannot be hedged against a market resolving in 2028.

This Actor solves all three problems by simulating real fills across live order books, netting both venues' exact fee schedules, and filtering with a multi-stage semantic matching engine.


Features

  • Exact Fee Accounting: Subtracts Kalshi and Polymarket taker fee schedules, including rounding quirks and per-category rates.
  • Live Order Book Depth Walking: Computes volume-weighted average fill prices (VWAP) for your chosen contract size (notionalSize).
  • Precision Matching Pipeline:
    • Entity Agreement Gate: Prevents template collisions across candidates, parties, and jurisdictions.
    • Leg Agreement Gate: Resolves Kalshi multi-outcome event markets (using custom_strike) and prevents candidate bleeding.
    • Subject Signature Gate: Strips entities to verify that underlying propositions actually overlap.
    • Threshold & Date Gates: Rejects conflicting strike values, directional conditions (above vs below), and diverging resolution windows.
  • Pay-Per-Event Billing: Seamless Apify Pay-Per-Event (PPE) integration (market_pair for matched pairs scanned, and arbitrage_opportunity for positive net-edge opportunities).
  • DNS Resilience: Built-in support for custom DNS servers (1.1.1.1, 8.8.8.8) to bypass network-level DNS sinkholes on Polymarket CloudFront domains.

How It Works

1. Fetch Open Markets (Kalshi Trade API + Polymarket Gamma API)
↓
2. Semantic Normalization & Slot Extraction (Thresholds, Dates, Entities, Legs)
↓
3. Inverted Index Candidate Generation & Hard Precision Gates
↓
4. Fetch Live Order Books (Kalshi Book + Polymarket CLOB)
↓
5. Walk Depth to Size → Calculate VWAP → Subtract Fees on Both Legs
↓
6. Output Verified Arbitrage Opportunities & Detailed Spread Analytics

Input Settings

ParameterTypeDefaultDescription
minNetEdgePctnumber0.002Minimum net edge (after fees) to flag as arbitrage (e.g. 0.002 = 0.2%).
notionalSizeinteger100Target trade size in contracts per leg used when walking depth.
useOrderbooksbooleantrueWhen enabled, pulls real order books to verify liquidity and calculate VWAP.
minMatchScoreinteger42Match confidence threshold (20–95%). Raise for strict precision, lower for recall.
maxKalshiEventsinteger2000Max Kalshi events to scan.
maxPolymarketMarketsinteger4000Max Polymarket markets to scan (ordered by 24h volume).
kalshiCategoriesarray[]Optional category filter (e.g., ["Elections", "Politics", "Financials"]).
includePairsbooleantrueInclude all matched pairs in output, even if spread does not cover fees.
feeModelstring"conservative"Polymarket fee formula (conservative, docs, exponent).
dnsServersstring"1.1.1.1,8.8.8.8"Custom DNS resolvers to avoid Polymarket CloudFront connectivity issues.

Output Dataset Schema

Each result pushed to the default dataset contains full trade execution mechanics:

{
"type": "arbitrage",
"score": 0.568,
"matchReasons": [
"entity match: naftali bennett <-> naftali bennett",
"leg match: naftali bennett",
"subject overlap: next"
],
"matchWarnings": [],
"cheapVenue": "polymarket",
"richVenue": "kalshi",
"cheapLeg": "buy YES",
"richLeg": "buy NO (hedge)",
"cheapPrice": 0.058,
"richPrice": 0.922,
"costPerUnit": 0.980,
"grossEdgePerContract": 0.020,
"netEdgePerContract": 0.0072,
"netEdgePct": 0.0073,
"sizeUsed": 100,
"depthLimited": false,
"fees": {
"kalshiFee": 0.49,
"polymarketFee": 0.23,
"totalFee": 0.72
},
"kalshi": {
"ticker": "KXBIC-26",
"question": "Will Naftali Bennett be the next Prime Minister of Israel",
"yesBid": 0.07,
"yesAsk": 0.078
},
"polymarket": {
"id": "12345",
"question": "Will Naftali Bennett be the next Prime Minister of Israel?",
"yesBid": 0.048,
"yesAsk": 0.058
},
"scannedAt": "2026-11-19T09:15:00.000Z"
}

A final record of type: "summary" reports aggregate run statistics (total markets scanned, matched pairs, order books queried, and count of viable opportunities).


Automated Scheduling & Webhooks

To run this scanner as an automated recurring alert pipeline:

  1. In Apify Console, configure a Schedule (e.g. */10 * * * * for every 10 minutes).
  2. Attach an Apify Webhook triggered on Run succeeded.
  3. Route the webhook payload to your notification handler (Discord, Telegram, Slack, or automated execution bot).

Development & Testing

# Run unit test suite (30 offline tests)
npm test
# Run live smoke probe against active Kalshi & Polymarket markets
node test/live-probe.js 100 0.42