Knight Capital: The Deploy That Lost $440 Million in 45 Minutes

On August 1, 2012, Knight Capital ran new code on seven of its eight servers. The eighth ran something else, and 45 minutes later $440 million was gone.

Knight Capital: The Deploy That Lost $440 Million in 45 Minutes

At 8:01 on the morning of August 1, 2012, a system inside Knight Capital's offices in Jersey City emailed a group of staff. The message mentioned an order router called SMARS and an error: "Power Peg disabled." Ninety-six more like it arrived before the opening bell. Nobody acted on them.

This is the story of the 45 minutes that followed, when one server that missed a software update cost a 17-year-old firm $440 million. People file it under typos. There was no typo, and I think that makes it worse.

The biggest firm most people had never heard of

Knight was founded in 1995, went public in 1998, and by 2000 was worth $4.8 billion at its peak. Its business was market making: standing in the middle of other people's trades. By 2012 its market-making unit was executing about 10 percent of all US share volume, according to Bloomberg's reporting at the time. If you placed a market order at a retail brokerage that summer, there was a fair chance Knight was on the other side. TD Ameritrade sent it 9 percent of its NYSE-listed market orders the quarter before. Stifel sent 38 percent.

The chief executive was Thomas Joyce, who had seen software bite before. In June 2002, three days after he started the job, a flaw sent out sell orders in Knight's own stock and knocked it down more than 50 percent during the day before exchanges cancelled the trades. Ten years later, in the spring of 2012, Knight lost $35 million in the technical mess of Facebook's first day of trading on Nasdaq, and Joyce publicly criticized how Nasdaq handled it.

Then it was his turn.

Code that had been dead since 2003

SMARS was the piece of software that took a customer's order (the "parent") and broke it into smaller "child" orders sent out to the exchanges. Buried inside it was an old function called Power Peg. Knight had stopped using Power Peg in 2003. Nobody deleted it. It sat there, dormant, waiting for a flag that nobody would ever set.

In 2005, Knight moved the part of SMARS that counted how many shares had been filled to an earlier point in the code. Nobody retested Power Peg afterwards, because why test something you do not use? The effect, according to the SEC's account, was that the old function could no longer recognize when an order had been filled. If it ever ran again, it would have no way to know when to stop.

For seven years that did not matter at all.

Seven servers out of eight

In July 2012 the New York Stock Exchange was preparing to launch its Retail Liquidity Program, meant to give small investors better prices, on August 1. Knight wanted in, so it wrote new code for SMARS. To switch the new code on, its developers reused an old flag. The one that used to call Power Peg.

Deployment started on July 27 and went out in stages over several days. SMARS ran on eight servers. A technician copied the new code to seven of them.

That is the whole mistake. No second person checked the work, and Knight had no written procedure saying a second person had to. Seven servers now read the flag as "run the new retail code." The eighth still read it the way it had in 2003.

As someone who ships software for a living, this is the part I cannot read comfortably. Nothing here is exotic. A manual copy across a handful of machines, an old flag given a new meaning, a function nobody had the heart to delete. I have seen every one of those ingredients in ordinary projects where the worst outcome is a broken web page.

9:30 AM: the eighth server wakes up

The 97 emails came first, between 8:01 and the open, triggered by orders arriving ahead of the bell in pre-market hours. They were not built as alarms, so they were treated like any other automated mail.

At 9:30 the market opened and the retail orders started to flow. On seven servers, everything worked. On the eighth, each order that arrived with the flag set woke up Power Peg, which began firing child orders into the market and, because it could no longer count fills, kept firing.

Manoj Narang, who ran the trading firm Tradeworx, later described what that looked like from outside: Knight was buying at the offer and selling at the bid, over and over, paying the spread each time. He called it death "by small cuts." Prices move because of orders, and these orders had no opinion behind them at all. A small stock called Wizzard Software went from $3.50 to $14.76.

The NYSE's chief executive said the exchange contacted Knight "within minutes." Inside Knight, people could see the damage but not the cause. So they did the reasonable thing and suspected the new code. According to Doug Seven's account of the SEC's findings, they uninstalled it from the seven servers where it had been deployed correctly. The flag was still arriving on the orders. Now all eight servers answered it with Power Peg.

The fix was the bug, applied seven more times.

10:15 AM: the bill

It took 45 minutes to shut the thing down. In that time SMARS had been asked to handle 212 customer orders. It sent out millions, which produced more than 4 million executions in 154 stocks, over 397 million shares in total. Knight was left holding about $3.5 billion of stock it never meant to buy in 80 names, and was short about $3.15 billion in 74 others.

Then came the detail that sealed it. After the 2010 flash crash, exchanges had adopted clear rules for when bad trades get cancelled. Under those rules the NYSE voided only trades 30 percent or more away from the opening price. That covered six of the 140 securities it reviewed. Everything else stood.

Knight sold the positions to Goldman Sachs and booked a $440 million pre-tax loss. Its cash balance at the end of June had been $365 million. The stock, which closed at $10.33 the day before, fell 75 percent in two days to $2.58.

Joyce went on Bloomberg Television on August 2. "Technology breaks," he said. "It ain't good. We don't look forward to it."

The weekend the firm was sold

Customers started routing orders elsewhere. Analysts at CLSA said bankruptcy was possible without new money.

The money arrived over that weekend, and it was expensive. Six investors, led by Jefferies and including Getco, Blackstone, Stifel, TD Ameritrade and Stephens, put in $400 million for preferred stock that converted into about 267 million common shares at roughly $1.50 each. That handed them most of the company. In December 2012 Knight agreed to merge with Getco, one of its rescuers, and the deal closed in July 2013.

That October the SEC fined Knight $12 million, its first case under a 2010 rule requiring brokers to have controls on the orders they send to market. The regulator's Daniel Hawke said Knight's failure to ask the right questions "had catastrophic consequences."

It was not a typo, and that is the point

It would be easy to file this next to fat fingers and misplaced decimals. It does not belong there. Nobody typed a wrong number. Every person in the chain did something that looked sensible on the day: keep the old code in case, skip the test on a feature nobody uses, reuse a flag instead of making a new one, copy the files by hand.

Jayanth Varma, writing about the SEC order on his blog, ranked the missed server as the least serious of the three failures. The worst, in his view, was 2005, when live code was changed and never retested. I agree with him. The technician is the person everyone remembers, and the least interesting one in the story.

What I keep coming back to is something else Narang said. His own firm had a similar accident earlier in 2012, and the strategy shut itself off after losing $5,000 in under a minute. He asked why Knight had no automated stop of its own. The difference between a $5,000 story and a $440 million story was not smarter code. It was a rule, written in advance, about when to stop.

What it means on an ordinary Monday

When a chart does something strange in the first minutes of a session, it is natural to assume somebody knows something. Knight is the reminder that sometimes nobody does. A move can be a machine with nothing behind it, and the trades can stand anyway.

It is also the reason I do not let software have the last word here. A scanner narrows 11,000+ tickers, and then a person reviews every chart before anything goes into the free weekly signals. Software is very good at looking at everything. It is not good at noticing that it has gone wrong.

Knight's software did try to say so, in its way. The first email went out at 8:01. The market opened at 9:30. The warning sat in the inbox for 89 minutes, and there were 97 copies of it.

Quick Questions

Did Knight Capital go bankrupt?

No, but it stopped being an independent company in all but name. The $440 million loss was bigger than its cash balance, and analysts warned that bankruptcy was possible. Within days, six investors led by Jefferies put in $400 million in exchange for most of the firm. Knight agreed to merge with Getco in December 2012, and the combined company became KCG Holdings in July 2013.

Why do some sources say $440 million and others $460 million?

Both numbers are real. $440 million is the pre-tax loss Knight reported in August 2012, and it is the figure most news coverage used. When the SEC published its findings in October 2013, it said Knight had lost more than $460 million on the unwanted positions. The story is the same either way: the loss was larger than the cash the firm had on hand.

Were the bad trades cancelled?

Very few. Rules written after the 2010 flash crash set fixed thresholds for cancelling erroneous trades. The NYSE voided trades that were 30 percent or more away from the opening price, which applied to six of the 140 securities it reviewed. Everything else stood, which is why the loss landed on Knight. One rival executive called it a "$440 million donation" to the market.

Get the weekly research.

I scan 11,000+ charts every week and share what I find interesting. Educational research notes, posted weekly, free to read.

Read the Research Free

Free forever. No card required. Educational content only — not financial advice.