1. Introduction

A crypto currency is a digital currency designed to work as a medium of exchange that uses cryptography to secure its transactions, to control the creation of additional units, and to verify the transfer of currencies. Cryptocurrencies use decentralized control as opposed to centralized electronic money and central banking systems.Decentralized cryptocurrency is produced by the entire cryptocurrency system collectively, at a rate which is defined when the system is created and which is publicly known. In case of decentralized cryptocurrency, companies or governments cannot produce new units, and have not so far provided backing for other firms, banks or corporate entities which hold asset value measured in it.

  1. Overview

Bitcoin, created in 2009, was the first decentralized cryptocurrency.As of September 2017, over a thousand cryptocurrency specifications exist; most are similar to and derive from the first fully implemented decentralized cryptocurrency, bitcoin. Most cryptocurrencies are designed to gradually decrease production of currency, placing an ultimate cap on the total amount of currency that will ever be in circulation.cryptocurrencies can be more difficult for seizure by law enforcement. This difficulty is derived from leveraging cryptographic technologies.

  1. Architecture

Blockchain

A blockchain is a continuously growing list of records, called blocks, which are linked and secured using cryptography. Each block typically contains a hash pointer as a link to a previous block, a timestamp and transaction data. By design, blockchains are inherently resistant to modification of the data. The validity of each cryptocurrency’s coins is provided by a blockchain.

Timestamping

Cryptocurrencies use various timestamping schemes to avoid the need for a trusted third party to timestamp transactions added to the blockchain ledger.

  1. Study of a few crypto currencies’ everyday’s price details.

Overview

the main aim of this study was to perform a detail analysis of crypto currencies prices all across the globe and to construct a model that will describe the price trends over a long period of time.crypto currencies are in demand at a rate faster than they were ever before. bitcoin, the first ever crytpo currency raised by 171% in the year 2017 itself and has risen by 20566% in the year 2010.

Data

for this study the data was collected from kaggle (https://www.kaggle.com/jessevent/all-crypto-currencies). this data set contains 5572 observations over 12 variables.data description is as follows : slug : name of the crypto currency symbol : symbol used to the respective crypto currency. name : name of crypto currency. ranknow : current rank of crypto currency in the world. open : opening price of the day. high : peak price of the day. low : least price of the day. close : closing price of the day. market : volume currently in circulation in market. close_ration : daily close rate, min-maxed with the high and low values for the day. spread : difference between the high and low values for the day.

reading the data set:

coin.df <- read.csv(paste("crypto-markets.csv"),sep=",")
dim(coin.df)
## [1] 5572   12

there are 670420 rows containing the details of all crypto currencies available till date.

List of all the crypto currencies available in the world.

table(coin.df$slug)
## 
##  bitcoin     dash ethereum     iota litecoin   ripple 
##      999     1444      898      229     1001     1001

minimum open value of all the coins

aggregate(coin.df$open,by=list(coin.df$slug),min)
##    Group.1         x
## 1  bitcoin 68.500000
## 2     dash  0.213899
## 3 ethereum  0.431589
## 4     iota  0.157961
## 5 litecoin  1.150000
## 6   ripple  0.002809

maximum open value of all the coins

aggregate(coin.df$open,by=list(coin.df$slug),max)
##    Group.1           x
## 1  bitcoin 1152.730000
## 2     dash 1555.590000
## 3 ethereum 1397.480000
## 4     iota    5.370000
## 5 litecoin   44.530000
## 6   ripple    0.058772

min close value of all the coins

aggregate(coin.df$close,by=list(coin.df$slug),min)
##    Group.1         x
## 1  bitcoin 68.430000
## 2     dash  0.314865
## 3 ethereum  0.434829
## 4     iota  0.158688
## 5 litecoin  1.160000
## 6   ripple  0.002810

maximum close value of all the coins

aggregate(coin.df$close,by=list(coin.df$slug),max)
##    Group.1           x
## 1  bitcoin 1151.170000
## 2     dash 1550.850000
## 3 ethereum 1396.420000
## 4     iota    5.370000
## 5 litecoin   44.730000
## 6   ripple    0.058692

one way contigency table

table(coin.df$slug)
## 
##  bitcoin     dash ethereum     iota litecoin   ripple 
##      999     1444      898      229     1001     1001

two way contigency table

library(gmodels)
CrossTable(coin.df$slug,coin.df$ranknow)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  5572 
## 
##  
##              | coin.df$ranknow 
## coin.df$slug |         1 |         2 |         3 |         7 |        11 |        12 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##      bitcoin |       999 |         0 |         0 |         0 |         0 |         0 |       999 | 
##              |  3753.110 |   161.002 |   179.469 |   179.469 |    41.057 |   258.894 |           | 
##              |     1.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.179 | 
##              |     1.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
##              |     0.179 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##         dash |         0 |         0 |         0 |         0 |         0 |      1444 |      1444 | 
##              |   258.894 |   232.719 |   259.412 |   259.412 |    59.346 |  3058.217 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     1.000 |     0.259 | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     1.000 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.259 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##     ethereum |         0 |       898 |         0 |         0 |         0 |         0 |       898 | 
##              |   161.002 |  3920.724 |   161.324 |   161.324 |    36.906 |   232.719 |           | 
##              |     0.000 |     1.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.161 | 
##              |     0.000 |     1.000 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
##              |     0.000 |     0.161 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##         iota |         0 |         0 |         0 |         0 |       229 |         0 |       229 | 
##              |    41.057 |    36.906 |    41.139 |    41.139 |  5123.412 |    59.346 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     1.000 |     0.000 |     0.041 | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     1.000 |     0.000 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.000 |     0.041 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##     litecoin |         0 |         0 |         0 |      1001 |         0 |         0 |      1001 | 
##              |   179.469 |   161.324 |   179.828 |  3749.828 |    41.139 |   259.412 |           | 
##              |     0.000 |     0.000 |     0.000 |     1.000 |     0.000 |     0.000 |     0.180 | 
##              |     0.000 |     0.000 |     0.000 |     1.000 |     0.000 |     0.000 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.180 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##       ripple |         0 |         0 |      1001 |         0 |         0 |         0 |      1001 | 
##              |   179.469 |   161.324 |  3749.828 |   179.828 |    41.139 |   259.412 |           | 
##              |     0.000 |     0.000 |     1.000 |     0.000 |     0.000 |     0.000 |     0.180 | 
##              |     0.000 |     0.000 |     1.000 |     0.000 |     0.000 |     0.000 |           | 
##              |     0.000 |     0.000 |     0.180 |     0.000 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |       999 |       898 |      1001 |      1001 |       229 |      1444 |      5572 | 
##              |     0.179 |     0.161 |     0.180 |     0.180 |     0.041 |     0.259 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 

the bitcoin is ranked no. 1 follwed by ethereum.

boxplot of open prices of coins

boxplot(coin.df$open~coin.df$slug)

as we can see there is no grouping of the opening prices for the crypto coin “dash”. it is due to it’s highle diverse opening on a regular basis.let us see for closing prices.

boxplot of closing prices of coins

boxplot(coin.df$close~coin.df$slug)

similar is the case for closing prices also. the closing pricess of “dash” doesn’t fit in any region. while on the other hand we can see the from the above box plot that bitcoin for most of time has remained in a fixed range and had a sudden jump to a high opening and closing price.

let us have a look on the difference between highs and low of the day for a crypto coin.

boxplot(coin.df$spread~coin.df$slug)

the difference between highest ond lowest price for the day of any crypto currency is very less as compared to there high and low prices.

histograms for suitable data fields.

hist(coin.df$open,main="opening values of crypto currencies.",xlab="open",ylab = "no. of time.")

hist(coin.df$close,main="closing  values of crypto currencies.",xlab="close",ylab = "no. of time.")

hist(coin.df$high,main="maximum values of crypto currencies.",xlab="max value",ylab = "no. of time.")

hist(coin.df$low,main="minimum values of crypto currencies.",xlab="min value",ylab = "no. of time.")

hist(coin.df$close_ratio,main = "histogram for close ratio",xlab="close_ratio")

we can see the there is no significant differences between the opening and closing prces of crypto currencies.

scatter plot:

library(car)
scatterplotMatrix(formula= ~open+high+low+spread+close, data=coin.df,diagonal="histogram",cex=0.1)

correlation matrix.

library(corrgram)
corrgram(coin.df[,c(5,6,7,8,11,12)],order = TRUE, lower.panel=panel.shade,upper.panel=panel.pie, text.panel=panel.txt)

generating correlation matrix :

cor(coin.df[,c(5,6,7,8,12)])
##             open      high       low     close    spread
## open   1.0000000 0.9982251 0.9967469 0.9968374 0.7279732
## high   0.9982251 1.0000000 0.9959673 0.9986240 0.7481412
## low    0.9967469 0.9959673 1.0000000 0.9980000 0.6855931
## close  0.9968374 0.9986240 0.9980000 1.0000000 0.7219424
## spread 0.7279732 0.7481412 0.6855931 0.7219424 1.0000000

Model

we proposed the following null hypothesis :

null hypothesis : there is no significant relation between change in daily price and number of corresponding coins in market.

fit  <- lm(coin.df$spread~ coin.df$market)
summary(fit)
## 
## Call:
## lm(formula = coin.df$spread ~ coin.df$market)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -91.50  -4.31  -3.97  -3.25 568.20 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    4.022e+00  3.290e-01   12.22   <2e-16 ***
## coin.df$market 1.416e-09  3.317e-11   42.68   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.37 on 5570 degrees of freedom
## Multiple R-squared:  0.2465, Adjusted R-squared:  0.2463 
## F-statistic:  1822 on 1 and 5570 DF,  p-value: < 2.2e-16

we can see that since the p-value is less than 0.05 we can reject the null hypothesis. this means that the change in price of crypto-currencies is highly correlated on the number of crypto currencies floating in the market.

fit1  <- lm(coin.df$spread~ coin.df$close_ratio+coin.df$open+coin.df$close+coin.df$market)
summary(fit1)
## 
## Call:
## lm(formula = coin.df$spread ~ coin.df$close_ratio + coin.df$open + 
##     coin.df$close + coin.df$market)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -64.22   0.19   1.31   2.45 438.30 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         -3.195e+00  4.871e-01  -6.560 5.86e-11 ***
## coin.df$close_ratio  2.873e+00  8.195e-01   3.505  0.00046 ***
## coin.df$open         1.815e-01  1.512e-02  12.004  < 2e-16 ***
## coin.df$close       -9.668e-02  1.511e-02  -6.400 1.68e-10 ***
## coin.df$market       3.363e-10  3.170e-11  10.610  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.22 on 5565 degrees of freedom
##   (2 observations deleted due to missingness)
## Multiple R-squared:  0.5425, Adjusted R-squared:  0.5421 
## F-statistic:  1650 on 4 and 5565 DF,  p-value: < 2.2e-16

getting confidence interval :-

confint(fit1)
##                             2.5 %        97.5 %
## (Intercept)         -4.150346e+00 -2.240556e+00
## coin.df$close_ratio  1.266043e+00  4.479171e+00
## coin.df$open         1.518370e-01  2.111099e-01
## coin.df$close       -1.262987e-01 -6.706965e-02
## coin.df$market       2.741632e-10  3.984329e-10

getting coefficients :

coefficients(fit1)
##         (Intercept) coin.df$close_ratio        coin.df$open 
##       -3.195451e+00        2.872607e+00        1.814735e-01 
##       coin.df$close      coin.df$market 
##       -9.668416e-02        3.362981e-10

Results

from the above coefficients we can formulate the regression model for the given data , “spread” beong the dependent variable and rest being the independent variable.

spread = -3.19 + 2.872 x close_ration + 0.181 x open -0.0966 x close + 3.3 x x10^-10 x market

Coclusion

-we can see from the given data set that price of crypto currencies are highly dependent on the volume floating in the market.

-data set provides us the top 8 crypto currencies with “bitcoin” at the top followed by “ethereum” followed by “ripple” and so on.

-the high and low values are the peak values of the day for the crypto currencies and Close ratio is the daily close rate, min-maxed with the high and low values for the day.

Table statistics

summary(coin.df)
##        slug        symbol           name         ranknow     
##  bitcoin : 999   BTC  : 999   Bitcoin : 999   Min.   : 1.00  
##  dash    :1444   DASH :1444   Dash    :1444   1st Qu.: 2.00  
##  ethereum: 898   ETH  : 898   Ethereum: 898   Median : 3.00  
##  iota    : 229   LTC  :1001   IOTA    : 229   Mean   : 5.86  
##  litecoin:1001   MIOTA: 229   Litecoin:1001   3rd Qu.:12.00  
##  ripple  :1001   XRP  :1001   Ripple  :1001   Max.   :12.00  
##                                                              
##       open                high                low           
##  Min.   :   0.0028   Min.   :   0.0031   Min.   :   0.0028  
##  1st Qu.:   1.2700   1st Qu.:   1.3700   1st Qu.:   1.1775  
##  Median :   4.9850   Median :   5.2950   Median :   4.6350  
##  Mean   : 107.5167   Mean   : 111.6705   Mean   : 103.3272  
##  3rd Qu.: 120.4700   3rd Qu.: 123.8800   3rd Qu.: 117.5975  
##  Max.   :1555.5900   Max.   :1642.2200   Max.   :1371.3900  
##                                                             
##      close               volume              market         
##  Min.   :   0.0028   Min.   :0.000e+00   Min.   :0.000e+00  
##  1st Qu.:   1.2875   1st Qu.:1.735e+05   1st Qu.:6.142e+07  
##  Median :   5.0000   Median :1.587e+06   Median :2.569e+08  
##  Mean   : 107.8857   Mean   :8.653e+07   Mean   :3.052e+09  
##  3rd Qu.: 121.1625   3rd Qu.:1.854e+07   3rd Qu.:2.011e+09  
##  Max.   :1550.8500   Max.   :9.215e+09   Max.   :1.355e+11  
##                                                             
##   close_ratio         spread       
##  Min.   :0.0000   Min.   :  0.000  
##  1st Qu.:0.2321   1st Qu.:  0.070  
##  Median :0.5000   Median :  0.340  
##  Mean   :0.4987   Mean   :  8.343  
##  3rd Qu.:0.7748   3rd Qu.:  5.140  
##  Max.   :1.0000   Max.   :588.080  
##  NA's   :2