Budget day: when the exchange becomes your bottleneck
transcript
Budget day. 11:40. A capital-gains tax change is announced. Orders flood in. Then the exchange slows down. And your servers stop mattering.
Your order rate jumps to 30,000 a second. The exchange, under its own load, slows its replies. From 5 milliseconds to 800. And you cap orders in flight at 18,000. 90 sessions, 200 unanswered each.
Here's the law that decides everything now. Throughput is in flight, divided by latency. 18,000 in flight, over 0 point 8 seconds. That's 22,500 orders a second. Your ceiling. At 5 milliseconds, the same cap allowed 3 point 6 million. The exchange is now your limit.
Your ceiling: 22,500 a second. Demand: 30,000. The queue grows by 7,500 every second. But here's the catch. About 30 percent of people retry after three seconds of spinner. If retries became new orders: 39,000 a second. Every one a duplicate position.
So shed the reads first. Charts, depth, reports. A new order queued past 2 seconds? Not sent. The price it saw has moved. Cancels and exits jump the queue. A delayed cancel can become an unwanted fill. And one key per tap. A retry just reads back the same order.
In flight divided by latency. That's your real capacity. When the exchange slows, your ceiling drops. Know it before Budget day.
Full breakdown in the lecture.