Calculations¶
The Calculation API provides endpoints to perform portfolio stress tests, risk attribution, exposure and sensitivity calculations. Monte Carlo with full revaluation as well as parametric end points are provided.
Every calculation is a POST to /calculations/<name>, with its parameters in a JSON body.
The portfolio¶
Most calculations run on a portfolio, which you either describe inline or reference by id:
| Parameter | Description |
|---|---|
securities array |
The securities in the portfolio, each with a unique id, symbol, quantity and label. See Securities. |
portfolio_id string |
The ID of an existing portfolio. The calculation uses the portfolio's securities, date, base currency and NLV, and securities is no longer required. |
date string date |
Portfolio date in the format YYYYMMDD. The API uses the market conditions and prices prevailing on that date. Defaults to null (today). |
base_currency string |
3-letter ISO 4217 currency code. Changing it automatically incorporates currency risks. Defaults to USD. |
nlv float |
The net liquidating value of the portfolio. Defaults to null, in which case the API calculates it from all cash securities. |
Beyond these, each calculation takes its own parameters. The ones shared by several calculations, like confidence, filter or horizon, are described under Parameters.
The response¶
A calculation returns a JSON object keyed by the calculation name, plus an unmapped_tickers list with any symbols the API could not recognize: