Automation and scraping · Edition No. 18 · 12 Sep 2026

dcajasn/Riskfolio-Lib

It works out how to split money between several strategies, using many different measures of risk.

← Automation and scrapingRead the whole edition →
Riskfolio-Lib: how much of each. Splits money across strategies by risk measure.

4.5k stars · BSD-3-Clause · 7.3.0 on PyPI (2026-05-31) · Track this in Rising ↗

Portfolio optimisation with a large library of risk measures — how capital should be split across strategies.

Verified25 Oct 2026

Radar check

What we found when we opened it. Every bar is one fact, with its date.

Alive100

Last code pushed 22 Oct 2026, 5 days before this check.

Releases—

No releases published on GitHub; the code date above is the one to trust.

Maturity90

Public since March 2020, a little over 6 years.

Adoption73

4,569 stars and 731 forks.

Activity65

37 commits and 9 new issues in the last 90 days.

Community60

12 contributors. 7 pull requests merged in 90 days.

Security40

No security policy file says how to report a problem. No published security advisories.

Licence BSD-3-Clause | [portfoliooptimization.or: permissive: use it for anything, keep the notice
How the bars are scored
  • Alive. Days since the last code push: a week or less 100, a month 90, three months 70, six months 50, a year 30, eighteen months 15, older 0.
  • Releases. Age of the latest GitHub release, on a similar scale; no bar when the project publishes no releases.
  • Maturity. Age of the project: eight years 100, five 90, three 70, two 55, one 40, six months 25, younger 10.
  • Adoption. Stars on a log scale: 100,000 stars is 100, 10,000 is 80, 1,000 is 60, 100 is 40.
  • Activity. Commits in the last 90 days: 300 or more 100, 100 85, 30 65, 10 45, any 25.
  • Community. People who have contributed: 100 or more 100, 30 80, 10 60, 5 40, 2 25, one 10.
  • Security. A published security policy 80, none 40; published advisories are listed, not scored.

Checked by Repo Radar on 25 Oct 2026 from the repository on GitHub. Covered in Edition 18.

▶Repo detailsthe review · specs · pros & cons · install

What it does

Riskfolio-Lib takes the past returns of several assets or strategies and produces the mix that best balances return against a chosen measure of risk. It supports more than twenty risk measures, including variance, mean absolute deviation, conditional value at risk and maximum drawdown. It can also build portfolios by hierarchical clustering, which groups similar assets before allocating between the groups. It draws the results: efficient frontiers, allocation pies, risk contributions and dendrograms. It works directly with pandas, the standard Python table library, so existing data fits with no conversion. Version 7.4.0 arrived on 4 October 2026, and it needs Python 3.10 or newer. It does not fetch market data, it places no orders, and it publishes no tagged releases on GitHub, only on PyPI.

Why it matters

Who it suits. It suits anyone with several things to allocate between: strategies, instruments, or the same strategy in different time windows. It suits a researcher who already has a table of returns and wants a defensible split rather than a round number. Skip it while there is only one strategy, because the honest answer then is to put everything in it. Skip it too if the real problem is choosing which strategy to run, rather than how much of each.

Verdict. Worth a weekend, and the weekend is mostly reading rather than coding. The caution is bigger than the software: this is finance mathematics, and it gives confident answers to questions that may be asked wrongly. It optimises on past returns, and past returns are not a promise. Installing it pulls in a solver library, so the first install is larger and slower than most. Edition 13 covered pmorissette/ffn, which answers the earlier question of which candidate performed best, and robertmartin8/PyPortfolioOpt is the smaller, gentler library to start with.

Stars4.5k
LicenceBSD-3-Clause
Latest7.3.0 on PyPI (2026-05-31)checked 7 Sep 2026
Written inC++
Summary (Key Points)from the README
Key features
  • Mean risk optimization: Supports 4 objective functions (Minimum Risk, Maximum Return, Maximum Utility Function, Maximum Risk Adjusted Return Ratio) across 26 convex risk measures, plus Logarithmic Mean Risk (Kelly Criterion).
  • Risk parity: Offers risk parity portfolio optimization with 22 convex risk measures.
  • Hierarchical clustering: Provides Hierarchical Risk Parity (HRP) and Hierarchical Equal Risk Contribution (HERC) with 37 risk measures.
  • Nested Clustered Optimization: Supports NCO with four objective functions and the risk measures available for each objective.
  • Alternative models: Includes Worst Case Mean Variance, Relaxed Risk Parity, OWA, MVSK (semidefinite relaxation), Black-Litterman (including Bayesian and Augmented variants), Risk Factors, and Entropy Pooling.
  • Constraints: Covers tracking error and turnover, short positions and leverage, maximum and effective number of assets, graph-based constraints, and integer constraints such as cardinality and mutually exclusive investments.
  • Efficient frontier: Builds efficient frontiers for 24 convex risk measures.
  • Analysis tools: Calculates risk measures, risk contributions per asset and per risk factor, uncertainty sets for mean and covariance, asset clusters, and loadings matrices via Stepwise Regression or Principal Components Regression.
  • Reporting and solvers: Produces reports in Jupyter Notebook and Excel, and can use commercial solvers such as MOSEK or GUROBI for large-scale problems.
Important
  • Python version: Requires Python 3.10 or higher.
  • Heavy dependency list: Installation pulls in numerous packages with minimum versions, including cvxpy >= 1.7.2, clarabel >= 0.11.1, scs >= 3.2.7, arch >= 7.2 and astropy >= 6.1.3.
  • Solver choice matters: Some risk measures (Gini Mean Difference, Even Moment, Tail Gini, EVaR, RLVaR, and their range and drawdown variants) are flagged as needing MOSEK, because CLARABEL can fail to find a solution and SCS can be very slow.
  • Semidefinite constraints: Variance models with graph theory or risk contribution constraints switch to an SDP formulation, which needs a compatible solver.
  • Commercial solvers: MOSEK and GUROBI are optional for large-scale problems, and the README does not describe their licensing terms.
  • Example dependencies: The examples need yfinance, mosek and vectorbt, which are not part of the core install.
  • Roadmap is thin: The README's roadmap only says more functions will be added based on user suggestions.

Written by an AI model from the project’s README; not part of the review, and it can be wrong.

Good
  • More than twenty risk measures, not only the textbook one.
  • It draws the results, so the output is a chart rather than a wall of numbers.
  • It works directly with pandas, so existing tables of returns fit as they are.
Watch for
  • It optimises on past returns, which are not a promise about the future.
  • The mathematics is the hard part, and a wrong question still gets a confident answer.
  • The first install is large and slow, because it pulls in a solver library.
Install
cd ~/myapp
source venv/bin/activate
pip install Riskfolio-Lib
Screenshots
dcajasn/Riskfolio-Lib: GitHub preview carddcajasn/Riskfolio-Lib: Screenshot 1dcajasn/Riskfolio-Lib: Screenshot 2

On Stack Radar: Data & Research › Market & Competitive Research › Market Intelligence.

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.