A production-grade, high-performance trading platform for the Solana ecosystem
Built with modern microservices architecture, event-driven design, and optimized for low-latency trading operations.
This platform demonstrates professional-level backend engineering for crypto trading:
- ⚡ High Performance: Sub-100ms API responses, real-time WebSocket updates
- 🏗️ Microservices Architecture: 6 independent services with clear responsibilities
- 📊 Event-Driven: Redis Streams for reliable inter-service communication
- 🔒 Production-Ready: Error handling, retries, monitoring, and observability
- 🎨 Developer Experience: Well-documented APIs, TypeScript strict mode, clean code
┌─────────────────────────────────────────────────────────────┐
│ API GATEWAY │
│ (REST API + WebSocket Hub) │
└──────────────┬──────────────────────────────┬───────────────┘
│ │
┌───────▼────────┐ ┌────────▼────────┐
│ PRICE SERVICE │ │ ORDER SERVICE │
│ (Market Data) │ │ (Trading) │
└───────┬────────┘ └────────┬────────┘
│ │
└──────────┬───────────────────┘
│
┌─────────▼─────────┐
│ REDIS STREAMS │
│ (Event Bus) │
└─────────┬─────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌─────▼─────┐ ┌─────▼──────┐ ┌─────▼─────┐
│ PORTFOLIO │ │ ANALYTICS │ │ WEBHOOK │
│ SERVICE │ │ SERVICE │ │ SERVICE │
└───────────┘ └────────────┘ └───────────┘
- Runtime: Bun.js - 3-4x faster than Node.js
- Language: TypeScript 5.3 (strict mode)
- Monorepo: Turborepo with pnpm workspaces
- Blockchain: Solana (via @solana/web3.js + Jupiter SDK)
- Database: PostgreSQL 16 (ACID compliance for financial data)
- Cache/Events: Redis 7 (with Redis Streams)
- API Framework: Fastify (high-performance HTTP server)
- WebSocket: Native WebSocket implementation
- Logging: Pino (structured, high-performance logging)
- Containerization: Docker + Docker Compose
- CI/CD: GitHub Actions (coming soon)
- Monitoring: Prometheus + Grafana (optional)
high-performance-trading/
├── apps/
│ ├── api-gateway/ # Main API entry point (REST + WebSocket)
│ ├── price-service/ # Real-time price aggregation
│ ├── order-service/ # Trade execution via Jupiter
│ ├── portfolio-service/ # Portfolio tracking & P&L
│ ├── analytics-service/ # Trading analytics
│ └── webhook-service/ # Event notifications
│
├── packages/
│ ├── shared-types/ # TypeScript types & interfaces
│ ├── solana-client/ # Solana blockchain wrapper
│ ├── redis-client/ # Redis wrapper
│ ├── db-client/ # PostgreSQL client
│ ├── event-bus/ # Redis Streams abstraction
│ ├── logger/ # Structured logging (Pino)
│ └── config/ # Configuration management
│
├── infrastructure/
│ ├── docker/ # Docker configurations
│ └── postgres/ # Database schemas & migrations
│
├── docs/
│ ├── ARCHITECTURE.md # System architecture details
│ ├── API.md # API documentation
│ └── SETUP.md # Setup & deployment guide
│
├── docker-compose.yml # Local development stack
├── turbo.json # Turborepo configuration
└── package.json # Root package.json
# 1. Clone the repository
git clone https://github.com/yourusername/high-performance-trading.git
cd high-performance-trading
# 2. Install dependencies
pnpm install
# 3. Copy environment variables
cp .env.example .env
# 4. Edit .env with your settings
# - Add Helius/QuickNode API keys (optional, can use public RPC)
# - Generate JWT secret: openssl rand -base64 32
# 5. Start infrastructure (Postgres + Redis)
docker-compose up -d
# 6. Wait for services to be healthy (30 seconds)
docker-compose ps
# 7. Start development servers
pnpm dev# Check API Gateway health
curl http://localhost:3000/health
# Expected response:
# {"status":"ok","timestamp":1234567890}
# Check logs
docker-compose logs -f- Learning Roadmap - Complete guide to learn Solana development
- Architecture - System design and decisions (coming soon)
- API Reference - Complete API documentation (coming soon)
- Setup Guide - Detailed setup instructions (coming soon)
- Monorepo structure with Turborepo
- Docker Compose development environment
- PostgreSQL schema with migrations
- Shared TypeScript types
- Structured logging (Pino)
- Configuration management
- API Gateway (in progress)
- Price Service (in progress)
- Order Service (in progress)
- Portfolio Service (planned)
- Analytics Service (planned)
- Webhook Service (planned)
- JWT authentication
- Rate limiting
- WebSocket real-time updates
- Jupiter swap integration
- Multi-wallet support
- P&L calculation
- Price alerts
- API documentation (Swagger)
- Load tests
- CI/CD pipeline
pnpm dev# API Gateway
cd apps/api-gateway && bun run dev
# Price Service
cd apps/price-service && bun run devpnpm buildpnpm testpnpm lint
pnpm format- API Response Time: p95 < 100ms
- WebSocket Latency: < 50ms
- Order Execution: < 2 seconds
- Price Update Frequency: 1-5 seconds
- Concurrent Users: 100+ (tested with k6)
- Database Queries: < 50ms
See .env.example for all available variables.
Key variables:
# Solana
SOLANA_RPC_URL=https://api.devnet.solana.com
HELIUS_API_KEY=your_key # Optional, for better performance
# Database
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=trading_platform
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT
JWT_SECRET=your_secret_keyThis is a personal project for learning and portfolio purposes, but suggestions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
MIT License - see LICENSE file for details
- Solana Foundation - Blockchain infrastructure
- Jupiter Aggregator - DEX aggregation
- Helius - RPC provider
- Trojan Trading - Inspiration for this project
Wesley Santos
- LinkedIn: linkedin.com/in/wesleymassine
- GitHub: @wesleymassine
Built with ❤️ for the Solana ecosystem