Introduction
Introduction
The main goal of this notebook is to provide some basic views and insights into the landscape of cryptocurrencies. The “landscape” we consider consists of price action and trading volume time series for cryptocurrencies found in Yahoo Finance.
Here is the work plan followed in this notebook:
1
.Get cryptocurrency data
2
.Do basic data analysis over suitable date ranges
3
.Gather important cryptocurrency events
4
.Plot together cryptocurrency prices and trading volume time series together with the events
5
.Make observations and conjectures over the plots
6
.Find “global” correlations between the different cryptocurrencies
7
.Find clusters of cryptocurrencies based on time series correlations
Here are some details for the steps above:
◼
◼
There is a dedicated resource object CrypocurrencyData that provides cryptocurrency data and related documentation.
◼
The cryptocurrency events data, point 3, is taken from different news sites.
◼
Links are provided in the corresponding dataset.
◼
Those two articles deal with COVID-19 time series.
Remark: Note that in this notebook we do not discuss philosophical, macro-economic, and environmental issues with cryptocurrencies. We only discuss financial time series data.
Cryptocurrencies data
Cryptocurrencies data
The cryptocurrencies data used in this notebook is obtained from found in Yahoo Finance . The procedure of obtaining the cryptocurrencies data is explained in detail in [AA1]. There is a dedicated resource object CrypocurrencyData that provides the cryptocurrency data and related documentation.
Here are all cryptocurrencies we have data for:
In[]:=
ResourceFunction["CryptocurrencyData"]["CryptocurrencyNames"]
Out[]=
BTCBitcoin,ETHEthereum,USDTTether,BNBBinanceCoin,ADACardano,XRPXRP,USDCCoin,DOGEDogecoin,DOT1Polkadot,HEXHEX,UNI3Uniswap,BCHBitcoinCash,LTCLitecoin,LINKChainlink,SOL1Solana,MATICMaticNetwork,THETATHETA,XLMStellar,VETVeChain,ICP1InternetComputer,ETCEthereumClassic,TRXTRON,FILFilecoinFutures,XMRMonero,EOSEOS
Remark: FinancialData is “aware” of 10 cryptocurrencies, but that is not documented (as far as I can tell) and only prices are provided. (For more details see the discussion in CrypocurrencyData.) Here are examples:
In[]:=
Row[DateListPlot[FinancialData[#,"Jan 1 2021"],ImageSize->Medium,AspectRatio1/4,PlotLabel#]&/@{"BTC","ETH"}]
Out[]=
Significant cryptocurrencies
Significant cryptocurrencies
In this section we analyze the summaries of cryptocurrencies data in order to derive a list of the most significant ones.
We choose the phrase "significant cryptocurrency" to mean "a cryptocurrency with high market capitalization, price, or trading volume.”
Together with the summaries we look into the Pareto principle adherence of the corresponding values.
Remark: The Pareto principle adherence should be interpreted carefully here -- the cryptocurrencies are not mutually exclusive when in comes to money invested and trading volumes. Nevertheless, we can interpret the corresponding value ratios as indicators of “mind share” or “significance.”
By summaries
By summaries
Here is a summary of the cryptocurrencies we consider (from Yahoo Finance) ordered by “Market Cap” (largest first):
In[]:=
dsCCSummary=ResourceFunction["CryptocurrencyData"][All,"Summary"]
Out[]=
Here is the summary of summary dataset above:
In[]:=
ResourceFunction["RecordsSummary"][dsCCSummary]
Out[]=
,
,
,
,
,
,
,
,
,
1 Symbol | ||||||||||||||
|
2 Name | ||||||||||||||
|
3 Price (Intraday) | ||||||||||||
|
4 Change | ||||||||||||
|
5 % Change | ||||||||||||
|
6 Market Cap | ||||||||||||
|
7 Volume in Currency (Since 0:00 UTC) | ||||||||||||
|
8 Volume in Currency (24Hr) | ||||||||||||
|
9 Total Volume All Currencies (24Hr) | ||||||||||||
|
10 Circulating Supply | ||||||||||||
|
Here is a Pareto principle adherence plot for the cryptocurrency market caps:
In[]:=
aMCaps=Normal[dsCCSummary[Association,StringSplit[#Symbol,"-"]〚1〛->#["Market Cap"]&]];ResourceFunction["ParetoPrinciplePlot"][aMCaps,PlotRange->All,PlotLabel->"Pareto principle for cryptocurrency market caps"]
Out[]=
Here is the Pareto statistic for the top 12 cryptocurrencies:
In[]:=
Take[AssociationThread[Keys@aMCaps,Accumulate[Values@aMCaps]]/Total[aMCaps],12]
Out[]=
BTC0.521221,ETH0.71188,USDT0.765931,BNB0.800902,ADA0.833777,XRP0.856467,USDC0.878274,DOGE0.899587,DOT10.9121,HEX0.924055,UNI30.932218,BCH0.939346
By price
By price
Get the mean daily closing prices data for the last two weeks and show the corresponding data summary:
In[]:=
startDate=DatePlus[Now,-Quantity[2,"Weeks"]];aMeans=ReverseSort[Association[#->Mean[ResourceFunction["CryptocurrencyData"][#,"Close",startDate]["Values"]]&/@ResourceFunction["CryptocurrencyData"]["Cryptocurrencies"]]];ResourceFunction["RecordsSummary"][aMeans,Thread->True]
Out[]=
1 column 1 | ||||||||||||||
|
1 column 1 | ||||||||||||
|
Pareto principle adherence plot:
Here are the Pareto statistic values for the top 12 cryptocurrencies:
Plot the daily closing prices of top cryptocurrencies since January 2018:
By trading volume
By trading volume
Get the mean daily trading volumes data for the last two weeks and show the corresponding data summary:
Pareto principle adherence plot:
Here are the Pareto statistic values for the top 12 cryptocurrencies:
Plot the daily closing prices of top cryptocurrencies since January 2018:
Related events
Related events
In this section we make a dataset that has the dates of certain cryptocurrency related events and links to their news announcements.
The events were taken by observing cryptocurrency board stories in the news aggregation site slashdot.org.
Cryptocurrency time series with events
Cryptocurrency time series with events
In this section we discuss possible correlation and causation effects of reported cryptocurrency events.
Remark: The discussion is based on time series and events only, without considering other operational properties of the cryptocurrencies.
Here is a date range:
Here get time series for the daily opening and closing prices for the selected date range:
Here are the summaries for prices:
Here are the summaries for trading volumes:
Here we plot the cryptocurrency events with together with the Bitcoin (BTC) price time series:
Here we plot the cryptocurrency events with together with the Ether (ETH) price time series:
Here we plot the cryptocurrency events with together with the BTC trading volume time series:
Observations
Observations
Going down
Going down
We can see that opening prices and volume going down correlate with:
1
.The news announcement that China plans to crackdown on mining and trading
2
.The news announcement Iran bans crypto mining
3
.The Sichuan Provincial Development and Reform Commission and the Sichuan Energy Bureau issue of a joint notice, ordering local electricity companies to “screen, clean up and terminate” mining operations
4
.The start of the “Bitcoin 2021” conference
Related conjectures:
◼
We can easily conjecture that 1 and 2 made cryptocurrencies (Bitcoin) less attractive to miners or traders in China and Iran, hence the price and the volume went down.
◼
The most active Bitcoin traders were attending the “Bitcoin 2021” conference, hence the price and volume went down.
Going up
Going up
We can see the prices and volume going up correlate with:
1
.The news announcement of El Salvador adopting BTC as legal tender currency
2
.The news announcement that US Justice Department recovered most of the ransom paid to the Colonial Pipeline hackers
3
.The end of the “Bitcoin 2021” conference
Related conjectures:
◼
Of course, a country deciding to use BTC as legal tender would make (some) traders willing to invest in BTC.
◼
The announcement that USA Justice Department, have made (some) traders to more confidently invest in BTC.
◼
Although, the opposite could also happen -- for some people if BTC can be recovered by law enforcement, then BTC is less attractive for financial transactions.
◼
After the end of “Bitcoin 2021” conference the attending traders resumed their usual activity.
◼
That conjecture and the “start of Bitcoin 2021” conjecture above support each other.
◼
The same pattern is observed for both BTC and ETH trading volumes.
Time series correlations
Time series correlations
In this section we compute and visualize correlations between the time series of a set of cryptocurrencies.
Getting time series data
Getting time series data
Here are the cryptocurrencies we consider:
Opening price time series
Opening price time series
Show heat-map plot corresponding to the max-normalized time series with clustering:
Derive correlation triplets using SpearmanRho :
Show summary of the correlation triplets:
Show correlations that too high or too low:
Cross tabulate the correlation triplets and show the corresponding dataset:
Cross tabulate the correlation triplets and plot the corresponding matrix with heat-map plot:
Trading volume time series
Trading volume time series
Show heat-map plot corresponding to the max-normalized time series with clustering:
Derive correlation triplets using SpearmanRho :
Show summary of the correlation triplets:
Show correlations that too high or too low:
Cross tabulate the correlation triplets and show the corresponding dataset:
Cross tabulate the correlation triplets and plot the corresponding matrix with heat-map plot:
Observations
Observations
Here are the correlation matrix plots above placed next to each other:
Generally speaking, the two clustering patterns are different. This is one of the reasons to do the nearest neighbor graph clusterings below.
Nearest neighbors graphs
Nearest neighbors graphs
In this section we create nearest neighbor graphs of the correlation matrices computed above and plot clusterings of the nodes.
Graphs overview
Graphs overview
Here we create the nearest neighbor graphs:
Here we plot the graphs with clusters:
Here are the corresponding time series plots for each cluster:
Other types of analysis
Other types of analysis
I investigated the data with several other methods:
◼
Clustering with different methods and distance functions
◼
Clustering after the application of Independent Component Analysis (ICA), [AAw5]
◼
Time series analysis with Quantile Regression (QR), [AAw6]
None of the outcomes provided some “immediate”, notable insight. The analyses with ICA and QR, though, seem to provide some interesting and fruitful future explorations.
Load packages
Load packages
Definitions
Definitions
References
References
Articles
Articles
[AA1] Anton Antonov, "Crypto-currencies data acquisition with visualization", (2021), MathematicaForPrediction at WordPress.
Packages
Packages
[AAp1] Anton Antonov, Data reshaping Mathematica package, (2018), MathematicaForPrediciton at GitHub.
Resource functions
Resource functions