Kalshi TradeAgent
An autonomous AI agent that trades prediction markets — and remembers and learns from every trade.

A trading platform for Kalshi prediction markets where the agent doesn't just execute — it remembers and learns. Every trade generates a lesson; an hourly feedback loop scores those lessons against realized P&L, raises confidence in the knowledge that made money, feeds it back into the next trade's decision prompt, and suspends strategies on consecutive losses until they earn their way back.
The agent fetches live Kalshi markets, qualifies opportunities with LLMs, places orders in paper or live mode, and tracks positions, settlements, and performance. You can sign up and run it in paper mode without risking money; the live track record is inside the app.
Architecture
React/Vite frontend on Vercel; the entire backend is 33 Supabase Edge Functions with pg_cron driving the hourly learning loop. Kalshi REST v2 with HMAC auth; multi-provider LLM routing via OpenRouter. The client is never trusted with money decisions — every trading, risk, and billing rule executes server-side.
Production posture
Built multi-tenant from the schema up: every query is user-scoped with Postgres row-level security active across all edge functions. Users' Kalshi and AI provider keys are encrypted end to end with AES-256-GCM. Subscription tiers enforce real server-side limits — trades per day, open positions, position size — not display-only caps. Capital is reserved atomically under per-user advisory locks so concurrent orders can't double-spend a budget, LLM context is wrapped and validated against prompt injection, and a CI gate drives the deployed dashboards in a real browser, asserting rendered numbers match the database before any release ships.
Related: kalshi-mcp — my open-source MCP server that gives any MCP-compatible agent live Kalshi market data.