How Does CoinMarketCap Price Coins? – Hacker Noon

4. THE SILICOIN coin price calculation methodology

(or how to calculate average coin prices properly)

Below we lay out methodology for calculating average prices that cures the problems described in

Section 2 and Section 3 above.

This methodology is 100% transparent, robust and uses real transaction prices.

Input data for calculations is available on THE SILICOIN — you can always verify our calculations. For example, see Exchanges section of Ethereum pagefor details of Ethereum average price calculation.

4.1. Methodology summary

  1. For each exchange calculate price of each coin traded on this exchange
    1.1. Price of a coin on particular exchange is established from the best trading pair, i.e. pair that has minimum number of steps to fiat and maximum transaction volume
    1.2. For exchanges that do not have fiat trading use one top-tier coin to establish a link to fiat
  2. Calculate total trading volume of a coin on particular exchange as sum of volumes across all trading pairs with this coin on this exchange
  3. Calculate volume weighted average coin prices across all exchanges

4.2. Methodology results

Benefits of this methodology are clearly visible.

Let’s compare Tether (USDT) prices on CoinMarketCap and on THE SILICOIN.

There are only 2 exchanges that offer liquid USDT trading to USD — Kraken and Bittrex. USDT/USD price on these exchanges indicate true market Tether’s price.

CMC arrives at inflated USDT prices on most trading pairs except USDT/USD markets that are priced directly from fiat. See screenshots below.

As of 18 Dec 2018 Source: CoinMarketCap

With our methodology we arrive at stable prices across all exchanges.Moreover, users can always verify that average price of a cryptocurrency is calculated by multiplying Price by Adjusted share (see full methodology below for details).

As of 18 Dec 2018 Source: THE SILICOIN

4.3. Detailed methodology

We encourage you to be patient and invest your time in reviewing detailed methodology.

Step 1:

Retrieve raw data from exchanges

From each exchange receive last price and 24-hour trading volume for available trading pairs (i.e. BTC/USD, XRP/ETH, etc.).

Step 2:

Find USD price and trading volume of coins on each exchange

Procedure of finding USD price of a coin on an exchange depends on whether this exchange offers trading to fiat or not.

This part is important, please pay attention to it. We provide calculation example below for more clarity.

2.1. If liquid fiat trading is available on the exchange — price all coins directly

2.1.1. Find USD prices of coins traded directly to fiat. Fiat currencies other than USD are converted to USD using Open Exchange Rates data

In case there are several trading pairs that can establish coin’s USD price in one step, pair with the highest trading volume is selected. See example below

2.1.2. Find USD prices of coins traded to coins priced at a previous step but not traded to fiat

2.1.3. Such step by step iterations continue until all coins on the exchange receive USD price

2.2. If no liquid trading to fiat on the exchange is available use base coin

2.2.1. We use USD price of an applicable base coin to find USD prices of other coins on this exchange

Base coins are top-tier coins that are extensively traded to fiat on other exchanges. Base coins are used to find USD price on exchanges with no fiat trading — base coins serve instead of fiat currency in this case.

Base coin is selected for each exchange separately — coin with the largest trading volume is selected. So far Bitcoin offers maximum trading volume on all exchanges with no fiat trading that are integrated by THE SILICOIN.

For example, Bitcoin serves as base coin on Binance.

Only one base coin may be selected for an exchange to assure price homogeneity as explained in Section 2 of this article.

2.2.1. Same algorithm as described in 2.1. is applied to find most efficient path to base coin for other coins

2.3. Calculate total trading volume for each coin on the selected exchange

Calculation example for Step 2 of THE SILICOIN methodology

Assume that exchange “XYZ” has the following trading pairs:

Trading data retrieved from imaginary exchange “XYZ”. USD/EUR retrieved from Open Exchange Rates

1. Price coins traded directly to fiat (item 2.1.1. of detailed methodology)
There are 3 pairs to fiat: BTC/USD, BTC/EUR, ETH/USD. Therefore, we can price BTC and ETH at this step

For BTC we have 2 pairs to fiat. Dollar volume of BTC/USD=$15,000,000; of BTC/EUR=10,000,000/0.88=$11,363,363. We select the pair with higher volume → BTC/USD. Last price of BTC/USD=$3,200 → that is BTC price on this exchange

For ETH we have only 1 pair to fiat. Therefore, ETH costs $85 on this exchange

We explain why we use the most liquid pair approach instead of averaging in Section 4.4 below.

2. Price coins that are not traded to fiat but traded to coins priced previously (item 2.1.2.)

For LTC we have 2 applicable pairs: LTC/BTC and LTC/ETH. Dollar volume of LTC/BTC=160*$3,200=$512,000, of LTC/ETH=3,500*$85=$297,500. We use pair with higher volume. Therefore, LTC costs 0.008*$3,200=$25.6

3. Calculate total USD trading volume for all coins (item 2.3.)

  • For BTC we have 3 pairs with following volumes: BTC/USD=$15mn, BTC/EUR=$11.36mn, LTC/BTC=$0.512mn. Total BTC volume is $26,872mn
  • For ETH we have 2 pairs with following volumes: ETH/USD=$6mn, LTC/ETH=$0.2975mn. Total ETH volume is $6.2975mn
  • For LTC we have two pairs with following volumes: LTC/BTC=$0.512mn, LTC/ETH=$0.2975mn. Total LTC volume is $0.8095mn

Illustration for calculation example:

Illustration for calculation example

Step 3:

Calculate market average price of coins

We combine data from all exchanges to find market average price of coins. Exchanges may be excluded from calculating average price for some coins under rules laid out below.

3.1. Market average price of a coin calculated as volume weighted average price (VWAP) across exchanges integrated by THE SILICOIN and where this coin is traded

The VWAP formula:

Where:
Pi— price of a coin on exchange i as determined in Step 2, 
Vi— total trading volume of a coin on exchange i as determined in Step 2, 
WAi — weight of an exchange i after adjustments, 
adji— adjustments applied to raw weight of exchange i,
Wi — raw weight of an exchange i,
Sum(Vi)
 — total trading volume of a coin across all integrated exchanges that are not excluded. In other words, it is sum of individual Vi
Exchange i — exchange integrated by THE SILICOIN and not excluded from calculation of totals for selected coin

3.2. Exchange may be partially or fully excluded from calculation of VWAP and Sum(Vi) of a coin under following conditions

3.2.1. Automated full exclusion from VWAP if coin serves as a base coin on this exchange (WAi in the formula above is set to 0)

3.2.2. Automated full exclusion from both VWAP and Sum(Vi) if 24-hour trading volume increased over 300% day-over-day and exceeds $100k (exchange is excluded from Sum(Vi), therefore Wi and WAi are set to 0)

3.2.3. Automated partial or full exclusion from VWAP if price of a coin on an exchange has large deviation from VWAP

In this case we adjust weight of an exchange (Wi in the formula above). Adjustment applies linearly to price deviations from 50% to 100%. 
For price deviation of 80%
WAi=Wi*(1-(80%-50%)/(100%-50%))=Wi*0.6. For price deviations above 100% WAi=0, for price deviations below 50% WAi=Wi

3.2.4. Manual full exclusion. Automated exclusion algorithms are set to cut off extreme deviations. Smaller deviations may be detected manually and exchanges may be excluded from VWAP or from both VWAP and Sum(Vi) for some coins

Note that WAi are always rescaled to sum up to 100%

Note on 3.2.2.
This mechanism protects from exchanges sending us erroneous volume and distorting the price. $100k threshold is set in order not to cut off coins with low trading volume that tend to exhibit high volume volatility.

Note on 3.2.3.
We first calculate VWAP using Wi. Then we compare prices on each exchange with VWAP and implement adjustments to Wi according to the formula. Next we recalculate VWAP using WAi. Exchanges that dominate by trading volume are unlikely to be penalized. This procedure occurs only once.

4.4. Why use the most liquid trading pair to calculate coin price on an exchange

As described in Step 2 of the methodology we use trading pair with the highest volume to determine price of a coin on an exchange at each step.

Alternatively, we can use average price across all pairs available in one step (both BTC/USD and BTC/EUR in the example above).

Below we explain why using the most liquid pair is better than averaging.

Price of a coin within one exchange may vary across trading pairs for the following reasons:

  1. Bid-ask spread
  2. Transaction fees (Arbitrageurs may be unable to eliminate price deviations because of fees. Such deviations move stochastically and should have mathematical expectation of zero)
  3. No trading

These inefficiencies obscure the true price, i.e. the price at which users can transact on the selected exchange.

The most liquid pair provides more precise price than averaging:

1. Top volume pair has the narrowest bid-ask spread 
By accounting for lower volume pairs we will widen the spread

We use the last price for calculations — it may be on both buy or sell side of the spread. Averaging may theoretically yield the mid price. However, during buy or sell markets, last price for each pair will be on the same side of the bid-ask interval most of the time. Therefore, averaging will widen the spread

2. Lower volume pairs are more likely to exhibit inefficiencies 
On a lower volume pairs, off-market price may hold for some time. Assume arbitrageurs see mispricing on low volume pair and try to eliminate it, but no one is buying/selling on the other side. The highest volume pair is less prone to such distortions

3. It is just more straightforward and people are more likely to be able to transact at prices of the most liquid pairs

4.5. How to observe all inputs used for calculation of average prices

  1. Contribution of each exchange to average price and total trading volume of a coin:
  • You would find exchange weights for each coin in “Exchanges” section of the dedicated page of selected coin. For example, Bitcoin page or Ethereum page
  • We provide Wi from the VWAP formula in “Market share” column of the table and WAi in “Adjusted share” column
  • If Market share = 0, then exchange is excluded from both VWAP and Sum(Vi) calculation for selected coin (footnotes 3 or 5, details below)
  • If Adjusted share = 0, then exchange is included in Sum(Vi) but excluded from VWAP for selected coin (footnotes 1, 2 or 4)

2. Adjustments and outlier cleaning mechanisms applied to exchanges:

  • If any conditions described in Section 3.2. of the methodology apply to an exchange, a footnote will appear near the name of this exchange in the “Exchanges” section of the coin page. Below is the legend:

No footnote — fully included in calculations of aggregates
1 — Base coin (see item 3.2.1. of the methodology)
2 — Price outlier (see 3.2.3.)
3 — Volume outlier (see 3.2.2.)
4 — Manually excluded from average price (see 3.2.4.)
5 — Manually excluded from average price and total volume (see 3.2.4.)

3. What trading pair was used to establish USD price of a coin on each exchange

  • In “Exchanges” section of any coin page you can find “Pricing pair” column that contains trading pairs used to establish USD price of the selected coin on each exchange and a link to historical trading data of this pair
  • Base coin in Pricing pair column means that selected coin was used as a base coin on this exchange. Adjusted share will be automatically set to 0% as described in item 3.2.1 of the methodology. You can observe it on Bitcoin page

read original article here