Skip to main content

Infinite Loop Of Facebook IPO Stories Caused By Actual Infinite Loop During Facebook IPO

  • Author:
  • Updated:

Remember when Facebook IPOed last May and it was a mess? Today the SEC released its amusing order fining Nasdaq $10 million for the mess and explaining what happened. Some computers were having a stressful day at work and so they decided to give up and hide out in the nap room, is the gist of it. I feel like I'd get along with those computers.

What started the mess is that Nasdaq opens the trading of a newly IPO'ed stock with an opening cross where it compiles quotes for a while and then crosses them in one big opening cross before continuous trading starts. And it uses the following process to do the opening cross:

  • 1 Get a bunch of orders over a ~20 minute period before trading starts
  • 2 Use a program called the IPO Cross Application to calculate the clearing price and shares crossed based on those orders, which takes a few milliseconds
  • 3 Check if any of the orders were cancelled during those milliseconds
  • 4 If they were, delete those orders and Goto 2

Did you spot the problem?1 Nasdaq's systems engineers did not, even after the IPO Cross Application had been running on an infinite loop for twenty minutes. The SEC caught it, though, reading their order, I was worried that they'd fallen prey to it as well:

After the IPO Cross Application determined the price and volume of the cross, the matching engine performed a validation check to confirm that none of the orders on which the price and volume determination were based had been cancelled during the time that the IPO Cross Application was calculating the price and volume of the cross. The time that had elapsed during the price/volume calculation and validation check was 20 milliseconds, which is significantly longer than usual for an IPO cross, which usually takes 1 to 2 milliseconds. This additional length resulted from the larger than normal volume of orders received during the [Display Only Period from 10:45 to 11:05 when orders were submitted].

The validation check found that a cancellation had been received during the calculation and thus the validation check failed. This caused the IPO Cross Application to recalculate the cross price and volume incorporating the cancellation.

During this second price/volume calculation, two additional cancellations were received and thus the validation check failed again because the second calculation did not account for those two additional cancellations. However, due to the design of the IPO Cross Application, only the first of those two cancellations was incorporated into a third price/volume calculation, and as a result the validation check failed again. And by the time that the IPO Cross Application had run for the fourth time – thereby including the second of the two cancellations that came in during the second calculation – an additional cancellation had been received, thereby causing another failure of the validation check.

During the next price/volume calculation four more cancellations arrived.

OKAY GOT IT. This goes on for seventy pages, just like that.2

After a while Nasdaq fixed the problem by turning off the error check and just saying "if the thing misses any cancellations, we'll just step in in place of the cancelled orders and buy/sell those shares in our error account." But they did this only after the IPO Cross Application had fallen nineteen minutes behind the actual orders, and the solution itself caused several more problems including:

  • Various marketable orders submitted during those nineteen minutes got lost,
  • Nasdaq thus had to step into a lot more cancellations than it expected, ending up short 3mm Facebook shares after the opening cross,
  • Nasdaq - who knew? - wasn't actually allowed to step into those cancellations and buy/short shares for its error account (or, I guess, have an error account at all), and
  • Nobody told the program that sends out order confirmations - the Execution App - that the error check was being turned off; so the Execution App, seeing that the initial cross failed the error check, just sat back with its little electronic arms crossed refusing to send out any confirmations.

So some people who'd submitted marketable orders didn't get their orders executed, other people whose orders were executed didn't get confirmations,3 and general unpleasantness ensued. Also Nasdaq accidentally and illegally shorted 3 million shares of an IPO that it was in the process of fucking up, which is a great idea except for the "illegally" part: the stock went down and Nasdaq made $10.8 million dollars covering its short.

The chain reaction of disaster that ensued from this makes up the bulk of the SEC order and it is consistently entertaining.4 It was perhaps less entertaining for Nasdaq, insofar as there are a whole lot of securities laws that apply to you if you run a stock exchange, and if your stock exchange just plain doesn't work then you're probably violating most of them. The list of violations here stretches for three pages.

Anyway Nasdaq got out of its SEC case with a $10 million fine and some undertakings to, like, fix all the bugs. Also some undertakings to institute rules allowing it to do the things that it did illegally during the Facebook IPO, which when you think about it is sort of an amazing way to resolve a regulatory violation. I bet the Libor banks would love to reach a settlement that's like "from now on, we'll all just agree that it's okay to manipulate Libor."5 For instance, Nasdaq extended the end of the pre-cross period from 11am to 11:05am at the request of one of the underwriters, which was not allowed by Nasdaq's rules; the settlement requires that Nasdaq amend its rules "to provide for an underwriter-requested extension of the DOP for an IPO Cross."

The bug-fixing and rule-changing both seem appropriate. The sense you get from this SEC order is that Nasdaq as an institution spent the day of the Facebook IPO acting as though it was in a different, clubbier, less rule-bound and more sensible time. The underwriters want to delay the IPO cross? Just delay it, of course; after all they're the underwriters. Computer bug preventing you from cancelling order? Just have Nasdaq step into those orders with its error account, only fair, right thing to do, etc.

That's all fine if you're, like, some gentlemen trading stocks under a buttonwood tree. It doesn't work as well for computers that are frantically cancelling their orders every time you take a millisecond to calculate. Computers need clear, consistent rules with no unforeseen application of human judgment to gum up the works. Also, if the rules work, that's helpful too.

SEC Charges Nasdaq for Failures During Facebook IPO [SEC, and order (pdf)]

1.Is it possible that my generation is the first and last to near-universally learn about the dangers of Goto? (Also: line numbers? An earlier draft of this post was numbered 10, 20, 30, 40.) Anyway: the problem is the Goto loop. As long as there are cancellations during each few milliseconds, you're doing this forever.

2.Not really.

3.And so entered them again. And again and again and again, if they were UBS, who I guess were trying to get in on the infinite-loop action.

4.I enjoyed this for instance:

On May 18, 2012, trading in Zynga was halted twice pursuant to NASDAQ Rule 4120(a)(11), after Zynga’s share price moved more than 10% in a five-minute window. The first Zynga halt occurred at 11:37 a.m., with Zynga stock trading at $7.15. Under Rule 4120(a)(11), trading was to resume after a halt cross at 11:42 a.m.14 However, NASDAQ uses the IPO Cross Application for halt crosses as well as IPO crosses, and the IPO Cross Application – which had fallen behind the pace of Facebook orders by 19 minutes – was still occupied with orders from the Facebook IPO cross.

Thus, when NASDAQ was finally able to issue the bulk print for Zynga and resume continuous trading at 12:27 p.m., the IPO Cross Application had only processed orders received between 11:37 a.m. and 11:55 a.m. And, as with the more than 30,000 orders in the Facebook IPO cross, approximately 365 cross-eligible orders in Zynga that were received between 11:55 a.m. and 12:27 p.m. were processed in violation of NASDAQ’s price-time priority rules. Those orders were not placed into the continuous trading book for Zynga and confirmations for orders executed in the halt cross were not sent out to members until approximately 1:50 p.m.

Zynga's motto is basically "anything bad that happens to Facebook happens to us too."

5.They obviously will, right?