Markowitz portfolio optimization for cryptocurrencies in Catalyst

Enigma Project
Catalyst Crypto
Published in
6 min readSep 20, 2017

A Catalyst application for modern portfolio theory

Hello all! This is Enigma’s second article focusing on cryptocurrency trading strategies developed on our Catalyst platform, submitted by a member of the Catalyst community. Please leave your feedback and remember to try our alpha and join our Discord community!

by Rodrigo Gomez-Grassi

Markowitz and the Modern Portfolio Theory

At the Central Bank of Mexico, where I was a portfolio manager for 3 years, building and running a Markowitz portfolio optimization model was an essential part of the portfolio construction process. This is true for most traditional asset managers (i.e. other central banks, pension funds, sovereign wealth funds, etc.).

This optimization model is based on Modern Portfolio Theory (MPT). “According to the theory, investment’s risk and return characteristics should not be viewed alone, but should be evaluated by how the investment affects the overall portfolio’s risk and return. MPT shows that an investor can construct a portfolio of multiple assets that will maximize returns for a given level of risk.” (Investopedia)

The main inputs of this model are the historical returns of the selected assets. The model uses the average return of each asset as its expected return. With these data, the model then computes the correlations between all the assets, which are used to determine the expected level of risk for the entire portfolio, or its standard deviation. These correlations are expressed as numbers between -1 and 1. Numbers close to 1 indicate that assets tend to move in the same direction, numbers close to 0 indicate that there is no relation between the assets, and numbers close to -1 indicate that assets tend to move in opposite direction.

The parameters of the model are the individual weights of each asset in the portfolio, expressed in percentage terms. However, the portfolio manager usually determines constraints to these parameters to limit the optimization results to viable portfolios. Usually, these constraints include no negative weights (i.e. no short positions) and a sum of weights equal to 100% (i.e. no leftover cash or leverage). However, additional constraints can be included depending on the objectives and limitations of the portfolio manager.

With all these in place, the model runs thousands of iterations of all possible portfolio weights to come up with the portfolios which minimize expected levels of risk for a series of return levels. The set of optimal portfolios form what is known as the efficient frontier. Within this frontier, the model can also find the portfolio with the maximum Sharpe Ratio — that is to say, the portfolio with the higher return per unit of risk.

Markowitz backtest with Catalyst

As I mentioned earlier, the Markowitz optimization model is a fundamental part of the portfolio construction process for traditional asset managers, who usually invest in traditional assets (i.e. Gov. and Corp. bonds, foreign currencies, and equity). However, cryptocurrencies are not traditional assets. For this reason, I wanted to do an experiment and see how the model performs in this asset class.

For the experiment, I filtered the cryptocurrencies with prices above $1 USD per token and available trading history from January 1st, 2016 or earlier. Among the remaining currencies, I used the 5 cryptocurrencies with higher market caps: Bitcoin, Ethereum, Litecoin, Dash, and Monero. I used a window of historical prices of 180 days, and rebalance period of 30 days. This means that at the beginning of the algorithm execution and every subsequent 30 days, the model will use 180 days of historical returns to compute the efficient frontier. Finally, I programmed the model to order the weights of the portfolio with the maximum sharpe ratio every rebalance period. The Python code can be found here.

My first concern was the correlations of the assets. To have significant diversification benefits, the assets need to have low-positive or negative correlations. If we saw high correlations among the cryptocurrencies, this would’ve indicated that a Markowitz optimization model was not ideal for a crypto-only portfolio. However, this was not the case. In fact, most of the correlations were below 0.5, as seen in the following table:

Selected cryptocurrencies correlation matrix

Computed with 180 days of historical data as of August 29, 2017

This was an indication that the Markowitz model might add value and outperform the individual assets and/or an equally weighted portfolio from a risk-adjusted perspective. However, before I go into the results, I l’d like to show a simple analysis of the expected return and risk characteristics of each asset and the portfolio with the maximum sharpe ratio. This information is shown in the following table:

Asset summary data for each rebalance period. Sharpe Ratios computed assuming 0% risk free rate for simplification.

Using the characteristics of each individual asset and the correlations among them, it is possible to compute the expected return and risk of any possible portfolio. However, to limit the results to viable portfolios, I used the restrictions of nonnegative weights and the sum of total weights equal to 100%. Then, I generated 50,000 random portfolios and compute its return and risk profile. The portfolios with the maximum expected return for each level of risk generate what is known as the Efficient Frontier. Within the Efficient Frontier, there is a portfolio which has the maximum expected return per unit of risk. This is the Maximum Sharpe Portfolio.

The return and risk of the 50,000 random portfolios is shown in the graph below. The Maximum Sharpe Portfolio marked with a blue dot.

Random Portfolios and the Efficient Frontier. Computed with 180 days of historical data as of August 29, 2017

The model is expected to allocate a greater proportion of the portfolio to the assets with higher individual Sharpe Ratios, marked with the color green in the tables above, and avoid those with negative or relatively-low Sharpe Ratios, marked with the color red. The optimal portfolio weights computed by the model are in-line with this intuition. These weights are displayed in the following graph:

Using these optimal portfolio weights, I performed a backtest of the strategy with Catalyst using all available YTD data (from Jan 1, 2017 to Sep 19, 2017). I also ran a backtest for an equally weighted portfolio with the same assets, and additional backtests for a buy and hold strategy for each individual asset. Then, I computed the computed average annualized returns and standard deviations of each strategy. The results summary is displayed in the following table:

Summary of results.

The optimized portfolio had a great performance. It achieved a 359.6% annualized return with a standard deviation of 106%, which represents a Sharpe Ratio of 3.4. This Sharpe Ratio is very high, and would be difficult to obtain investing in the major asset classes (fixed income, equity, etc.). However, the optimized portfolio was not the best performing strategy among the comparables. The best performing strategy was an equally weighted portfolio.

More surprisingly, there were two buy and hold strategies for single assets (ETH and DASH) that outperformed the “optimal portfolio”. These results are not consistent with MPT and the benefits of diversification. One possible explanation is that crypto is not a mature asset class, so correlations between the assets might not be stable enough to predict the standard deviation of the portfolio.

This article was written by Rodrigo Gomez-Grassi, an MBA candidate at the MIT Sloan School of Management.

Find this analysis exciting? Ready to get started with Catalyst? Try our alpha and join our Discord community. Best of luck, and happy trading!

Disclaimer — The material in this article is provided for informational purposes only. It is not a recommendation to buy or sell any security or implement any investment strategy.

--

--

Enigma Project
Catalyst Crypto

Enigma is securing the decentralized web. We solve for privacy with “secret” smart contracts, allowing dApps and blockchains to use private/sensitive data.