Flash Boys: Cracking The Money Code

By Deepak Bhalla Tue 19 July 2016 11 min read

Brad Katsuyama, an employee of the Royal Bank of Canada was based in the equities division on New York’s Wall Street. Like most of us with a simplistic view of the markets he believes accessing a Bloomberg terminal and typing in the ticker of a company gave him the current price of its stock. Why then when he tried to buy stocks at the offer prices did the offers vanish only to be replaced with a higher price? He wasn’t alone, like many large equities traders the bid offer you see on your screen is merely a suggestion.

Michael Lewis again leads us in to the world of finance, this time he takes a look at the world of High Frequency Trading (HFT). In Brad Katsuyama - the protagonist - Lewis is able to tell the story of the establishment of IEX, the hopeful stock exchange that is supposed to put a huge dent in the high frequency trader’s ability to game the system.

But do HFT’s really have an advantage, and why? Computer-driven trading accounts for an estimated 50 percent of all transactions in the stock market. Of that, a sizeable percentage is executed by so called High Frequency Trading firms who use esoteric speed networks to beat the market. HFT’s can make money in a number of ways:

  • Bid-Ask Arbitrage. The bid is the price for an immediate sale and an the offer is the price for immediate purchase. This strategy relies on the firms abilities to play on the the difference in prices for stocks between exchanges (the spread).
  • Flash Orders. Attract other algorithm traders to trade a stock and raise the price, taking an early position or use Bid-Ask arbitrage to gain a profit.
  • Iceberg and Sniffer - Detect other traders attempting execute large block trades (sometimes millions of shares executed over many smaller transactions) and raise the price by buying reducing the amount of that stock and raising the offer price.
  • By making markets. The basis of making markets is the buying and selling equities using limit orders1 to make profits on the bid-ask spread2 between exchanges. This method is by no means exclusive to HFT firms and is considered essential for functioning markets.
  • By providing liquidity. Firms are often paid to provide liquidity to exchanges by creating their own bid-ask spreads.

Its the Iceberg and Sniffer strategy that is the main focus of Flash Boys (although the book's name would imply flash orders, those are mentioned sparingly). The etymology is simple, Iceberg means a large trade and Sniffer is the algorithm that finds the trades (remember they have to separate algorithm traders like themselves from traders like pension funds executing iceberg trades). When a significant trade is made, the price jumps before the trade can be executed leaving the buyer with greater cost than anticipated.

Flash Boys

In the book Brad teams up with Ronan Ryan, an ex-communications employee, who joins RBC as head of high-frequency trading strategies. Together, they notice a distinct lack of understanding amongst their peers in how the stock exchanges function at a detailed level, and why they are all being made for fools, they move to develop their own understanding. The team goes on to conclude that high-frequency traders, working hand in hand with the exchanges, brokers and big banks, were ripping off investors to the tune of billions of dollars per year and implicitly allowing HFT firms to manipulate price.

They developed in insight in to how exchanges worked and found that if you were to buy a large order of stock you will most likely end up buying from multiple vendors. You would tell your broker "I want 25,000 of Vodafone Common Stock" and your broker would unknowingly route your order through several exchanges (who may have a few thousand of the share each) and one or several dark pools3.

The key advantage HFT firms had was the speed at which it could communicate with exchanges. Speed meant a HFT firm could transmit their order to an exchange before Katsuyama's. Say we place an order for 25,000 Vodafone shares to our broker. Our order gets routed to the brokers "Smart Order Router" (SOR) which decides to which exchanges our order will be sent for execution. It first directs our order to its own dark pool where it may be able to match up our order with a seller (A dark pool means no exchange fees for the broker and a larger margin). There we are able to purchase 4,000 shares from within the dark pool, but we want 25,000 shares, so our order goes back through the SOR to Exchange A & B to look for the other 21,000 shares. This trade is vulnerable to front running. When we purchased the 4,000 shares from the dark pool the HFT firm (which has paid access to the brokers dark pool) sniffed out our Iceberg trade. It sees the trade and uses its understanding of how the SOR operates (purchase from the cheapest exchange - in this case the dark pool - and then purchase from the exchange holding the lowest price stock) to front run our order to the other exchanges. It will submit at order to exchange A & B to buy all the Vodafone stock it thinks we will need, selling it back to us at a higher price. A speed visualisation between three major exchanges can be seen here. Front running only works because HFT's have access to faster network lines and is therefore able to execute their order at exchange before ours.

A large number of shares outstanding means that stock is in abundance, the more abundant a stock, the less likely you are to be squeezed on price as you attempt to buy a large number of shares. Katsuyama experienced both a jump in price and an inability to complete full orders. If he asked for 25,000 Vodafone shares he might only be able to buy 12,000 shares at a higher price in a single order. The price he paid for each share was over the price agreed because HFT firms would immediately sell the stock they front run for a profit, but why wasn't it in the HFT firm's interest to allow him to buy the other 13,000 shares? HFT firms are not out to profit from long positions and driving up the price of a stock might require significant investment. To inexpensively drive up the price without taking a long position HFT's would use cancelled orders to reduce the number of shares available during the order period (measured in microseconds). They momentarily tied up stock to drive simulate demand rather than purchase the stock themselves, making the stock unavailable for purchasing while Katsuyama's order was executed. If you are interested in a detailed millisecond by millisecond guide on how a trade like this can be front run check out the Nanex Blog here.

Katsuyama & Co. go on to found IEX (The Investors Exchange), technically a dark pool, hoping to be a public exchange like the London Stock Exchange. This “commercial heroism” is typical of Lewis' storytelling. He enjoys stories where the protagonist faced with a sizeable and corrupt system, defying the odds to make a change (see The Big Short). I can’t deny the formula’s appeal, and from Lewis’ explanation neither can you deny its effective us as a story telling framework. In one chapter Katsuyama goes on to tell both the SEC and the Wall Street Journal of his findings; he is left with little to show for it.

One likeable aspect of the book is the parallel storylines Lewis has become fond of. Lewis is constantly trying to convey the market's desperation to gain even fractions of seconds in speed. He showed this through the story of Spread Networks, who laid a 827-mile cable running through mountains and under rivers from Chicago to New Jersey only to reduce the journey time of data from 17 to 13 milliseconds. The second story is the much sadder tale of Sergey Aleynikov, a lead developer working on Goldman Sach’s HFT trading strategy division who was jailed for pushing proprietary code to a private code repository and leaving to start his own company. Self hosting proprietary code was an odd decision for any developer who’s ever read and signed a contract, even odder is the fact that Sergey never opened the repository once he left. He was jailed, released and then jailed again for this crime.

One of the annoying aspects of Lewis’s reporting is the lack of a voice to the antagonists. No one from the banks, The Wall Street Journal, or any of the accused exchanges seem to have a voice in the book. The SEC has a brief mention but remains firmly on the “side of evil” if the storyline is anything to go by.

I won’t spoil the book, but the story is well told and has some memorable moments. One such moment is the story of RBC’s Thor, an early-on iteration of a product designed to stop price jumps which receives honourable mention for its ability to set the trend in product naming throughout the industry. The book has some surprises too, some banks (who have been mentioned already) come off much better than you would immediately assume.

The question still remains, why do HFTs bother the small trader? A Bill Ackman might benefit from IEX but why would I worry from a few pennies loss? High-­frequency trading has also been able to narrow the spread between bid and ask prices, lowering the cost of trading. Do I, the small trader, gain a net benefit from the presence of HFT traders? Not from my view, I am almost certain HFT Firms are a net negative on the market, they operate with seemingly esoteric tools and make the markets far more deceptive than they need to be. If I purchase an equity I should be worried about the the company alone and not the means by which I bought it.

  1. A limit order is an order placed with a brokerage to buy or sell a set number of shares at a specified price or better.
  2. The bid is the price for an immediate sale and an the offer is the price for immediate purchase. The bid-ask spread is the difference between the two
  3. A Dark pool is a private exchange with much more lax regulation than a public exchange like LSE. In a dark pool trades do not have to be disclosed, they are called dark for their lack of transparency. Dark pools are not new and have been around since the 80’s, they accounted for a massive 40% of all trades in 2014. Despite their ominous name they do serve a particular purpose in allowing Banks to link buyers and sellers in large block trades without affecting the price of the stock. In effect they are a private buy-sell match making service that gets the buyer and seller a better price.
Deepak Bhalla