Automated detection of profitable arbitrage opportunities in prediction markets
Based on IMDEA Networks research documenting $39.59M in arbitrage extraction from Polymarket (April 2024 - April 2025).
This bot detects and alerts you to arbitrage opportunities in real-time using 100% FREE APIs (no authentication required):
-
Single-Condition Arbitrage (YES + NO β $1.00)
- Historical extraction: $10.58M across 7,051 conditions
- Detects when binary market prices don't sum to $1.00
- Example: YES = $0.55, NO = $0.40 β Buy both, guaranteed $0.05 profit
-
NegRisk Rebalancing (Ξ£ prices β 1.00)
- Historical extraction: $28.99M across 662 markets
- 29Γ capital efficiency advantage over single-condition
- Multi-outcome markets (3+ options) where probabilities don't sum to 100%
- Example: Candidate A=45%, B=46%, C=6% = 97% β 3% arbitrage
-
Whale Tracking
- Follows large traders (>$5K positions)
- Research shows whale signals predict price movement with 61-68% accuracy
- Top performer made $2.01M with 11 trades/day
# 1. Install Python dependencies
pip install -r requirements.txt
# 2. Run the bot
python prediction_market_arbitrage.pyThat's it! The bot will start scanning for opportunities immediately.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PREDICTION MARKET ARBITRAGE BOT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Starting Scan #1
[1/50] Analyzing: Will Trump win the 2024 election?
[2/50] Analyzing: Will Bitcoin reach $100K in 2024?
================================================================================
π΄ ARBITRAGE OPPORTUNITY DETECTED - NEGRISK
================================================================================
Market: Democratic VP Nominee 2024?
Expected Profit: $127.50
ROI: 4.73%
Capital Required: $2,695.00
Risk Score: 0.15/1.00
Urgency: HIGH
Details:
num_conditions: 5
prob_sum: 0.9527
deviation: 0.0473
capital_efficiency: 29Γ
action: buy_all
Timestamp: 2025-01-11 14:23:45
================================================================================
π SCAN SUMMARY
================================================================================
Total Opportunities: 3
Total Expected Profit: $347.80
Total Capital Required: $5,240.00
Average ROI: 6.64%
By Strategy:
negrisk: 2 opportunities, $255.30 profit
single_condition: 1 opportunities, $92.50 profit
================================================================================
Edit these variables in prediction_market_arbitrage.py:
# Main configuration (bottom of file)
SCAN_INTERVAL = 60 # Seconds between scans (60 = 1 minute)
TOP_MARKETS = 50 # Number of markets to monitor (max 100)
# Detection thresholds
MIN_PROFIT_THRESHOLD = 0.02 # Minimum 2Β’ profit (covers gas costs)
WHALE_THRESHOLD = 5000 # Minimum $5,000 for whale tradesHow it works:
- Binary markets should have YES + NO = $1.00
- When they deviate, guaranteed profit exists
- Buy both sides if sum < $1.00, sell both if sum > $1.00
Example:
Market: "Will it rain tomorrow?"
YES price: $0.53
NO price: $0.42
Sum: $0.95
Action: Buy YES + NO for $0.95 total
Payout: $1.00 (exactly one will win)
Profit: $0.05 per dollar (5.3% ROI)
Research stats:
- 7,051 exploitable conditions found
- $10.58M total extracted
- Average profit: $1,500 per opportunity
Why 29Γ more efficient:
- Multi-condition markets fragment liquidity
- Retail focuses on favorites, ignores tail outcomes
- Institutional market makers avoid due to complexity
Example:
Market: "Which party wins Senate majority?"
Democrat: 47%
Republican: 46%
Tie: 3%
Other: 2%
Sum: 98%
Action: Buy all 4 outcomes for $0.98 total
Payout: $1.00 (exactly one will win)
Profit: $0.02 per dollar (2% ROI)
But with higher liquidity: $10K position = $200 profit
Research stats:
- Only 662 markets (vs 7,051 single-condition)
- $28.99M extracted (2.7Γ more than single-condition)
- 29Γ capital efficiency per opportunity
Key insight from research:
- Top 10 traders captured 21% of all profits ($8.18M)
- Whale entries precede retail by 35-60 minutes
- Order flow predicts price movement
Detection criteria:
- Trades >$5,000
- Calculate directional imbalance
- Strong signal if buy/sell ratio >60/40
Example output:
Whale Activity Detected:
- 8 whale trades in last hour
- Total volume: $47,300
- Flow imbalance: +73% (strong BUY pressure)
- Action: Consider following BUY side
From the IMDEA study:
- Total profit: $2,009,631.76
- Transactions: 4,049 (over 12 months)
- Average per trade: $496
- Frequency: 11+ trades per day
- Strategy: Systematic NegRisk + single-condition
Key takeaway: Frequency over position size. Small, consistent profits compound.
| Strategy | Opportunities | Total Extracted | Avg Profit |
|---|---|---|---|
| Single-Condition | 7,051 | $10.58M | $1,500 |
| NegRisk | 662 | $28.99M | $43,800 |
| Whale Following | N/A | Included in above | Variable |
| Combinatorial | 13 pairs | $95K | $7,300 |
The bot calculates a risk score (0-1) for each opportunity based on:
-
Time to resolution
- <2 days: +0.4 risk (oracle manipulation danger)
- <7 days: +0.2 risk
-
Market complexity
- More conditions = higher execution risk
- NegRisk with 5+ outcomes: +0.2 risk
-
Oracle subjectivity
- Subjective markets ("Who won the debate?"): +0.3 risk
- Objective markets ("Official vote count"): No penalty
What happened:
- Market: "Ukraine agrees to Trump mineral deal before April?"
- $7M in trading volume
- Whale deployed ~5M UMA tokens (25% voting power)
- Market resolved YES despite no official agreement
- Polymarket declined refunds
Lesson: Exit positions 24-48 hours before resolution on subjective markets.
- 29Γ more capital efficient
- Less competition (complexity barrier)
- Target markets with 4+ outcomes
- Markets resolving in <24 hours (oracle risk)
- Subjective resolution criteria
- Low liquidity (<$1K available)
- Cross-platform hedges (oracle divergence risk)
- Event-driven opportunities: T-60 to T-30 minutes before scheduled events
- Whale signals most predictive at T+15 to T+60 minutes
- Exit before major news/resolution clustering
40% - NegRisk rebalancing (highest efficiency)
30% - Single-condition (high frequency)
20% - Event-driven (scheduled catalysts)
10% - Whale following (signal-augmented)
Critical insight: ICE's $2B investment in Polymarket (Oct 2025) signals institutional entry.
Projected compression (based on crypto arbitrage history):
| Timeline | Spread Levels | Opportunity |
|---|---|---|
| Months 0-6 (NOW) | 10-15Β’ | Maximum extraction window |
| Months 6-12 | 3-5Β’ flagship, 5-8Β’ mid-tier | 50-70% degradation |
| Months 12-18 | 0.5-2Β’ | Retail extinct on major markets |
Action: Deploy capital aggressively in Q1-Q2 2025, or accept opportunity closure.
The bot automatically creates:
arbitrage_bot.log- Detailed scan history- Console output - Real-time opportunities
2025-01-11 14:23:45 - INFO - Starting Scan #1
2025-01-11 14:24:12 - INFO - OPPORTUNITY: negrisk - $127.50 profit, 4.7% ROI
2025-01-11 14:25:03 - INFO - Scan #1 complete. Found 3 opportunities.
- Check internet connection
- Polymarket API might be down (rare)
- Try reducing
TOP_MARKETSto 20-30
- Increase timeout in code:
timeout=10βtimeout=30 - Your network might have high latency
- Increase
MIN_PROFIT_THRESHOLDfrom 0.02 to 0.03 - Adjust urgency thresholds
- β Execute trades automatically
- β Handle your private keys
- β Guarantee profits
- β Provide financial advice
- β Verify opportunities manually before trading
- β Understand prediction market mechanics
- β Accept risk of capital loss
- β Comply with regulations in your jurisdiction
- Oracle manipulation (March 2025 case: $7M market)
- Regulatory changes (Massachusetts sued Kalshi Sept 2025)
- Smart contract vulnerabilities
- Execution failures (slippage, gas costs)
- Market compression (institutional entry)
- Primary source: IMDEA Networks - "Unravelling the Probabilistic Forest: Arbitrage in Prediction Markets" (2025)
- 86 million bets analyzed
- $39.59M arbitrage documented
- Published in 7th Conference on Advances in Financial Technologies
- Polymarket: https://polymarket.com
- Kalshi: https://kalshi.com
- Dune Analytics: Public dashboards for whale tracking
Found a bug? Have a strategy improvement?
- Check
arbitrage_bot.logfor errors - Open an issue with:
- Error message
- Market that caused the issue
- Your configuration settings
Phase 1 (Months 0-6):
- Capital: $10,000
- Expected monthly ROI: 12-20%
- Expected monthly profit: $1,200-2,000
- Time commitment: 2-4 hours/day monitoring
Phase 2 (Months 6-12):
- Expected monthly ROI: 5-10% (compression)
- Expected monthly profit: $600-1,200
- More active management required
Key factors:
- Research top performer: $2.01M / 12 months = $167K/month
- Required: Automated execution, $100K+ capital, full-time
- Your results will vary based on capital and execution speed
- Run bot in monitor-only mode
- Observe opportunities for 7 days
- Verify a few manually on Polymarket
- Deploy $1,000-5,000
- Target single-condition arbitrage (simplest)
- Execute 5-10 trades manually
- Track results in spreadsheet
- Increase capital to $10K-25K
- Add NegRisk opportunities (29Γ efficiency)
- Implement systematic execution
- Target 10-15 trades/day
- β Read-only (no write operations)
- β No authentication required
- β No private keys handled
- β Uses public Polymarket API
- β Open source (you can audit code)
- Use hardware wallet (Ledger, Trezor)
- Never share private keys
- Test with small amounts first
- Use separate wallet for prediction markets
Questions? Issues?
- Check the log file first:
arbitrage_bot.log - Review the 15 research articles provided
- Verify market data manually on Polymarket.com
Remember: This tool provides signals. You make trading decisions. Always verify before executing.
MIT License - Free to use, modify, and distribute
Based on rigorous academic research:
- IMDEA Networks Institute
- Researchers: Saguillo, Ghafouri, Kiffer, Suarez-Tangil
- Published: 7th Conference on Advances in Financial Technologies (AFT 2025)
"Top arbitrageur generated $2,009,631.76 across 4,049 transactions ($496 average per trade), executing 11+ trades daily with systematic bot-like behavior."
"NegRisk markets (Nβ₯4 conditions) generated 73% of total arbitrage ($28.99M) despite representing a fraction of opportunities - documenting 29Γ capital efficiency advantage."
"As institutional capital enters (ICE $2B investment), spreads will compress - replicating crypto's evolution from retail arbitrage to institutional derivatives market."
python prediction_market_arbitrage.pyThe window is compressing. Deploy now or accept opportunity closure.
Last updated: January 2025 Bot version: 1.0.0