Design a Stock Broker System
Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2024-09-25
Problem Statement
Design a Stock Broker Platform Backend that enables users to:
•Buy and sell stocks in real time
•View live stock prices and charts
•Manage their portfolio and watchlist
•View transaction history and performance
•Handle KYC, regulations, and funds settlement
The system should ensure low-latency order execution, high reliability, and regulatory compliance. It must be scalable to support millions of users and trades per second.
🎯 Functional Requirements:
1.User Account Management
•Signup, KYC, fund management (deposit/withdrawal)
2.Market Data Feed
•Real-time price updates (tick-level)
•Support for multiple exchanges (e.g., NSE, NYSE)
3.Order Management
•Place buy/sell orders (market, limit, stop-loss)
•Cancel/modify orders
•Track order status
4.Portfolio Tracking
•Holdings, average price, P&L (realized/unrealized)
•Intraday vs long-term segregation
5.Transaction History
•Order book, trade book, ledger view
6.Alerts & Notifications
•Price threshold alerts, order execution, fund updates
7.Watchlist & Insights
•Track selected stocks, news, and analytics
⚙️ Non-Functional Requirements:
•Ultra low latency (<10ms) for order matching
•Scalability to support millions of concurrent users
•High availability and disaster recovery
•Security: encryption, 2FA, secure APIs
•Audit logging for compliance