Ecosystem
LIVE
Q3 2025 - Present

PaperTrade

High-frequency algorithmic execution engine for equities.

Overview

PaperTrade is a low-latency trading simulation engine capable of processing thousands of ticks per second. It integrates directly with Polygon.io and Alpaca APIs to provide real-time market data and simulated execution against live order books.

Why It Exists

Existing paper trading platforms are either too slow, simulating execution at the minute level, or lock you into a heavy monolithic UI. I needed an API-first engine that could backtest and forward-test algorithmic strategies with millisecond precision without risking real capital.

Engineering Challenges

High-Throughput Race Conditions

Handling concurrent order executions when the market price swings rapidly. If two strategies attempt to execute massive block trades simultaneously, ensuring ledger consistency at high throughput required moving from standard database locks to a Redis-backed optimistic locking model.

WebSocket Data Streaming

Broadcasting live tick data to thousands of potential client connections without bottlenecking the main execution thread. Achieved by offloading Pub/Sub duties to a dedicated Redis cluster.

Core Stack

FastAPI
React
PostgreSQL
WebSockets
Redis

Performance

< 5ms
Execution Latency
15,000
Peak TPS
99.99%
Uptime

System Architecture

High-level overview of the data flow and infrastructure orchestration.

Client Application
Load Balancer
API Gateway
Auth Service
Primary Database / Ledger

PostgreSQL for Ledger

Used PostgreSQL to guarantee ACID compliance for all simulated transactions and account balances.

TradeoffSlower write speeds compared to NoSQL alternatives, mitigated by heavy Redis caching and batch writes.

FastAPI over Node.js

Chose FastAPI (Python) for the core engine to leverage the extensive quantitative finance libraries (Pandas, NumPy) natively.

TradeoffPython's GIL complicates multi-threading, requiring a multi-process uvicorn setup to utilize full CPU cores.
🤝

Ready to scale your next idea?

These systems were built from scratch with zero compromises. I can do the same for your team.