Prediction markets offer a unique playground for quantitative strategies, especially when you can identify pricing inefficiencies across platforms. Polymarket-kalshi-weather-bot stands out by combining two distinct approaches under one hood: short-term Bitcoin microstructure signals and ensemble weather forecasts. The blend of these strategies, paired with a robust backend and real-time dashboard, makes it a fascinating case study for anyone interested in algorithmic trading beyond traditional assets.
what polymarket-kalshi-weather-bot does
At its core, this project is a multi-strategy trading bot designed to exploit price discrepancies on two prediction market platforms: Kalshi and Polymarket. It implements two independent strategies:
BTC microstructure signals: This strategy taps into 5-minute interval BTC market data sourced from Coinbase, Kraken, and Binance. It analyzes technical indicators like RSI, momentum, VWAP, and SMA crossovers to predict short-term directional moves in BTC. The signals then guide trades on BTC direction markets.
Ensemble weather forecasts: This is the more novel part. The bot uses a 31-member ensemble from the Global Forecast System (GFS) via the Open-Meteo API to simulate a Monte Carlo distribution of temperature outcomes. By probabilistically pricing KXHIGH series weather temperature contracts, it attempts to identify edges where the market price diverges from the forecast distribution.
Under the hood, the bot uses fractional Kelly position sizing with a conservative 15% fraction to manage risk, applying edge thresholds (2% for BTC trades, 8% for weather trades) to filter actionable signals. The backend is built with FastAPI, utilizing APScheduler for job scheduling and SQLite for persistence. The frontend dashboard is built with React and connects via WebSocket for real-time updates.
The system relies exclusively on free data sources, with an optional Kalshi API authentication supported via RSA-PSS signatures.
technical strengths and architectural tradeoffs
The architecture strikes a balance between complexity and maintainability. The FastAPI backend is a solid choice for scalable asynchronous Python APIs, and APScheduler ensures scheduled tasks like fetching market data and executing trades run reliably. SQLite provides a lightweight persistence layer adequate for this use case without the overhead of heavier databases.
What distinguishes this bot is the dual-strategy approach combining classic crypto microstructure signals with a quantitative weather derivative model. The ensemble forecast technique uses 31 GFS ensemble members to approximate a probability distribution of temperature outcomes — effectively a Monte Carlo simulation. This probabilistic approach is relatively rare in open-source weather derivative trading strategies and highlights a quant mindset applied outside equity or crypto.
The code implements the fractional Kelly criterion for position sizing, which is a standard in quantitative finance to balance growth and risk. Using a fraction of 15% reveals a conservative stance, likely to avoid overexposure given the inherent noise in prediction markets.
On the tradeoffs side, relying on free data APIs means data quality and latency can vary. Weather forecasts and BTC microstructure signals both introduce noise and uncertainty, requiring robust error handling and careful threshold tuning, which the code appears to address through configurable parameters.
The React dashboard, updated via WebSocket, offers a smooth developer experience for monitoring live trading activity and performance metrics. This is an important touch for real-world usability, though it adds frontend complexity.
Overall, the codebase is surprisingly clean for a multi-platform trading bot, with clear separation of concerns between data ingestion, signal processing, trade execution, and UI.
quick start
1. Backend setup
cd kalshi-trading-bot
# Install dependencies
pip install -r requirements.txt
# Install dependencies
npm install
This quick start snippet from the README gets you the backend dependencies installed and prepares the environment. You’ll want to follow further instructions in the repo for configuration, API keys, and running the scheduler and API server.
verdict
Polymarket-kalshi-weather-bot is a solid example of an open-source multi-strategy prediction market bot that blends traditional crypto technical analysis with a thoughtful probabilistic weather forecasting model. The use of ensemble GFS data to model weather contract prices is a clever application of quantitative finance concepts outside the usual asset classes.
That said, the bot demands a solid understanding of both crypto market microstructure and weather derivatives to tune effectively. The reliance on free data sources and the inherent noise in prediction markets mean it’s not a plug-and-play solution but rather a practical research and development platform.
It’s well-suited for quant developers or hobbyists interested in prediction markets who want to experiment with combined signal strategies and fractional Kelly sizing. The FastAPI backend and React dashboard provide a good developer experience for monitoring and extending the bot.
If you’re looking for a straightforward, battle-tested trading bot for equities or crypto only, this might be overkill. But if you want to explore an edge in prediction markets with a quant flavor, it’s worth digging into the code and data flow.
Related Articles
- TradingAgents: a multi-agent LLM framework simulating real-world trading firm dynamics — TradingAgents uses specialized LLM agents in a structured bull/bear debate to mimic real trading firms. Supports 10+ LLM
- Inside daily_stock_analysis: a multi-LLM automated stock analysis system — daily_stock_analysis combines multi-LLM integration with multi-source financial data to automate stock market decisions
- TrendRadar: AI-powered multi-platform trend monitoring with MCP architecture — TrendRadar is a self-hosted AI-driven tool for multi-platform trend monitoring, using MCP architecture for advanced lang
→ GitHub Repo: suislanchez/polymarket-kalshi-weather-bot ⭐ 291 · Python