prediction-market-analysis: Polymarket and Kalshi Data for Research
A framework for collecting and analyzing prediction market data, including the largest publicly available dataset of Polymarket and Kalshi market and trade data.
At a glance
- What is it?
- Jon-Becker/prediction-market-analysis ships a 36GiB pre-collected Parquet dataset of Polymarket and Kalshi markets and trades, plus indexers and an analysis framework. It is a research toolkit, not a trading system.
- Who is it for?
- Adopt it if you need historical Polymarket and Kalshi market and trade data in Parquet and you are willing to spend the disk space and the download time to get it; the repository is public, MIT licensed, and its last push was on 2026-09-21. Do not adopt it if you want a live trading client, a hosted query endpoint, or a curated statistical result: the analyses are scripts you run yourself and the outputs land in output/.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 24 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- Jon-Becker/prediction-market-analysis3,957 ★ · +100
| Repository | 2026-09-24 | 2026-11-22 |
|---|---|---|
| Jon-Becker/prediction-market-analysis | 3.9k | 4k |
100 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What prediction-market-analysis actually solves
Anyone who wants to study prediction markets hits the same wall first: the data is spread across two venues with different access models. Kalshi exposes a REST API. Polymarket exposes an API and an on-chain trade history, which means pulling event logs from Polygon through an RPC endpoint and reconciling them against market metadata. Doing that once is a weekend. Keeping it consistent across two venues, with resumable progress and a stable schema, is the part people abandon.
This repository packages that work. The README describes it as a framework for data collection, storage, and running analysis scripts that generate figures and statistics, and it states that the project includes the largest publicly available dataset of Polymarket and Kalshi market and trade data. The audience is narrow and specific: researchers, data scientists, and quantitatively minded engineers who need historical market and trade records rather than an execution venue. The homepage points at a paper on prediction market microstructure, which tells you the intended consumer is someone writing analysis, not someone placing orders.
The supported feature list in the README is short and worth reading literally. Market metadata collection for both venues. Trade history collection via API and blockchain. Parquet-based storage with automatic progress saving. An extensible analysis script framework. There is no backtesting engine, no order book reconstruction, no strategy runner, and no live feed. If you need any of those, this is the wrong layer of the stack.
How the indexers, Parquet store and analysis scripts fit together
The repository layout in the README separates three concerns. src/indexers/ holds the collection code, split into kalshi/ (an API client and indexers) and polymarket/ (API and blockchain indexers). src/analysis/ holds the analysis scripts, again split by venue. src/common/ holds shared utilities and interfaces, which is where the abstractions that let both venues feed the same analysis live.
Data lands in data/, and the directory structure is explicit about the shape: data/kalshi/markets/ and data/kalshi/trades/, plus data/polymarket/blocks/, data/polymarket/markets/ and data/polymarket/trades/. The blocks directory is the tell that Polymarket collection is blockchain-based rather than purely API-based. Storage is Parquet, and the README points to docs/SCHEMAS.md for the file schemas, which is the document to read before writing anything that consumes the data.
The flow is: an indexer pulls from a venue, writes Parquet under data/, and an analysis script reads those files and writes PNG, PDF, CSV or JSON into output/. Progress saving is called out in the README as automatic, so a collection run can be interrupted and resumed. That matters more than it sounds, because blockchain indexing over a large block range is the kind of job that fails partway through and restarts from zero in a naive implementation.
The dependency list in pyproject.toml confirms the design. duckdb and pyarrow for the columnar layer, pandas and scipy for analysis, matplotlib, brokenaxes, squarify and imageio for figures, web3 for Polygon access, httpx and requests for APIs, tenacity for retries, tqdm for progress, and simple-term-menu for the interactive menus. The Python floor is 3.9, set in both requires-python and the ruff target-version.
Installing it and running your first analysis
The README asks for Python 3.9 or newer and uses uv for dependency management. Running uv sync installs everything declared in pyproject.toml and pins it via uv.lock. There is no published package to install; you work from a clone.
uv syncThe second step pulls the pre-collected dataset. The README states this archive is 36GiB compressed, downloaded from Cloudflare R2 Storage and extracted into data/. The make target wraps a shell script, so the download and the extraction both happen under one command.
make setupExpect a long download and a data/ directory that is larger than the archive once extracted. This is the step to plan storage for before you start, not after.
To run an analysis, the Makefile forwards to uv run main.py analyze. The README says this opens an interactive menu where you select a single analysis or run all of them, and that outputs (PNG, PDF, CSV, JSON) are written to output/.
make analyzeIf you want to collect fresh data instead of using the archive, the same pattern applies: make index opens an interactive menu for choosing an indexer, and results are written under data/kalshi/ and data/polymarket/. Before running the Polymarket blockchain indexer, copy the environment template and fill it in.
cp .env.example .envThe template declares two keys: POLYGON_RPC, which is empty and must be set to an RPC endpoint, and POLYMARKET_START_BLOCK, which ships as 33605403. The README does not document which RPC providers work or what rate limits to expect, so that is on you to confirm. Once collection finishes, make package compresses data/ into data.tar.zst and removes the directory, which is useful if you want to move the dataset to another machine.
The 36GiB download and other constraints worth knowing
The dataset size is the first real constraint, and the README states it plainly: 36GiB compressed. Extracted Parquet is typically larger than its compressed form, so budget accordingly before you run make setup. There is no documented incremental or partial download, and the README does not describe a way to fetch only Polymarket or only Kalshi data. If you need one venue, you still take the whole archive or you index it yourself.
make package is destructive by design. The README says it creates the archive and removes the data/ directory. That is convenient for distribution and dangerous if you run it in the wrong working directory, since the local Parquet files are the only copy unless you have indexed them from source.
Polymarket collection depends on external infrastructure. .env.example requires POLYGON_RPC, and the repository does not ship a default endpoint. The starting block is configurable via POLYMARKET_START_BLOCK, but the README does not document rollback, reorg handling, or what happens if the RPC provider returns inconsistent results across runs. For a dataset whose value comes from reproducibility, that gap matters, and it is the kind of thing you should verify against docs/SCHEMAS.md and the indexer source before citing results.
Finally, the project description in pyproject.toml still reads "Add your description here", and the version is 0.1.0. Neither is a functional problem, but together they suggest the packaging metadata has not been a priority. The repository has no published GitHub releases, so installation from the repository is the only path.
When this is the wrong tool, and what to use instead
If you want to trade, this repository does nothing for you. There is no order placement, no position tracking, no risk management. The dependency list includes kalshi-python and polymarket-py, which are the vendor clients the indexers wrap for data access, not execution frameworks this project builds on top of. For live trading you would go to those vendor SDKs directly, or to a dedicated execution library, and write the trading logic yourself.
If you want a hosted, queryable dataset rather than files on disk, the fit is also poor. Everything here is local Parquet plus duckdb and pandas. There is no server, no API, and no query endpoint. A team that wants SQL over prediction market history without managing a 36GiB download is better served by loading the data into a warehouse once, or by a managed data product, and accepting the vendor's schema and update cadence instead of this repository's.
The closest alternative in spirit is building your own indexer against the Kalshi and Polymarket APIs. The difference is where the effort goes. A custom indexer gives you exactly the fields and the update schedule you want, and it lets you skip the blockchain path entirely if API data is sufficient for your question. What it does not give you is the pre-collected archive, the shared interface in src/common/, or the schema documentation in docs/SCHEMAS.md. Those three things are the actual product here, and rebuilding them is the cost you avoid by adopting the repository.
A narrower alternative for Polymarket-only work is querying the chain yourself with web3 and decoding only the events you need. That is lighter than a full index if your question is small, and much heavier if you later want cross-venue comparisons, because you will have written one half of what this project already provides.
Maintenance, licence and upgrade cost
The repository is not archived and the last push was on 2026-09-21, two days before this was written. That is a recent push, so the codebase is receiving changes. The repository has no published GitHub releases, which means there is no versioned upgrade path to follow: you track main, and you read commits rather than changelogs. The version string in pyproject.toml is 0.1.0, consistent with pre-1.0 software where interfaces can move.
The upgrade surface is wider than a typical library because the data schema is part of the contract. docs/SCHEMAS.md documents the Parquet schemas, and any change there can break an analysis script that reads specific columns. The practical upgrade cost is therefore: re-sync dependencies with uv sync, re-run your analyses, and diff the schemas before trusting a comparison against earlier output. The dev tooling is conventional and cheap to run, with ruff for lint and format (line length 120, target py39, E501 ignored) and pytest with a slow marker so long tests can be deselected.
The licence is MIT, which is permissive and places few conditions on reuse. That is a statement about the licence text, not advice about your situation. The README separately asks that researchers who use the dataset reach out by email or Twitter and consider opening a pull request to add their paper to the citations list. That is a request, not a licence term, and it does not restrict what you may do with the data. Note that the citations section contains third-party papers under their own terms; the repository's MIT licence covers the repository's code and does not speak for those documents.
Editorial conclusion
Adopt it if you need historical Polymarket and Kalshi market and trade data in Parquet and you are willing to spend the disk space and the download time to get it; the repository is public, MIT licensed, and its last push was on 2026-09-21. Do not adopt it if you want a live trading client, a hosted query endpoint, or a curated statistical result: the analyses are scripts you run yourself and the outputs land in output/. Before committing, verify three things: that the 36GiB compressed dataset fits your storage budget, that your POLYGON_RPC endpoint can serve the block range starting at POLYMARKET_START_BLOCK, and that the Parquet schemas in docs/SCHEMAS.md match the columns your analysis expects. If those three hold, the repository removes the indexing work that otherwise dominates a prediction market research project.
Frequently asked questions
What is the prediction-market-analysis dataset and how big is it?
It is a pre-collected set of Polymarket and Kalshi market and trade data stored as Parquet files, described in the README as the largest publicly available dataset of its kind. The README states the compressed archive is 36GiB and that make setup downloads and extracts it into data/.
How do I install and run prediction-market-analysis?
The README requires Python 3.9 or newer and uses uv, so the first step is uv sync. After that, make setup downloads and extracts the dataset, and make analyze opens an interactive menu that writes figures and CSVs into output/.
What do I need to set in the .env file for Polymarket collection?
The .env.example template declares POLYGON_RPC, which is empty and must be filled in with an RPC endpoint, and POLYMARKET_START_BLOCK, which ships as 33605403. The README does not document provider requirements or rate limits.
Does prediction-market-analysis place trades on Polymarket or Kalshi?
No. The README describes data collection, Parquet storage, and analysis scripts that generate figures and statistics. There is no order placement or position management anywhere in the documented feature list.
What licence does prediction-market-analysis use?
The repository is MIT licensed, which is permissive. The README separately asks researchers who use the dataset to reach out and to add their paper to the citations list, but that is a request rather than a licence condition.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/jon-becker-prediction-market-analysis)Star history chart for your README
[](https://hysenlabs.com/projects/jon-becker-prediction-market-analysis)Was this useful?