---
title: "Hierarchical Risk Parity Portfolio"
method: POST
path: "/portfolios/optimization/hierarchical-risk-parity"
tags: ["Portfolio Optimization"]
---

# Hierarchical Risk Parity Portfolio

`POST /portfolios/optimization/hierarchical-risk-parity`

## Request

- Base URL: `https://api.portfoliooptimizer.io/v1`
- URL: `https://api.portfoliooptimizer.io/v1/portfolios/optimization/hierarchical-risk-parity`
- Auth: API key in header `X-API-Key`

Compute the asset weights of the hierarchical risk parity portfolio, optionally subject to:  
* Minimum and maximum weights constraints
* Minimum and maximum portfolio exposure constraints

References
 * [Lopez de Prado, M. (2016). Building diversified portfolios that outperform out-of-sample. Journal of Portfolio Management, 42(4), 59–69](https://jpm.pm-research.com/content/42/4/59)
 * [Johann Pfitzinger & Nico Katzke, 2019. A constrained hierarchical risk parity algorithm with cluster-based capital allocation. Working Papers 14/2019, Stellenbosch University, Department of Economics](https://ideas.repec.org/p/sza/wpaper/wpapers328.html)

## 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[]
  - `clusteringMethod` 'singleLinkage' | 'averageLinkage' | 'completeLinkage' | 'wardLinkage': The hierarchical clustering method to use
  - `clusteringOrdering` 'r-hclust' | 'optimal': The order to impose on the hierarchical clustering tree leaves
  - `constraints` object
    - `minimumAssetsWeights` number[]: minimumAssetsWeights[i] is the minimum weight of the asset i in the portfolio, in percentage
    - `maximumAssetsWeights` number[]: maximumAssetsWeights[i] is the maximum weight of the asset i in the portfolio, in percentage
    - `minimumPortfolioExposure` number: The minimum portfolio exposure; must be lower than or equal to maximumPortfolioExposure
    - `maximumPortfolioExposure` number: The maximum portfolio exposure; must be higher than or equal to minimumPortfolioExposure

## Response `200`

OK

- object
  - `assetsWeights` number[], required: assetsWeights[i] is the weight of the asset i in the portfolio, in percentage

## Changes

- **2026-06-08** `614076795988`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/changes/portfolios/optimization/hierarchical-risk-parity/post.md)

---

[API](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer.md) - [All operations](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) - [OpenAPI document](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/revisions/9d075aa717bf?raw)
