Portfolios

Use this endpoint to submit portfolios for margin and risk analytics calculations.

POST/portfolios

Calculate portfolio margin

Calculate the margin requirements for multi-account and multi-exchange portfolios.

Required attributes

  • Name
    portfolio
    Type
    array
    Description

    Portfolio payload, multi-account positions.

Optional attributes

  • Name
    calculation_type
    Type
    enum
    Description

    One of margins, analytics or all.

  • Name
    calculation_type
    Type
    enum
    Description

    One of margins, analytics or all.

  • Name
    execution_mode
    Type
    enum
    Description

    One of sync or async.

  • Name
    vendor_symbology
    Type
    enum
    Description

    One of clearing, ion, bloomberg, gmi or tt_new.

  • Name
    cme_symbology
    Type
    enum
    Description

    One of clearing or globex.

  • Name
    currency_code
    Type
    string
    Description

    Currency for the aggregate multi-currency results. The international 3-letter currency code, as defined by the ISO 4217 standard.

  • Name
    use_closest_match
    Type
    boolean
    Description

    Allow the system to find and use the closest match contract e.g. for incorrect expiry or strike.

  • Name
    pnl_details
    Type
    boolean
    Description

    Historical P&L details. To create cache data for the entire P&L vector.

Request

POST
/portfolios
# example of portfolio payload
portfolio_payload='
{
    "vendor_symbology": "clearing",
    "calculation_type": "margins",
    "execution_mode": "sync",
    "portfolio": [
        {
            "account_code": "Account 001",
            "exchange_code": "ASX",
            "contract_code": "XT",
            "contract_type": "F",
            "contract_expiry": "DEC-25",
            "contract_strike": "",
            "net_position": "500"
        },
        {
            "account_code": "Account 001",
            "exchange_code": "ICE.EU",
            "contract_code": "B",
            "contract_type": "Future",
            "contract_expiry": "DEC-25",
            "contract_strike": "",
            "net_position": "500"
        },
        {
            "account_code": "Account 001",
            "exchange_code": "NYMEX",
            "contract_code": "LO",
            "contract_type": "CALL",
            "contract_expiry": "202512",
            "contract_strike": "50.1",
            "net_position": "-1000"
        },
        {
            "account_code": "Account 002",
            "exchange_code": "EUREX",
            "contract_code": "FDAX",
            "contract_type": "FUT",
            "contract_expiry": "202612",
            "contract_strike": "",
            "net_position": "-50"
        }
    ]
}'

# post portfolio
headers=("Content-Type: application/json" "Authorization: Bearer $access_token")
response=$(curl -s -X POST "$c9_api_endpoint/portfolios" -H "${headers[1]}" -H "${headers[2]}" -d "$portfolio_payload" | jq)

echo $response

Response

{
  "request_id": "0aa6a8b1-f8d4-4006-9102",
  "username": "@cumulus9.com",
  "data": [
    {
      "request_id": "0aa6a8b1-f8d4-4006-9102",
      "portfolio_id": "13fcacf076f925f0309e",
      "username": "@cumulus9.com",
      "submitted_time": "2025-01-30 09:45:17.197197",
      "account_code": "Account 001",
      "price_date": 20250130,
      "currency_code": "USD",
      "initial_margin": 6313765.31,
      "option_liquidation_value": -18850000,
      "value_at_risk": 0,
      "stress_loss": 0,
      "additional_margin": 0,
      "margin_by_ccp": [
        {
          "clearing_org": "ASXCLF",
          "result_type": "span",
          "currency_code": "AUD",
          "fxrate": 1.60435,
          "initial_margin": 1418500,
          "option_liquidation_value": 0,
          "cross_model_offset": 0
        },
        {
          "clearing_org": "ICE",
          "result_type": "irm",
          "currency_code": "USD",
          "fxrate": 1,
          "initial_margin": 1715000,
          "option_liquidation_value": 0,
          "cross_model_offset": 0
        },
        {
          "clearing_org": "CME",
          "result_type": "span2",
          "currency_code": "USD",
          "fxrate": 1,
          "initial_margin": 3714606.62,
          "option_liquidation_value": -18850000,
          "cross_model_offset": 0
        }
      ],
      "margin_by_contract": [
        {
          "clearing_org": "ASXCLF",
          "result_type": "span",
          "exchange": "SFE",
          "cc_code": "XT",
          "cc_name": "10 Year Treasury Bond",
          "sector": "Interest Rate",
          "sub_sector": "Fixed Income",
          "currency_code": "AUD",
          "fxrate": 1.60435,
          "initial_margin": 1418500,
          "option_liquidation_value": 0
        },
        {
          "clearing_org": "ICE",
          "result_type": "irm",
          "exchange": "I",
          "cc_code": "BRN",
          "cc_name": "Brent Crude",
          "sector": "Energy",
          "sub_sector": "Oil",
          "currency_code": "USD",
          "fxrate": 1,
          "initial_margin": 1715000,
          "option_liquidation_value": 0
        },
        {
          "clearing_org": "CME",
          "result_type": "span2",
          "exchange": "CME",
          "cc_code": "NY-CL",
          "cc_name": "WTI Crude Oil",
          "sector": "Energy",
          "sub_sector": "Oil",
          "currency_code": "USD",
          "fxrate": 1,
          "initial_margin": 3714606.62,
          "option_liquidation_value": 0
        }
      ],
      "margin_by_span": [
        {
          "result_type": "span",
          "clearing_org": "ASXCLF",
          "exchange": "SFE",
          "scenario": "13",
          "cc_code": "XT",
          "currency_code": "AUD",
          "scanning_risk": 1418500,
          "initial_margin": 1418500,
          "prompt_date_charge": 0,
          "intra_spread_charge": 0,
          "short_option_charge": 0,
          "intercontract_credit": 0,
          "strategy_spread_charge": 0,
          "option_liquidation_value": 0
        },
        {
          "result_type": "irm",
          "clearing_org": "ICE",
          "exchange": "I",
          "scenario": "13",
          "cc_code": "BRN",
          "currency_code": "USD",
          "scanning_risk": 1715000,
          "initial_margin": 1715000,
          "prompt_date_charge": 0,
          "intra_spread_charge": 0,
          "short_option_charge": 0,
          "intercontract_credit": 0,
          "strategy_spread_charge": 0,
          "option_liquidation_value": 0
        }
      ],
      "margin_by_span2": [
        {
          "result_type": "span2",
          "clearing_org": "CME",
          "exchange": "CME",
          "pod_id": "CRUDE",
          "pod_name": "CRUDE",
          "currency_code": "USD",
          "margin_method": "SPAN2",
          "option_liquidation_value": -18850000,
          "initial_margin": 3714606.62,
          "maintenance_margin": 3714606.62,
          "concentration_component": 6606.27,
          "hvar_component": 2050031.02,
          "implied_offset": 0,
          "liquidity_component": 83387.98,
          "short_option_min": 30000,
          "stress_component": 1574581.34,
          "product_group": [
            {
              "product_group_id": "CL",
              "product_description": "WTI Crude Oil",
              "currency_code": "USD",
              "risk_maintenance_requirement": 3714606.62,
              "concentration_component": 6606.27,
              "hvar_component": 2050031.02,
              "liquidity_component": 83387.98,
              "stress_component": 1574581.34,
              "implied_offset_prorated": 0,
              "total_initial_margin": 3714606.62
            }
          ]
        }
      ],
      "closest_matches": [
        {
          "position_id": "0",
          "engine": "validation",
          "exception": "Applied closest matching expiry instead of loaded DEC-25 on position ASX | XT - 10 Year Treasury Bond Futures | FUT | 202506 | 0"
        },
        {
          "position_id": "2",
          "engine": "validation",
          "exception": "Applied closest matching strike instead of loaded 50.1 on position NYMEX | LO - Crude Oil Options | CALL | 202512 | 50"
        }
      ],
      "portfolio": [
        {
          "market_type": "ETD",
          "position_id": "0",
          "exch_acronym": "ASX",
          "contract_code": "XT - 10 Year Treasury Bond Futures",
          "contract_type": "FUT",
          "contract_id": "06a8f567b7ad61171413adbb3b0640e7",
          "expiry": "202506",
          "rel_period": 2,
          "last_trade_date": 20250616,
          "time_to_maturity": 99,
          "net_position": 500,
          "account_type": "H",
          "price_date": 20250129,
          "stl_price": 95.6,
          "cvf": 1186.511915,
          "is_valid": true,
          "cycle_code": false,
          "fxrate": 1.602,
          "decomp_legs": [],
          "closest_match_applied": [
            {
              "lower_bound": 202503,
              "upper_bound": 202506,
              "error_fields": "expiry",
              "closest_match": "JUN-25",
              "loaded_value": "DEC-25"
            }
          ],
          "clearing_org": "ASXCLF",
          "option_type": null,
          "margin_currency": "AUD",
          "unit": "AUD",
          "sector": "Interest Rate",
          "sub_sector": "Fixed Income",
          "underlying": "10 Year Treasury Bond",
          "option_model": null,
          "free_risk_rate": 0.01,
          "imp_vol": 0.2
        },
        {
          "market_type": "ETD",
          "position_id": "1",
          "exch_acronym": "ICE.EU",
          "contract_code": "B - Brent Crude Futures",
          "contract_type": "FUT",
          "contract_id": "d4520d3e958f968cb1ab7fdd05b4dd07",
          "expiry": "20251200",
          "rel_period": 10,
          "last_trade_date": 20251031,
          "time_to_maturity": 198,
          "net_position": 500,
          "account_type": "H",
          "price_date": 20250129,
          "stl_price": 71.44,
          "cvf": 1000,
          "volume": 53306,
          "is_valid": true,
          "cycle_code": false,
          "fxrate": 1,
          "decomp_legs": [],
          "closest_match_applied": [],
          "clearing_org": "IPE",
          "option_type": null,
          "margin_currency": "USD",
          "unit": "barrel",
          "sector": "Energy",
          "sub_sector": "Oil",
          "underlying": "Brent Crude",
          "option_model": null,
          "free_risk_rate": 0.01,
          "imp_vol": 0.2
        },
        {
          "market_type": "ETD",
          "position_id": "2",
          "exch_acronym": "NYMEX",
          "contract_code": "LO - Crude Oil Options",
          "contract_type": "CALL",
          "contract_id": "7e11131582ad9b29043b51698086cd18",
          "expiry": "202512",
          "rel_period": "0",
          "last_trade_date": 20251117,
          "time_to_maturity": 209,
          "strike": 50,
          "net_position": -1000,
          "account_type": "H",
          "price_date": 20250129,
          "ustl_price": 67.72,
          "cvf": 1000,
          "is_valid": true,
          "cycle_code": false,
          "fxrate": 1,
          "decomp_legs": [],
          "closest_match_applied": [
            {
              "lower_bound": 0.5,
              "upper_bound": 350,
              "error_fields": "strike",
              "closest_match": 50,
              "loaded_value": 50.1,
              "strike_denominator": 1
            }
          ],
          "clearing_org": "CME",
          "option_type": "C",
          "margin_currency": "USD",
          "unit": "barrel",
          "sector": "Energy",
          "sub_sector": "Oil",
          "underlying": "Crude Oil",
          "option_model": "B76",
          "free_risk_rate": 0.01,
          "imp_vol": 0.2
        }
      ]
    },
    {
      "request_id": "0aa6a8b1-f8d4-4006-9102",
      "portfolio_id": "910d938911f13d8c347fdba1e3dcc5d5",
      "username": "@cumulus9.com",
      "submitted_time": "2025-01-30 09:45:17.197197",
      "account_code": "Account 002",
      "price_date": 20250130,
      "currency_code": "USD",
      "initial_margin": 2150381.7,
      "option_liquidation_value": 0,
      "value_at_risk": 0,
      "stress_loss": 0,
      "additional_margin": 0,
      "margin_by_ccp": [
        {
          "clearing_org": "EUREX_P",
          "result_type": "eurexpme",
          "currency_code": "EUR",
          "fxrate": 0.95948,
          "initial_margin": 2063248.2336687227,
          "option_liquidation_value": 0,
          "cross_model_offset": 0
        }
      ],
      "margin_by_contract": [
        {
          "clearing_org": "EUREX_P",
          "result_type": "eurexpme",
          "exchange": "EUREX",
          "cc_code": "PEQ01",
          "cc_name": "Listed Equity Index",
          "sector": "Equity",
          "sub_sector": "Single Name",
          "currency_code": "EUR",
          "fxrate": 0.95948,
          "initial_margin": 2063248.2336687227,
          "option_liquidation_value": 0
        }
      ],
      "margin_by_eurexpme_drilldown": [
        {
          "line_no": 3,
          "iid": 67104574,
          "product_id": "FDAX",
          "contract_date": 20261218,
          "maturity": 202612,
          "call_put_flag": "",
          "exercise_price": 0,
          "version_number": "0",
          "net_ls_balance": -50,
          "liquidation_group": "PEQ01",
          "liquidation_group_split": "PEQ01_HP3",
          "component_margin": 2063248.2336687224,
          "component_margin_currency": "EUR",
          "premium_margin": 0,
          "premium_margin_currency": "EUR"
        }
      ],
      "margin_by_eurexpme": [
        {
          "result_type": "eurexpme",
          "clearing_org": "EUREX_P",
          "exchange": "EUREX",
          "currency_code": "EUR",
          "liquidation_group": "PEQ01",
          "liquidation_group_split": "PEQ01_HP3",
          "initial_margin": 2063248.2336687227,
          "market_risk": 2060662.1209639995,
          "liquidity_addon": 2586.112704723063,
          "long_option_credit": 0,
          "time_to_expiry_adjustment": 0,
          "premium_margin": 0
        }
      ],
      "portfolio": [
        {
          "market_type": "ETD",
          "position_id": "3",
          "exch_acronym": "EUREX",
          "contract_code": "FDAX - DAX Index Futures",
          "contract_type": "FUT",
          "contract_id": "9f160777bcfb3d34137418b0cef3515e",
          "expiry": "202612",
          "rel_period": 8,
          "last_trade_date": 20261218,
          "time_to_maturity": 493,
          "net_position": -50,
          "account_type": "H",
          "price_date": 20250129,
          "stl_price": 22882,
          "cvf": 25,
          "is_valid": true,
          "cycle_code": false,
          "fxrate": 0.9593,
          "decomp_legs": [],
          "closest_match_applied": [],
          "clearing_org": "EUREX_P",
          "option_type": null,
          "margin_currency": "EUR",
          "unit": "x index",
          "sector": "Equity",
          "sub_sector": "Index",
          "underlying": "DAX Index",
          "option_model": null,
          "free_risk_rate": 0.01,
          "imp_vol": 0.2
        }
      ]
    }
  ],
  "runtime": 1310,
  "parameters": {}
}

Was this page helpful?