PolyWorkBench
A workbench over prediction-market data
47,000 markets and tens of millions of events: a stats endpoint that used to time out now answers in 2 ms warm.
- Python
- FastAPI
- PostgreSQL
- Alembic
- React
- Docker Compose
- pytest
What it is
A workbench for analysing prediction-market data — Polymarket, the markets where people buy and sell contracts on whether something will happen. It collects their data through the API continuously, stores it in a database of my own, and builds three things on top: a dashboard for exploring markets and their price history, strategy backtesting over that history, and tracking of public wallets to see what the consistently right ones are doing.
It is on hold, and the interesting part of having built it is that almost all the work turned out to be data work rather than analysis: the collector survives API outages with retries and a circuit breaker, migrations are additive so nothing already collected is lost, and the backtester corrects the things that make fake backtests look good — forward windows and a slippage model — because a strategy tested against data that did not exist yet always wins.
The number: the statistics screen ran COUNT(*) over tables holding tens of millions of
rows and returned timeout errors. With the heavy query dropped and a 60-second cache, it
answers in ~2 ms warm. It was my reminder that past a certain size a counter stops
being free — and 47,271 markets is already that size.
