Skip to content

jaredgrxss/Nexus

Repository files navigation

Nexus

Nexus: Algorithmic Trading Platform

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.


Table of Contents

  1. Features
  2. Architecture
  3. Getting Started
  4. Environment Variables
  5. Security
  6. Testing
  7. Contributing
  8. License

Features

  • 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.

Architecture

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 .env files 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.

Getting Started

Prerequisites

  • 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.

Installation

  1. Clone the repository:
git clone https://github.com/jaredgrxss/nexus.git
cd nexus
  1. Install dependencies:
python -m pip install --upgrade pip
pip install -r requirements.txt
  1. Set up environment files:
cp .env.example .env

Configuration

  1. Environment Setup
nano .env
python src/helpers/cloud/encrypt_env_file .env
  1. AWS Resources
  • Create SQS queues for inter-service communication
  • Configure SNS topics for event notifications
  • Store sensitive credentials in Secrets Manager
  1. GPG Setup
gpg --full-generate-key  # Create new keypair
gpg --list-secret-keys   # Note your key ID

Environment Variables

Variable 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

Security

  • 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

Testing

Run the test suite with coverage:

pytest --cov=src --cov-report=html
  • Unit tests: tests/unit
  • Integration/tests: tests/integration
  • Security tests: tests/security

Contributing

  1. Fork the repository
  2. Create your feature branch:
git checkout -b feature/new-strategy
  1. Add tests for new features
  2. Submit a pull request

License

Distributed under the MIT License. See LICENSE for more information

About

A proprietary algorithmic trading system written in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages