Skip to content

naikmubashir/AgentVest

Repository files navigation

AI Hedge Fund

This is a proof of concept for an AI-powered hedge fund. The goal of this project is to explore the use of AI to make trading decisions. This project is for educational purposes only and is not intended for real trading or investment.

This system employs several crypto-focused agents working together:

  1. Vitalik Buterin Agent - The Ethereum Visionary, focuses on protocol fundamentals and network effects
  2. Willy Woo Agent - On-chain analyst who uses data-driven metrics for network valuation
  3. Barry Silbert Agent - Crypto advocate focused on institutional positioning and ecosystem building
  4. Raoul Pal Agent - Macro bull who analyzes exponential growth and "Everything Code" thesis
  5. Nick Szabo Agent - Cryptographic rationalist emphasizing smart contracts and decentralization
  6. Arthur Hayes Agent - Contrarian macro trader who capitalizes on market dislocations
  7. Pomp (Anthony Pompliano) Agent - Bitcoin maximalist focusing on sound money and asymmetric upside
  8. Michael Saylor Agent - Bitcoin maximalist who studies digital scarcity deeply
  9. Chris Burniske Agent - Protocol analyst who examines network effects and long-term growth
  10. Changpeng Zhao (CZ) Agent - Ecosystem builder focused on DeFi/Web3 and platform economics
  11. Mike Novogratz Agent - Institutional adoption expert analyzing macro trends
  12. Lyn Alden Agent - Macro + crypto fundamentals analyst with rigorous Fed policy analysis
  13. Valuation Agent - Calculates the intrinsic value of crypto assets and generates trading signals
  14. Sentiment Agent - Analyzes market sentiment and generates trading signals
  15. Fundamentals Agent - Analyzes fundamental data and generates trading signals
  16. Technicals Agent - Analyzes technical indicators and generates trading signals
  17. Risk Manager - Calculates risk metrics and sets position limits
  18. Portfolio Manager - Makes final trading decisions and generates orders

Note: the system does not actually make any trades.

Disclaimer

This project is for educational and research purposes only.

  • Not intended for real trading or investment
  • No investment advice or guarantees provided
  • Creator assumes no liability for financial losses
  • Consult a financial advisor for investment decisions
  • Past performance does not indicate future results

By using this software, you agree to use it solely for learning purposes.

Table of Contents

How to Install

Before you can run the AI Hedge Fund, you'll need to install it and set up your API keys. These steps are common to both the full-stack web application and command line interface.

1. Clone the Repository

git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund

2. Set Up Your API Keys

Create a .env file for your API keys:

# Create .env file for your API keys (in the root directory)
cp .env.example .env

Open and edit the .env file to add your API keys:

# For running LLMs hosted by openai (gpt-4o, gpt-4o-mini, etc.)
OPENAI_API_KEY=your-openai-api-key

# For running GigaChat (use gigachat credentials)
GIGACHAT_API_KEY=your-gigachat-api-key

# For running LLMs hosted by groq (deepseek, llama3, etc.)
GROQ_API_KEY=your-groq-api-key

# For getting cryptocurrency data from Binance (optional - public endpoints work without keys)
BINANCE_API_KEY=your-binance-api-key
BINANCE_API_SECRET=your-binance-api-secret

# For getting cryptocurrency market cap and news (optional)
COINGECKO_API_KEY=your-coingecko-api-key
CRYPTOPANIC_API_KEY=your-cryptopanic-api-key

Important: You must set at least one LLM API key (OPENAI_API_KEY, GROQ_API_KEY, ANTHROPIC_API_KEY, or DEEPSEEK_API_KEY) for the hedge fund to work.

Cryptocurrency Data: The system uses Binance API for cryptocurrency price data. Public endpoints work without an API key for basic functionality. For enhanced features (news, market cap), you can optionally add CoinGecko and CryptoPanic API keys.

How to Run

⌨️ Command Line Interface

For users who prefer working with command line tools, you can run the AI Hedge Fund directly via terminal. This approach offers more granular control and is useful for automation, scripting, and integration purposes.

Screenshot 2025-01-06 at 5 50 17 PM

Choose one of the following installation methods:

Using Poetry

  1. Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
  1. Install dependencies:
poetry install

Using Docker

  1. Make sure you have Docker installed on your system. If not, you can download it from Docker's official website.

  2. Navigate to the docker directory:

cd docker
  1. Build the Docker image:
# On Linux/Mac:
./run.sh build

# On Windows:
run.bat build

Running the AI Hedge Fund (with Poetry)

poetry run python src/main.py --ticker AAPL,MSFT,NVDA

Running the AI Hedge Fund (with Docker)

# Navigate to the docker directory first
cd docker

# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA main

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA main

You can also specify a --ollama flag to run the AI hedge fund using local LLMs.

# With Poetry:
poetry run python src/main.py --ticker AAPL,MSFT,NVDA --ollama

# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --ollama main

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --ollama main

You can also specify a --show-reasoning flag to print the reasoning of each agent to the console.

# With Poetry:
poetry run python src/main.py --ticker AAPL,MSFT,NVDA --show-reasoning

# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --show-reasoning main

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --show-reasoning main

You can optionally specify the start and end dates to make decisions for a specific time period.

# With Poetry:
poetry run python src/main.py --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 

# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 main

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 main

Running the Backtester (with Poetry)

poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA

Running the Backtester (with Docker)

# Navigate to the docker directory first
cd docker

# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA backtest

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA backtest

Example Output: Screenshot 2025-01-06 at 5 47 52 PM

You can optionally specify the start and end dates to backtest over a specific time period.

# With Poetry:
poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01

# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 backtest

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 backtest

You can also specify a --ollama flag to run the backtester using local LLMs.

# With Poetry:
poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA --ollama

# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --ollama backtest

# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --ollama backtest

🖥️ Web Application

The new way to run the AI Hedge Fund is through our web application that provides a user-friendly interface. This is recommended for most users, especially those who prefer visual interfaces over command line tools.

Screenshot 2025-06-28 at 6 41 03 PM

For Mac/Linux:

cd app && ./run.sh

If you get a "permission denied" error, run this first:

cd app && chmod +x run.sh && ./run.sh

For Windows:

# Go to /app directory
cd app

# Run the app
\.run.bat

That's it! These scripts will:

  1. Check for required dependencies (Node.js, Python, Poetry)
  2. Install all dependencies automatically
  3. Start both frontend and backend services
  4. Automatically open your web browser to the application

Detailed Setup Instructions

For detailed setup instructions, troubleshooting, and advanced configuration options, see:

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Important: Please keep your pull requests small and focused. This will make it easier to review and merge.

Feature Requests

If you have a feature request, please open an issue and make sure it is tagged with enhancement.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published