Margin Service API - Optimize - Get
The get optimize request returns the status and results of an optimize request by its identifier.
Description
The request allows the Client to get the optimized results of an already optimized portfolio which was added and optimized in the Margin API (Add Portfolio and Optimize Portfolio). The Client must submit the unique assigned optimize request identifier in the request URL. The server then returns the identifier along with the status and the result requested.  Â
Request
Parameter | Name | Type | Required | Notes |
---|---|---|---|---|
| Requesting User ID | No | Â |
The response for the Optimize get request includes the portfolio margin for three portfolio states:
Current (futCurrAmt and otcCurrAmt): Margin of portfolio including the current allocation of futures in the OTC IRS account versus SEG account.
Baseline (futPreAmt and otcPreAmt): Margin of portfolio where no futures are in the OTC IRS account.
Post-Optimizer (futPostAmt and otcPostAmt): Margin of portfolio including the Optimizer's allocation of futures in the OTC IRS account versus SEG account.
Entity | |
Action | Get |
URL |
|
HTTP Method |
|
Parameter Input | Yes |
XML Input | No |
Multiple Output | No |
Synchronous | Yes |
Response
XPath | Name | Type | Required | Notes |
---|---|---|---|---|
| Status | Yes | Â | |
| Error Code | No | Â | |
| Error Message | No | Â | |
| As-of Time | No | Â | |
| Create Time | Yes | Â | |
| ID | Yes | Â | |
| Portfolio ID | Yes | Â | |
| Settlement Qualifer | No | Â | |
| Settlement Indicator | No | Â | |
| Update Time | Yes | Â | |
| Amount Currency | Yes | Â | |
| Currency Exchange Rate | No | Exchange rate used to convert base currency to USDE | |
| Concentration Margin Amount | No | Concentration/liquidity margin requirement | |
| Initial Margin Amount | Yes | Initial margin requirement (Base + Concentration/liquidity + Skew) | |
| Maintenance Margin Amount | Yes | Maintenance margin requirement (Base + Concentration/liquidity + Skew) | |
| Option Value Amount | Yes | Net Options Value (Long Options Value - Short Options Value). This only applies to portfolios with options. Negative if net short, positive if net long. | |
| Futures margin current portfolio | Yes | SPAN®margin for the current allocation of futures in the SEG account | |
| Futures margin baseline portfolio | Yes | SPAN®margin for all futures (OTC and SEG futures) in account | |
| Futures margin post-optimized portfolio | Yes | SPAN®margin for SEG futures allocation identified by the Optimizer | |
| OTC margin current portfolio | Yes | OTC IRS margin for the current allocation of IRS+OTC futures in the account | |
| OTC margin baseline portfolio | Yes | OTC IRS margin for IRS positions only | |
| OTCÂ margin post-optimized portfolio | Yes | OTC IRS margin for IRS + OTC futures identified by the Optimizer | |
| Portfolio ID | Yes | Â | |
| Transaction Type | Yes | Â | |
| ID | Yes | Â | |
| Encoding | Yes | Â | |
| Format | Yes | Â | |
| Payload String | No | Returned Optimizer offset and onset trade capture reports, FIXML format. |
Â
Examples
This assumes that margin request for portfolio has already been submitted. The id used (2345 should be the CME CORE generated unique id returned in response to a Margin Calculate request.
Like some list requests, Optimize Get response includes FIXML transactions which represent the onset and offset trades the Optimizer uses to describe which futures should move to or from the OTC IRS account to achieve margin offsets. Note the Optimizer Get response uses "TrdTyp = 22" to describe futures in the OTC IRS account.
Optimize Request
GET /MarginServiceApi/1.6/optimize/1234567
Response - Portfolio Optimized
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:optimizerRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="SUCCESS">
<margin portfolioId="12345678" id="1234567" createTime="2019-11-21T19:56:42+00:00" updateTime="2019-11-21T19:56:45+00:00">
<amounts conc="3531.75158986107" init="1033754.24448408" maint="1037285.99607394" optVal="48125">
<portfolio futCurrAmt="230415" futPreAmt="260000" futPostAmt="1300" otcCurrAmt="623627.825051428" otcPreAmt="1547449.14988385" otcPostAmt="1035985.99607394" diffAmt="770163.15380991"/>
</amounts>
</margin>
<transaction portfolioId="12345678" 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="100" SettlCcy="USD"><Instrmt ID="21" Src="H" SecTyp="FUT" MMY="201912" MatDt="2019-12-19" Exch="CBT"/><RptSide Side="2" InptDev="API"><Pty ID="TEST" R="4"/><Pty ID="CME" R="21"/><Pty ID="1234" R="24"><Sub ID="2" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
</payload>
</transaction>
<transaction portfolioId="12345678" 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 TrdTyp="22" LastQty="100" SettlCcy="USD"><Instrmt ID="21" Src="H" SecTyp="FUT" MMY="201912" MatDt="2019-12-19" Exch="CBT"/><RptSide Side="1" InptDev="API"><Pty ID="TEST" R="4"/><Pty ID="CME" R="21"/><Pty ID="1234" R="24"><Sub ID="2" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
</payload>
</transaction>
<transaction portfolioId="12345678" type="TRADE" id="1234569">
<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="99" SettlCcy="USD"><Instrmt ID="21" Src="H" SecTyp="FUT" MMY="201912" MatDt="2019-12-19" Exch="CBT"/><RptSide Side="2" InptDev="API"><Pty ID="TEST" R="4"/><Pty ID="CME" R="21"/><Pty ID="1234" R="24"><Sub ID="2" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
</payload>
</transaction>
<transaction portfolioId="12345678" type="TRADE" id="1234570">
<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 TrdTyp="22" LastQty="99" SettlCcy="USD"><Instrmt ID="21" Src="H" SecTyp="FUT" MMY="201912" MatDt="2019-12-19" Exch="CBT"/><RptSide Side="1" InptDev="API"><Pty ID="TEST" R="4"/><Pty ID="CME" R="21"/><Pty ID="1234" R="24"><Sub ID="2" Typ="26"/></Pty></RptSide></TrdCaptRpt></FIXML></string>
</payload>
</transaction>
</ns2:optimizerRpt>
Response - Portfolio Could not be Optimized
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:optimizerRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="SUCCESS">
<margin portfolioId="12345679" id="1234568" createTime="2019-11-25T17:31:41+00:00" updateTime="2019-11-25T17:31:44+00:00">
<amounts conc="0" init="271810.135066162" maint="271810.135066162">
<portfolio futCurrAmt="0" futPreAmt="5200" futPostAmt="0" otcCurrAmt="271810.135066162" otcPreAmt="284884.360044503" otcPostAmt="271810.135066162" diffAmt="18274.224978341"/>
</amounts>
</margin>
</ns2:optimizerRpt>
Â
Â
Errors
Code | Description |
---|---|
| Returned if the user does not have permission to access the specified optimize response. |
| Returned if the requested optimizer calculation could not be found. |
| The server was not able to process the request. More information (if available) will be provided in the error message. |
Â
How was your Client Systems Wiki Experience? Submit Feedback
Copyright © 2024 CME Group Inc. All rights reserved.