Experiments · Nobody Writes Code Anymore · Chapter 4

Knight Capital’s forty-five minutes

The Knight Capital trading glitch of 2012

Theme
Try itKnight Capital’s forty-five minutes
The eighth server the technician never reached, and the server comparison the firm did not have. The totals are from the US Securities and Exchange Commission’s findings.

Everything is computed in your browser; nothing is sent anywhere.

About this experiment

On 1 August 2012 Knight Capital installed new trading code. It had to go onto eight servers, and the technician reached seven. The new code reused a switch that had once turned on an old program called Power Peg. On the eighth server the switch woke Power Peg up, and Power Peg no longer had the counter that used to tell it when to stop.

In the experiment you install the code server by server and then open the market at 9:30. Server 8 stays on the old code and the counters start to run. In 45 minutes 212 client orders turn into more than four million orders sent to the market and 397 million shares bought and sold, with a loss of more than 460 million dollars. The totals are from the findings of the US Securities and Exchange Commission. Between them the counters grow evenly to show the scale, because the chapter does not say how the orders went minute by minute.

Then tick the box that compares the eight servers before the open. Knight had no such check. With it, the mismatch on server 8 is found, that server stays off until it has the new code, and the 212 client orders are filled as usual. In 2012 the system was stopped after 45 minutes, and within a year Knight had merged into another firm.

The chapter uses Knight as the most expensive example of one change reaching a part of the system nobody looked at. The code that did the damage was old, forgotten and still installed. Writing the new version was the cheap part of that morning.

From the book

Nobody Writes Code Anymore · Chapter 4

Change One Thing Without Breaking Everything

Next to this experiment in the chapter
There is not a single stupid decision in this story if you look at each one separately. The new code, by all accounts, was written correctly. Reusing a free switch is ordinary practice. The technician made the kind of mistake all people make. The disaster arose at the joints: between the change of 2005 and the code nobody checked after it, between the new code and the old code someone forgot to delete, between the switch and its previous meaning, between eight servers that were supposed to be identical. Each link looked sound on its own, and together they brought the company down.

If this is your team

If agents write code on your team and every fix breaks something next to it, we can go through it on a call. The first consultation is free and takes thirty minutes.

Book a consultation →