git clone https://github.com/cywf/AlphaNest.git
cd AlphaNest
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
cp .env.example .env
# Edit .env with your configuration
pytest tests/ -v
# In simulation mode (no actual trading)
python -m alphanest.core.bot
# Or using the installed command
alphanest
# Build the image
docker build -t alphanest:latest .
# Run with environment file
docker run --env-file .env alphanest:latest
# Or use docker-compose
docker-compose up -d
cd infra/terraform
# Initialize Terraform
terraform init
# Plan the deployment
terraform plan
# Apply the infrastructure
terraform apply
# Get ECR login
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com
# Build and tag
docker build -t alphanest:latest .
docker tag alphanest:latest <ecr-repository-url>:latest
# Push to ECR
docker push <ecr-repository-url>:latest
Key environment variables (see .env.example):
OPENAI_API_KEY: Your OpenAI API key (required for AI features)TRADING_ENABLED: Enable actual trading (false by default for safety)ENVIRONMENT: deployment environment (development/production)TRACKED_SYMBOLS: Comma-separated list of symbols to trackThe bot can be configured via environment variables or by modifying the configuration in src/alphanest/core/config.py.
# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=src/alphanest --cov-report=html
# Run specific test file
pytest tests/unit/test_config.py -v
AlphaNest/
├── src/alphanest/ # Main application code
│ ├── core/ # Core components (bot, config, AI)
│ ├── strategies/ # Trading strategies
│ ├── data/ # Data ingestion
│ ├── models/ # AI models
│ └── utils/ # Utilities
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── infra/ # Infrastructure as code
│ └── terraform/ # Terraform configurations
├── docs/ # Documentation
├── .github/ # GitHub workflows
└── requirements.txt # Python dependencies
# Set debug mode
export DEBUG=true
# Run with more verbose logging
python -m alphanest.core.bot
# Format code with black
black src/ tests/
# Lint with flake8
flake8 src/ tests/
# Type checking with mypy
mypy src/
⚠️ Important: By default, the bot runs in simulation mode with TRADING_ENABLED=false. This is intentional to prevent accidental trading.
See LICENSE file for details.