Skip to content

Latest commit

Β 

History

History
91 lines (63 loc) Β· 2.23 KB

File metadata and controls

91 lines (63 loc) Β· 2.23 KB

Cofieu

Modern C#/.NET 8 Port of the Cofieu with Blazor Web UI

A multi-agent financial analysis and trading system powered by LLMs (OpenAI), integrating with Alpaca for trading and data, Finnhub for fundamentals, and news sources.


πŸš€ Quick Start

Prerequisites

  • .NET 8.0 SDK
  • Docker (optional)
  • API Keys: OpenAI, Alpaca (Paper/Live), Finnhub

Running Locally

  1. Configure Keys: Edit appsettings.json or set environment variables (see .env.example for reference).

  2. Run the Web UI:

    dotnet run -- webui
    # Opens at http://localhost:7860

    CLI mode is also available:

    dotnet run -- analyze --tickers NVDA,AMD

Running with Docker 🐳

  1. Setup Environment:

    cp .env.example .env
    # Edit .env and fill in your API keys
  2. Run with Compose:

    docker compose up --build -d

    The Web UI will be available at http://localhost:7860. Logs are persisted to the trading-logs volume.


πŸ—οΈ Architecture

  • Frontend: Blazor Server (Server-side rendering, real-time SignalR)
  • Backend: .NET 8, Dependency Injection, Serilog
  • Core Logic:
    • TradingGraph: Direct Acyclic Graph (DAG) orchestration of agents
    • AlpacaService: Async wrapper for Alpaca.Markets SDK
    • DataFlows: Services for News, Reddit, Fundamentals, Technicals
    • Agents: LLM-powered analysts (Market, Macro, Risk, etc.)

πŸ§ͺ Testing

The solution includes a comprehensive test suite using xUnit, bUnit (Blazor components), and Moq.

dotnet test

Current Status: 75 tests passed, 0 failed.


πŸ“‚ Project Structure

  • App/ β€” Application entry point and DI setup
  • WebUI/ β€” Blazor components (Pages, Panels) and services
  • Services/ β€” Backend services (Alpaca, DataFlows)
  • Core/ β€” Graph engine and LLM integration
  • Agents/ β€” Analyst logic
  • Cofieu.Tests/ β€” Unit and integration tests

πŸ”§ Configuration

Configuration is handled via appsettings.json and supports environment variable overrides (e.g., TradingConfig__LLM__QuickThinkModel).

Key settings:

  • TradingConfig: LLM models, debate rounds, risk parameters
  • ApiKeys: Service credentials