Damodar Basyal/

The role of Bitcoin in a 3-asset portfolio


The role of Bitcoin in a 3-asset portfolio

Table of contents

  1. Executive summary
  2. Data description & cleaning
  3. Initial exploratory analysis
  4. Comparison of asset class risk & returns
  5. Bitcoin and inflation
  6. Portfolio analysis: Finding the minimum volatility and maximum Sharpe ratio portfolios
    6.1. Illustrative portfolio examples
    6.2. Random sampling to approximate the efficient frontier
    6.3. Portfolio optimization with PyPortfolioOpt
    6.4. Illustration of optimal portfolios
  7. Summary of main findings
  8. Portfolio recommendations & next steps
  9. References

1. Executive summary

Bitcoin (BTC) - the most popular of cryptocurrencies - has developed from a niche project for IT-savvy people into a mainstream investment vehicle. The emergence of easy-to-access wallets and ETFs now allows a wide audience - from small retail speculators to large institutional investors - to invest into Bitcoin. As an investment firm we are facing the question whether an allocation to Bitcoin could improve our fund's performance?

To help answer this question, this report will analyze Bitcoin's performance since 2014, alongside the two other major asset classes in our fund, US equities and gold. In doing so we will answer several questions:

  • How does the performance of Bitcoin (i.e. risk and returns) compare to the S&P 500 and the price of gold?
  • How does the inclusion of Bitcoin change a portfolio's characteristics and can it help improve a portfolio's performance?
  • Could Bitcoin be used as a hedge against inflation?
  • In the light of our fund's goal to minimize risk: What is the minimum volatility portfolio, consisting of these three asset classes? And for comparison: Which portfolio would maximize risk-adjusted returns?

The report starts with a brief description and cleaning of the data. We then do some initial exploratory analysis on returns and market behavior, before comparing risk and returns of the three asset classes in more detail. Next, we analyze the relationship of Bitcoin with inflation. Finally, section 6 analyzes the asset classes in a portfolio context, optimizing for minimum volatility as well as maximum risk-adjusted returns. We do so in several steps to make results more tangible and easier to understand. The report concludes with recommendations for the fund's allocation as well as for next steps.

A note of caution: This analysis is entirely backward-looking, relying on past performance data. That's valuable information to help answer the questions above. At the same time it shouldn't simply be extrapolated into the future. The observation period of the data (2014-2021) is relatively short, arguably not capturing a full business cycle. Inflation has been relatively low throughout most of this period. Meanwhile the period captures the initial stage of Bitcoin developing into a mainstream investment and attracting huge investor inflows. Behavior might differ significantly in the future. Thus before taking the final investment decision we recommend complementig these findings with further forward-looking analysis.

2. Data description & cleaning

Data used for the analysis:

  1. Bitcoin and S&P 500 daily data (in US dollars)
  • "date" - date from September 17, 2014 to November 17, 2021
  • "open" - the price / index level at the beginning of the trading day
  • "high" - the highest level reached that day
  • "low" - the lowest level reached that day
  • "close" - the price / level at the closing of the trading day
  • "volume" - how many Bitcoin / shares in the companies that make up the index were traded that day
  1. Inflation and gold as monthly data
  • "date" - date from September, 2014 to November, 2021
  • "gold_usd" - price in usd of gold for that month
  • "cpi_us" - the inflation index for the US for that month (cpi = consumer price index)

Remarks on the data:
The data consists of daily observations for the S&P 500 (1805 rows; no missing data) and Bitcoin (2619 rows; 4 missing data points) as well as monthly observations for gold and US inflation (87 rows; no missing data). The data covers a time period of roughly 7 years (from September 2014 to November 2021).

A check of the data source shows that CPI refers to prior month's inflation index (e.g. 2021-11-01 is October's data point). The gold price is given for the 1st day of each month. We will interpret it as the price of the last day of the prior month to better match it with inflation data. We'll use the S&P 500 as a proxy for US equities and refer to both interchangeably.

Getting started:
First, we import necessary libraries and load the data. We drop the 4 missing data points in the Bitcoin dataframe. We then merge the (monthly resampled) Bitcoin and S&P 500 dataframes with the gold and inflation data on the appropriate date. As there are only monthly observations of the gold price and inflation, we will conduct most of the analysis on monthly data, which anyway is an appropriate frequency for asset allocation decisions.

#Import necessary libraries (some will be added later, where they are needed)
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
import matplotlib.ticker as mtick
import numpy as np
from datetime import datetime
from datetime import timedelta
#Import the data
bitcoin = pd.read_csv('./data/bitcoin-usd.csv', parse_dates=['date'])
sp500 = pd.read_csv('./data/sp500.csv', parse_dates=['date'])
monthly_data = pd.read_csv('./data/monthly_data.csv', parse_dates=['date'])
#Merge data and convert to monthly frequency
merged1 = sp500.merge(bitcoin, on = 'date', how = 'left', suffixes=['_sp500','_btc']).dropna()
merged1.set_index('date', inplace=True)
merged1_last = merged1.resample('M').last()
monthly_data['date'] = monthly_data['date'] - timedelta(days=1)
monthly_data.set_index('date', inplace=True)

merged2 = merged1_last.merge(monthly_data, left_index=True, right_index=True)
merged2.drop(['open_sp500','high_sp500','low_sp500','volume_sp500','open_btc','high_btc','low_btc','volume_btc'], axis=1, inplace=True)
#Define some chart formatting needed for most charts below
def chart_formatter(ax_numbers):
    for i in range(ax_numbers):

3. Initial exploratory analysis

To gain first insights into the behavior of the three asset classes, we first compare their performance since 2014 in figure 1. We also take a look at the development of daily trading volumes for equities and Bitcoin.

Hidden code

Finding 1
Figure 1 shows strong outperformance of Bitcoin over the observation period. From September 2014 until October 2021 Bitcoin (+103.2% p.a.) massively outperformed both gold (+5.4% p.a.) and the S&P 500 (12.5% p.a.). Over the entire period Bitcoin's value increased by a factor of roughly 160x, compared to 2.3x for the S&P 500 and 1.5x for gold.

  • AI Chat
  • Code