Skip to main content
POST
/
quantlib
/
portfolio
/
risk
/
comprehensive
Comprehensive Portfolio Risk Analysis
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/portfolio/risk/comprehensive \
  --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
    ]
  ],
  "returns": null,
  "benchmark_returns": null,
  "rf_rate": 0.03
}
'
{
  "success": true,
  "data": {
    "volatility": 0.2145,
    "variance": 0.046,
    "downside_deviation": 0.1823,
    "tracking_error": 0.0456,
    "information_ratio": 0.5482,
    "sortino_ratio": 0.4125,
    "max_drawdown": 0.1834
  }
}

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]
]
returns
number[][] | null

Historical returns matrix (time series for each asset). Required for certain metrics like max drawdown.

Example:

null

benchmark_returns
number[] | null

Benchmark return time series. Required for tracking error and information ratio.

Example:

null

rf_rate
number
default:0

Risk-free rate (annualized) for Sharpe/Sortino calculations

Example:

0.03

Response

Comprehensive risk analysis completed successfully

success
boolean
Example:

true

data
object

Risk metrics object with various portfolio risk measures

Example:
{
"volatility": 0.2145,
"variance": 0.046,
"downside_deviation": 0.1823,
"tracking_error": 0.0456,
"information_ratio": 0.5482,
"sortino_ratio": 0.4125,
"max_drawdown": 0.1834
}