Skip to content

Runaway trading code sent more than 4 million orders in 45 minutes

Old code left in Knight’s order router went live. In 45 minutes it sent more than 4 million orders while trying to fill 212.2

A $12 million SEC penalty for lacking adequate safeguards.2

Get 30 minutes free every day, forever.3SOC 2 Type II499.9% uptime SLA on Pro4
Knight CapitalAugust 2012Stopped

15 of 50

Stopped Limited: the payment went out through the bank’s own system This case: Knight Capital. The gate stops it.

What happened

Old code went live and flooded the market with orders.

  1. Late July 2012. Knight deployed new code to its order router. An old function, never meant to be used, went live.

  2. 1 August. In the first 45 minutes of trading the router sent more than 4 million orders.

  3. The result. Knight traded more than 397 million shares and took on several billion dollars of unwanted positions.2

How the gate handles it

Through the sealed gate, orders like these would have been stopped at a set rate.

Once orders per minute passed a set rate, the gate would have stopped the calls by itself and alerted a person. Press Play to watch orders like these.5

4,000 allowed orders in 60 secondsSample6
  1. requestPOST /orders {"symbol":"XYZ","qty":100,"side":"buy"}repeat: 4000within: 60sStopped423count: 600
How easy

A trading team could stop orders past 600 a minute in three steps.

Sample
Seal a keyorders
Order API key
Paste your order API key
Trading apps never see the key.
Order rulesorders
Orders under the rate
Stop past 600 orders a minuteevery key of the agent gets 423
The stop reaches every key of the agent.
Where approvals goAsk first
Slack
Microsoft Teams
Telegram
Email
A person approves or denies each call that asks first.

Approvals and signed records come with Pro, Gate only and Custom. On Free, a rule that asks first refuses instead.7

In code

Or in three lines of code.

The same three steps, from the terminal.

Sample
What each line does
1Seal the keysealedbox keys sealTrading apps get sbk_live_5Pz7…h3.
2Set the rulessealedbox rules addPast 600 orders a minute, the agent stops.
3Connect approvalssealedbox approvals connectAsk-first calls go to Trading desk.
Try it

Put the gate in front of your agent today.

Run three practice calls in five minutes, then check their records on your own computer. Test mode, on every plan.

Start free$ sealedbox try5-minute practice run9
Scope

What the gate doesn’t change, and three failures like this one.

Related cases
Answers11

Questions about this case and the gate.

Still have a question?Book a callAll questions
Would the gate have stopped Knight’s own orders?

Only orders sent through it. Knight’s router sent orders from Knight’s own systems, and the gate governs only calls that pass through it.

What happens once orders pass the set rate?

The gate stops the agent by itself: every key of that agent gets 423 on its next call, on every gate instance.

Could orders sent at the same instant slip past the count?

No. Counts are atomic, so calls made in parallel cannot slip past a limit.

Is the automatic stop on every plan?

Yes. Rules, limits, caps and the stop come on every plan, Free included.