An open API service indexing awesome lists of open source software.

https://github.com/h-vance/algorithmic-trading-engine

Low-latency execution framework supporting quant-driven strategies, featuring sub-10ms response times, dynamic risk parity modeling, and optimized order flow across fragmented markets.
https://github.com/h-vance/algorithmic-trading-engine

algorithmic-trading aws cpp execution-engine finance fintech hft low-latency python redis risk-parity trading-bot

Last synced: 25 days ago
JSON representation

Low-latency execution framework supporting quant-driven strategies, featuring sub-10ms response times, dynamic risk parity modeling, and optimized order flow across fragmented markets.

Awesome Lists containing this project

README

          

# Quantitative Algorithmic Trading Platform

Institutional-grade algorithmic trading platform optimized for low-latency execution on the Hyperliquid exchange. This system provides a secure, hardened, and scalable infrastructure for managing automated trading strategies with real-time risk monitoring and high-frequency execution patterns.

[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
[![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=white)](https://reactjs.org/)
[![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/)
[![Express.js](https://img.shields.io/badge/Express.js-000000?style=for-the-badge&logo=expressdotjs&logoColor=white)](https://expressjs.com/)
[![Google Cloud](https://img.shields.io/badge/Google_Cloud-4285F4?style=for-the-badge&logo=googlecloud&logoColor=white)](https://cloud.google.com/)
[![Hyperliquid](https://img.shields.io/badge/Hyperliquid-000000?style=for-the-badge&logo=hyperliquid&logoColor=white)](https://hyperliquid.xyz/)
[![Terraform](https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform&logoColor=white)](https://www.terraform.io/)
[![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![Redis](https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white)](https://redis.io/)

## System Architecture

The platform is built as a decoupled, microservices-oriented monorepo to ensure fault tolerance and ultra-low latency.

- **Web Frontend (`apps/web`)**: A high-performance React dashboard for strategy management, real-time performance tracking, and system health monitoring.
- **Backend API (`apps/server`)**: A Node.js/TypeScript Express-based middleware layer managing authentication, strategy configuration, and coordination between the frontend and the execution layer.
- **Execution Engine (`apps/execution-engine`)**: A specialized Python/FastAPI microservice optimized for high-frequency interaction with the Hyperliquid API, utilizing asynchronous connection pooling and circuit-breaker patterns.
- **Shared Packages (`packages/shared`)**: Common TypeScript utilities, types, and business logic used across the Node.js components.

## Institutional Hardening

### Security & Access Control
- **Least Privilege IAM**: Service accounts are scoped to specific resources (e.g., resource-level Secret Manager access) rather than project-wide roles.
- **Edge Security**: Integrated Google Cloud Armor with pre-configured WAF rules to mitigate SQLi, XSS, and DDoS attacks.
- **Secure Secret Management**: Automated secret handling via GCP Secret Manager with zero-exposure lifecycle policies in Terraform.
- **Auth Guardrails**: Multi-layer authentication including wallet-based signing and staging-bypass keys for environment isolation.

### Reliability & Performance
- **Connection Optimization**: Hardened PostgreSQL connection pooling with read/write separation and SSL encryption.
- **Fault Tolerance**: Circuit breaker patterns implemented in the execution layer to prevent cascading failures during exchange outages.
- **Cost-Effective Compute**: Standardized on Cloud Run Gen2 for serverless efficiency, with optional C3-high-memory instance groups for extreme low-latency requirements.

## Key Features

- **Low-Latency Execution**: Optimized WebSocket integration with Hyperliquid for sub-millisecond order response times.
- **Risk Management**: Real-time equity tracking, automated circuit breakers, and position-sizing safeguards.
- **Infrastructure as Code**: Production environments defined and managed via Terraform (GCP/AWS) for repeatable, secure deployments.
- **Observability**: Integrated health checks, performance monitoring, and centralized logging.

## Technical Stack

- **Languages**: TypeScript, Python 3.12+
- **Frontend**: React, Vite, Tailwind CSS
- **Backend**: Node.js, Express, Vitest
- **Execution Engine**: Python, FastAPI, UV, Pytest
- **Database**: PostgreSQL (Prisma ORM), Redis
- **DevOps**: Docker, Terraform, Google Cloud Platform, GitHub Actions

## Getting Started

### Prerequisites
- Node.js 20+ and `pnpm`
- Python 3.12+ and `uv`
- Docker and Docker Compose

### Installation
1. Clone the repository:
```bash
git clone https://github.com/harrison-vc/algorithmic-trading-app.git
cd algorithmic-trading-app
```
2. Install dependencies:
```bash
pnpm install
```
3. Set up the execution engine:
```bash
cd apps/execution-engine
uv sync
```

### Development
- Start the full stack in development mode:
```bash
pnpm dev
```
- Run tests:
```bash
pnpm test
```