Skip to main content
POST
/
quantlib
/
risk
/
var
/
component
Calculate Component VaR
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/risk/var/component \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "returns_by_factor": {
    "US_equities": [
      0.012,
      -0.018,
      0.025,
      -0.008,
      0.015
    ],
    "EU_bonds": [
      0.003,
      -0.002,
      0.004,
      -0.001,
      0.002
    ],
    "commodities": [
      0.02,
      -0.03,
      0.015,
      -0.012,
      0.018
    ]
  },
  "weights": {
    "US_equities": 0.5,
    "EU_bonds": 0.3,
    "commodities": 0.2
  },
  "confidence": 0.95,
  "portfolio_value": 10000000
}
'
{
  "success": true,
  "data": {
    "US_equities": 125000,
    "EU_bonds": 35000,
    "commodities": 78000,
    "total_var": 238000
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
returns_by_factor
object
required

Dictionary mapping factor/asset names to their historical return arrays

Example:
{
"equities": [0.01, -0.02, 0.015],
"bonds": [0.005, -0.003, 0.004]
}
weights
object
required

Portfolio weights for each factor (must sum to 1.0)

Example:
{ "equities": 0.6, "bonds": 0.4 }
confidence
number
default:0.99

Confidence level for VaR calculation

Example:

0.99

portfolio_value
number
default:1000000

Total portfolio value

Example:

1000000

Response

Successful component VaR calculation

success
boolean
Example:

true

data
object

Component VaR for each factor

Example:
{
"US_equities": 125000,
"EU_bonds": 35000,
"commodities": 78000
}