Inspiration
Prediction markets like Polymarket and Kalshi are supposed to be efficient — but they're not. The same event gets priced differently on two platforms because they have separate liquidity pools and user bases. A Fed rate cut might be 67% on Polymarket and 60% on Kalshi at the same time. That gap is free money — and nobody was scanning for it systematically.
We also noticed that near-certain markets (priced at 92–98% YES) are massively underpriced relative to their time-adjusted yield. A market at 94 cents resolving in 2 days is a 1168% annualized return. Traders ignore this because they're chasing volatile markets. We built a bot that doesn't.
What it does
PolyEdge is a dual-strategy automated trading signal system for prediction markets.
Strategy 1 — Cross-Platform Arbitrage: Scans Polymarket and Kalshi every 60 seconds, fuzzy-matches the same event across both platforms, and flags price spreads above 3%. When a spread exists, you buy on the cheaper platform and sell on the expensive one — guaranteed profit regardless of the real-world outcome.
Strategy 2 — High-Probability Bond Harvester: Scans all active Polymarket markets for contracts priced above 92% YES and ranks them by annualized yield. These near-certain outcomes are systematically underpriced relative to their time-adjusted return. The scanner treats them like short-duration bonds and surfaces the highest-yield opportunities first.
Both strategies are backtested on 1,500 historical resolved markets with full P&L, win rate, Sharpe ratio, and max drawdown output. Results export to CSV. Everything runs live with a web dashboard and a Rich terminal UI.
How we built it
- Python 3.11 — core engine, all strategy logic
- The Graph subgraph (Polygon blockchain) — primary Polymarket data source, on-chain, globally accessible
- Polymarket Gamma API + CLOB API — market metadata and orderbook fallback
- Kalshi Trade API v2 — cross-platform market data (public read)
- rapidfuzz — fuzzy title matching engine (token-set ratio + partial ratio, weighted 70/30)
- FastAPI + uvicorn — REST API serving all signals and backtest results
- Chart.js — equity curve visualization in the web dashboard
- Rich — live terminal dashboard with real-time signal tables
- Custom backtest engine — replays both strategies on historical data, calculates all metrics
Challenges we ran into
Building from India meant Polymarket's CLOB API and Gamma API are geo-restricted — HTTP requests would hang indefinitely with no error. We discovered this mid-build when our data pipeline silently failed.
We solved this by pivoting the primary data source to The Graph subgraph — Polymarket's on-chain data indexed from the Polygon blockchain. The Graph is globally accessible with no geo-restrictions, and reading directly from the blockchain is actually more technically credible than a REST API.
For the backtest, Kalshi does not provide historical price data publicly. Rather than fake it or skip the arb backtest entirely, we built a deterministic synthetic spread model — seeded by each market's condition ID via MD5 hash, producing reproducible spread distributions calibrated to documented price discovery lag between prediction market platforms. We're transparent about this in the codebase.
We also had to handle the fact that Polymarket's resolved market API returns inconsistent field names across different market types — some use winner, some use token prices at 1.0, some use resolvedOutcome. We wrote a robust normalizer that handles all cases.
Accomplishments that we're proud of
- Built a fully working dual-strategy signal system end-to-end in 48 hours
- Bond harvester achieves 94.8% historical win rate across 210 backtested trades
- Arb scanner backtested across 864 historical market pairs with average 5.42% spread
- Combined backtest P&L of $4,881 on $100/trade stake
- Sharpe ratio of 26.6 (bond) and 47.6 (arb) — both well above institutional benchmarks
- Live web dashboard with real-time equity curves, signal feed, and backtest visualization
- Pivoted data architecture mid-hackathon from geo-blocked REST APIs to on-chain blockchain data — and the final system is stronger for it
What we learned
Prediction markets are not as efficient as people think — especially across platforms. The fuzzy matching problem (same event, different wording on two platforms) is harder than it looks and required careful tuning of the similarity threshold to minimize false positives without missing real matches.
We also learned that geo-restrictions are a real engineering constraint, not just an inconvenience. Building resilient data pipelines with multiple fallback sources is essential for any system that needs to run reliably across different network environments.
What's next for PolyEdge
- Live execution engine — automatically place trades via Polymarket CLOB API when a signal fires
- Real Kalshi historical data integration for a cleaner arb backtest
- Whale wallet tracker — monitor the most profitable Polymarket wallets on-chain and generate copy-trade signals
- Combinatorial arbitrage — detect logical inconsistencies across related markets
- Telegram/Discord alerts when high-yield signals are detected
Log in or sign up for Devpost to join the conversation.