Robinhood is a brokerage app that lets users trade stocks, options, and crypto, routing their orders to market makers or exchanges. It offers commission-free trading and makes money mainly through payment for order flow.
Background: Financial Markets
Before diving into system design, it’s important to understand a few fundamental financial concepts.
Core Terminology
- Symbol (Ticker) A short abbreviation used to uniquely identify a stock. Examples: META, AAPL
- Order: An instruction to buy or sell a stock. Orders can be categorized into different types based on execution behavior.
Order Types
- Market Order: An order to buy or sell a stock immediately at the current market price.
- Specifies only the number of shares
- No control over execution price
- Prioritizes speed of execution
- Limit Order: An order to buy or sell a stock at a specified price.
- Specifies both number of shares and target price
- May not execute immediately
- Can remain open until filled or cancelled
Role of Robinhood
Robinhood functions as a brokerage system, not an exchange.
- It accepts and manages user orders
- It routes orders to external systems (exchanges or market makers)
- It provides market data to users
Robinhood does not match orders itself — it relies on external exchanges for execution.
Functional Requirements
- Users can see a list of stocks as well as live stock prices
- Users can manage orders (make order, cancel order, etc..)
Non-Functional Requirements
- Prioritize strong consistency for order management so users always see accurate, up-to-date order states.
- Scale to handle high trading volume (e.g., ~20M DAU, ~5 trades/user/day, thousands of symbols).
- Maintain low latency for price updates and order placement (target <200ms).
- Minimize external exchange connections by efficiently sharing limited, costly data feeds.
Data Model
- User (the one who trades stocks in Robinhood)
- Symbol (stock being traded, like AAPL or TSLA)
- Order (an order created by user, like buy 50 shares of AAPL or sell 100 shares of TSLA)
API Design
1. User should be able to view up-to-dated stock as well their prices
We need a GET endpoint like GET /stocks/:name -> Symbol
2. Users can place orders
We need a POST endpoint for order creation
POST /order -> Order { symbol: TSLA action: BUY price: 420 numberOfShares: 1000 }
An DELETE order for canceling order
DELETE /order/:orderID Response: success | fail
3. Users can view orders
GET /orders -> order []