Staged What-If
Calculate a changed portfolio and compare it with a stored baseline without replacing the original result.
Stage the changed book
Call POST /portfolios/stage with the changed book. The stage endpoint accepts
the same tabular row shape as the portfolio loader.
For an ETD stage, each row contains line ID, account code, exchange, contract, type, expiry, strike, net position, and account type, in that order.
{
"type": "etd",
"data": [["0", "WHAT_IF_ACCOUNT", "ICE.EU", "B", "FUT", "DEC-27", "", "120", "H"]],
"idx": [0],
"errors": [],
"vendor_symbology": "clearing"
}
The response contains the standardised data and cell-coordinate errors. Fix any errors before submitting.
Event-market stages require the requested exchange to be enabled on your licence.
An unlicensed event stage returns 403 with EVENT_MARKET_NOT_LICENSED.
Submit the comparison
Call POST /portfolios/stage/submit after the staged rows are valid.
Use the request_id and portfolio_id of a stored result you can view:
{
"action": "what-if",
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"portfolio_id": "ca6b921c04f6afa9e35608d61a0223b3"
}
The server resolves the stored baseline from the authenticated API key.
Read the result
Fields ending in _1 are baseline values. Fields ending in _2 are staged values.
{
"what_if": {
"summary": {
"gross_requirement_1": 1250000,
"gross_requirement_2": 1310000,
"value_at_risk_1": 310000,
"value_at_risk_2": 330000
},
"margin_by_contract": [],
"portfolio": []
}
}
A 403 means the baseline is outside the caller's visibility. A 409 means its stored detail has aged out and the baseline must be submitted again.