System Design
Stock Exchange - Zerodha, Groww

Stock Exchange - Zerodha, Groww

Design a system for a stock exchange like Zerodha that allows traders to buy and sell stocks, bonds, and other securities. The system should be able to handle a large number of transactions and provide real-time updates to traders on market movements and their investments.

Example:

Suppose we need to build a stock exchange system like Zerodha, which has 2 million registered traders and processes 3 million transactions per day. Traders should be able to trade stocks, bonds, and other securities and receive real-time updates on their investments.

Functional Requirements:

  1. Traders should be able to buy and sell stocks, bonds, and other securities.
  2. The system should be able to handle a large number of transactions and provide real-time updates to traders on market movements and their investments.
  3. Traders should be able to view their account balances, trade history, and other relevant information.
  4. The system should support a variety of order types, such as limit orders, market orders, and stop-loss orders.
  5. The system should have a robust matching engine to match buyers and sellers efficiently.
  6. The system should have a user-friendly interface for traders to access and trade on the platform.
  7. The system should provide access to historical price and volume data for traders to make informed investment decisions.
  8. The system should provide a comprehensive set of trading tools and charts for traders to perform technical analysis.

Non-functional Requirements:

  1. The system should be highly available and fault-tolerant, with a minimum of 99.99% uptime.
  2. The system should be secure, with strong encryption and authentication measures to protect sensitive user data and prevent unauthorized access.
  3. The system should be scalable, able to handle increased traffic and transactions as the number of users grows.
  4. The system should have a low latency to provide real-time updates to traders.
  5. The system should be able to handle a high volume of concurrent users and transactions.

Assumptions:

  1. The system assumes that traders have valid identification and are authorized to trade on the platform.
  2. The system assumes that traders are not engaging in fraudulent or illegal activities on the platform.
  3. The system assumes that traders have a basic understanding of financial markets and trading.

Estimated Usage:

  1. The system should be able to handle 5 million registered traders.
  2. The system should be able to handle 10 million transactions per day.
  3. The system should have a response time of less than 100 milliseconds for user requests.