Skip to main content
POST
/
quantlib
/
risk
/
var
/
historical
Calculate Historical VaR
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/risk/var/historical \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "returns": [
    -0.025,
    0.018,
    -0.012,
    0.031,
    -0.008,
    0.022,
    -0.015,
    0.009,
    -0.005,
    0.014
  ],
  "confidence": 0.95,
  "portfolio_value": 5000000
}
'
{
  "success": true,
  "data": {
    "var": 87500,
    "confidence": 0.95
  }
}

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

Historical returns as decimals (e.g., 0.01 for 1% return)

Minimum array length: 100
Example:
[-0.03, 0.02, -0.01, 0.015, -0.005]
confidence
number
default:0.99

Confidence level for VaR calculation

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

0.99

portfolio_value
number
default:1000000

Total portfolio value in currency units

Example:

1000000

Response

Successful VaR calculation

success
boolean
Example:

true

data
object