Skip to content

Latest commit

 

History

History
67 lines (56 loc) · 4.42 KB

File metadata and controls

67 lines (56 loc) · 4.42 KB

Kurisu - AI Quant Trading Agent Requirements Document

1. Project Overview

Project Name: Kurisu (Tentative) Goal: Build a modular, extensible, and modern AI-powered quantitative trading agent with a comprehensive UI. Core Objectives:

  1. Trading Execution: Automate trading strategies based on quantitative analysis and AI insights.
  2. AI Agent Research: Implement advanced agent architectures (planning, memory, tool use) for financial markets.
  3. Education Platform: Serve as a learning tool for quantitative finance, strategy mathematics, and modern software architecture.

2. Target Audience & Personas

  • The Quant Trader: Wants to automate strategies, backtest ideas, and monitor live performance.
  • The AI Researcher: Wants to experiment with different LLM prompts, agent architectures (e.g., ReAct, Plan-and-Solve), and RAG implementations.
  • The Learner: Wants to understand the "why" behind a trade, visualize the mathematical models (e.g., Kelly Criterion, Sharpe Ratio), and learn code implementation.

3. Functional Requirements

3.1 Data Management Module

  • Multi-Source Data Ingestion: Support for crypto (Binance/CCXT), stocks (Yahoo Finance/Alpha Vantage), and alternative data (News/Social Media).
  • Data Normalization: Unified data structure for OHLCV (Open, High, Low, Close, Volume) and tick data.
  • Storage: Efficient storage for time-series data (historical and real-time).

3.2 Quantitative Strategy Engine

  • Strategy Interface: Standardized base class for implementing strategies (e.g., Moving Average Crossover, Mean Reversion, Grid Trading).
  • Indicator Library: Integration with pandas-ta or talib for technical indicators.
  • Backtesting Core:
    • Event-driven backtesting engine.
    • Support for transaction costs, slippage simulation, and margin logic.
    • Performance metrics: ROI, Max Drawdown, Sharpe Ratio, Sortino Ratio, Win Rate.

3.3 AI Agent Core ("The Brain")

  • LLM Integration: Support for multiple models (OpenAI, Anthropic, Local LLMs via Ollama).
  • Market Sentiment Analysis: Analyze news headlines and social sentiment to adjust strategy parameters.
  • Strategy Generation: Agent can propose new code snippets for strategies based on natural language descriptions.
  • Explainability: Agent must explain why a specific trade was taken or recommended, citing mathematical principles or market conditions.
  • Memory System:
    • Short-term: Context window for current market session.
    • Long-term (Vector DB): Historical patterns, past successful trades, and learned rules.

3.4 Educational Module

  • Interactive Tutorials: Walkthroughs of how specific strategies work.
  • Math Visualization: UI components to visualize formulas (e.g., visualizing the Efficient Frontier).
  • Code Breakdown: "Click-to-explain" functionality for strategy code.

3.5 Execution Engine

  • Paper Trading: Simulated execution environment for validation.
  • Live Trading: API integration with exchanges for real order placement.
  • Risk Management: Hard stops, position sizing limits, and kill-switch functionality.

3.6 User Interface (UI)

  • Dashboard: Real-time chart visualization (TradingView widget), account balance, open positions.
  • Agent Chat: Chat interface to converse with the AI (e.g., "Analyze the trend of BTC for the last 4 hours").
  • Backtest Lab: Form to configure and run backtests, with detailed report visualization.
  • Strategy Editor: Code editor (Monaco Editor) for writing/modifying strategies in the browser.

4. Non-Functional Requirements

  • Modularity: Loose coupling between Data, Strategy, and Execution layers to allow swapping components.
  • Latency: Low-latency processing for real-time data ingestion and signal generation.
  • Scalability: Ability to monitor multiple assets and run multiple strategies concurrently.
  • Security: Secure handling of API keys (local encryption or environment variables, never stored in DB).
  • Observability: Comprehensive logging of all Agent decisions and system errors.

5. Implementation Phases

  1. Phase 1 (Foundation): Data ingestion, basic backtesting engine, simple UI.
  2. Phase 2 (AI Integration): LLM connection, sentiment analysis, basic chat interface.
  3. Phase 3 (Live Execution): Exchange integration, paper trading, risk management.
  4. Phase 4 (Advanced Agent): Autonomous strategy optimization, long-term memory.