Skip to main content
POST
/
quantlib
/
portfolio
/
risk
/
var
Portfolio Value at Risk (VaR)
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/portfolio/risk/var \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "weights": [
    0.3,
    0.25,
    0.25,
    0.2
  ],
  "covariance_matrix": [
    [
      0.04,
      0.006,
      0.008,
      0.01
    ],
    [
      0.006,
      0.09,
      0.012,
      0.015
    ],
    [
      0.008,
      0.012,
      0.0625,
      0.018
    ],
    [
      0.01,
      0.015,
      0.018,
      0.16
    ]
  ],
  "confidence": 0.95,
  "horizon": 0.00396825,
  "portfolio_value": 1000000,
  "method": "parametric"
}
'
{
  "success": true,
  "data": {
    "var": 52345.67,
    "confidence": 0.95,
    "method": "parametric"
  }
}

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
weights
number[]
required

Portfolio weights (should sum to 1.0)

Example:
[0.3, 0.25, 0.25, 0.2]
covariance_matrix
number[][]
required

Asset covariance matrix (annualized)

Example:
[
[0.04, 0.006, 0.008, 0.01],
[0.006, 0.09, 0.012, 0.015],
[0.008, 0.012, 0.0625, 0.018],
[0.01, 0.015, 0.018, 0.16]
]
confidence
number
default:0.95

Confidence level (e.g., 0.95 for 95% VaR)

Required range: 0.5 <= x <= 0.999
Example:

0.95

horizon
number
default:1

Time horizon in years (e.g., 1/252 for daily, 1/12 for monthly)

Required range: 0.001 <= x <= 10
Example:

0.00396825

portfolio_value
number
default:1000000

Current portfolio value in currency units

Required range: x >= 0
Example:

1000000

method
enum<string>
default:parametric

VaR calculation method

Available options:
parametric
Example:

"parametric"

Response

VaR successfully calculated

success
boolean
Example:

true

data
object