Skip to content

Repository files navigation

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

About

AI Powered Stock Trading

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages