Bloom Trading Agent is an autonomous, options-only trading system built for the Alpaca Builder Hackathon. It combines a Django backend API, Vue 3 dashboard, and Node CLI to deliver real-time portfolio monitoring and AI-driven hedge management on Alpaca paper-trading accounts. Each user operates in complete isolation—cookie-based silent authentication binds browser sessions to individual `UserProfile` records, which store encrypted Alpaca credentials. The agent's cognitive loop continuously perceives account data through the Alpaca MCP server, embeds market facts as semantic vectors (Chroma locally, pgvector on Neon in production), recalls relevant context via similarity search, and reasons through trading decisions using an LLM (Fireworks primary, Featherless fallback) that operates under a strict options-only system prompt. When no LLM is available, it degrades to deterministic heuristics without losing functionality. The system enforces protective strategies: buying puts to hedge long positions, selling covered calls for income, entering cash-secured puts, and executing vertical spreads—never naked directional bets. Configuration is granular and per-user: dry-run mode defaults to safe simulation, autonomous position entry is disabled by default, and emergency controls flatten the entire book or liquidate individual positions with two-step confirmation. The architecture transparently switches between local SQLite/Chroma (development) and production Postgres/pgvector, requires zero external dependencies for inference failover (both LLM providers speak OpenAI's wire format), and uses native `fetch` instead of axios so the same REST client works identically in the browser and Node CLI. The dashboard is read-heavy and monitoring-focused; the CLI provides deterministic, keyboard-driven operations for traders who need immediate action without a browser. All decisions, orders, hedges, and portfolio snapshots are persisted for audit, backtesting, and P&L analysis.
Category tags: