Defining the market data protocol and order data protocol
Before we build the components inside the trading exchange that publish market data updates and receive and respond to client requests, we need to finalize the protocol. The protocol needs to be publicly available so that market participants who want to connect to the exchange, process updates, and send order requests can build their software. The protocol is the language that the exchange and market participants will use to communicate. We will have two protocols – one for the format of the market data updates and one for the format to send order requests and receive order responses in.
Designing the market data protocol
For the market data protocol, we will define an internal format that the matching engine uses, and a public format meant for the market participants. We saw the internal matching format, that is, the MEMarketUpdate
struct, in the Building the Matching Engine chapter, in the Defining the operations...