Excerpt |
---|
The calculate margin request performs a margin calculation on an existing portfolio with optional additional transactions. |
Request
XPath | Name | Type | Required | Notes |
---|---|---|---|---|
| Requesting User ID | No | ||
| Portfolio ID | Yes | ||
| Risk Framework | No | Specifies if the request should be margined in the SPAN or the SPAN 2 methodology. This is relevant to Futures & Options users only. |
Response
XPath | Name | Type | Required | Notes |
---|---|---|---|---|
| Status | Yes | ||
| Create Time | Yes | ||
| ID | Yes | ||
| Portfolio ID | Yes | ||
| Update Time | Yes | ||
| Error Message | No | ||
| Error Message | No |
Errors
Code | Description |
---|---|
| Bad XML syntax or missing content. More information will be provided in the error message. |
| Returned if the user does not have permission to perform calculations on the portfolio |
| The server was not able to process the request. More information (if available) will be provided in the error message. |
Examples
Basic
This example requests that a portfolio with ID 123
be margined. The unique ID of the margin request is returned along with the portfolio identifier.
Calculating Margin for CME
Request - All Margin Methodologies
Code Block |
---|
POST {{API_URL}}/margins |
Code Block | ||
---|---|---|
|
<core:marginReq xmlns:core="http://cmegroup.com/schema/core/1.2">
<margin portfolioId="123" />
</core:marginReq> |
Request - SPAN 2 Margin
For the SPAN 2 project, the CORE API has been enhanced with a new was enhanced to include attribute "riskFramework" which specifies if the request specific products going through a SPAN 2 framework transition should be margined in the SPAN or the SPAN 2 methodology during the SPAN 2 transitionframework. This is relevant to Futures & Options users only.
Expected values in riskFramework attribute:
CURRENT - current production margin framework.
This will equate to SPAN methodology until the SPAN 2 project go live for upcoming in-scope products.
NEXT - upcoming production margin framework, in production parallel.
This will equate to SPAN 2 methodology for in-scope products.
For Top top day margin request in CORE, please refer to the below table for cycle names and approximate timings.
Risk Cycle Naming Conventions
CORE Cycle Naming Convention | Naming Convention (risk parameter files) | Approximate Risk Snapshot Timing | Description |
---|---|---|---|
X | .x | 8:30 a.m. CT | Forecasting cycle. Includes any risk parameter changes planned for go live in the top day EOD cycle as described in Clearing Advisories. Does not include forecasted risk scenario changes. |
AM | .a | 11:00 a.m. CT | Morning file, run occurs before ITD cycle. |
ITD | .i | 12:00 p.m. CT | ITD cycled used for CME settlements and reporting. |
AFTER_ITD | .ai | 2:30 p.m. CT | After ITD cycle. |
SUPER_EARLY | . |
be | 3:30 p.m. CT | Very early EOD cycle. | |
EARLY | .e | 4:30 p.m. CT | Early EOD cycle. Settle prices incorporated for some markets. |
FINAL | .s | 6:30 p.m. CT | Second early EOD cycle. Settle prices incorporated for all markets. |
EOD | .c | 8:00 p.m. CT | Final EOD cycle used for CME settlements and reporting. |
Request
Code Block | ||||
---|---|---|---|---|
| ||||
<core:marginReq xmlns:core="http://cmegroup.com/schema/core/1.12"> <margin portfolioId="123" riskFramework="NEXT" /> </core:marginReq> |
Response
Code Block | ||||
---|---|---|---|---|
| ||||
<ns2:marginRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="PROCESSING"> <margin portfolioId="123" id="321"/> </ns2:marginRpt> |
Request - Historical Margin
The CORE API now supports historical margin calculations and two new with the attributes "date" and "code" have been added to in the request. This is relevant to Futures & Options users only.
New attributes:
Date: CME core allows user to margin portfolios in SPAN 2 framework as of late 2022 and in SPAN framework as of late 2021. Acceptable date format is yyyy-mm-dd.
Code: For last 5 business days, user can select from several daily cycles, please refer to the
above table “Risk Cycle Naming Conventions”. For margin request prior to 5 business days, the .
i, .s and .c cycles are available.
SPAN requestRequest Example
Code Block |
---|
<core:marginReq xmlns:core="http://www.cmegroup.com/schema/core/1.14"> <cycle date="2023-03-31" code="ITD"/> <margin portfolioId="123" riskFramework="CURRENT"/> </core:marginReq> |
SPAN 2 Request
Code Block |
---|
<core:marginReq xmlns:core="http://www.cmegroup.com/schema/core/1.14">
<cycle date="2023-03-31" code="EOD"/>
<margin portfolioId="123" riskFramework="NEXT"/>
</core:marginReq> |
ResponseResponse Example
Code Block |
---|
<ns2:marginRpt xmlns:ns2="http://cmegroup.com/schema/core/1.2" status="PROCESSING"> <margin portfolioId="123" id="321"/> </ns2:marginRpt> |