Skip to content

CME MDP3

Feed Handler for CME MDP3 protocol (CLI Application -a cmemdp3).

Please refer to general Feed Handler for Feed Handler overview and common configurations.

CME MDP3 Feed handler can be configured to run only off of incremental lines (without Product Definition or Snapshot lines) if desired.

If Product Definition lines are not configured, product file with up-to-date definitions must be provided via secdef-file options.

Note

The Product file can be generated from CME secdef.dat file via Nanoconda CLI cmesecdefreader application. Example: ./nanoconda-cli -a cmesecdefreader -f secdef.dat -o products.naco > stoutput

If Snapshot Lines are not defined the book will be built from incremental updates only and feed handler will need be able to recover for network gaps efficiently. It is not recommended to remove Snapshot Lines from production.

CME MDP3 Specific Configuration:

Lane Node

All <Lane> nodes for the same channel must be configured inside the same <Highway> node.

Note

There can be multiple channels per <Highway> node configured, but the same channel must not span multiple <Highway> nodes.

Example:

 <Highway cpu="1" intf-a="eth0" intf-b="eth1">
        <Lane mc-a="224.0.31.9:14318" mc-b="224.0.32.9:15318" type="inc" name="l2i" group="318"/>
        <Lane mc-a="224.0.31.30:14318" mc-b="224.0.32.30:15318" type="snap" name="l2s" group="318"/>
        <Lane mc-a="224.0.31.51:14318" mc-b="224.0.32.51:15318" type="def" name="l2d" group="318"/>
 </Highway>
 <Highway cpu="2" intf-a="eth0" intf-b="eth1">
        <Lane mc-a="224.0.31.1:14310" mc-b="224.0.32.1:15310" type="inc" name="l1i" group="310"/>
        <Lane mc-a="224.0.31.22:14310" mc-b="224.0.32.22:15310" type="snap" name="l1s" group="310"/>
        <Lane mc-a="224.0.31.43:14310" mc-b="224.0.32.43:15310" type="def" name="l1d" group="310"/>
</Highway>

Option Description Notes
type Specifies Type of the MC Channel inc - incremental, snap - snapshot, def - product definition
group Specifies Group of the MC Channel For CME, Group value must match group Id of the CME channel, Ex 310 for ES
name Specifies Name of the MC Channel Can be set arbitrarily, useful when investigating logs

Example CME MDP3 Configuration Files

Consuming CME Live Data

Example of consuming live data from eth0 and eth1 interfaces with all lines configured for channels 318 and 310.

nanoconda-cli -a cmemdp3 -c CME-mdp3-prod-channels-310-318-mc.xml
CME-mdp3-prod-channels-310-318-mc.xml
<Feed logger="CME-mdp3-prod-channels-310-318-mc.log" logger-cpu="1" logger-level="debug" entitlement="XCME" efvi-enabled="true">
        <Ingester cpu="2">
          <Highway cpu="3" intf-a="eth0" intf-b="eth1">
                 <Lane mc-a="224.0.31.9:14318" mc-b="224.0.32.9:15318" type="inc" name="l2i" group="318"/>
                 <Lane mc-a="224.0.31.30:14318" mc-b="224.0.32.30:15318" type="snap" name="l2s" group="318"/>
                 <Lane mc-a="224.0.31.51:14318" mc-b="224.0.32.51:15318" type="def" name="l2d" group="318"/>
          </Highway>
          <Highway cpu="4" intf-a="eth0" intf-b="eth1">
                 <Lane mc-a="224.0.31.1:14310" mc-b="224.0.32.1:15310" type="inc" name="l1i" group="310"/>
                 <Lane mc-a="224.0.31.22:14310" mc-b="224.0.32.22:15310" type="snap" name="l1s" group="310"/>
                 <Lane mc-a="224.0.31.43:14310" mc-b="224.0.32.43:15310" type="def" name="l1d" group="310"/>
         </Highway>
        </Ingester>

        <Instruments>
          <Instrument symbol="ESM5" />
          <Instrument symbol="MESM5" />
          <Instrument symbol="MNQM5" />
          <Instrument symbol="NQM5" />
        </Instruments>

        <Entitlements>
          <User username="username1" passwordhash="5411718394350379800" />
          <User username="username2" passwordhash="5421711394150379800" />
        </Entitlements>
</Feed>

Consuming a CME PCAP

Example of consuming data from a PCAP file with only incremental lines.

nanoconda-cli -a cmemdp3 -c CME-mdp3-prod-pcap-310-314-318-inc-only.xml
CME-mdp3-prod-pcap-310-314-318-inc-only.xml
<Feed logger="CME-mdp3-prod-pcap-310-318-inc-only.log" logger-cpu="-1" logger-level="debug" secdef-file="data/producdefs.naco"  entitlement="XCME">
   <Ingester cpu="7" pcap-file="data/cmerecording.pcap" pcap-speed="realtime">
      <Highway cpu="5" intf-a="lo" intf-b="lo">
         <Lane mc-a="224.0.31.1:14310" mc-b="224.0.32.1:15310" type="inc" name="l1i" group="310"/>
      </Highway>
      <Highway cpu="6" intf-a="lo" intf-b="lo">
         <Lane mc-a="224.0.31.5:14314" mc-b="224.0.32.5:15314" type="inc" name="l4i" group="314"/>
         <Lane mc-a="224.0.31.9:14318" mc-b="224.0.32.9:15318" type="inc" name="l8i" group="318"/>
         </Highway>
   </Ingester>
   <Instruments>
      <Instrument symbol="ESM5" />

      <Instrument symbol="MESM5" />
      <Instrument symbol="MNQM5" />
      <Instrument symbol="NQM5" />

      <Instrument symbol="6EM5" />
      <Instrument symbol="6JM5" />

   </Instruments>
   <Entitlements>
      <User username="username1" passwordhash="5411718394350379800" />
      <User username="username2" passwordhash="5411718394350379800" />

   </Entitlements>

</Feed>

CME Backtester

The cmebacktester runs user-defined plugin code inline while reading from a set of PCAP files. This enables high-speed backtesting without concerns about client-side latency. All trading is simulated using the in-memory Simulator

nanoconda-cli -a cmebacktester -c CME-mdp3-prod-pcap-310-314-318-inc-only.xml -i myPlugin.so -- userArg1 userArg2

Your plugin must define the following function, which the backtester will call to initialize the plugin. It receives a session object used for submitting simulated orders and must return a pointer to your custom listener:

extern "C" nanoconda::listener* init_nanoconda_plugin(int argc, char** argv, nanoconda::dmasession* session) {
   _listenerS._session = session;
    return &_listenerS;
}

To compile your plugin for use with the backtester, make sure to use the following compiler flags:

-shared -fPIC -o myPlugin.so