What it does
Kalshi is a CFTC-regulated event market where contracts resolve to YES or NO based on real-world events. Sports markets — game outcomes, player props, point spread brackets — have well-defined settlement conditions and predictable market structure. This makes them tractable for automation.
The platform scans active Kalshi markets, evaluates current contract prices against model probabilities, identifies positive expected value positions, and places orders automatically. Stop-loss floors and circuit breakers prevent runaway drawdown. All positions are logged and the system can be monitored remotely without interrupting execution.
This is not a simulation. It trades real capital through the Kalshi REST API on a schedule keyed to game schedules and market open windows.
How it works
Production infrastructure
Deployed on a Linux VPS. The platform runs as a systemd service under a dedicated non-root service user, automatically restarting on crash and starting on boot. The dashboard and API server run as companion services under the same unit file group.
# /etc/systemd/system/trading-bot.service
[Unit]
Description=Event-Market Trading Bot
After=network.target
[Service]
Type=simple
User=trader
WorkingDirectory=/opt/trading-bot
ExecStart=/opt/trading-bot/.venv/bin/python main.py
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Capital protection
Trading real capital requires explicit, tested risk controls. The platform has three independent protection layers. Any one of them can halt trading without requiring the others.
| Control | Mechanism | Behaviour on trigger |
|---|---|---|
| Position limit | Maximum capital allocated per market. Hard limit enforced before any order submission, not after. | Order rejected. Logged. Platform continues scanning other markets. |
| Stop-loss floor | If a position's mark-to-market value falls below a configurable percentage of entry cost, it is closed immediately. | Market sell order placed. Position removed from active tracking. |
| Daily circuit breaker | If daily realised P&L crosses a configured negative threshold, all new order placement is halted for the remainder of the session. | New orders blocked. Open positions held to settlement. Operator notified. |
| API error guard | Consecutive API errors beyond threshold (rate limiting, 5xx responses) pause order placement and escalate to notification. | Exponential backoff. After max retries, platform enters safe mode and waits for manual restart. |