Open source
Polkas
A prediction-market arbitrage system that watches Kalshi and Polymarket for opportunities, with an Axum backend, WebSocket market data, and a TypeScript frontend.
- Role
- Author
- Status
- Active
- Stack
- Rust, TypeScript
- Repository
- github.com/pwnholic/polkas
What this project shows
Context
Personal open-source end-to-end system for monitoring prediction-market data and surfacing arbitrage opportunities.
My contribution
Author of the backend, market matching, persistence, and frontend integration described in the repository.
Why it matters
Shows how I approach concurrent feeds, data freshness, matching uncertainty, and human-facing signals.
Public evidence
Highlights
- Kalshi and Polymarket feeds matched into arbitrage opportunities
- Axum and Tokio backend with WebSocket market data
- SQLite persistence so a restart keeps signal history
- React and TypeScript live view for the signals
Prediction-Market Arbitrage - Rust and Axum Backend - WebSocket Market Data - React Frontend
Overview
Polkas monitors the Kalshi and Polymarket prediction markets and looks for arbitrage opportunities between them. It is an end-to-end system rather than a library: an Axum/Tokio backend, an HTTP API, WebSocket market data, market matching, SQLite persistence, and a React/TypeScript frontend. It can also place the trade, with auto-trade limits (a maximum trade count and amount) rather than unlimited automation.
Problem
Constraints
- Two venues, two APIs. Nothing can be assumed to be shared beyond the concept of a market.
- Streaming first. Polling two venues at a useful frequency is both slow and rate-limited, so the books are maintained from WebSocket feeds.
- Matching is the hard part. An arbitrage pair is a judgement about equivalence, and a wrong match is worse than a missed one.
Architecture
Technical decisions
| Decision | Alternative | Why |
|---|---|---|
| Rust backend | A scripting language | Two concurrent feeds with matching on the hot path |
| WebSocket market data | Polling | Polling either lags or trips rate limits |
| SQLite | A server database | The working set is small and the deployment stays single-process |
| Separate frontend | Server-rendered pages | The UI is a live view, not a document |
Tradeoffs
Matching heuristics produce false positives, and a false positive in an arbitrage tool is expensive; the system therefore treats the signal as the primary output, and puts execution behind an auto-trade path bounded by a maximum trade count and amount rather than leaving it unlimited. Keeping the frontend separate also means two runtimes and two dependency trees for one tool.