Skip to end of metadata
Go to start of metadata

 

‘ALL-IN-ONE’ margin call is an all-inclusive margin calculation request that allows a user to specify transactions and/or a portfolio id that was created using an earlier call.  This call is limited to one portfolio at a time. This features allows a single asynchronous request to build a portfolio, add transactions, and request margin calculation.   

See the following topics on this page:

Supported Asset Classes

ALL-IN-ONE margin call supports all assets classes, including:

  • IRS – Interest Rate Swaps
  • IRS - Swaptions
  • DL – Delta Ladders
  • CDS  - Credit Default Swaps
  • F&O - Futures and Options
  • FX – Foreign Exchange

Enabling ALL-IN-ONE Margin Call

To enable this feature, use the API version 1.1 schema or above and complete the following steps:

CMEUS Margin

  1. Append a “?complete = true”  request parameter to the margin request, such as  /MarginServiceApi/margins?complete=true
  2. Include either transactions or a portfolio id in the ‘marginReq’ xml

CMECE Margin

IRS:

  1. Append a “?complete = true”  request parameter to the margin request, such as  /MarginServiceApi/margins/CMECE?complete=true
  2. Include either transactions or a portfolio id in the ‘marginReq’ xml

F&O: 

  1. Append a “?complete = true”  request parameter to the margin request, such as  /MarginServiceApi/margins/?complete=true
  2. Include either transactions or a portfolio id in the ‘marginReq’ xml

*IRS and segregated F&O postions only for CMECE

Specify transactions in either CSV or XML formats, and note the following system behavior:

  • When only transactions are supplied within the ‘ALL-IN-ONE’ margin call, the API creates a portfolio, adds the given transactions to the portfolio, margins the portfolio, and returns a margin request id within the response. 
  • When an existing portfolio id is specified and no transactions are included within the call, the API requests a margin on the transactions that currently exist within the specified portfolio id.  If the given portfolio id does not contain any trades, and no transactions are specified, the API returns an error. 
  • When an existing portfolio id is specified, and transactions are included within the call, the specified transactions are added to the existing portfolio before margining.
  • This request acts asynchronously to return a margin response id within the response, which is then used to poll for results.
Sample Request Message (CMEUS)
POST /MarginServiceApi/margins?complete=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2">
<margin>
<transactions>
<transaction type="TRADE">
<payload format="CSV" encoding="STRING">
<string>
Product,Direction,Clearing Firm,Account Number,Contract,Maturity,Notional,Coupon,Currency
CDS,B,123,TEST123,2I65BYBX2,201912,"1,000,000",100,USD
CDS,S,234,TEST234,CG13,201912,"1,850,000",100,USD
CDS,B,456,TEST456,CG15,201712,"1,500,000",100,USD
</string>
</payload>
</transaction>
</transactions>
</margin>
</ns2:marginReq>
Sample Response Message (CMEUS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginRpt 
    xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="PROCESSING">
    <margin portfolioId="1234" id="123456"/>
</ns2:marginRpt>
Sample Request Message (CMECE)
POST /MarginServiceApi/margins/CMECE?complete=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2">
<margin>
<transactions>
<transaction type="TRADE">
<payload format="CSV" encoding="STRING">
<string>
Firm ID,Account ID,Product Type ,Currency,Effective Date,Maturity Date,Notional,Direction,Fixed Rate
TEST,1234,Vanilla,AUD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,CAD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,CHF,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,CZK,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,DKK,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,EUR,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,GBP,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,HKD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,HUF,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,JPY,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,MXN,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,NOK,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,NZD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,PLN,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,SEK,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,SGD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,USD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,ZAR,6/3/2015,6/3/2017,10000000,R,0.05
</string>
</payload>
</transaction>
</transactions>
</margin>
</ns2:marginReq>


Sample Response Message (CMECE)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="PROCESSING">
    <margin portfolioId="5418340" id="4598428"/>
</ns2:marginRpt>
FIXML All in One Request 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2" xmlns:ns4="http://www.fpml.org/FpML-5/confirmation" xmlns:ns3="http://www.w3.org/2000/09/xmldsig#" xmlns:ns5="http://www.cmegroup.com/otc-clearing/confirmation" xmlns:ns6="www.cmegroup.com/fixml50/1">
    <margin>
        <transactions>
            <transaction type="TRADE">
                <payload encoding="STRING" format="FIXML"><string><![CDATA[<FIXML xmlns="www.cmegroup.com/fixml50/1" v="5.0 SP2" xv="109" cv="CME.0001" s="20090815">
<TrdCaptRpt LastQty="1000000"><Instrmt ID="IT21" Src="H" SecTyp="CDS" MMY="201906" RstrctTyp="MM" Snrty="SR" CpnRt="0.01"/><RptSide Side="2" InptDev="API">
<Pty ID="234" R="4"/>
<Pty ID="TEST234" R="24"/>
</RptSide>
</TrdCaptRpt>
</FIXML>]]></string>
                </payload>
            </transaction>
        </transactions>
    </margin>
</ns2:marginReq>
FpML All in One Request
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2" xmlns:ns4="http://www.fpml.org/FpML-5/confirmation" xmlns:ns3="http://www.w3.org/2000/09/xmldsig#" xmlns:ns5="http://www.cmegroup.com/otc-clearing/confirmation" xmlns:ns6="www.cmegroup.com/fixml50/1">
    <margin>
        <transactions>
            <transaction type="TRADE">
                <payload encoding="STRING" format="FPML"><string>
<![CDATA[<ns3:FpML xmlns="http://www.fpml.org/FpML-5/confirmation" xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
          xmlns:ns3="http://www.cmegroup.com/otc-clearing/confirmation">
    <clearingConfirmed>
        <trade>
            <tradeHeader>
                <partyTradeIdentifier>
                    <partyReference href="clearing_service"/>
                    <tradeId tradeIdScheme="cme_trade_id"/>
                    <tradeId tradeIdScheme="remaining_trade_id"/>
                    <tradeId tradeIdScheme="platform_trade_id"/>
                    <tradeId tradeIdScheme="block_trade_id"/>
                    <tradeId tradeIdScheme="client_trade_id"/>
                </partyTradeIdentifier>
                <partyTradeInformation>
                    <partyReference href="clearing_firm"/>
                    <accountReference href="account1"/>
                    <relatedParty>
                        <partyReference href="trade_source"/>
                        <role>InputSource</role>
                    </relatedParty>
                    <category categoryScheme="cme_origin_code"/>
                </partyTradeInformation>
                <tradeDate>2011-09-06</tradeDate>
            </tradeHeader>
            <swap>
                <swapStream id="fixedLeg">
                    <payerPartyReference href="clearing_firm"/>
                    <payerAccountReference href="account1"/>
                    <receiverPartyReference href="clearing_service"/>
                    <calculationPeriodDates id="fixedLegCalcPeriodDates">
                        <effectiveDate>
                            <unadjustedDate>2011-09-06</unadjustedDate>
                            <dateAdjustments>
                                <businessDayConvention>NONE</businessDayConvention>
                            </dateAdjustments>
                            <adjustedDate>2011-09-06</adjustedDate>
                        </effectiveDate>
                        <terminationDate>
                            <unadjustedDate>2021-09-06</unadjustedDate>
                            <dateAdjustments>
                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                <businessCenters>
                                    <businessCenter>BRBD</businessCenter>
                                    <businessCenter>USNY</businessCenter>
                                </businessCenters>
                            </dateAdjustments>
                            <adjustedDate>2021-09-06</adjustedDate>
                        </terminationDate>
                        <calculationPeriodDatesAdjustments>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>BRBD</businessCenter>
                                <businessCenter>USNY</businessCenter>
                            </businessCenters>
                        </calculationPeriodDatesAdjustments>
                        <calculationPeriodFrequency>
                            <periodMultiplier>1</periodMultiplier>
                            <period>T</period>
                            <rollConvention>NONE</rollConvention>
                        </calculationPeriodFrequency>
                    </calculationPeriodDates>
                    <paymentDates>
                        <calculationPeriodDatesReference href="fixedLegCalcPeriodDates"/>
                        <paymentFrequency>
                            <periodMultiplier>1</periodMultiplier>
                            <period>T</period>
                        </paymentFrequency>
                        <payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
                        <paymentDatesAdjustments>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>USNY</businessCenter>
                                <businessCenter>BRBD</businessCenter>
                            </businessCenters>
                        </paymentDatesAdjustments>
                    </paymentDates>
                    <calculationPeriodAmount>
                        <calculation>
                            <notionalSchedule>
                                <notionalStepSchedule>
                                    <currency>BRL</currency>
                                </notionalStepSchedule>
                            </notionalSchedule>
                            <futureValueNotional>
                                <amount>12345</amount>
                            </futureValueNotional>
                            <fixedRateSchedule>
                                <initialValue>0.03123</initialValue>
                            </fixedRateSchedule>
                            <dayCountFraction>BUS/252.FIXED</dayCountFraction>
                            <compoundingMethod>None</compoundingMethod>
                        </calculation>
                    </calculationPeriodAmount>
                    <cashflows>
                        <cashflowsMatchParameters>true</cashflowsMatchParameters>
                    </cashflows>
                </swapStream>
                <swapStream id="floatLeg">
                    <payerPartyReference href="clearing_service"/>
                   <receiverPartyReference href="clearing_firm"/>
                    <receiverAccountReference href="account1"/>
                    <calculationPeriodDates id="floatLegCalcPeriodDates">
                        <effectiveDate>
                            <unadjustedDate>2011-09-06</unadjustedDate>
                            <dateAdjustments>
                                <businessDayConvention>NONE</businessDayConvention>
                            </dateAdjustments>
                            <adjustedDate>2011-09-06</adjustedDate>
                        </effectiveDate>
                        <terminationDate>
                            <unadjustedDate>2021-09-06</unadjustedDate>
                            <dateAdjustments>
                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                <businessCenters>
                                    <businessCenter>BRBD</businessCenter>
                                    <businessCenter>USNY</businessCenter>
                                </businessCenters>
                            </dateAdjustments>
                            <adjustedDate>2021-09-06</adjustedDate>
                        </terminationDate>
                        <calculationPeriodDatesAdjustments>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>BRBD</businessCenter>
                                <businessCenter>USNY</businessCenter>
                            </businessCenters>
                        </calculationPeriodDatesAdjustments>
                        <calculationPeriodFrequency>
                            <periodMultiplier>1</periodMultiplier>
                            <period>T</period>
                            <rollConvention>NONE</rollConvention>
                        </calculationPeriodFrequency>
                    </calculationPeriodDates>
                   <paymentDates>
                        <calculationPeriodDatesReference href="floatLegCalcPeriodDates"/>
                        <paymentFrequency>
                            <periodMultiplier>1</periodMultiplier>
                            <period>T</period>
                        </paymentFrequency>
                        <payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
                        <paymentDatesAdjustments>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>BRBD</businessCenter>
                                <businessCenter>USNY</businessCenter>
                            </businessCenters>
                        </paymentDatesAdjustments>
                    </paymentDates>
                    <resetDates id="floatLegResetDates">
                        <calculationPeriodDatesReference href="floatLegCalcPeriodDates"/>
                        <resetRelativeTo>CalculationPeriodStartDate</resetRelativeTo>
                        <fixingDates>
                            <periodMultiplier>-2</periodMultiplier>
                            <period>D</period>
                            <dayType>Business</dayType>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>BRBD</businessCenter>
                                <businessCenter>USNY</businessCenter>
                            </businessCenters>
                            <dateRelativeTo href="floatLegResetDates"/>
                        </fixingDates>
                        <resetFrequency>
                            <periodMultiplier>1</periodMultiplier>
                            <period>D</period>
                        </resetFrequency>
                        <resetDatesAdjustments>
                            <businessDayConvention>MODFOLLOWING</businessDayConvention>
                            <businessCenters>
                                <businessCenter>BRBD</businessCenter>
                                <businessCenter>USNY</businessCenter>
                            </businessCenters>
                        </resetDatesAdjustments>
                    </resetDates>
                    <calculationPeriodAmount>
                        <calculation>
                            <notionalSchedule>
                                <notionalStepSchedule>
                                    <currency>BRL</currency>
                                </notionalStepSchedule>
                            </notionalSchedule>
                            <floatingRateCalculation>
                                <floatingRateIndex>BRL-CDI</floatingRateIndex>
                                <indexTenor>
                                    <periodMultiplier>1</periodMultiplier>
                                    <period>D</period>
                                </indexTenor>
                            </floatingRateCalculation>
                            <dayCountFraction>BUS/252.FIXED</dayCountFraction>
                            <compoundingMethod>None</compoundingMethod>
                        </calculation>
                    </calculationPeriodAmount>
                    <cashflows>
                        <cashflowsMatchParameters>true</cashflowsMatchParameters>
                    </cashflows>
                </swapStream>
            </swap>
        </trade>
        <party id="clearing_firm">
            <partyId partyIdScheme="clearing_member_firms">Test</partyId>
        </party>
        <party id="clearing_service">
            <partyId/>
        </party>
        <party id="trade_source">
            <partyId/>
        </party>
        <account id="account1">
            <accountId accountIdScheme="clearing_firm_accounts">1234</accountId>
            <servicingParty href="clearing_firm"/>
        </account>
    </clearingConfirmed>
</ns3:FpML>]]>
</string>
                </payload>
            </transaction>
        </transactions>
    </margin>
</ns2:marginReq>

Cross Margin IRS and Futures
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:marginReq xmlns:ns2="http://cmegroup.com/schema/core/1.2">
<margin>
<transactions>
<transaction type="TRADE">
                              <payload encoding="STRING" format="CSV"><string>Firm ID,Account ID,Product Type ,Currency,Effective Date,Maturity Date,Notional,Direction,Fixed Rate
TEST,1234,Vanilla,AUD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,CAD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,CHF,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,CZK,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,DKK,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,EUR,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,GBP,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,HKD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,HUF,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,JPY,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,MXN,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,NOK,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,NZD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,PLN,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,SEK,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,SGD,6/3/2015,6/3/2017,10000000,R,0.05
TEST,1234,Vanilla,USD,6/3/2015,6/3/2017,10000000,P,0.05
TEST,1234,Vanilla,ZAR,6/3/2015,6/3/2017,10000000,R,0.05</string>
                              </payload>
               </transaction>
               <transaction type="TRADE">
                              <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,123,CME,GEZ9,,ED,201912,,,,1000,OTC
Test,123,CBT,ZFM6,,25,201606,,,,10,OTC
                        </string>
                              </payload>
               </transaction>
</transactions>
</margin>
</ns2:marginReq>

 

Polling For Your Results

Use the Id (id="123456" in this case) and use it to poll for your margin results.

  • No labels