
Investo
Real-time Order Matching Engine with Live Candelstick Data
Investo simulates the core infrastructure of a real stock exchange — from order placement to trade execution. The platform runs a custom matching engine that pairs buy and sell orders using price-time priority, just like production exchanges. Two markets run live with dedicated market makers continuously adding liquidity, so there's always action in the orderbook.
Built for anyone who wants to see what happens behind the trade button — real-time WebSocket feeds push orderbook depth and price updates to the UI the moment a match happens, while candlestick charts aggregate live trade data to show market momentum as it forms.
System Architecture
Investo/How it works
A real-time stock exchange simulator. Each service in the pipeline is responsible for exactly one thing.

Built with WebSockets · Redis pub/sub · Prisma · Docker · Node.js
How to Scale
the Exchange
Six concrete problems in the current Investo architecture — what breaks, why it breaks, and exactly how to fix each one. Ordered by risk.
Your Node.js matching engine is single-threaded. One process holds all 100 orderbooks in memory. As order volume grows, the event loop maxes out — every market stalls together because they all share one CPU core.
Full Scaled Architecture
All six fixes applied together
fans out to browsers
Redis Streams
source of truth
Implementation Priority
Investo · Scaling Guide · WebSockets · Redis · Rust · Prisma · Docker
Insider Threats
in Investo
The most dangerous attacker already has your credentials. These are the five attacks that matter most — and how to stop them.
Developer with engine access modifies a user's in-memory balance directly. The withdrawal service trusts the engine's memory as source of truth — so the inflated balance passes the check and money leaves.
Five Things That Actually Matter
If you implement only these, you're ahead of most fintech startups
In-memory state can be modified by anyone with server access. Multi-region quorum consensus means a single compromised engine cannot influence withdrawals or balances.
Private keys that never leave the browser make server-side impersonation impossible. No signature = no order processed, regardless of who sends it or how.
A shadow engine owned by a separate team and comparing every match output is the only reliable way to catch algorithmic manipulation that leaves no other trace.
JWT secrets, event signing, and auth tokens should all use asymmetric cryptography. A public key cannot forge — only verify. Secrets that live in .env files will eventually leak.
Every control above can be bypassed by someone who can also delete the logs. Logs must be append-only, cryptographically chained, and shipped to a system no single developer can access.
"Verify everything.
Trust nothing implicitly."
Zero Trust Architecture · Investo Security Model
Investo · Threat Model · ECDSA · Quorum · HSM · Kafka · Canary Engine
