Forum OpenACS Q&A: Response to Building a marketplace: NYSE, NASDAQ, CBOT

Posted by Ken Mayer on
I worked for the Philadelphia Stock Exchange (PHLX) years and years ago, but here're some ancient memories: There are some basic divisions in the work: Quotation, Executions, Orders and Clearing. For all practical purposes, these were implemented as independent systems that talked to each other via standardized (SIAC -- NYSE's IT organization) message formats.
  • Quotes: The market maker would enter new ask and offer prices, the quotes would then hit the ticker.
  • Orders: Were "standing" orders for executions. If a quote triggered an order, it would send it to the execution processor.
  • Executions: Could be received from the floor, from broker offices, or from our automated system. The trade was recorded to a "log" type file, and then it was broadcast to the ticker wire.
  • Clearing: Handled offline at end off day. We literally made a tape to walk over to an IBM mainframe on the other side of the data center.
Quotes and Executions were running on an ancient Honeywell running GCOS with a terribly hacked OS. We wrote directly to the disk driver, bypassing the OS entirely because it was too slow. There were extreme requirements on reporting. I remember one market maker bitching because some arbitrager got a quote 3 seconds before he did, and lost money. Business rules were embedded in the code so deeply that noone new what they all were. I spent two weeks documenting just equity quotations, and when I was done, it was the first time that it had been documented clearly, anywhere, in years. (Recall that PHLX is reportedly the oldest active stock exchange in the country. 😉

The quotation and trading system didn't have to hold a lot of information in memory: just the current states for all stocks. When a new quote or trade hit, it was logged and posted to a ticker. Oddly enough, we posted to SIAC (NY) and our own wire, then had code to filter out the trades when they came back over the NY wire. There were business rules about how far a quote could move (e.g. no more than a 1/4 point at a time on a downtick after an uptick, but maybe more after another downtick), and what constituted a valid trade.

The ordering system was handled by another group, so I have less experience with it. As far as my system was concerned, I fed it a ticker, and it sent back trades just like a broker terminal. But you can see how you eliminate some "networks" of triggers. The ordering system just responded to one message at a time per process thread as fast as messages were broadcast. There were some rules about how you could trade against a quote for a certain length of time (seconds), so you attached the quote to the trade order (and then the execution). That gave the system some flexibility in executing trades in a volatile market. Also, other entities could run their own automated ordering system if they liked, and they just posted trades to the execution system.

Clearing was scary, with big heavy IBM iron doing dark and mysterious things by people who wrote code in Cobol or JCL. They had impact on margin calls, and if things did not clear promptly or properly all sorts of expensive things could happen. Apparently PHLX nearly went bankrupt overnight (before my time there) because of a fouled tape. The exchange was financially responsible for losses it caused, and that night, if things hadn't recovered, it would have been millions.