A field guide to high-frequency trading

Where the nanoseconds go

High-frequency trading is a race measured in billionths of a second. This page walks the path of a single trade, from a packet on the wire to an order at the exchange, and shows what each step costs.

Light in fibre
4.90µs/km
Light through air
3.34µs/km
One nanosecond of fibre
20cm
FPGA tick-to-trade
~300ns

01 · The latency ladder

Nine rungs, nine orders of magnitude

Every bar is on a log scale, so each step to the right is ten times slower. A trading firm lives on the left half of this chart.

  1. One CPU clock cycle (4 GHz)The smallest tick a processor can count.
    0.25 ns
  2. L1 cache readData already sitting next to the core.
    1 ns
  3. 1 metre of fibreWhy firms pay for the rack closest to the exchange.
    4.9 ns
  4. Main memory (DRAM) readA cache miss costs a hundred cycles or more.
    100 ns
  5. FPGA tick-to-tradeMarket data in, order out, decided in hardware.
    300 ns
  6. Kernel-bypass software tick-to-tradeTuned C++ reading the network card directly.
    2 µs
  7. Standard Linux network round tripThe operating system adds copies and context switches.
    20 µs
  8. 100 km of fibreRoughly the hop between two nearby data centres.
    490 µs
  9. A human blinkEverything above happens inside it, many times over.
    150 ms

Figures are typical orders of magnitude for comparing scales, not benchmarks. Real systems vary with hardware, exchange and how hard they are tuned.

02 · Tick to trade

One packet in, one order out

Tick-to-trade is the clock that starts when market data arrives and stops when your order leaves. These are the seven things that happen in between.

  1. Wire

    Exchange multicasts a market-data packet. Light in glass covers about 20 cm per nanosecond.

  2. NIC

    The network card timestamps the packet in hardware and hands it over without waking the kernel.

  3. Decode

    Feed handler parses the binary protocol into a book update: price, size, side, sequence number.

  4. Book

    The local order book is updated. Gaps in sequence numbers trigger a recovery request.

  5. Signal

    Strategy logic reads the new state: imbalance, queue position, a lead-lag move on a related contract.

  6. Risk

    Pre-trade checks: position limits, price bands, fat-finger caps. Mandatory, and it has to be fast too.

  7. Order

    Encode the order in the exchange format and push it back down the wire. The clock stops here.

03 · The speed limit

Glass is slow. Air is faster.

Light in a fibre-optic cable travels about a third slower than through air. That gap is why firms built chains of microwave towers between financial centres. Pick a route or drag the distance.

Routes (straight-line distance)

Fibre, one way5.63 ms
Microwave (air), one way3.84 ms

Air wins by 1.80 ms each way. That is 5,984 full FPGA tick-to-trades.

Physics floor for a perfectly straight path. Real cables bend and real towers relay, so actual routes are slower.

04 · Glossary

The words you'll hear

Tick-to-trade
Time from a market-data packet arriving to your order leaving. The number HFT shops optimise.
Co-location
Renting rack space inside the exchange data centre so the cable to the matching engine is metres, not kilometres.
Kernel bypass
Reading packets straight from the network card in user space, skipping the operating system network stack.
FPGA
A reprogrammable chip. Logic is wired as circuits instead of run as instructions, so latency is fixed and tiny.
Market making
Quoting both a bid and an ask, earning the spread, and managing the inventory that builds up.
Queue position
Your place in line at a price level. At the same price, the earlier order is filled first.
Jitter
Variation in latency. A system that is fast on average but slow one time in a thousand loses on that one time.
Microwave links
Radio towers between cities. Light travels about a third faster through air than glass, so they beat fibre.