Packet Path/

What Trading Is (and Why Being Fastest Wins)

Low-Latency HFT Network Engineer · Module 1: Latency From Zero

Lesson 2 of 7

Foundations⏱ 25 min

Prerequisites: What "Latency" Actually Means

What you'll be able to do: explain what a stock exchange does, why two people seeing the same price creates a race, and what a speed-focused trading firm actually sells.

Imagine an auction where the rule is simple: whoever shouts a price first gets the sale. Two people both want to buy the same painting for fifty dollars. One is standing next to the auctioneer; the other is across the room. The price is fair to both — but the person across the room can never win, because their voice takes longer to arrive. Electronic markets work exactly like that auction, except the "room" is a data center and the "shouting" travels as messages through cables. Whole companies exist just to stand closer to the auctioneer, measuring their lead in millionths of a second. This lesson explains what that auction actually is — and why standing closest wins.

Here's the puzzle.

Scenario. Two traders, A and B, both want to buy the same shares at the same price the instant it becomes available. The exchange awards the shares to whichever trader's message arrives first. Trader A is fast to react but has a slower connection; Trader B reacts later but has a faster connection. Only one of them walks away with the shares.

Given artifacts. Two exhibits — one per trader — plus the exchange's rule. There is no tie: the exchange's clock decides to the microsecond.

Trader A — reacts instantly but has the slower pipe Trader A Sees price at t = 0 μs Pipe: 10 μs The exchange — awards the shares to the first message to arrive Exchange First arrival wins the shares Trader B — reacts 2 microseconds later but has the faster pipe Trader B Sees price at t = 2 μs Pipe: 9 μs (1 μs faster) 10 μs 9 μs Exchange rule: at the same price, the first message to arrive gets the shares. No ties — the clock decides.

Your task: Compute each trader's arrival time at the exchange (show the math), name the winner, and state the ONE variable Trader B would need to change to win instead.

Workspace. Analyze-and-answer: a text box for your arrival-time math (e.g. "A: 0 + 10 = …"), the winner, and B's one change. Submitting is optional — the ritual below is what unlocks the worked answer.

Hint ladder.

Hint 1 — where to look There are two separate waits in this race, and the winner is decided by their sum. One wait is "how long before the trader even knows the price exists." The other is "how long the message takes to travel." Find both numbers for each trader.
Hint 2 — what to compare Arrival time = (time the trader sees the price) + (pipe travel time). For A: 0 μs + 10 μs. For B: 2 μs + 9 μs. Add them up — don't let the "1 μs faster pipe" distract you from the other term.
Hint 3 — the mechanism Being fast has two halves: knowing sooner and traveling sooner. B's pipe already beats A's — so if B still loses, the losing half must be the other one. Which number would B have to shrink, and what does that number represent in the real world?

Commitment ritual. ☐ "I've attempted this challenge and thought it through." Check the box (or submit an answer above) and the worked answer in S7 reveals. Nothing is graded; the struggle is the point.

Checking the box reveals the worked answer in S7 below. Returning learners stay unlocked.

The matchmaker in the middle

A stock exchange (in plain English: a central meeting place that matches buyers with sellers, enforcing one set of rules for everyone) exists for one job: pairing up. A buyer says "I'll pay $50 for 100 shares." A seller says "I'll accept $50 for 100 shares." The exchange introduces them and records the trade. Without it, buyers and sellers would have to find each other one by one — slow, unfair, and chaotic.

The exchange also publishes the current prices for everyone to see. That published price is the starting gun for every race in this track: the moment a new price appears, every trader who wants those shares starts running. Same information, same instant, same finish line — the only difference is how fast each runner's message travels.

Why this matters for the challenge: the exchange in the diagram is the finish line, and its rule — first arrival wins — is the entire game. Everything else is just computing arrival times.

The best price wins; the first arrival gets it

Two rules run every electronic market. First, the best price rule: if you're willing to pay more than anyone else (or sell for less), you jump to the front of the line. Price beats everything. Second, the time priority rule: among everyone offering the same price, whoever's message arrived first gets served first. This is the auction from the hook — same bid, earliest shout wins.

Time priority is why this track exists. When thousands of traders all want the same shares at the same price, the exchange doesn't split them evenly or pick favorites — it serves them in arrival order. Being second by a microsecond means watching someone else take the shares you wanted. There's no prize for close.

Why this matters for the challenge: A and B offer the same price, so the best-price rule can't separate them. Time priority decides — which is exactly the arrival-time math you're doing.

Two halves of being fast

Speed in trading has two halves, and beginners always forget one. Half one is reaction: how quickly you notice the new price and decide to act — the "seeing" delay. Half two is travel: how quickly your message crosses the cables to the exchange — the "pipe" delay. Your total time is the sum, and a weakness in either half loses the race.

Trader B in the challenge is the classic trap: a faster pipe, but a slower reaction. It feels like B should win — "1 μs faster pipe!" — but races are won by totals, not by one fast leg. Real trading firms obsess over both halves: faster computers to decide sooner, and shorter, straighter cables to travel sooner. Lesson 3 will put a dollar value on each microsecond saved in either half.

Why this matters for the challenge: Hint 3 points at this directly. Name both halves for each trader, add them, and the winner is arithmetic.

What a speed-focused firm actually sells

A trading firm (in plain English: a company that buys and sells in markets for its own profit, using computers instead of humans shouting) that competes on speed sells exactly one product: being first. It doesn't make a better gadget or offer friendlier service. Its edge is arriving at the exchange a few microseconds before everyone else, thousands of times a day, and collecting the tiny profit on each win.

That sounds almost too simple to be a business — until you multiply. A few cents of profit per win, times thousands of wins per day, times hundreds of days per year. The whole industry is that multiplication. And because the prize goes to the first arrival, the competition never settles: the moment one firm gets faster, everyone else must match it or start losing every race. This endless arms race is why firms spend millions to save single microseconds — the subject of the next lesson.

Why this matters for the challenge: B's "one variable to change" is a business decision as much as a math answer — it's literally what these firms spend their millions on.

The race: two messages, one finish line Trader A Sends at t = 0 μs Trader B Sends at t = 2 μs Exchange first arrival wins pipe: 10 μs pipe: 9 μs (faster!) A arrives at 10 μs — WINS B arrives at 11 μs — loses
  1. Step 1 of 4: The price appears. Trader A sees it instantly (t = 0 μs) and sends; Trader B won't even know about it for 2 μs.
  2. Step 2 of 4: A's message travels its 10 μs pipe. B's message hasn't been sent yet — B is still "seeing" the price.
  3. Step 3 of 4: B finally sends at t = 2 μs down a faster 9 μs pipe — but the 2 μs head start A already banked is bigger than the 1 μs B saves in travel.
  4. Step 4 of 4: A arrives at 10 μs, B at 11 μs. Time priority gives the shares to A. Races are won by totals, not by the fastest leg.
🔒 The worked answer is hidden until you commit...

Check yourself — nothing here is graded. Wrong answers are the useful ones; each explains why.

Question 1. What is a stock exchange's core job?

Question 2. Put these events in the order they happen in a winning trade:

Question 3. Two traders offer the SAME price for the same shares. Who gets them?

Question 4. A new trader, C, joins the race. C sees the price at t = 1 μs and has a 12 μs pipe. A (0 + 10) and B (2 + 9) race as before. Who wins now, and what does it prove?

Next: Why Microseconds Are Money — you now know how the race is won; next you'll calculate what a single microsecond of victory is actually worth in dollars.