Crypto Analysis COVID-19 amid turmoil and after plunge

Yuya Sugano
13 min readApr 12, 2020

--

This article covers the trace of analysis of Cointelegraph article the financial assets correlation with bitcoin amid COVID-19 crisis with some additional index such as Nikkei225 and the crypto currency “Ether”. In the latter article I’ll introduce DeFi analysis with crypto currencies and the correlations with the traditional assets. Please note that reading this article throughly needs some technical knowledge about Anaconda3, python and Docker container to analyze and visualize data with hands-on. Jupyter Notebook is here.

COVID-19 financial asset analysis trace

Introduction

All asset classes in the financial market have been affected by the chaos of COVID-19 pandemic and confronting plunge and high level of volatilities since then. In stock exchanges and industries they would need to concern bail-outs or expect monetary stimulus by governments to avoid the worse situations however there is more optimistic view for crypto assets such as bitcoin and crypto currencies that employ decentralization concept enforced in protocol. Anthony “Pomp” Pompliano, co-founder and partner at Morgan Creek Digital posted his anticipation what will occur next 18 to 24 months in his article as below and he said bitcoin will outperform other asset classes even better than gold as inflation headge asset. I think it’s true. What he emphasized in the article were 1) With quantitative easing people seek inflation hedge asset to battle with devaluation of cash and other assets, gold and bitcoin would benefit in that case, 2) Bitcoin reward halving is coming on May 13th, which will reduce the block reward from 12.5 BTC to 6.25 BTC. This could be technically quantitative tightening. [1]

Under this pandemic situation I’d like to emphasize two more aspects that bitcoin will be strengthening compared to the traditional assets such as stock, bond, gold, commodity. These aspects could be considered not just only for next 18 to 24 months forecast by looking bitcoin as inflation hedge asset but the characteristics in decetralization nature, which has been tremendous advantage for crypto currencies as investments not only for decentralized application and technolibertarianism focusing (for people came from tech side).

  1. Robustness of decentralization beyond central parties risk, there is no companies or governments or sovereignties involved, the protocol rules
  2. Assets such as cash, gold, commodity, these asset classes are distributed in digital deed but must exist in actual, these assets might be contaminated

“Reducing the risk of spreading disease would be rationale” [2]

Alternative asset for time of uncertainty

Uncertainty with geopolitical, govermental, environmental aspects for the financial assets has triggered high volatility and huge plunge in the market harshly. COVID-19 severe situation can be counted obviously as one of environmental aspects (such as pandemic, climate change, lack of sustainability) that hit quite hard the financial market. That’s why investors sometimes seek hedge asset such as gold, and maybe bitcoin with the fame of “digital gold” under the uncertain financial situation. Contrary to expectations, one article from Cointelegraph has revealed that bitcoin has been in high correlation with other traditional assets such as stock and real estate, so it hasn’t been spared from the recent COVID-19 financial crisis while gold has to some extent. It’s said that “the recent crash has really challenged Bitcoin’s claim as “digital gold” and puts its assertion as a financial “safe haven” to the test”.

It’s skeptical if bitcoin will really work as inflation hedge asset when quantitative easing is executed and money will be flooding into the market if following the analysis. I’d like to trace the analysis of the article with Anaconda3 and reconfirm that some numbers and figures were sufficient to be coherent for the analysis result. At last I’d like to conclude that bitcoin would perform well not only short term but long term too with the composite reasons, where it’s facing the tipping point from two perspectives 1) Crypto currencies seem advance indicator and for contaminant avoidance, 2) Crypto currencies characteristics that are reward halving (bitcoin for May 13th) and decentralization nature. It’s not necessary to read the original article but I recommend reading this impressive article beforehand. DeFi part will be covered in the latter article. [3]

Preparation

All data were taken from each source by using pandas-datareader library. The library covers an extensive range of data source as following. Please note that various sources support different kinds of data, so not all sources implement the same methods and the data elements returned might also differ. It’s vexing us by lack of information like unknown implementation of source sites, need of index string investigation at source site, etc but all data are pass in pandas, which is awesome in this library. [4]

Data sources are not reliable sometimes so please consider what to trust if you want to retrieve data via such API for the sake of trading. Because we’re not sure how these data were obtained and calculated in the systems when we call REST API. How accurate is it? Is it a realtime response data? Is information genuine? Nothing is sure. I used the source data just for this experimental attempt.

BTC/USD and ETH/USD were taken from yahoo and the rest of data were from stooq except daily gold price that was taken from FRED (Federal Reserve Economic Data). [5]

Data source for pandas-datareader (stooq, FRED)

Analytic tool

You can skip “Analytic tool” part if you’re not interested in how to extract data from each data source and analyze it with Anaconda3 and python libraries shown in this entire paragraph.

I introduced the Anaconda3 Docker image already with some financial and analysis libraries in the past article. You can just pull the image from DockerHub or build from the Dockerfile if you want to add some spices on the image. Anaconda3 has a lot of benefits for data scientists to develop, test, and train a ML model without doing tedious installation works. It’s all-in-one package for people as it’s kept maintained and usable. You don’t need to get lost in the maze of of library dependencies as long as installed libraries satisfy your needs. [6]

Directly from the platform and without involving DevOps, data scientists can develop and deploy AI and machine learning models rapidly into production. Anaconda provides the tools needed to easily.

A little about Docker container. Docker container is loosely isolated environment on host machine run directry within host kernel level. Docker enables us to deliver infrastructures in the same way as we manage applications. Docker images can be shared among developers for re-use purpose and they don’t need to build environment with hands-on from scratch. DockerHub is the official repository of Docker where we can manage images like we manage our codes in github repository.

  • Docker container is lightweight and potable because it doesn’t need any extra layer of hypervizor and can be reproducible as an Docker image
  • Docker platform provides a tool to manage containers and containers are good for CI/CD (Continuous integration and Continuous delivery).
  • Docker images are potable and can be pulled from repositories (DockerHub or cloud/private repositories) to reproduce the same result
  • Docker images can be defined as text file that is called “Dockerfile”, this means this file also can be managed and maintained like a code
  • Docker images are customizable, it consists of layers based on other images or it can be created from scratch with a “Dockerfile”

I recommend using container either just for developing Jupyter Notebook or running your model or inference endpoint to make your whole environment coherent. If you can run your code in your local machine by Jupyter, the same code would be able to run in the production environment as long as you use the same container image.

Once you pulled the image, now you have to run a container with the command docker run -p xxxx:8888 -v ${PWD}/notebooks:/opt/notebooks anaconda3 for your environment. Please omit the port forwarding part -p xxxx:8888 if you don’t need to change accessing port from TCP 8888 on your browser to Jupyter Notebook.

conda list in the container shows library versions as of writing. If you pull the image you will see the same version in Anaconda3. Again here has the additional libraries that are useful for financial trading and machine learning in this image.

# conda list
backtesting 0.1.7
mpl-finance 0.10.1
optuna 1.3.0
pandas-datareader 0.8.1
pandas-highcharts 0.5.2
ta-lib 0.4.17

You’ll be able to access a local notebook or remote server depending on where you invoke your Anaconda3 container.

Jupyter first page (I mounted the local volume here)

Experiment & Analysis

It’s time to play with data. Just please avoid tedious works for retrieving and rinsing data. All crawling and manipulating operations are there in the libraries pandas and pandas-datareader . I did run DataReader to get the aforementioned data from each source and concatenate DataFrame and Series then changed the column names. Here’s the example.

Then show calculated stats with describe() function. Viola!! Let’s look through stats a little and go to graphycal analysis.

Stats of the financial assets in 2020

All extracted data are U.S. Dollars based. I looked at the standard deviation (which must be U.S. Dollars in unit) and compare coefficient of variation between the asset classes. The coefficient of variation is defined as the ratio of the standard deviation to the mean. It shows the extent of variability in relation to the mean. [7]

Fig.1 Coefficient of variation per asset

The figure explains that bond index and gold price indicate relatively low coefficient of variation (again it’s calculated standard deviation per its mean) throughout the season. However the rest of asset classes showed similar level of coefficient of variation except ether. Please be careful that the standard deviations and means were calculated from the mean values with the Close value in OHLC daily data. If you change these scale or interval of data it might be showing drastically different.

Fig2. Rolling 7-days change of financial assets (%)
Fig.3 Rolling 7-days standard deviation of financial assets (%)

As U.S. stocks had plunged the most since 1987 these figures explain occurrence of that event. The Dow Jones Industrial Average lost almost 13%, falling 3,000 points to close at at two-year low as reported on March 16th. The shape of curves look similar while the scale of curves are different. Crypto currencies seemed to surge and plunge slightly earlier than other asset classes at a glance so the traditional assets look lagging a little compared to crypto currencies as long as the figures show. Crypto currencies might be more sensitive for the market turmoil and react faster with high rate of daily change and standard deviation.

Fig4. Bitcon’s Rolling 7-days correlations with other financial assets
Fig.5 Correlation of the financial assets

I changed rolling correlation period from 21 days to 7 days for bitcoin here. The original article showed the bitcoin’s rolling 21 days correlation with other financial assets and concluded that “Bitcoin has recently become increasingly correlated with other global financial assets”. The above mentioned figure shows that bitcoin and ether were high-correlated in rolling 7 days period but bitcoin and other financial assets were sometimes negatively correlated when those prices plunged partilarly. The correlation between bitcoin and ether kept high always as assumed. The next figure fig5. shows the significant correlation between bitcoin and the traditional asset classes such as stock, real estate and Nikkei225, on the other hand we could glimpse low (or neutral) correlations of ether over other financial assets. This result implies that ether or other crypto currencies except bitcoin would be more adequate for hedge asset over the traditional financial assets. Because bitcoin might take a correlated path with other financial assets from this perspective.

Harry Markowitz, the father of the modern portfolio theory, postulated that the most important aspect of risk to consider is an asset contribution to the overall risk of the portfolio, rather than the risk of the asset in isolation. Uncorrelated asset is the key when we build a portfolio to reduce volatility and improve risk-adjusted returns. When we pursue an optimal risk-adjusted returns in the market, we would not choose bitcoin which has been high-correlated with the traditional financial assets. Including other crypto currencies and even gold there seems no true financial safe haven that is robust against financial shocks reverberating through other financial markets. However as we saw the correlations of ether with the financial assets, other crypto currencies might be relatively uncorrelated and could be thought as hedge asset more than bitcoin for either financial panic or inflation case.

The original article confirmed also the correlation between the crypto currency index (HODL30 index) and American stocks was significantly lower than the correlation between bitcoin and U.S. stocks. I assume that a correlation between crypto currency index excluding bitcoin and major coins and the traditional assets would be much less correlated or rathar negatively correlated from that result’s saying. Lastly even the correlations between gold and other assets have marked high sometimes. So I’d say there are two asset groups from this angle, the one that falls under traditional house including gold and the one that falls under crypto house including bitcoin, ether, other crypto currencies. Because cryptocurrencies that employ decentralization i.e. Byzantine Fault Tolerance are less vulerable to turmoil and chaos by avoiding central party risk in nature. You don’t need to worry about the company’s declaration bankruptcy or the country’s default, it exists there witout any central interventions as long as underlying machines are working and mining coins.

Correlations between gold and other financial assets have also soared during this time, signaling that the world’s financial markets are more interconnected than ever before.

Fig6. Gold’s Rolling 7-days correlations with other financial assets

Here’s another angle. Gold and real estate are actual assets. Those have intrinsic values in physical substance. Gold and real estate can’t be securitized and be a deed if those do not exist in real. Let’s say you buy a gram of gold from your bank and you will receive a deed, but that gold must exist. So what if the asset gets polluted by pandemic? Houses and buildings are collapsed by disaster? Crypto house is more robust over the former group obviously.

Fig.7 Rolling 21-day historical volatilities for financial assets
Fig.8 Rolling 21-days sharpe ratio for financial assets

Sharpe ratio allows an investor to better isolate the profits associated with risk-taking activities. Rolling 21 days sharpe ratio has shown minus returns for all assets in the fig.8 here. I didn’t subtract the risk-free rate from the mean return so the result means the profits were simply negative. Generally, the greater the value of the Sharpe ratio, the more attractive the risk-adjusted return but be carefull about minus sharpe ratio. Because when the profits were negative the smaller sharpe ratio were given for the high risk assets. In this figure Nikkei225 and real estate are better for the risk-adjusted returns with the lower standard deviation. Rolling 21 days historical volatilies were annualized.

All codes are written in the Jupyter Notebook here for your reference. [8]

https://github.com/yuyasugano/crypto-analysis/blob/master/notebooks/Crypto%20Analysis%20COVID-19%20amid%20turmoil%20and%20after%20plunge.ipynb

Conclusion

Let’s brief what we looked through.

  1. Crypto currencies might outperform other financial assets because it reacts to the market faster than others and no worrisome points because neither bankruptcy nor default happens in decentralized nature
  2. Crypto currencies are less correlated with the traditional financial assets such as stock, real estate, gold so it would be adequate for hedge asset to adjust risk especially except bitcoin that was correlated to some extent

Also there are some points mentioned in the links, the reward halving for bitcoin on May 13th or contaminant avoidance in this article. I’d just like to emphasize that both perspectives in short term and long term investing bitcoin and crypto currencies look a good choice as of writing. In the next article we will delve into DeFi rather than just crypto currencies for the COVID-19 turmoil.

--

--

Yuya Sugano
Yuya Sugano

Written by Yuya Sugano

Cloud Architect and Blockchain Enthusiast, techflare.blog, Vinyl DJ, Backpacker. ブロックチェーン・クラウド(AWS/Azure)関連の記事をパブリッシュ。バックパッカーとしてユーラシア大陸を陸路横断するなど旅が趣味。

No responses yet