Skip to content

dginst/crypto-index

Repository files navigation

DGI Logo

DGI Crypto-Asset Index

The DGI crypto Index is a volume-weighted index and is composed of the most relevant crypto-assets in terms of liquidity and qualitative criteria. Designed and developed by an heterogeneous group of professionals with significant experience and relevant expertise related to Financial Benchmarks, Crypto–Assets and Financial Industry, the DGI Crypto Index is intended to provide to private and institutional investors a replicable tool that best represent and synthesize the Crypto-assets market. This Benchmark is denominated in USD and it is simulated using data from 2016/01/01.

Key Features:

  • use volume as resource for weight computation
  • selected pricing sources based on security, real-volume and law compliance
  • selected constituents on quantitative and qualitative criteria
  • designed to be replicable by investors thanks to the buy and hold daily solution.

Implementation

Index Definition Process - Workflow

Crypto-Index WF

1) Data Download

The software downloads the daily crypto-asset data in terms of trade volume and price of the 8 selected pricing sources that proved to be reliable in matter of real volumes and legal compliance:

  • BitFlyer
  • BitStamp
  • Bittrex
  • Coinbase-Pro
  • Gemini
  • itBit
  • Poloniex

Specifically the set of cryptocurrencies now downloaded is:

  • 'ETH', 'BTC', 'LTC', 'BCH', 'XRP', 'XLM', 'ADA', 'ZEC', 'XMR', 'EOS', 'BSV' and 'ETC'; Note that this set is not fixed and may be subjected to changes in the future.

The Data of these Exchanges are downloaded through two main provider:

  • the REST API of the Cryptowatch website https://cryptowat.ch/ --> this dataset is used from 01/01/2016 to 17/04/2020
  • the REST API of each single Exchange obtaining the daily ticker --> this dataset is used from 18/04/2020

Cryptowatch demonstrate to be a reliable data bank for Crypto-Assets, it is owned by the Kraken exchange and was founded in 2014 by Artur Sapek. Note that Cryptowatch has the historical values of all the selected Exchanges except for itBit's data that are downloaded only through the REST API of itBit website.

Because the Index denomination is in USD all prices from the non-USD pairs are reported in USD; to do so, all the daily relevant exchange-rates of the Fiat/USD pairs and Fiat/StableCoin pairs are obtained respectively, from the European Central Bank (ECB) Website and the data provider CoinGecko. The rates downloaded from ECB are: USD, GBP, CAD and JPY.

The Data Download procesess consists in downloading the data on daily basis from the described API and store it, as raw data, into the database Mongo DB.

The Mongo DB chosen tree structure is the following:

  • database name: index
  • collection names: CW_rawdata, EXC_rawdata, ecb_raw
  • documents: equivalent of a row, can be identified through specific "fields" (eg. {'Pair': 'BTCUSD', 'Exchange': 'Kraken'})

2) Data Management

The Data Management process mainly consists in: retriving the raw data from Mongo DB through querying, managing the data and structuring them as needed for the Index computation.

As for the exchange rates, being expressed in Euro and missing of weekends and holidays (due to closed markets), each rate is converted into USD based value (EUR/USD, CAD/USD, GBP/USD, JPY/USD) and each missing day simply takes the value of the last fixing day.

For the cryptocurrencies data there are some steps to be performed.

The first step is to homogeneize each crypto-fiat pair in terms of series lenght, the rules are the following:

  • if a certain Crypto-Fiat pair does not start at the beginning of the period but later, for example because the pair does not exist before, the code will put a series of zeros from the start date until the actual beginning of the series;

  • if, for one or more date, a certain Crypto-pair series has missing data, the file will compute a value to insert using all the values displayed, for the same Crypto-Fiat pair, in the other exchanges. In particular the code computes the volume weighted average of the values of interest for each of the missing date;

  • if, trying to fix a series as described above in the second point, the code finds out that just one exchange has the values for a certain Crypto-Fiat pair, the file will put a 0-values array for all the missing date;

Once all the series have been homogeineized everything is converted in USD values using the above descripted exchange rates.

The final step is the computation of single price for each cryptocurrency:

  • the daily price of the single coin in the single exchange is the volume weighted average of the prices of the selected coin for each fiat pair

  • the daily price of the single coin is the volume weighted average of the prices of the selected coin in each exchange

3) Index Computation

Once all the data has been processed, the code can compute the index value. The process of index computation can be summarized into six main parts.

  1. First logic matrix

The first logic matrix has the role of a first screening of all the crypto-assets in order to decide wheter or not the single crypto-asset can be eligible, for the index composition, in a determined interval of time. The interval of interest goes from each start date of the quarter to the end date of the quarter itself; follows that the specified interval is the period of application where a cryptoasset can be considered eligible. For the actual computation of the eligible cryptoassets is considered the period between the start date of each quarter and the day before the board day meeting of the quarter itself. Here the rule: if, for a single cryptoasset, one single exchange has traded more than the 80% of the total volume of the period, the cryptoasset is excluded.

  1. Exponential Weighted Movin Average (EWMA) computation

The ewma is performed on the traded volume levels and with a moving average period of 90 days. The code takes the data frame containing the total daily volume for each crypto-asset (cryptos as columns, days as rows) and compute the daily ewma considering the last 90 days volume values multiplied per the relative lambda, and then summarizing them. The index uses a fixed lambda value of 0.94 that decraeses exponentially starting from a value of 0.94 and followuing the formula:

daily_lambda = (1 - 0.94) * (0.94 ^ (index))

where the index is the value of intergers in the range (89, 0). The ewma values has two different usages: the computation of the second logic matrix and the computation of the quarterly weights.

  1. Second logic matrix computation

The second logic matrix is the second and last eligibility check that is needed in order to achieve a correct and consistent composition of the index. The idea is to compare, for each crytpoasset, the aggregate ewma volume of the specified period and then find the percentage that the single cryptoasset has respect to the totoal sum. The first step is to leave out, for each quarter, the cryptoassets that has been eliminated due to the first logic matrix; then the code takes the ewma values for the period between the start date of the quarter and the day before the board meeting day, sum them for sinle cryptoassets and compute the relative percentage of each one. If the relative percentage of a cryptoasset in less than 2%, the crytpoasset will be considered non eligible for the quarter. back the % of the EWMA-volume of any single cryptoasset compared to the aggregate EWMA-volume

  1. Quarter Weights computation

The weights computation is performed for each quarter on the day before the board meeting day. The first step is to leave out from the ewma dataframe all the cryptoassets that have been ideintified as non eligible with the logic matrices; done that the code simply finds the relative weights of the cryptoassets ewma: these are the weights of the next quarter.

  1. Synthetic Market Cap computation

WIP

  1. Initial Divisor computation

WIP

About

Digital Gold Institute Crypto Index Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •