2.5 KiB
2.5 KiB
Crypto Quick Start Guide
Installation (2 minutes)
# 1. Install crypto dependencies
pip install ccxt glassnode python-dotenv
# 2. Test the installation
python test_crypto_data.py
Basic Usage (Copy & Paste)
Get Bitcoin Price
from tradingagents.dataflows.ccxt_vendor import get_crypto_ohlcv
btc_price = get_crypto_ohlcv("BTC/USDT", timeframe="1d", limit=7)
print(btc_price)
Get Crypto Fundamentals
from tradingagents.dataflows.messari_vendor import get_crypto_fundamentals_messari
btc_fundamentals = get_crypto_fundamentals_messari("bitcoin")
print(btc_fundamentals)
Switch to Crypto Mode
from tradingagents.crypto_config import get_crypto_config
from tradingagents.dataflows.config import set_config
# Enable crypto mode
crypto_config = get_crypto_config()
set_config(crypto_config)
# Now all data calls use crypto vendors automatically
Run Examples
# Run comprehensive examples
python examples/crypto_analysis_example.py
# Run tests
python test_crypto_data.py
Supported Assets
Via CCXT (100+ exchanges)
- BTC/USDT, ETH/USDT, SOL/USDT
- Any trading pair on Binance, Coinbase, Kraken
Via Messari
- bitcoin, ethereum, solana, cardano, avalanche, polkadot
- 500+ crypto assets
Via Glassnode (requires API key)
- BTC, ETH (on-chain metrics)
API Keys (Optional)
Most features work without API keys. Add keys only for:
- Trading (CCXT authenticated endpoints)
- On-chain analytics (Glassnode)
# .env file
BINANCE_API_KEY=your_key
GLASSNODE_API_KEY=your_key
What Works Without API Keys?
✅ CCXT - All public market data ✅ Messari - Basic fundamentals and news ❌ Glassnode - Requires paid subscription
Common Issues
Import Error
pip install ccxt glassnode python-dotenv --upgrade
Exchange Connection Error
# Test connectivity
import ccxt
exchange = ccxt.binance()
print(exchange.fetch_ticker('BTC/USDT'))
Next Steps
- ✅ Phase 1 Complete - Data infrastructure
- 🔜 Phase 2 - Adapt agents for crypto
- 🔜 Phase 3 - Backtesting framework
- 🔜 Phase 4 - Paper trading
- 🔜 Phase 5 - Live deployment
Documentation
- Full details:
CRYPTO_PHASE1_README.md - Migration plan:
CRYPTO_MIGRATION_PLAN.md - Examples:
examples/crypto_analysis_example.py - Tests:
test_crypto_data.py
Support
- CCXT Docs: https://docs.ccxt.com/
- Glassnode API: https://docs.glassnode.com/
- Messari API: https://messari.io/api/docs