$ account ryanfrigo
This repository implements an automated trading bot for Kalshi prediction markets, leveraging AI models (primarily via OpenRouter) to make directional trading decisions. The system is built as an async Python application with a CLI entry point (`cli.py`), a Streamlit dashboard, and a paper trading mode. It supports multiple strategies: an AI-driven directional strategy using a multi-agent debate pipeline (bull/bear researchers, risk manager, trader), a conservative NO-side safe compounder, market making, and a unified trading system that dynamically allocates capital. The core data flow involves ingesting market data from the Kalshi REST and WebSocket APIs, persisting to SQLite, running AI inference through OpenRouter with fallback chains and cost tracking, executing trades via Kalshi's signed REST API, and monitoring positions with stop-loss/take-profit logic. Risk management is enforced through Kelly criterion position sizing, edge filtering, category scoring, portfolio enforcer, and cash reserves. The codebase also includes performance analysis jobs, a paper trading signal tracker with static HTML dashboard, and a comprehensive test suite. External dependencies include Kalshi API, OpenRouter (with optional xAI and Grok models), SQLite, Streamlit, and various async libraries (httpx, aiohttp, websockets).