System Architecture and Module Responsibilities
mainAlpha Arena is organized into several core services within the /arena-mvp directory:
- Orchestrator: The central scheduler. Every 5 minutes, it fetches the last 60 minutes of K-line data and current order book snapshots for two symbols, generates a unified Prompt, requests LLMs in parallel, validates the JSON schema, and passes the decision to the risk/execution layer.
- LLM Gateway: Provides a unified interface for different LLMs (OpenAI, DeepSeek, Anthropic, Google, etc.), handling requests, retries, rate limiting, and timeouts (default 8s timeout results in a
HOLDdecision). - Exchange Adapter: Handles market interaction. It supports paper-trading (simulated matching with fixed slippage) and can be switched to Bitget spot trading.
- Portfolio: Manages independent asset ledgers for each model, tracking cash, positions, and floating PnL, applying unified fees and slippage.
- Dashboard: A visualization layer (Streamlit or React) for monitoring Net Value curves, PnL, positions, trades, latency, and error rates.
Storage Layer:
- PostgreSQL: Stores trades, K-lines, model outputs, executions, and assets.
- Redis: Used for short-term queues, deduplication, and rate limiting.