Nexus is a robust and modular algorithmic trading platform designed to execute various trading strategies, such as mean reversion and momentum, in a scalable and secure manner. The platform integrates with AWS services (SQS, SNS, Secrets Manager) for message queuing, event-driven architecture, and secure secret management. It is designed to run both locally and in cloud environments.
- Modular Design: Easily add new trading strategies as independent services.
- Event-Driven Architecture: Uses AWS SQS and SNS for message queuing and event handling.
- Secure Secret Management: Integrates with AWS Secrets Manager for secure storage of sensitive information.
- Environment Agnostic: Runs seamlessly in both local and cloud environments.
- Logging and Monitoring: Built-in logging for debugging and monitoring.
The platform is structured as follows:
- Services: Each trading strategy (e.g., Reversion, Momentum) is implemented as a separate service.
- Helpers: Common utilities like logging, AWS client management, and environment decryption.
- Environment Management: Uses
.envfiles for configuration, with support for encrypted environment files for added security. - AWS Integration: Leverages AWS SQS, SNS, and Secrets Manager for message handling and secret management.
- Python 3.12+
- AWS account with access to SQS, SNS, and Secrets Manager.
- AWS CLI configured with valid credentials.
- GPG for encrypting/decrypting environment files.
- Clone the repository:
git clone https://github.com/jaredgrxss/nexus.git
cd nexus- Install dependencies:
python -m pip install --upgrade pip
pip install -r requirements.txt- Set up environment files:
cp .env.example .env- Environment Setup
nano .env
python src/helpers/cloud/encrypt_env_file .env- AWS Resources
- Create SQS queues for inter-service communication
- Configure SNS topics for event notifications
- Store sensitive credentials in Secrets Manager
- GPG Setup
gpg --full-generate-key # Create new keypair
gpg --list-secret-keys # Note your key IDVariable Description Required
AWS_ACCESS_KEY_ID AWS IAM access key Yes
AWS_SECRET__ACCESS_KEY AWS IAM secret key Yes
DATA_SNS_ARN ARN for market data topic Yes
BROKER_ACCESS_KEY Encrypted via secrets manager Yes
BROKER_SECRET_ACCESS_KEY Logging verbosity No
- Encrypted Secrets: Production credentials stored in AWS Secrets Manager
- Environment Encryption:
# Decrypt for local development
python src/helpers/env_helpers.py decrypt .env.gpg- IAM Policies: Least-privilege access for AWS resources
- Audit Logging: All trades logged to S3 bucket with versioning
Run the test suite with coverage:
pytest --cov=src --cov-report=html- Unit tests:
tests/unit - Integration/tests:
tests/integration - Security tests:
tests/security
- Fork the repository
- Create your feature branch:
git checkout -b feature/new-strategy- Add tests for new features
- Submit a pull request
Distributed under the MIT License. See LICENSE for more information
