Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>
<ns2:transactionReq xmlns:ns2="http://cmegroup.com/schema/core/1.0" processingMode="COMPLETE">
<transaction portfolioId="1234" type="TRADE">
<payload encoding="STRING" format="CSV">
<string>Bus_Date,Trade_Date,Clear_Date,Exch,Product_Type,Product_Code,Setl_Cur,CVF,Period,Deliv_Date,Setl_Date,Buy_Sell,Qty,Discount,Setl_Price,Trade_Price,MTM_Amt,Deliv_Cash,Deliv,CO,CMF,PA,Seg,TMF_Exch,TMF,Origin,Broker,Cust_Acct,CTI,Order_ID,Trade_ID,ALLOC_IND,Variation,MTM_UnDisc,PAA,Exec_ID,Exec_ID2,SetlMeth,ValMeth,UOM,UOMCCy,PxQteCcy,FnlSettlCcy,Fix_Date,Contra_Qty,ORIGINAL_TRADE_DATE,Reg_Trd_ID,InvoiceAmt,AllocID2,Status, Originating_Event, Terminating_Event,Netting_ID,Fee_Type,Fee_Amt,Fee_Date,Asset_Class,CFI,Put_Call,Expiration_Date,Prem_Amt,Prem_Date,Delta,Gamma,Theta,Vega
3/21/2019,3/21/2019,3/21/2019,CME,OPT,USDJYN,JPY,1,20210317,3/19/2021,3/18/2021,B,10000,0.999703246,113.765,111,27650,0,10000,CME,987,TESTACCT1,HOUS ,CME,987,HOUS,,TESTACCT1,4,CCPC_1234,1234,N,-0.29,140.42,-0.19,3340925,3340925,CASH,OPTCI,Ccy,USD,JPY,JPY,,1110000,7/5/2016,CPC1234,0,1234,CLEARED,NEW_TRADE,,USDJPY50115700.1,,,,OTCFX,OPECCN,P,3/17/2021,-10000,3/18/2021,-41.69,-0.61,34.96,-161.5
3/21/2019,3/21/2019,3/21/2019,CME,OPT,EURUSN,USD,1,20210317,3/19/2021,3/18/2021,B,10000000,0.992003518,1.059,1.06,-10000,0,10000000,CME,987,TESTACCT1,HOUS,CME,987,HOUS,,TESTACCT1,4,C1234,1234,N,259666.23,261759.38,0.07,3426476,3426476,CASH,OPTCI,Ccy,EUR,USD,USD,,10600000,7/5/2016,CPC12345,0,12345,CLEARED,NEW_TRADE,,EURUSD50115710.2,,,,OTCFX,OPECCN,P,3/17/2021,-15000,3/18/2021,-42.39,-2.53,28.66,-70.03
3/21/2019,3/21/2019,3/21/2019,CME,OPT,GBPUSN,USD,1,20210317,3/19/2021,3/18/2021,B,10000000,0.992003518,1.2265,1.24,-135000,0,10000000,CME,987,TESTACCT1,HOUS,CME,987,HOUS,,TESTACCT1,4,C12345,1234,N,259666.23,261759.38,0.94,3426477,3426477,CASH,OPTCI,Ccy,GBP,USD,USD,,12400000,7/5/2016,CPC123456,0,123456,CLEARED,TRANSFER_IN,,GBPUSD50115720.3,TRANSFER_FEE,-259666.23,1/18/2017,OTCFX,OCECCN,C,3/17/2021,-12500,3/18/2021,-0.01,0,0.02,-0.03
</string>
</payload>
</transaction>
</ns2:transactionReq>
Futures & Options CSV Requests

Example 1: Simple CSV Portfolio CSV

CORE API minimally requires the below attributes to build futures and options transactions. Note CORE will auto-fill attributes when able - for instance if a user supplies a valid Globex Ticket Symbol (Ticker Symbol attribute), other product attributes can be left blank. It is expected users leave the Product Name attribute blank.

Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.1" encoding="UTF-8" standalone="yes"?>
<ns2:transactionReq xmlns:ns2="http://cmegroup.com/schema/core/1.2" reqUserId="userid">
<transaction portfolioId="0" type="TRADE" id="0"><payload encoding="STRING" format="CSV">
<string>
Firm Id,Acct Id,Exchange,Ticker Symbol,Product Name,CC Code,Period Code,Put / Call,Strike,Underlying Period Code,Net Positions,Margin Type
Test,test,CME,GEU3,EURODOLLAR FUTURES,ED,202309,,,,-54461,
Test,test,CME,GEU9,EURODOLLAR FUTURES,ED,201909,,,,-123456,
Test,test,CME,GEH0,EURODOLLAR FUTURES,ED,202003,,,,-75406,
Test,test,CME,GEZ4,EURODOLLAR FUTURES,ED,202412,,,,-70732,
</string>
</payload>
</transaction>
</ns2:transactionReq>

...

Example 2: Risk API CSV Portfolio

Risk API CSV or JSON format

...

(see also below) are the expected SPAN 2 input payload

...

formats. These formats are supported for futures and options only

...

and are also compatible with the deployable margin software program. 

Additional details around using this payload format building a Risk API format payload can be found here.

Futures and Options Request

Please note CORE API seperates transactions into multiple portfolios when the Account ID or Firm ID do not match.

Code Block
languagehtml/xml
linenumberstrue
<transactionReq>
  <transaction portfolioId="1234" type="TRADE">
    <payload encoding="STRING" format="RISK_API_JSON">
      <string>{-- Risk API request goes here --}></string>
    </payload>
  </transaction>
</transactionReq>
Futures and Options Response
Code Block
languagehtml/xml
linenumberstrue
<ns2:transactionRpt<?xml version="1.1" encoding="UTF-8" standalone="yes"?>
<ns2:transactionReq xmlns:ns2="http://cmegroup.com/schema/core/1.212" statusreqUserId="SUCCESSuserid">
    <transaction portfolioId="12340" type="TRADE" id="1234560">
        <payload ><payload encoding="STRING" format="FIXMLCSV">
            <string><FIXML><!-- TrdCaptRpt goes here --><<string> requestId,version,sentTime,businessDate,cycleCode,runNumber,id,currency,customerAccountType,omnibusInd,parentPortfolioId,firmId,accountId,accountName,originType,accountType,segregationType,netQty,nakedLongQty,nakedShortQty,clearingOrganizationId,exchangeId,productCode,productType,periodCode,putCallInd,strike,underlyingPeriodCode,memo
TEST,1,2021-06-21T09:26:49Z,6/18/2021,EOD,1,TEST,USD,SPECULATOR,NO,,1234,ACCOUNT1,ACCOUNT1,CUST,CSEG,CSEG,5,0,0,CME,CME,ED,FUT,202309,,,,memo-1
TEST,1,2021-06-21T09:26:49Z,6/18/2021,EOD,1,TEST,USD,SPECULATOR,NO,,1234,ACCOUNT1,ACCOUNT1,CUST,CSEG,CSEG,-5,0,0,CME,NYMEX,CL,FUT,202206,,,,memo-1</string>
</payload>
</transaction>
</ns2:transactionReq>
Examples by Product in JSON Format

Risk API JSON or CSV format are the expected SPAN 2 input payload formats. These formats are supported for futures and options only and are also compatible with the deployable margin software program. 

Additional details around building a Risk API format payload can be found here.

Please note CORE API seperates transactions into multiple portfolios when the Account ID or Firm ID do not match.

Futures and Options Request
Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:transactionReq xmlns:ns2="http://cmegroup.com/schema/core/1.12" reqUserId="userid">
<transactionReq>
  <transaction portfolioId="1234" type="TRADE">
    <payload encoding="STRING" format="RISK_API_JSON">
      <string>{
    "header": {
        "requestId": "TEST",
        "sentTime": "2021-06-21T09:26:49Z",
        "version": "1"
    },
    "payload": {
        "pointInTime": {
            "cycleCode": "EOD",
            "businessDt": "2021-06-18",
            "runNumber": 1
        },
        "portfolios": [
            {
                "positions": [
                    {
                        "instrument": {
                            "clearingOrganizationId": "CME",
                            "exchangeId": "CME",
                            "periodCode": "202312",
                            "productCode": "ED",
                            "productType": "FUT"
                        },
                        "netQty": 5
                    },
                    {
                        "instrument": {
                            "clearingOrganizationId": "CME",
                            "exchangeId": "NYMEX",
                            "periodCode": "202206",
                            "productCode": "CL",
                            "productType": "FUT"
                        },
                        "netQty": -5
                    }
                ],
                "currency": "USD",
                "customerAccountType": "SPECULATOR",
                "entities": {
                    "accountId": "ACCOUNT1",
                    "accountName": "ACCOUNT1",
                    "firmId": "1234",
                    "originType": "CUSTOMER",
                    "segregationType": "CSEG"
                },
                "memo": "memo-1",
                "omnibusInd": "NO"
            }
        ]
    }
}></string>
    </payload>
  </transaction>
</transactionReq>
Futures and Options Response

Please note the response format for CORE API is FIXML regardles of inbound transaction type. CORE API assigns transaction and porfolio IDs to the newly created portfolio. The portfolio ID must be supplied in subsequent Margin actions.

Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:transactionRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="SUCCESS">
    <transaction portfolioId="12345" type="TRADE" id="1234567">
        <payload encoding="STRING" format="FIXML">
            <string><?xml version="1.0" encoding="UTF-8" standalone="yes"?><FIXML xmlns="www.cmegroup.com/fixml50/1" v="5.0 SP2" xv="109" cv="CME.0001" s="20090815"><TrdCaptRpt LastQty="5" SettlCcy="USD"><Instrmt ID="ED" Src="H" SecTyp="FUT" MMY="202309" MatDt="2023-09-18" Exch="CME"/><RptSide Side="1" InptDev="API"><Pty ID="1234" R="4"/><Pty ID="CME" R="21"/><Pty ID="ACCOUNT1" R="24"><Sub ID="1" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
        </payload>
    </transaction>
    <transaction portfolioId="12345" type="TRADE" id="1234568">
        <payload encoding="STRING" format="FIXML">
            <string><?xml version="1.0" encoding="UTF-8" standalone="yes"?><FIXML xmlns="www.cmegroup.com/fixml50/1" v="5.0 SP2" xv="109" cv="CME.0001" s="20090815"><TrdCaptRpt LastQty="5" SettlCcy="USD"><Instrmt ID="CL" Src="H" SecTyp="FUT" MMY="202206" MatDt="2022-05-20" Exch="NYMEX"/><RptSide Side="2" InptDev="API"><Pty ID="1234" R="4"/><Pty ID="CME" R="21"/><Pty ID="ACCOUNT1" R="24"><Sub ID="1" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
        </payload>
    </transaction>
</ns2:transactionRpt>

...