When holding Bitcoin is not enough: Mean Variance Optimization for a Cryptocurrency Portfolio

This is a practitioners exercise and as such, mathematical and statistical theory will be kept to a minimum to help for easier reading but embedded links on theories and further background are highlighted for the interested reader.

Mean Variance Optimization is performed on a test basket of 15 cryptocurrencies to create an optimal portfolio that lies on the Efficient Frontier Several practical portfolio scenarios are examined including a fully invested long-only portfolio, a long-short portfolio, a portfolio that minimizes “tail-end risk” (ie. Expected Shortfall ) which can be particularly useful in volatile crypto markets, and also a “Designer” portfolio.

This exercise tries to answer a common question : “I just hold Bitcoin at the moment, and that’s volatile enough. But can I buy any other cryptos to increase my return but also keep my risk the same?  The answer is YES.

An “optimal portfolio” can mean different things to different types of investors but in the end it is either a minimization or maximization problem. By looking at the expected return and variance of an asset, we can attempt to make a more efficient investment choice – seeking the lowest variance for a given expected return, or seeking the highest expected return for a given variance level.

Quick Theory Recap:
The Markowitz efficient frontier is an investment portfolio (ie. combination of assets) that has the best possible expected level of return for its level of  risk (standard deviation) for every possible combination of risky assets that can be plotted in Risk–Expected Return space.  The Capital Market Line (CML) is the tangent line drawn from the point of the risk-free asset to the feasible region for risky assets. All points along the CML have superior risk-return profiles to any portfolio on the efficient frontier (EFF). The Tangency Portfolio (red dot) represents the market portfolio.  The addition of leverage can create levered portfolios that also lie on the CML to the right of the Tangency Portfolio.
Note also that definition the the slope of the CML is the Sharpe ratio of the market portfolio (ie. (Expected Return – risk free rate )/ Standard Deviation ).

Efficient Frontier1

Data & Setup:
Our “market assets” for this exercise are a selection of 15 cryptocurrencies covering both large and small caps, and which have at least 2 years of daily historical aggregated trading data taken from Cryptocompare.com. The risk free rate of return is assumed to be zero and we are not pricing in any transaction costs.

The 15 cryptocurrencies listed below have a combined market cap of ~USD177 billion which in reality accounts for about 80% of the current total market cap of USD220 billion for over 1200 cryptocurrencies + cryptoassets/tokens. Bitcoin by itself now accounts for  56% of the total crypto market cap which has grown from just USD18 billion at the beginning of 2017.


Code  Coin Market Cap (USD Bln)
BTC Bitcoin 124.879
ETH Ethereum 31.215
XRP Ripple 9.423
LTC Litecoin 3.416
DASH Dash 3.211
XMR Monero 1.900
XEM NEM 1.850
VTC Vertcoin 0.180
FCT Fatcom 0.170
DOGE Dogecoin 0.151
GAME GameCredits 0.123
SC Saicoin 0.110
SYS Syscoin 0.110
BLOCK Block Net 0.103
NXT NXT 0.072
Total   176.913


Daily returns and standard deviation of those returns were measured for all 15 cryptos.  Mean Variance Optimization was performed to obtain the optimal portfolio weights of each cryptocurrency such that the Sharpe Ratio of the portfolio was maximized.  40,000 randomly generated portfolios were examined in each of the 4 test cases below, subject to any preset investment or portfolio constraints.

The Results!

(1) An Optimal Fully Invested (“long only”) portfolio

Objective: Maximize return and minimize risk (StdDev)

(1) No constraints on the maximum number of cryptos held in the portfolio.
(2) No constraints on the maximum weight of  any crypto

Optimal weights:
Optimal weight_scen1

The optimization results in assigning optimal weights to 11 of the 15 cryptos (the others are zero) with the top 3 weights (BTC, DASH and XRP) accounting for about 78% of the total portfolio. As can be seen below, this portfolio by definition maximizes the Sharpe Ratio.

Efficient Frontier (EFF) & Optimal Weights Plot:

The top diagram shows the Efficient Frontier plot with each point representing a particular portfolio combination. The 15 individual cryptocurrencies (risk-return) are also highlighted for comparison.

The optimal “market” portfolio is the intersection between the EFF and the CML and is represented by the blue dot.  Interestingly from the plot it can be seen that the optimal portfolio achieves a higher return for less risk than just holding Bitcoin (BTC) alone.  The bottom diagram shows the optimal portfolio weights. The orange dot is an equal weighted portfolio of all 15 cryptos as a starting comparison.

(2) A “Long Short” Portfolio example

Objective: Target to maximize overall portfolio daily return to at least 1% or more but minimize overall portfolio daily standard deviation to 5% or below.

Some realistic constraints are added:
(1) Only BTC, LTC, ETH, XRP are allowed to be shorted (given the existence of  more liquid futures in these names).
(2) No asset can short more than -20% of portfolio weight.

Optimal weights:
Optimal weight_scen2


6 cryptos were chosen with BTC and ETH as the clear top 2 weights. As can be seen from the first plot the target of objective of a mean daily return of 0.01 was met along with a min STDev of 5%. The only crypto that was shorted was Ripple (XRP) at -14.8% weight.  (The orange dot and lines represent the initial starting portfolio weights and corresponding risk/return in the optimization process)

(3) Minimizing Expected Shortfall : A “tail-end risk” portfolio example:

Examining ES risk in portfolio returns will help reduce the probability that a portfolio will incur large losses. This is performed by assessing the likelihood (at a specific confidence level) that a specific loss will exceed the Value at Risk.

Expected Shortfall is defined as the average of all losses which are greater or equal than Value at Risk (VaR), i.e. the average loss in the worst (1-p)% cases, where p is the confidence level.  Value at Risk (VaR) and Expected Shortfall  (ES) can be more intuitively explained in the following return histogram:

The historical tail end distributions of each asset and optimized weights are examined to those assets to minimize the overall portfolio ES risk.

Objective: Minimize the overall portfolio Expected Shortfall risk (at the 5% confidence level)

Optimal weights:
Optimal weight_scen3

Not surprisingly, BTC focuses heavily again (46% weight) in this minimized ES portfolio given it’s relatively low volatility compared to the other assets. But XEM was a surprise given its relatively high 34.8% weight. However, as can be seen in the EFF plot, the optimal portfolio does minimize ES risk and maximize return, and significantly more so than just holding BTC alone.

(4) A “Designer Portfolio”
This last example illustrates the versatility in the optimization process given the type of constraints that can be imposed in designing a portfolio to suit personal tastes. Hence we have the Designer Portfolio. Let’s try the following objective and constraints and for a fully invested portfolio:

Objective: Maximize portfolio return but not to exceed a risk tolerance of 7% daily standard deviation.

(1) Limit to a maximum of 6 cryptos (to filter out smaller holding percentages)
(2) BTC weight can be no less than 40% (I’m a Bitcoin HODLer!)
(3) LTC weight can be no less than 10% (I’m also a Litecoin fan!)
(3) No single asset can contribute more than 50% to overall portfolio risk
(4) ETH and/or  XRP can be shorted up to -20% weight.

Optimal Weights:
Optimal weight_scen4

The EFF plot shows a smaller size of feasible portfolios due to the added constraints. The target return and risk objectives were both met and BTC wins again with the highest allocation of 45% weight followed by BLOCK and LTC. Only ETH was shorted at -12% weight and likely chosen in the optimization to help minimize the overall portfolio risk to achieve the target return objective.

Mean Variance optimization was performed on a set of 15 cryptocurrencies under 4 different scenarios: a broad long-only portfolio, a long-short portfolio, a portfolio that minimizes tail -nd (ES) risk and a personalized “designer” portfolio.

Each portfolio showed it was possible to calculate optimized  portfolio asset weights that achieved targeted risk/return objectives.  The summary below shows each portfolio scenario, their optimal weights and the corresponding Sharpe ratio. Under Modern Portfolio Theory, the average rational risk averse investor would choose the first Mean Variance “market” portfolio highlighted in yellow which has the highest Sharpe ratio. The other portfolios are also optimal but tailored for more specific risk/return preferences.


Concluding Remarks:

Mean- variance analysis is a powerful tool for calculating the optimal allocation of investments using mean, variance and covariance of asset returns for finding the best trade-off between expected risk and return. But clearly there is no universal risk/return trade off that holds for all investors in real life.  In the above examples more work needs to done in exploring a larger the number of crytocurrencies, as well as testing the sensitivity of portfolio weights given a change in inputs or time frame.

Disclaimer: This is not investment advice and is a practical example for illustrative purposes only. Please note that historical gains may not be representative of future returns. And as always before any investment, especially in cryptoworld, please thoroughly DYOR.  #DoYourOwnResearch


Happy Trading!


3 thoughts on “When holding Bitcoin is not enough: Mean Variance Optimization for a Cryptocurrency Portfolio

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Up ↑

%d bloggers like this: