Software DisastersEpisode 02 · Knight Capital order router · 1 August 2012

45 Minutes That Cost Knight Capital $460 Million

One of Knight Capital’s eight servers was still running old code when the market opened. In about 45 minutes its router built up positions that ended in a loss of more than $460 million, and the attempt to fix it live made it worse.

Get the Claude skill

· Watch on YouTube

Free Claude skill · read-only

Kill switch check

Claude reads your repository and deploy scripts and tells you where one missed server or one old flag could set off a runaway, and whether anything would stop it, with file and line evidence and the first fix to make.

  • Every server is verified After a rollout, each target reports the version it runs.
  • Dead code is gone Retired features are deleted, not just switched off.
  • Flags keep one meaning New behaviour gets a new name. Unknown values are rejected.
  • Early errors are alerts Warnings before go-live reach someone who can act.
  • Output matches input Nothing sends more than it was asked for.
  • Limits stop things A kill switch tied to money or volume, not a dashboard.
  • The runbook says when to stop Disconnect first, diagnose second.
  • Fixes cover the class An incident adds a safety net, not just one patch.

You’ll get a download link by email. Using it confirms your address and subscribes you to new Software Disasters episodes. Unsubscribe anytime. About your email

Install: unzip into ~/.claude/skills/ for Claude Code, or upload the zip under Skills in Claude’s settings. Then ask: “Run the kill switch check on this repo.”

What happened

Seven servers out of eight.

At 9:30 a.m. Eastern on Wednesday 1 August 2012, the New York Stock Exchange opened and Knight Capital’s order router, SMARS, began turning 212 small retail orders into millions of orders of its own. In about 45 minutes it got more than 4 million executions in 154 stocks, for more than 397 million shares. Knight was left holding about $3.5 billion of stock it didn’t want and short about $3.15 billion more. It lost more than $460 million.

Knight had written new code for the exchange’s Retail Liquidity Program, which started that day. The code reused a flag that used to switch on Power Peg, a feature Knight stopped using in 2003 but never removed. A 2005 change had moved Power Peg’s fill counter, and nobody retested it. During the staged rollout from 27 July, the new code wasn’t copied to one of the eight servers, and nobody checked.

From 8:01 a.m., 97 automated e-mails said “Power Peg disabled”. They weren’t designed as alerts, and nobody acted on them. At the open, the eighth server ran Power Peg, which never learned its orders were filled and kept sending more. Fixing it live, the team uninstalled the new code from the seven servers where it worked, which put the old code back on all eight. In the SEC’s words, “This action worsened the problem.” Within a year, Knight had combined with GETCO to form KCG Holdings.

The safety net

Five safety nets. None of them stopped it.

  1. Deployment reviewNo second person checked the rollout, and no written procedure required one.
  2. Error e-mails97 before the open. They went to an inbox and weren’t treated as alerts.
  3. Price collarDidn’t apply to orders for the opening auction, which included the 212.
  4. 33 Account limitA $2 million position limit that wasn’t wired to any automated control.
  5. Risk monitorRelied entirely on people watching: no automated alerts, and it lagged at high volume.

What to take away

Verify every change. Then assume one will get through anyway.

  • Check that a deploy reached every server. Seven out of eight isn’t success.
  • Delete dead code. Code nobody runs is code nobody tests.
  • Never give an old flag a new meaning.
  • Treat unexpected errors before go-live as alerts.
  • Check output against input at the last point before the outside world.
  • Wire limits to an automatic stop, and decide in advance when to disconnect.

If one server in your fleet were running last year’s code right now, what would tell you, and what would stop it?

Check your own repository with the skill