Autonomous prediction market investment toolkit for Kalshi
Project description
TraderBot
Autonomous prediction market investment toolkit for Kalshi.
TraderBot provides the data pipeline, statistical analysis, risk enforcement, simulation, and execution layer that an AI agent needs to trade prediction markets.
Core Principle
Dumb pipe with smart guards. The toolkit handles the how (API calls, data normalization, risk limits, execution) but never the why (what to trade, when, how much). The agent decides strategy; the toolkit ensures execution is safe, correct, and auditable.
This separation is deliberate: it eliminates emotional bias from the execution layer. Even if the agent's LLM "decides" to go all-in on a hunch, hard-coded risk guards reject the order before it reaches the exchange.
Install
From PyPI (recommended)
pip install traderbot
From source
git clone https://github.com/JsonDaRula69/TraderBot.git
cd TraderBot
uv sync # or: pip install -e .
One-Liner Install (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/JsonDaRula69/TraderBot/main/install/traderbot-installer.sh | bash
Requires Python 3.12 and Kalshi API credentials (sign up at kalshi.com and generate an API key + RSA key pair).
Quick Start
# Store Kalshi credentials in your OS keyring
traderbot auth set-kalshi
# Scan available weather markets
traderbot scan --category weather
# Analyze a specific market
traderbot analyze KXHIGHNY-26JUN02-T72
# Paper trade with a strategy
traderbot paper momentum
# View your positions
traderbot positions
# Check for updates
traderbot update --check
Using with OpenClaw AI Agents
TraderBot integrates with OpenClaw for autonomous agent operation:
# Create a profile for your agent
traderbot profile create --name weather-agent --category weather
# Assign the profile token
traderbot profile assign --agent weather-agent --token $(traderbot profile token weather-agent)
The agent runs three autonomous loops: decision (every 5 min), heartbeat (every 30 min), and news/sentiment (event-driven). See docs/architecture.md for details.
CLI Overview
| Command | Description |
|---|---|
traderbot scan |
List open markets across categories |
traderbot analyze TICKER |
Orderbook depth + implied probability |
traderbot signals |
Active trading signals |
traderbot trade |
Place an order through risk checks |
traderbot positions |
View open positions with live pricing |
traderbot audit |
Decision history with filters |
traderbot performance |
P&L and win-rate metrics |
traderbot paper |
Run a paper trading session |
traderbot backtest |
Run backtests against historical data |
traderbot compare |
Compare profiles across strategies |
traderbot halt |
Check circuit breaker status |
traderbot resume |
Clear circuit breaker halt state |
traderbot heartbeat |
Self-review cycle |
traderbot learnings |
List and promote learned patterns |
traderbot data forecasts |
Weather forecasts with NWS + GFS/ECMWF/GEM ensemble |
traderbot data bias CITY |
Historical forecast bias for a city |
traderbot news-context |
News context for a category |
traderbot auth |
Credential management |
traderbot profile |
Multi-agent profile management |
traderbot cron |
Register heartbeat cron jobs with OpenClaw |
traderbot update |
Check for and apply updates |
Project Structure
src/traderbot/
├── kalshi/ # Kalshi exchange adapter
├── analysis/ # Statistical computation engine
├── risk/ # Immutable risk enforcement
├── simulation/ # Backtesting & paper trading
├── news/ # News & sentiment pipeline
├── data/ # Weather & market data providers
├── db/ # SQLite persistence
├── profiles/ # Multi-agent profile system
├── cli/ # Typer CLI entry point and sub-commands
├── experiment/ # Experiment design and evaluation
├── heartbeat.py # Self-review cycle
├── auth.py # Credential management
├── learning.py # Learning log manager
└── updater.py # Version management
Documentation
| Document | Scope |
|---|---|
| docs/architecture.md | Three-loop system, components, data flow |
| docs/kalshi.md | Kalshi API reference |
| docs/risk.md | Risk guards, circuit breakers, position sizing |
| docs/simulation.md | Backtest engine, paper trading |
| docs/profiles.md | Profile system, tokens, multi-agent |
| docs/deployment.md | Production deployment |
| docs/api.md | Full CLI reference |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file traderbot-0.14.72.tar.gz.
File metadata
- Download URL: traderbot-0.14.72.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29707f332b96b23ab356affa485a9ed858610ccc6b425c3487d2bdd0d57a639e
|
|
| MD5 |
6c83b5b87226f11c98f3b84c65ef9453
|
|
| BLAKE2b-256 |
8cb7c8baf287f1c850b4227bcc6206dfe15021ec62bc7098feb1eeaf8641e084
|
File details
Details for the file traderbot-0.14.72-py3-none-any.whl.
File metadata
- Download URL: traderbot-0.14.72-py3-none-any.whl
- Upload date:
- Size: 304.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b277144ad80ceeb94c45530a0bd5c334ab81bb84cc68fe002e871d283368c729
|
|
| MD5 |
21f6a20c7ebb3cd622f79bd73528761f
|
|
| BLAKE2b-256 |
6da290da10e377cce951e65387f27024db5338e9839365d6221217566103dcfa
|