CME STP FIXML - Trade Queries and Subscriptions
This page outlines the trade queries and subscription functionality for CME STP FIXML.
Contents
Data Retrieval
CME STP FIXML supports data retrieval using subscriptions and queries:
Queries: Client systems can request a snapshot of trades with /TrdCptRepReq/ReqTyp=1 (Matched trades) and /TrdCptRepReq/SubReqTyp=0 (Snapshot) limited by StartTm and optional EndTm attributes.
Subscriptions: Client systems can request a snapshot and initiate a continued subscription for trades with/TrdCptRepReq/ReqTyp=1 (Matched trades) and /TrdCptRepReq/SubReqTyp=1 (Snapshot + Updates) with the optional StartTm Attribute.
For both Queries and Subscriptions client systems must supply a unique identifier with each request in /FIXML/TrdCaptRptReq/@ReqID which the FIXML API will echo back in /FIXML/Batch/TrdCaptRpt/@ReqID for successful requests, and in /FIXML/TrdCaptRptReqAck/@ReqID in case of errors. This enables the user to match the request with the resulting response message. When continuing a Subscription or a Query, client systems may reuse the original @ReqID or may send a new identifier. The API will respond with the @ReqID sent on the latest request.
Client systems must be able to gracefully process unexpected tags/attributes, in CME STP FIXML messages, without failing.
Subscription and Query Parameters
Following tables note the Required and Optional filter parameters available in the Trade Capture Report Request (/TrdCaptRptReq) for query and/or subscription results. Omitting, changing, or adding filter criteria between service calls to CME STP FIXML may cause unexpected results. Every subsequent Subscription or Query must contain all of the filter criteria of the original subscription or query. Times below, (e.g. Start Time and End Time), use the XML xs:dateTime syntax in ISO 8601 format. Time should be entered in UTC Timestamp format.
Required Parameters
FIXML XPath | Request type | Comments | |
---|---|---|---|
Subscription | Snapshot | ||
/TrdCaptRptReq/@StartTm
| Y | Y | Client systems can request a snapshot of trades or start a subscription. @StartTm is required for snapshot requests and optional for subscription requests. If @StartTm is not provided in the subscription request, it will default to the current time of the request. |
/TrdCaptRptReq/@EndTm | N | Y | Client systems can use @EndTm to optionally time limit the snapshot request. @EndTm is optional and defaults to the current time of the request. |
Party Details /TrdCaptRptReq/Pty/@ID /TrdCaptRptReq/Pty/@R | C | C | Party details are conditionally required based on the specific client API ID entitlements. Multiple valid PartyID's can be in the request as long as they belong to the same PartyRole. Requests with different PartyRole(s) will be rejected. Maximum of 200 PartyRoles are allowed in the request. |
Optional Parameters
Following Optional parameters, which are to be used in conjunction with Required Parameters, in the Trade Capture Report Request (/TrdCaptRptReq) to further filter the resulting Trade data set for query and/or subscriptions.
Trade Capture Report Request Attribute | Request type | Applicable Market | Comments | |||
---|---|---|---|---|---|---|
Subscription | Snapshot | Futures and Options | BrokerTec FI | EBS FX | ||
MLegRptTyp | Y | Y | Y | Y | N | Request Spread Level or Leg level Trade Capture Reports. Defaults to Leg Level. |
ClOrdID | N | Y | Y | Y | Y | Request a specific Trade using client generated Order ID. |
TrdID | N | Y | Y | Y | Y | Request specific trade with related ID assigned by the exchange. |
TrdID2 | N | Y | Y | Y | N | Request specific trade with globally unique trade ID. |
TrdDt | N | Y | Y | Y | Y | Request trades for a specific trade date. |
BizDt | N | Y | Y | Y | N | Request trades for a specific Clearing Business date. |
InptSrc | Y | Y | Y | Y | Y | Request trades limited to Input Source such as CME Globex (GLBX) etc. Applicable values listed in the market related message specifications. |
VenuTyp | Y | Y | N | N | Y | Request trades limited to Venue |
TrdPtyTyp | Y | Y | N | N | Y | Request trades limited by Trade Party Type in conjunction with Party Role. |
PostTrdTyp | Y | Y | N | N | Y | Request trades refined by type of trade. |
NonDscIndr | Y | Y | N | N | Y | Request trades limited by disclosure requirements. |
ManOrdInd | Y | Y | N | N | Y | Request trades limited by order entry method. |
CollInd | Y | Y | N | Y | N | Include/Exclude Collateral Report (tag 35-MsgType=BA) messages. |
SecTyp Exch | Y | Y | Y | Y | Y | Request trades limited by specific Security Type and/or Exchange. |
ID | Y | Y | Y | Y | N | Request trades limited to a specific Security ID. tag 207-SecurityExchange needs to be populated. |
Sym | Y | Y | N | Y | Y | Request trades limited by human readable Security Symbol. |
Prod | Y | Y | N | N | Y | Request trades limited by specific product. |
PxStat | Y | Y | N | N | Y | Request trade limited by trade price status |
Batch Container
CME STP FIXML returns trades (FIXML Trade Capture Report messages) to clients by encapsulating a single Standard Header followed by zero or more Trade Capture Report messages within the /FIXML/Batch element. The Trade Capture Report messages themselves will not contain Hdr elements. CME STP FIXML may send an empty Batch, containing a Hdr but no TrdCaptRpt messages, either because a Query returned no results, or because no new activity occurred for a Subscription. However, in the case of an empty batch for a Subscription, a client system must process the token and use it in subsequent requests. A batch can return a maximum of 250 Trade Capture Report messages.
Example FIXML Batch |
---|
HTTP Post with Trade Capture Report Request <?xml version="1.0" encoding="UTF-8"?>
<FIXML v="5.0 SP2" s="20090815" xv="109" cv="CME.0001">
<Batch>
<Hdr SID="CME" TID="TEST" SSub="STP" TSub="TEST123"/>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
...
</Batch>
</FIXML> |
Subscription and Query requests (FIXML Trade Capture Report Request messages) sent by the client system to CME STP FIXML, as well as application level error messages (FIXML Trade Capture Report Request Ack messages) sent by the CME STP FIXML to the client systems, will not use the Batch container. The FIXML will contain the element for the message directly. The application level message itself will contain the Standard Header, e.g. /FIXML/TrdCaptRptReq/Hdr.
Queries
Client systems can request a snapshot of trades with /TrdCptRepReq/ReqTyp=1 (Matched trades) and /TrdCptRepReq/SubReqTyp=0 (Snapshot) limited by the required StartTm and optional EndTm attributes.
If the query is valid and there are trades for the requested time frame, CME STP FIXML will respond with HTTP status of 200 (Success) and Batch of Trade Capture Reports.
The x-cme-token custom HTTP header parameter will be populated with a token value if there are more Trade capture reports for client systems to continue their query.
If the query is valid and there are no trades for the requested time frame, an empty Batch is returned.
Example Request - HTTP Post with Trade Capture Report Request |
---|
POST /cmestp/query HTTP/1.1
Host: servicesnr.cmegroup.com
Content-Type: text/plain
Authorization: Basic <Base64 encoded secret key>
Content-Length: 637
<?xml version="1.0" encoding="UTF-8"?>
<FIXML v = "5.0 SP2" s = "20090815" xv = "109" cv = "CME.0001">
<!-- ReqTyp = "1" (Matched Trades) SubReqTyp = "0" (Snapshot) -->
<TrdCaptRptReq ReqID = "Testvalue" ReqTyp = "1" SubReqTyp = "0" MLegRptTyp = "2" StartTm="2024-09-23T00:00:00">
<Hdr SID = "Test" TID = "CME" SSub = "Test1" TSub = "STP"/>
<Pty ID = "Party value" R = "7"/>
</TrdCaptRptReq>
</FIXML> |
Example Response - HTTP Response Code = 200 (Success) |
---|
<?xml version="1.0" encoding="UTF-8"?>
<FIXML v="5.0 SP2" s="20090815" xv="109" cv="CME.0001">
<Batch>
<Hdr SID="CME" TID="Test" SSub="STP" TSub="Test1"/>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
...
</Batch>
</FIXML> |
Subscriptions
Client systems can request a snapshot and initiate a continued subscription to trades with/TrdCptRepReq/ReqTyp=1 (Matched trades) and /TrdCptRepReq/SubReqTyp=1 (Snapshot + Updates) with optional StartTm Attribute. CME STP FIXML will respond with HTTP status of 200 (Success) and Batch of Trade Capture Reports if there are any available. An empty Batch will be returned if there are no trades to report.
In response to a successful subscription request, CME STP FIXML will return a token in the x-cme-token custom HTTP header parameter.
If the optional StartTm Attribute isn't provided in the subscription request, CME STP FIXML will begin the subscription at the time the request was received.
Example - HTTP Post with Trade Capture Report Request |
---|
POST /cmestp/query HTTP/1.1
Host: servicesnr.cmegroup.com
Content-Type: text/plain
Authorization: Basic <Base64 encoded secret key>
Content-Length: 637
<?xml version="1.0" encoding="UTF-8"?>
<FIXML v = "5.0 SP2" s = "20090815" xv = "109" cv = "CME.0001">
<!-- ReqTyp = "1" (Matched Trades) SubReqTyp = "1" (Snapshot+Subscription) -->
<TrdCaptRptReq ReqID = "Testvalue" ReqTyp = "1" SubReqTyp = "1" MLegRptTyp = "2" StartTm="2024-09-23T00:00:00">
<Hdr SID = "Test" TID = "CME" SSub = "Test1" TSub = "STP"/>
<Pty ID = "Party value" R = "7"/>
</TrdCaptRptReq>
</FIXML> |
Example - HTTP Response Code = 200 (Success) |
---|
HTTP Header parameter x-cme-token will have the token value for the next polling request <?xml version="1.0" encoding="UTF-8"?>
<FIXML v="5.0 SP2" s="20090815" xv="109" cv="CME.0001">
<Batch>
<Hdr SID="CME" TID="Test" SSub="STP" TSub="Test1"/>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
...
</Batch>
</FIXML> |
Continuing a Subscription
To continue polling for trades after a successful subscription, client systems must POST Trade Capture Report requests with:
/TrdCptRepReq/ReqTyp=3 (Unreported trades matching the criteria) and /TrdCptRepReq/SubReqTyp=1 (Snapshot + Updates)
Populate the x-cme-token custom HTTP header parameter, in the POST, with the most recent token value received from CME STP FIXML.
Must include the filter criteria of the original subscription.
Client systems should continue polling for new trades with request intervals no more frequently than every three seconds.
Example - HTTP Post with Trade Capture Report Request |
---|
HTTP Post with Trade Capture Report Request with x-cme-token for continued polling of trades POST /cmestp/query HTTP/1.1
Host: servicesnr.cmegroup.com
Content-Type: text/plain
x-cme-token: eyJmcm9tVHJhbnNhY3R
Authorization: Basic <Base64 encoded secret key>
Content-Length: 637
<?xml version="1.0" encoding="UTF-8"?>
<FIXML v = "5.0 SP2" s = "20090815" xv = "109" cv = "CME.0001">
<!-- ReqTyp = "3" (Unreported Trades) SubReqTyp = "1" (Snapshot+Subscription) -->
<TrdCaptRptReq ReqID = "Testvalue" ReqTyp = "3" SubReqTyp = "1" MLegRptTyp = "2" StartTm="2024-09-23T00:00:00">
<Hdr SID = "Test" TID = "CME" SSub = "Test1" TSub = "STP"/>
<Pty ID = "Party value" R = "7"/>
</TrdCaptRptReq>
</FIXML> |
Example - HTTP Response Code = 200 (Success) |
---|
HTTP Header parameter x-cme-token will have the token value for the next polling request <?xml version="1.0" encoding="UTF-8"?>
<FIXML v="5.0 SP2" s="20090815" xv="109" cv="CME.0001">
<Batch>
<Hdr SID="CME" TID="Test" SSub="STP" TSub="Test1"/>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
<TrdCaptRpt ...>
...
</TrdCaptRpt>
...
</Batch>
</FIXML> |
Restarting a Subscription
Client systems should follow the same process as starting a subscription as detailed above. It is recommended that client systems specify a value in /TrdCptRepReq/@StartTm Attribute with one or more minutes prior to the value of /FIXML/TrdCaptRpt/@LastUpdateTm from the last trade they received, to cover any missing trades.
Duplicate Message Detection
To detect duplicate trades, client systems can use /FIXML/TrdCaptRpt/@RptId, the unique message ID for the trade being reported.
Legs of certain spread trades can share the same message ID. However, /FIXML/TrdCaptRpt/@TrdID2 and /FIXML/TrdCaptRpt/@RptID (together) will form a unique key.
How was your Client Systems Wiki Experience? Submit Feedback
Copyright © 2024 CME Group Inc. All rights reserved.