A multi-model LLM ensemble autonomous trading system for the Kalshi prediction market, featuring AI ensemble debate, pure math edge, and aggressive strategies, with built-in multi-layer risk controls and an observability dashboard.
Positioning#
A multi-model LLM ensemble autonomous trading system for the Kalshi legal prediction market, explicitly stated for educational and experimental research only, not investment advice.
Core Capabilities#
Multi-Model AI Integration#
Integrates 5 LLMs via OpenRouter with role-based division and weighted voting:
- Claude Sonnet 4.5 — Lead Analyst (30% weight)
- Gemini 3.1 Pro — Forecaster (30% weight)
- GPT-5.4 — Risk Manager (20% weight)
- DeepSeek V3.2 — Bull Researcher (10% weight)
- Grok 4.1 Fast — Bear Researcher (10% weight)
Note: Some model names in the README (e.g., GPT-5.4, Gemini 3.1 Pro, Grok 4.1 Fast) may be placeholder/anticipated names; actual availability depends on OpenRouter.
Consensus gating: skips trades when weighted confidence < 0.45; auto-reduces position size on high model disagreement. All inference uses temperature=0 for reproducibility. Models are replaceable via single-line config.
Three Trading Strategies#
- AI Ensemble (default): Five-model debate + Kelly Criterion position sizing + portfolio risk controls
- Safe Compounder: Pure math/pure edge strategy, NO-side only (YES price ≤ 20¢), no AI required
- Beast Mode: Aggressive mode (paper trading only, historical backtesting shows significant losses, not recommended)
Multi-Layer Risk Management#
- Fractional Kelly positioning (0.25x Kelly)
- Daily hard loss limit 10%, max drawdown circuit breaker 15%
- Industry concentration cap 30%
- Category scoring system (hard-blocks categories with proven negative edge)
- Daily AI API cost budget control (default $10/day)
Dynamic Exit Strategies#
- Trailing stop after 20% profit, 15% stop-loss
- AI confidence decay exit mechanism
- 10-day maximum holding period
- Volatility-adjusted thresholds
System Architecture#
Four-stage async pipeline: INGEST → DECIDE → EXECUTE → TRACK
- Ingest: Fetches all tradeable instruments via Kalshi Events API, supplemented by WebSocket real-time streams, RSS news, and volume/price data
- Decide: 5 models analyze from role perspectives, return probability estimates and confidence, weighted voting with consensus gating
- Execute: Qualified trades sized via Kelly Criterion, submitted through Kalshi Order API
- Track: Decisions and execution results written to SQLite, dashboard displays P&L, win rate, Sharpe in real-time
Project structure: src/agents/ (multi-model ensemble), src/clients/ (API clients), src/config/ (configuration), src/data/ (news & sentiment), src/events/ (async event bus), src/jobs/ (pipeline stages), src/strategies/ (strategy implementations), src/utils/ (utilities)
Observability#
- Real-time Streamlit dashboard (portfolio value, positions, P&L, AI decision logs)
- Paper trading simulation mode
- SQLite local telemetry (every trade, AI decision, cost metrics)
- Unified CLI (run / dashboard / status / health / scores / history)
Quick Start#
Prerequisites: Python ≥ 3.12, Kalshi account (API access required), OpenRouter API Key
git clone https://github.com/ryanfrigo/kalshi-ai-trading-bot.git
cd kalshi-ai-trading-bot
python setup.py
cp env.template .env # Fill in KALSHI_API_KEY and OPENROUTER_API_KEY
python -m src.utils.database
python cli.py run --paper
python cli.py dashboard
Unverified Claims#
- Safe Compounder claims 74% win rate and +10% ROI on NCAAB NO-side trades, but no independent verifiable backtest report or audit data is provided
- Beast Mode specific loss data not disclosed
- Safe Compounder edge quantification lacks statistical significance testing