This repo contains the codebase for our CIS 2450 Term Project on Kalshi Political Markets.
This project aims to analyze and predict outcomes in Kalshi Political Markets.
dashboard/dashboard.py: A Dash app that visualizes model performance and feature importance.
data/raw/kalshi_markets.parquet: Raw market data pulled from the Kalshi API.kalshi_trades.parquet: Raw trade data pulled from the Kalshi API.
intermediate/
models/: Saved model artifcats for dashboard display.notebooks/1_eda.ipynb: Exploratory Data Analysis for the raw Kalshi data and GDELT join.2_feature_engineering.ipynb: Feature engineering and analysis of the all features.3_modeling.ipynb: Evaluating predictive models for Kalshi market outcomes.
src/kalshi_api.py: Contains helper functions used for authenticating and making requests to the Kalshi API.pull_markets.py: Fetches all resolved Kalshi political markets (within our time scope) and save to parquet.pull_trades.py: Fetches trades for every political market and save to parquet.build_prediction_targets.py: Builds the prediction_targets.parquet file for the Kalshi data.gdelt_loader.py: Downloads GDELT 1.0 events, entity-links them to Kalshi markets via embedding similarity, and produces per-market sentiment features.
README.mdCan the Crowd Be Beaten? Slides.pdf
secrets\: stores private Kalshi API key.env: environment variables for API key*.parquet: files too large for git, stored on Drive