Starting with Q4 2016, CME MDP exposes Market By Order (MBO) functionality with current Market By Price (MBP) functionality. MBO disseminates individual orders and quotes at every price level for a particular instrument. MBO functionality is embedded into existing market events and channels.
The SDK API was enhanced with new classes, listeners and methods to expose the new functionality to the users and provide them with the same experience as they have while working with MBP books.
The SDK exposes the new class OnixS::CME::MDH::MboBook representing MBO book. The design and interface of the new class is similar to the classes encapsulating MBP books like the OnixS::CME::MDH::DirectBook. In particular, this class provides access to bids and offers for the given instrument with the help of OnixS::CME::MDH::MboBook::bids and OnixS::CME::MDH::MboBook::asks members respectively. All bids and asks are sorted in the same way as price levels in the MBP books. The OnixS::CME::MDH::Order class encapsulates bids and offers. It exposes order primary details like id, priority, price and display quantity. In contrast to MBP books, MBO book may contain multiple entries having the same price value. Orders with the same price are sorted by priority starting from the lowest to highest no matter whether a single order is representing bid or offer.
To get subscribed to MBO book updates, it's necessary to override OnixS::CME:MDP3::SecurityListener::onBookUpdate member of OnixS::CME:MDP3::SecurityListener and bind instance of listener to the instance of OnixS::CME::MDH::Handler class using OnixS::CME::MDH::Handler::registerSecurityListener.
Also, the correspondent Handler's parameter defines whether to maintain MBO order books:
The Handler supports both accurate maintenance and natural refresh for MBO books. Users should not experience any difference in MBP and MBO order book maintenance.
In case of late join or data loss, the Handler performs a large-scale market state recovery using snapshot feeds.
In contrast to real-time updates, when data for all kind of books is transmitted using the same incremental feed, the recovery from snapshots uses separate 'snapshot MBO' feeds. Therefore, the Handler uses the corresponding snapshot feeds for particular book types when the recovery is performed. Therefore, Handler processes market data from two sources (regular and MBO snapshot feeds), if the users are subscribed to both MBO and MBP books. An important aspect is the fact of performing two recovery procedures for MBP and MBO books may cause increase time of overall recovery since the Handler has to wait until the end of both procedures before switching to real-time data processing.