---
title: "Risk Contributions"
method: POST
path: "/portfolios/analysis/contributions/risk"
tags: ["Portfolio Analysis / Contributions"]
---

# Risk Contributions

`POST /portfolios/analysis/contributions/risk`

Perform a risk contribution analysis of a portfolio, where the risk measure is the portfolio standard deviation.

References
* Carl R. Bacon, Practical Portfolio Performance Measurement and Attribution

## Request body

- object
  - `assets` integer, required — The number of assets
  - `assetsCovarianceMatrix` array[], required — assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j
    - number[]
  - `assetsGroups` array[]
    - integer[] — assetsGroups[k] is the indexes of the assets belonging to the assets group k
  - `portfolios` object[], required
    - `assetsWeights` number[], required — assetsWeights[i] is the weight of the asset i in the portfolio, in percentage

## Response `200`

OK

- object
  - `portfolios` object[], required
    - `assetsMarginalRiskContributions` number[], required — assetsMarginalRiskContributions[i] is the marginal risk contribution of the asset i to the risk of the portfolio
    - `assetsRelativeRiskContributions` number[] — assetsRelativeRiskContributions[i] is the relative risk contribution of the asset i to the risk of the portfolio, in percentage; assetsRelativeRiskContributions is not provided when the risk of the portfolio is equal to 0
    - `assetsTotalRiskContributions` number[], required — assetsTotalRiskContributions[i] is the total risk contribution of the asset i to the risk of the portfolio
    - `assetsGroupsRelativeRiskContributions` number[] — assetsGroupsRelativeRiskContributions[k] is the relative risk contribution of the group of assets k to the risk of the portfolio, in percentage; assetsGroupsRelativeRiskContributions is not provided when the risk of the portfolio is equal to 0
    - `assetsGroupsTotalRiskContributions` number[] — assetsGroupsTotalRiskContributions[k] is the total risk contribution of the group of assets k to the risk of the portfolio

---

[API](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer.md) · [All operations](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portfoliooptimizer/portfolio-optimizer/revisions/d016f340e91c/schema)
