Most Gen 2 failures take years. This one took 45 minutes. It belongs here because it is the clearest public record of what happens when Gen 1 is never really switched off. Everything below comes from the SEC's order and press release.
Gen 1: code nobody used
Knight's order router, called SMARS, contained a function named Power Peg. The SEC order records that in 2003 "Knight ceased using the Power Peg functionality." It was not removed: "Despite the lack of use, the Power Peg functionality remained present and callable at the time of the RLP deployment."
Then it was quietly broken. "In 2005, Knight moved the tracking of cumulative shares function in the Power Peg code to an earlier point in the SMARS code sequence. Knight did not retest the Power Peg code after moving the cumulative quantity function." That function was what told Power Peg to stop sending orders once a customer's order was filled.
Gen 2: new code in the same place
In 2012 Knight wrote code for the NYSE's new Retail Liquidity Program. The order says the new code "was intended to replace unused code in the relevant portion of the order router," and that it "also repurposed a flag that was formerly used to activate the Power Peg code." The plan was that when the flag was set, the new RLP functionality, not Power Peg, would be engaged.
That only works if the old code is gone everywhere.
The deployment
"Beginning on July 27, 2012, Knight deployed the new RLP code in SMARS in stages." By hand, and once:
- In the order's words, "one of Knight's technicians did not copy the new code to one of the eight SMARS computer servers."
- "Knight did not have a second technician review this deployment."
- "Knight had no written procedures that required such a review."
There was a warning. Before the market opened on August 1, an internal system sent "97 of these e-mail messages to a group of Knight personnel" referring to "Power Peg disabled." They were not designed as alerts, and nobody acted on them.
August 1, 2012
"The seven servers that received the new code processed these orders correctly. However, orders sent with the repurposed flag to the eighth server triggered the defective Power Peg code still present on that server."
The SEC press release gives the scale: the router "rapidly sent more than 4 million orders into the market when attempting to fill just 212 customer orders," Knight "traded more than 397 million shares," and "eventually suffered a loss of more than $460 million."
The rollback made it worse. The order says Knight "uninstalled the new RLP code from the seven servers where it had been deployed correctly. This action worsened the problem, causing additional incoming parent orders to activate the Power Peg code that was present on those servers." Rolling back to Gen 1 meant rolling back to the broken code.
What failed
- Gen 1 was never removed. Retired code stayed callable for nine years. This is the killing Gen 1 step nobody did.
- A flag changed meaning. The same switch turned on the new feature on seven servers and the old one on the eighth. Hodgson's rule on feature flags applies: remove them, never repurpose them.
- No check that every server got the code. A cutover needs proof it reached everywhere, not a person's memory.
- The rollback was untested. Nobody knew that going back meant returning to code that had been broken since 2005.
What to take from it
- Delete retired code. Unused but callable code is a Gen 1 still running, waiting for a path to it.
- Never reuse a flag or a field for a new meaning. Make a new one.
- Automate deployments and verify every target. Eight servers, eight checks.
- Rehearse the rollback. Know what returning to the old version will actually run.
- Treat unexpected messages as alerts until proven otherwise. 97 emails said something was wrong before the market opened.
Common questions
What happened to Knight Capital in 2012?
During a deployment, one of eight servers did not get new code. A flag that the new code reused still switched on an old, retired function on that server, which sent millions of orders in 45 minutes. The SEC says Knight lost more than $460 million.
What is the lesson for software teams?
Remove retired code instead of leaving it callable, never reuse a flag that once meant something else, and verify that every server got a deployment.
Sources
- In the Matter of Knight Capital Americas LLC - SEC order, Release No. 34-70694 (October 16, 2013) - the Power Peg history, the deployment, the eighth server, the reused flag, the BNET emails and the rollback that made it worse
- SEC Charges Knight Capital With Violations of Market Access Rule - SEC press release 2013-222 (October 16, 2013) - the order counts, shares, loss and the $12 million settlement
- Release No. 34-67347 - order approving the NYSE Retail Liquidity Program (SEC, July 3, 2012) - the new program Knight's code was written for
- Rule 15c3-5, Risk Management Controls for Brokers or Dealers with Market Access - SEC - the market access rule Knight was charged under
Last updated November 29, 2026.

