Home/Study Plan/Rate & Flow Estimation
🔢

Fermi Estimation

Rate & Flow Estimation

Medium2–3 hrsRateFlowLittle's LawThroughput

Overview

Rate and flow problems require you to reason about steady-state quantities using Little's Law (L=λW) and bottleneck analysis. In trading contexts, this appears when estimating market impact (how quickly can you trade X shares?), order flow (how many messages does an exchange handle per second?), or hardware throughput (can our co-location server handle the tick data volume?). The key tools are Little's Law, unit conversion chains, and identifying the tightest constraint.

How to Recognize

  • 'How fast does X happen?'
  • 'How many Y happen per second/day/year?'
  • Queue length and wait time problems
  • 'How long does it take to...'
  • Any question about throughput or capacity

Step-by-Step Approach

  1. 1.Use Little's Law: L = λW (queue length = arrival rate × wait time)
  2. 2.Identify the bottleneck — the rate-limiting step determines the whole system rate
  3. 3.Anchor on a known rate (heartbeats/min, typing speed, internet bandwidth)
  4. 4.Convert units carefully: sec → min → hour → day → year
  5. 5.For economies of scale: double the throughput, roughly double the cost

Key Formulas

01L=λWL = \lambda W — Little's Law (avg queue length = arrival rate × avg wait)
02Throughput=min(capacity of each step in pipeline)\text{Throughput} = \min(\text{capacity of each step in pipeline})
031 yearπ×107 seconds1\text{ year} \approx \pi \times 10^7\text{ seconds} (useful mnemonic)
04Heartbeats/lifetime70×60×24×365×803×109\text{Heartbeats/lifetime} \approx 70 \times 60 \times 24 \times 365 \times 80 \approx 3 \times 10^9

Worked Examples

0Quick Example
How fast can you transfer 1TB over the internet? Broadband ≈ 100 Mbps = 12.5 MB/s. 1TB = 10^6 MB. Time = 10^6/12.5 ≈ 80,000 sec ≈ 22 hours. With fiber (1 Gbps): ~2.2 hours.

Problem

Estimate the peak message rate (orders + cancels + trades) at the NYSE or NASDAQ on a typical high-volume day.

Solution

1

US equity market trades roughly 10B shares/day total across all exchanges. NYSE + NASDAQ handle roughly half: ~5B shares.

2

Average trade size: ~200 shares. Trades executed: 5B/200 = 25M trades/day on the two main exchanges.

3

For each executed trade, there are roughly 20–50 order/cancel messages (most orders are cancelled). Messages ≈ 25M × 30 = 750M messages/day.

4

Trading hours: 6.5 hours = 23,400 seconds. Peak hours (first/last 30 min) see 3× average. Avg rate: 750M/23400 ≈ 32k msg/sec. Peak: ~100k msg/sec.

5

Actual: NASDAQ processes ~500k–1M messages/second at peak. We're off by ~5–10×, but the right order of magnitude.

Answer

Peak rate: ~100k–1M messages/second. Our estimate (100k) is a lower bound; actual systems handle ~10× more due to cancellations and quote updates.

Common Mistakes

  • !

    Forgetting that 1 year ≈ 3×10^7 seconds (not 10^8 or 10^6). Quick check: 365 × 24 × 3600 ≈ 31.5M ≈ π×10^7.

  • !

    Not identifying the bottleneck. The rate is always limited by the slowest step — find it first.

  • !

    Confusing 'orders' and 'trades'. In equity markets, ~95% of orders are cancelled; executed trade rate is much lower than total message rate.

Practice Problems

Click "Show Answer" to reveal
1

Estimate the number of heartbeats in a human lifetime.

Hint: Average heart rate: ~70 bpm. Average lifespan: ~80 years. Convert years to minutes.
2

Estimate the bandwidth required to stream all trades and quotes from all US equity exchanges in real time.

Hint: ~10B shares/day traded, but quotes are 100–1000× more data than trades. Estimate number of quote updates per day, then data per message.

Only works in the Electron app

<webview> is an Electron-only tag. Run npm run electron:dev to use this.

25:00Focus
0

25 min focus · 5 min break · long break every 4 sessions

The Ultimate Grind