Skip to main content

Key Points

  • 1.A machine learning model was trained on 5,335 historical 15-minute Bitcoin Up/Down markets from Kalshi to predict settlement outcomes ten minutes in advance.
  • 2.Out-of-sample testing showed the model achieved a log-loss edge of only 0.001432 over Kalshi market odds, demonstrating that the market already prices in nearly all available signal.
  • 3.During initial live tests, the model achieved a 75 percent win rate over 16 one-dollar trades and a 92.86 percent win rate over 14 five-dollar trades, growing account equity from $56.62 to $88.12.
  • 4.A quantitative audit revealed that high short-term win rates were primarily favorable variance rather than genuine alpha, as the model agreed with Kalshi on all 14 directional calls.
  • 5.Projections across 1,000 market windows indicate an expected net loss of approximately $12 because Kalshi taker fees exceed the model's marginal gross edge.

Summary

The experiment explores using machine learning to predict 15-minute Bitcoin Up or Down contracts on Kalshi. The dataset comprises 5,335 historical resolved markets collected across 58 days, with 606 untouched markets reserved as an out-of-sample test set. The model observes five one-minute candles during the first five minutes of the market window (at the t minus 600 mark) and attempts to predict the outcome ten minutes ahead before market resolution at t zero. In out-of-sample testing, the model achieved a log loss of 0.516982 compared to Kalshi's market log loss of 0.518414, reflecting a marginal edge of 0.001432. This small difference shows that Kalshi market prices already incorporate almost all available information.

Despite the tiny theoretical edge, an initial model run correctly predicted seven consecutive live market directions. Based on this outcome, an automated bot written in Python was deployed to execute live trades with one-dollar stakes. Over sixteen one-dollar live trade windows, the bot recorded twelve wins and four losses, delivering a seventy-five percent directional win rate. Encouraged by these early returns, the stake was raised to approximately five dollars per trade to observe performance under higher capital allocation, starting with a portfolio cash balance of 56.62 dollars.

During live execution with five-dollar stakes, the bot traded consecutive fifteen-minute intervals, taking either Yes or No positions depending on model probabilities. The account balance climbed steadily through multiple wins, surpassing 65.82 dollars, 73.79 dollars, and eventually reaching 88.12 dollars. Across the five-dollar live trading run, the system finalized fourteen trades, achieving thirteen wins and one loss. This produced a 92.86 percent win rate and a net profit of 31.50 dollars after transaction fees, yielding a portfolio return of over 174 percent in approximately three hours.

A subsequent quantitative post-mortem conducted using an AI coding assistant and Python audited the live results. The analysis revealed that the model and Kalshi took identical directional sides across all fourteen markets, with the model adjusting Kalshi's implied probabilities by an average of only 1.03 cents. Statistical projection over a simulation of 1,000 trade windows indicated that the win rate would regress to approximately 70 percent, producing an expected net loss of roughly twelve dollars due to taker fees averaging 1.62 cents per contract against an estimated gross model edge of 1.48 cents. The repository containing data extraction guidelines, LLM prompts, requirements, and training code using LightGBM and XGBoost was published on GitHub for educational experimentation.

Machine Learning Setup and Backtesting

The presenter outlines an experiment using Kalshi 15-minute Bitcoin Up/Down binary contracts. Using 5,335 resolved markets collected over 58 days, a machine learning model is trained to observe the first five minutes of candle data and predict the outcome ten minutes before resolution. On 606 untouched test markets, the model scored a log loss of 0.516982 versus Kalshi's 0.518414, indicating a tiny predictive difference.

Live Trading with $1 and $5 Stakes

After one candidate model recorded seven consecutive correct directions, an automated trading script executed live orders on Kalshi. Testing with $1 stakes produced 12 wins and 4 losses across 16 trades. Increasing stake sizes to approximately $5 per window yielded 13 wins out of 14 trades, lifting the portfolio balance from $56.62 to $88.12.

Quantitative Audit and Long-Term Projections

An automated quantitative analysis of the $5 trading session showed that the model and Kalshi chose the exact same direction on all 14 trades, with the model adjusting Kalshi odds by an average of only 1.03 cents. Simulating performance over 1,000 future windows projected a regression to roughly 70 percent directional accuracy and an expected net loss of about $12 after paying taker fees.

Open-Source Code and Repository Walkthrough

The repository for the project is shared on GitHub under kalshi-btc15-ml-experiment. It includes documentation for fetching historical data via Kalshi API endpoints, copy-paste prompts for LLM coding assistants, dataset structure definitions, and python training scripts using libraries such as LightGBM, XGBoost, and Scikit-learn.

Worth watching for

Developers, quantitative trading enthusiasts, and machine learning practitioners interested in building prediction models for Kalshi binary prediction markets.

  • kalshi
  • machine-learning
  • bitcoin
  • algorithmic-trading
  • python
  • prediction-markets