Alpha Engine X
Production-grade algorithmic stock market simulation platform with demand-driven volatility modeling and rate limiting.
Signature: Demand-driven pricing · atomic updates · rate-limited execution
Key Verified Performance Metrics
01 System Context & Problem
Standard paper-trading platforms either lag behind real markets or crash under heavy transaction volumes due to database lock contentions.
02 Architecture & Implementation
Layered backend (Flask Blueprints) isolating HTTP request handling from business validations and database repositories, rendering on a dynamic React client.
Engineering Approach: Engineered a custom trading engine that simulates real-time price volatility and executes atomic, multi-document stock purchases without write lock timeouts.
03 Technical Decisions & Trade-offs
Core Architectural Decision
Selected MongoDB for storing complex, nested transaction histories, and used atomic operations (`$inc`, `$push`) for instant balance updates and concurrency safety.
Constraints & Incurred Trade-off
Chose short polling (2s intervals) over WebSockets to reduce persistent connection overhead, allowing the server to handle more concurrent requests on basic hardware.
04 Scalability, Throughput & Security
Implemented rate-limiting (Flask-Limiter) and IP-based request restriction to prevent API abuse, making it resilient to DDOS and transaction spam.
Achieved average query execution times of under 18ms for balance verification and stock checkout.
05 Verified Outcomes
- Built a concurrent trading platform with live prices updating every 2 seconds across 15 companies, keeping trades consistent through atomic MongoDB transactions, rate limiting, and duplicate-order prevention.
- Architected a layered Flask backend (routes -> services -> repositories) over a 7-collection MongoDB schema with admin audit trails, demand-driven volatility modeling, automated P&L, and brokerage fee logic.