A system for detecting pricing inefficiencies across two prediction exchanges in the hourly Bitcoin outcome market.
The scanner continuously compares bid-ask data from two platforms. When the combined cost of taking opposite sides on the same outcome falls below the settlement value, a profitable spread exists.
Architecture:
- API service written in Python with FastAPI
- Web interface built with Next.js and Tailwind CSS
Background on the underlying math is in thesis.md.
- Continuous price polling at one-second intervals
- Automatic alignment of markets across platforms using strike price
- Spread detection when total cost is under one dollar
- Browser dashboard with live price feeds and cost breakdowns
- Support for both directional combinations (e.g. Down+Yes, Up+No)
- Python 3.9 or newer
- Node.js 18 or newer
- npm or yarn
Clone the repository and enter its directory:
git clone <repository-url>
cd polymarket-kalshi-btc-arbitrage-botBackend:
cd backend
pip install -r requirements.txtFrontend:
cd frontend
npm installStart both services.
Backend (from backend/):
python3 api.pyRuns at http://localhost:8000.
Frontend (from frontend/):
npm run devRuns at http://localhost:3000.
- Fetches the current hourly Bitcoin Up/Down market from the first platform.
- Locates the matching market on the second platform.
- Maps prices to a normalized 0.00–1.00 scale.
- Compares strike prices:
- If first platform strike is higher: evaluates Down + Yes.
- If first platform strike is lower: evaluates Up + No.
- Sums the two leg costs. A total below $1.00 indicates an opportunity.
Pull requests are accepted. Standard flow:
- Fork the repository
- Create a branch
- Commit and push
- Open a pull request
MIT License. See LICENSE for details.
Disclaimer: Do not run this project. This software is provided for educational and informational purposes only.