Skip to content

HKUSTDial/DeepFund

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’°πŸ’° DeepFund πŸ”₯πŸ”₯

arXiv Python Demo DeepWiki

Will LLMs Be Professional At Fund Investment?

This project serves as an ideal solution to the above key question. We evaluate the trading capability of LLM across various financial markets given a unified environment. The LLM shall ingest external information, drive a multi-agent system, and make trading decisions. The LLM performance will be presented in a trading arena view across various dimensions.

Arena

🏁 Car-racing is for illustration only. LLM performance is subject to the real market.
‼️ This project is for research purposes only, it DOES NOT TRADE.

Updates

  • 2025-07-03: Visit paradoox.ai and join waitlist to get early access to our product-ready release.
  • 2025-06-20: Our vision paper is accepted by IJCAI 2025 FinLLM Workshop.
  • 2025-06-09: DeepFund & Arena Leaderboard is available for demonstration.
  • 2025-05-24: Our project paper is released on arXiv.

Contact Us

This project aims to be a long-term research project. We are adding more particular analysts, expanding market coverage and building dashboard to deliver fresh insights.

  • General Inquiries: Mr. Changlun Li, cli942[at]connect.hkust-gz.edu.cn
  • Research Collaboration: Prof. Yuyu Luo, yuyuluo[at]hkust-gz.edu.cn

Framework

Framework

Setup Environment

  1. Choose an environment manager:

  2. Clone the repository:

git clone https://github.com/HKUSTDial/DeepFund.git
cd DeepFund
  1. Create a virtual env from the env configuration file:

    • If you are using Anaconda:
      conda env create -f environment.yml # if using Conda
    • If you are using uv:
      uv sync # detects pyproject.toml, create an venv at project root, and install the dependencies
      source .venv/bin/activate # or .venv\Scripts\activate for windows to activate the venv
  2. Set up environment variables:

# Create .env file for your API keys (OpenAI, DeepSeek, etc.)
cp .env.example .env

Connect to Database

To better track the system performance, DeepFund uses a database to timely monitor the trading status. Besides, it also stores the LLM reasoning results for future analysis and traceback.

Option 1: Use Supabase

DeepFund connects to Supabase by default.

  • Supabase is a PostgreSQL-compatible Cloud Database
  • You can create a free account on Supabase website.
  • Refer to src/database/supabase_setup.sql to create the tables.
  • Update the SUPABASE_URL and SUPABASE_KEY in .env file.

Option 2: Use SQLite

SQLite is a lightweight database that stores data locally.

  • Run the following command to create a sqlite database in the path
cd src
python database/sqlite_setup.py
  • You may need to install VSCode Extension SQLite Viewer to explore the database.
  • Path: src/assets/deepfund.db

Relation Diagram

DeepFund system gets supported by four elementary tables:

  • Config: store user-defined configurations
  • Portfolio: record the portfolio updates
  • Decision: record the trading decisions from managers
  • Signal: record the signals generated from analysts

The ERD is generated by Supabase - DB Schema Visualizer.

DeepFund ERD

Running the System

Enter the src directory and run the main.py file with configuration:

cd src
python main.py --config xxx.yaml --trading-date YYYY-MM-DD [--local-db]

trading-date coordinates the trading date for the system. It can be set to historical trading date till the last trading date. As the portfolio is updated daily, client must use it in chronological order to replay the trading history. Switch to local DB by adding --local-db option in the command line.

Configurations

Configs are saved in src/config. Below is a config template:

# Deep Fund Configuration
exp_name: "my_unique_exp_name"

# Trading settings
tickers:
  - ticker_a
  - ticker_b

# Analysts to run, refer to graph.constants.py
planner_mode: true/false
workflow_analysts:
  - analyst_a
  - analyst_b
  - analyst_c

# LLM model settings, refer to llm/inference.py
llm:
  provider: "provider_name" 
  model: "model_name"

Planner Mode

We use planner_mode configs to switch the mode:

  • True: Planner agent orchestrates which analysts to run from workflow_analysts.
  • False: All workflow analysts are running in parallel without orchestration.

Remarks

  • exp_name is unique identifier for each experiment. You shall use another one for different experiments when configs are changed.
  • Specify --local-db flag to use SQLite. Otherwise, DeepFund connects to Supabase by default.

Project Structure

deepfund/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py                   # Main entry point
β”‚   β”œβ”€β”€ agents/                   # Agent build and registry
β”‚   β”œβ”€β”€ apis/                     # APIs for external financial data
β”‚   β”œβ”€β”€ config/                   # Configuration files
β”‚   β”œβ”€β”€ database/                 # Database setup and helper
β”‚   β”œβ”€β”€ example/                  # Expected output
β”‚   β”œβ”€β”€ graph/                    # Workflow, prompt, and schema
β”‚   β”œβ”€β”€ llm/                      # LLM providers
β”‚   β”œβ”€β”€ util/                     # Utility functions and helpers
β”œβ”€β”€ environment.yml               # For Conda
β”œβ”€β”€ README.md                     # Project documentation
β”œβ”€β”€ ...

πŸ“š Additional Resources

Technical Guide - Detailed information for developers including:

  • Analyst breakdown and system architecture
  • System dependencies and API requirements
  • Advanced usage: Adding new analysts and LLM providers

Acknowledgements

The project gets inspiration and supports from the following projects:

Star History

Star History Chart

Citation

If you find it useful, please cite it as follows:

  • Project Paper
@misc{li2025timetravel,
      title={Time Travel is Cheating: Going Live with DeepFund for Real-Time Fund Investment Benchmarking}, 
      author={Changlun Li and Yao Shi and Chen Wang and Qiqi Duan and Runke Ruan and Weijie Huang and Haonan Long and Lijun Huang and Yuyu Luo and Nan Tang},
      year={2025},
      eprint={2505.11065},
      archivePrefix={arXiv},
      primaryClass={cs.CE},
      url={https://arxiv.org/abs/2505.11065}, 
}
  • Vision Paper
@misc{li2025deepfund,
      title={DeepFund: Will LLM be Professional at Fund Investment? A Live Arena Perspective}, 
      author={Changlun Li and Yao Shi and Yuyu Luo and Nan Tang},
      year={2025},
      eprint={2503.18313},
      archivePrefix={arXiv},
      primaryClass={cs.MA},
      url={https://arxiv.org/abs/2503.18313}, 
}

About

Pilot for Your Next Fund Investment

Resources

License

Stars

Watchers

Forks

Contributors 6

Languages