Most AI trading bots fail for one reason: they are black boxes with zero risk discipline. Giving an LLM the keys to a brokerage account is a recipe for disaster because LLMs hallucinate numbers and ignore portfolio exposure. To solve this, we built ThetaSwarm: an autonomous options trading desk that relies on one strict architectural principle—Separation of Powers. In our system, intelligence is autonomous, but execution is mathematically governed. The AI Swarm (Powered by Qwen 2.5 72B & CrewAI): A Narrative Agent reads live market news to predict Volatility regimes. A Quant Agent fetches live Alpaca options chains and structures a defined-risk multi-leg trade (like a Long Straddle). The Adversarial Critic: A third agent actively red-teams the trade, acting as a skeptical Chief Risk Officer looking for any reason to veto the proposal. The Deterministic Risk Engine: If the AI agrees, the trade is sent to a hard-coded Python Risk Engine with 6 mathematical gates (Max Loss, Margin Caps, Delta Limits). If a trade fails even one gate, it is killed instantly. Execution: Approved trades are fired natively to the Alpaca Paper Trading exchange via the Alpaca MCP Server. Why this wins: We didn't just build a bot; we proved it works. We ran an episodic backtest against the 5 largest macro shocks of 2024, proving the swarm's predictive alpha. Furthermore, our Streamlit dashboard features the "Shadow Book"—an append-only ledger of every trade the AI refused to take, proving the adversarial risk guardrails work. We built the fortress around the AI.
Category tags: