by 51bitquant
AI-Hedge-Fund for Crypto 🚀 AI-powered hedge fund for cryptocurrency trading, leveraging LLM agents for intelligent decision-making.
# Add to your Claude Code skills
git clone https://github.com/51bitquant/ai-hedge-fund-cryptoA next-generation algorithmic trading framework that leverages graph-based workflow architecture, ensemble technical analysis, and AI language models to make data-driven cryptocurrency trading decisions. This system employs a directed acyclic graph (DAG) of specialized nodes for multi-timeframe analysis, enabling sophisticated signal generation through weighted combinations of diverse trading strategies.
At its core, the system builds upon LangGraph's computational graph architecture to process market data through a pipeline of technical analysis nodes. Each strategy implements a BaseNode interface that processes multi-interval data for multiple assets simultaneously. The framework then aggregates these signals using adaptive weighting mechanisms, evaluates risk parameters, and formulates position management decisions through large language model (LLM) analysis.
The system stands out through its:
No comments yet. Be the first to share your thoughts!
Sample backtesting results showcasing how well-designed trading strategies can generate high-quality signals when implemented in this framework. The system's performance is driven by the quality of your strategies, with the framework enabling efficient implementation, LLM-based decision refinement, and multi-timeframe analysis:

These results demonstrate the system's ability to:
The system is built around a highly configurable directed acyclic graph (DAG) architecture, where data flows through various processing nodes. This architecture provides exceptional flexibility, allowing users to customize both the available strategies and the timeframes for analysis without modifying the core code.
At its heart, the system uses LangGraph to create a dynamic computational graph where:
The key innovation is that both the data nodes and strategy nodes are fully configurable via the config.yaml file,
allowing you to add, remove, or modify these nodes without changing the core architecture.

You can specify multiple timeframes for analysis in your configuration:
signals:
intervals: ["5m", "15m", "30m", "1h", "4h", "1d"]
The system will dynamically create separate data processing nodes for each timeframe, allowing strategies to analyze market behavior across multiple time horizons simultaneously. This multi-timeframe approach provides more robust signals by capturing both short-term and long-term market trends.

Similarly, you can specify which trading strategies to include:
signals:
strategies: ['MacdStrategy', 'RSIStrategy', 'BollingerStrategy']
The system will dynamically load and integrate only the specified strategies into the workflow graph. Each strategy is implemented as an independent node that:
This modular approach allows you to easily experiment with different combinations of strategies without rewriting any code. You can also create your own custom strategy modules and add them to the configuration.

The complete data flow works as follows:
This architecture provides several advantages:
⚠️ While Python 3.9+ should work, we recommend using Python 3.12 for full compatibility with the development environment.
git clone https://github.com/51bitquant/ai-hedge-fund-crypto.git
cd ai-hedge-fund-crypto
# Install uv if you don't have it
curl -fsSL https://install.lunarvim.org/uv.sh | sh
# create an venv with python 3.12
uv venv --python 3.12
# Activate the virtual environment
# For macOS/Linux:
source .venv/bin/activate
# For Windows (PowerShell):
.venv\Scripts\Activate.ps1
# For Windows (CMD):
.venv\Scripts\activate.bat
# Install dependencies using pyproject.toml and lockfile
uv pip sync
If you have more questions, feel free to check out the uv documentation
cp config.example.yaml config.yaml
cp .env.example .env
.env file:# Binance API keys (required for data access)
BINANCE_API_KEY=your-binance-api-key
BINANCE_API_SECRET=your-binance-api-secret
# For running LLMs hosted by openai (gpt-4o, gpt-4o-mini, etc.)
# Get your OpenAI API key from https://platform.openai.com/
OPENAI_API_KEY=your-open-ai-key
GROQ_API_KEY=your-open-ai-key
OPENROUTER_API_KEY=your-open-ai-key
ANTHROPIC_API_KEY=your-anthropic-api-key
GOOGLE_API_KEY=your-google-api-key
The system is configured through the config.yaml file. Here's what each setting means:
mode: backtest # Options: backtest, live
start_date: 2025-04-20 # Start date for backtesting
end_date: 2025-05-01 # End date for backtesting
primary_interval: 1h # Main timeframe for analysis
initial_cash: 100000 # Starting capital
margin_requirement: 0.0 # Margin requirements for short positions
show_reasoning: false # Whether to show strategy reasoning
show_agent_graph: true # Whether to show the agent workflow graph
signals:
intervals: ["30m", "1h", "4h"] # Timeframes to analyze
tickers: ["BTCUSDT", "ETHUSDT"] # Trading pairs
strategies: ['MacdStrategy'] # Strategies to use
model:
name: "gpt-4o-mini" # config your model
provider: "openai" # config your llm provider, support openai, groq, openrouter,gemini,anthropic,ollama
# base_url: "https://api.openai.com/v1" # not required, but if you want to set the base_url
Supported providers include OpenAI, Groq, OpenRouter, Gemini, Anthropic, and Ollama. Most LLMs are compatible with the OpenAI SDK, so you can often switch models by simply adjusting the model name and base_url to match the desired provider.