HIGH-FREQUENCY
TRADING
falling. You analyze a million occurrences of this falling event, and along
with some of the greatest minds you
know, you discover gravity. It’s perfect: you can model it, define it, measure it, and predict it. You test it with
your colleagues and say, ‘I will drop
this apple from my hand, and it will
hit the ground in 3. 2 seconds,’ and it
does. Then two weeks later, you go to
a large conference. You drop the apple
in front of the crowd… and it floats up
and flies out the window. Gravity is no
longer true; it was, but it is not now.
That’s HFT. As soon as you discover it,
you have only of few weeks to capitalize
on it; then you have to start all over.”
the hft technology stack
What follows is a high-level overview
of the modern HFT stack. It is broken
into components, though in a number
of shops these components are encapsulated in a single piece of hardware,
often as FPGA.
Collocation. The first step in HFT
is to place the systems where the exchanges are. Light passing through
fiber takes 49 microseconds to travel
10,000 meters, and that is all the time
available in many cases. In New York,
there are at least six data centers you
need to collocate in to be competitive
in equities. In other assets (for exam-
ple, foreign exchange), you need only
one or two in New York, but you also
need one in London and probably one
in Chicago. The problem of collocation
seems straightforward:
1. Contact data center.
2. Negotiate contract.
3. Profit.
The details, however, are where the
first systems problem arise. The real
estate is extremely expensive, and the
cost of power is an ever-crushing force
on the bottom line. A 17.3-kilowatt
cabinet will run $14,000 per month.
7
Assuming a modest HFT draw of 750
watts per server, 17 kilowatts can be
taken by 23 servers. It’s also important
to ensure you get the right collocation. In many markets, the length of
the cable within the same building is a
competitive advantage. Some facilities
such as the New York Stock Exchange
(NYSE) data center in Mahwah, NJ,
have rolls of fiber so that every cage has
exactly the same length of fiber running to the exchange cages.
3
Networking. Once the servers are
collocated, they need to be connect-
ed. Traditionally this is done via two
methods: data-center cross connects
(single-mode or multimode fiber); and
cross-data-center WAN links.
The Cross Connect and NAT. Inside
the data center are multiple exchanges
or market-data feeds. Each endpoint
must conform to the exchange transit
network. This is a simple Network Address Translation (NAT) problem and
can be tackled at the switch level, as
shown in Figure 1. Multiple vendors
(for example, Arista2) offer hardware-based NAT at the port level. For some
marketplaces (foreign exchange) there
may be as many as 100 such NAT endpoints within a single data center.
The key to the internal NAT problem
is the core nature of trading: correlated
bursts. These bursts are what make
HFT networks so ridiculously difficult.
Figure 2 is a screenshot of an internal
monitoring application that shows the
packet-per-second rates for a (small)
collection of symbols moving together
during an ISM announcement. The Institute of Supply Management (ISM)
manufacturing composite index is a
diffusion index calculated from five of
the 11 subcomponents of a monthly
survey of purchasing managers at approximately 300 manufacturing firms
in the U.S. At 14:00 EDT the ISM announcement is made, and a burst occurs. Bursts like this are common and
happen multiple times a day.
As the world becomes more interconnected, and assets are more closely
linked electronically, these bursts can
come from anywhere. A change in U.K.
employment will most certainly affect
the GBP/USD rate (currency rates are
like relative credit strength). That in
turn affects the electronic U.S. Treasury
market, which itself affects the options
market (the risk-free rate in our calculations has changed). A change in op-
figure 3. WAn links: high-throughput path and lower-throughput fast path.
Colo 2
Microwave
10GbE
Fiber
10GbE
Fiber
Fiber
Colo 1
Millimeter Wave
Colo 3
Microwave
figure 4. feed handler parsing market-data feeds.
Fe
e
d
Ha
n
dl
e
r
Encode in
internal structure
Construct
Order Book
Data
Parse Market
Data
Parse Market
Data
Parse Market
Data
Receive Data
Off Wire
Receive Data
Off Wire
Receive Data
Off Wire
Receive Data
Off Wire
Raw Market Feed
Raw Market Feed
Raw Market Feed
Raw Market Feed
Normalized Feed