Skip to content

CME iLink3

Establishes CME Ilink3 session. Session credentials and IPs must be obtained from CME. Additionally, each week the credentials must be pre-registered with CME via their service gateway with the cmepreregister application.

Both Convenience and Market Segment gateways are supported.

Threading

A Session has one main thread: Dispatcher, which can be pinned to a cpu via dispatch-cpu configuration option.

Data flow

Dispatch thread performs 2 main functions:

  1. Listens for shared memory requests, normalizes them to CME SBE protocol and sends them to the exchange.
  2. Consumes data from the NIC and produces updates to shared memory.
graph LR
  A[ALGO] <--> B[Shared Memory];
  B <--> C{Dispatcher};
  C --> |Orders| D[NIC];
  D --> |Confirmations| C;

Configuration

Access Node

<Access> node must be the root of the XML file. It is the main configuration node for establishing an iLink connection.

Option Description Notes
logger Specifies Desired Name of the Log File Logs will be appended to the same file, if the file exists
logger-cpu Specifies Desired CPU for Logger Thread By default, Logger thread is not pinned, use this option to pin it
logger-level Specifies Desired Log Level Default level is info, possible levels: error,warn,info,debug,trace
tcp-direct Enable Solarflare TCP Direct TCP Direct mode can be enabled for best latency. Default: false
dispatch-cpu Pin Dispatch thread to a CPU
primary-sgw-ip Primary IP:PORT of CME Service Gateway Provided by CME
secondary-sgw-ip Secondary IP:PORT of CME Service Gateway Launch application with -s or --secondary option
primary-ip Primary IP:PORT of CME Order Gateway Provided by CME
secondary-ip Secondary IP:PORT of CME Order Gateway Launch application with -s or --secondary option
intf Network Interface to connect on
session-id Session ID Provided by CME
sekret-key Session Secret Key Provided by CME
access-key-id Access Key ID Provided by CME
firm-id Firm ID PartyDetailRole=1 (executing firm) TAG 39007
customer Customer Account PartyDetailRole=24 (customer account)
operator Operator (Tag 5392) PartyDetailRole=118
location Location (Tag 9537) Country code of operator location. Default value is "US"
persist-file Persist File Name Persist File that tracks Session state on Hard Drive - used on re-starts
audit-file Audit Trail File Name Stores Session activity trail and can be used to generate CME Audit CSV
audit-cpu Audit Trail Writer CPU Pins Audit trail writer to a specific CPU
retrans-on-start Enables re-transmission on start Default: false
account-id Account Name for Shared Memory Used to connect client application to the session, name must be unique per session
username Username Used to identify client application and ensure access
passwordhash Password Used to identify client application and ensure access
trace-file Trace File Name Used to trace and save all user API activity for the session
max-drawdown Maximum Drawdown Prevents position expansion once daily losses exceed the configured limit
starting-balance Starting Account Balance Specifies the initial account balance for a new session.
throttle-limit Throttle Limit Maximum Number of operations per trailing Throttle Window.
throttle-window Throttle Window Number of seconds of the trailing Throttle Window.
log-api-errors Display API Errors in GUI Enables functionality to pass Algo API errors to GUI.
persist-risk Persist Risk settings accross session restarts Default is true.

Risk Node

The <Risk> node must be present inside the Access node. It defines session-start risk limits per underlying asset using one or more <Instrument> nodes.

<Instrument> node arguments:

Option Description Notes
symbol Underlying asset symbol
maxpositions Maximum net exposure for the asset
maxdailylots Maximum daily lots per asset per a trading session
clipsize Maximum order clip size for the asset
capitalreq Capital requirements per contract for the Asset Value in USD
fee Fee per contract for the Asset Value in USD, supports two decimal places

Markets Node

<Markets> node must be present inside the Access node. It specifies which entitlement codes can be traded.

It is required to get appropriate product deifinitions for CME.

GUI Node

<Gui> node must be present inside the Access node. It specifies options for GUI Access.

Credentials Node

<Credentials> node must be present inside the Access node. It specifies a list of credentials and their roles that can utilize the GUI.

Passwords

Passwords in XML are stored as hashed values for security. To set your password, please first hash it with this utility. Ex: nanoconda-cli -a hashstring -i somestring

Trading Session

nanoconda-cli -a cmeilink3 -c CME-ilink3-session.xml
CME-ilink3-session.xml
<Access logger="cme-ilink3-session.log" logger-level="debug" logger-cpu="1" dispatch-cpu="2"
   primary-sgw-ip="205.209.202.123:2345"
   primary-ip="205.209.202.124:2345"
   secondary-sgw-ip="205.209.202.125:2345"
   secondary-ip="205.209.202.125:2345"
   account-id="useraccount1"
   username="username1" passwordhash="5411718394350379800"
   tcp-direct="true"
   session-id="ABC"
   intf="eth0"
   secret-key="abcdefghijklmnopqrstuvwxyz1234567890abcdefg"
   access-key-id="AbCdefGhiJkLmnOpQrStuV"
   retrans-on-start="true"
   firm-id = "1AB"
   customer = "CUST"
   operator = "CUSTOP"
   persist-file="ABC1AB-persist-primary.naco"
   audit-file="ABC1AB-audit-trail.naco"
   audit-cpu="4"
   >

<Risk>
   <Instrument symbol="NQ" maxpositions="100" clipsize="10" />
   <Instrument symbol="MNQ" maxpositions="1000" clipsize="100" />
</Risk>

<Markets>
   <Market code="XCME" />
</Markets>

<Gui intf="eth0" port="2345" cpu="5"/>

<Credentials>
   <User login="user-trader" passwordhash="5411718394350379800" role="trader"/>
   <User login="clearer" passwordhash="5411718394350379800" role="clearer"/>
   <User login="user-viewer1" passwordhash="5411718394350379800" role="viewer"/>
   <User login="user-viewer2" passwordhash="5421711394150379800" role="viewer"/>
</Credentials>

</Access>

Service Gateway Pre-registration

This application pre-registers your credentials with CME. Must be performed weekly (prior to a new trading week).

Read more at CME iLink Architecture

nanoconda-cli -a cmepreregister -c CME-ilink3-session.xml

CME Audit Trail

Generates a CME Audit trail file that is required by clearing firms and CME.

nanoconda-cli -a cmeaudittrail -f audittrailfile1.naco,audittrailfile2.naco > output-file.csv

CME Persist File

Ilink3 Application persists administrative information on hard drive that is helpful between re-starts.

cmepersistflush Application can be used to reset any of the values.

For example, UUID and sequence numbers can be reset to establish a new UUID session with the exchange (mask 1000) or only Sequence numbers (mask 1100) could be reset to request retransmission of all previous messages.

Warning

cmepersistflush should never be executed while session is active.

Can be ran using session configuration:

nanoconda-cli -a cmepersistflush -c CME-ilink3-session.xml  -m 1111

Or on the persist file directy:

nanoconda-cli -a cmepersistflush -f cmepersistfile.naco -m 1111

Mask Table

Position Description Notes
1 Party ID Set to 0 to reset, set to 1 to keep
2 UUID Set to 0 to reset, set to 1 to keep
3 Application SeqNo Set to 0 to reset, set to 1 to keep
4 CME SeqNo Set to 0 to reset, set to 1 to keep