coinratecap / Backend

This is the backend of coinratecap
MIT License
6 stars 6 forks source link

Coin Listing price calculation Methodology #40

Closed hussu010 closed 3 years ago

hussu010 commented 3 years ago

Research and edit readme.md file with the coin listing methodology.

hussu010 commented 3 years ago

Coin Listing Methodology

Price

Using Bitcoin (BTC) as an example, and assuming we only track two exchanges, A and B: Exchange A: BTC/USD = USD 1,000 / BTC @ 15,000 BTC Trading Volume (rolling 24 hours) Exchange B: BTC/USD = USD 1,050 / BTC @ 10,000 BTC Trading Volume (rolling 24 hours)

We will then calculate the global volume-weighted average price. In this case, it will be: BTC Price (USD) = [Volume % First Exchange USD Price] + [Volume % Second Exchange USD Price] = [ 15,000 / (15,000 + 10,000) ] USD 1,000 + [ 10,000 / (15,000 + 10,000) ] USD 1,050 = 0.6 USD 1,000 + 0.4 USD 1,050 = USD 1020

Why global volume-weighted average price?

Because the higher the amount of BTC traded in a particular exchange, the higher it mush have an impact on the price of the BTC. That way if some exchange has a high deviation in value of BTC but low volume traded, it will have a low impact on the price of the crypto in our platform.

hussu010 commented 3 years ago

41

hussu010 commented 3 years ago

Some URLs to get the ticker info of BTC-USD https://api.gemini.com/v1/pubticker/btcusd https://api-public.sandbox.pro.coinbase.com/products/BTC-USD/ticker https://api.kraken.com/0/public/Ticker?pair=BTCUSD https://api-pub.bitfinex.com/v2/tickers?symbols=tBTCUSD https://ftx.com/api/markets/BTC/USD https://api.binance.us/api/v3/ticker/24hr?symbol=BTCUSD

Wisdom132 commented 3 years ago

Hello @NoorAhmd ....can you add a flow chart for this?

hussu010 commented 3 years ago

Trading Volume (Cryptoasset)

The trading volume for a crypto asset is the aggregate trading volume of all trading pairs of the crypto asset. Let’s assume Litecoin (LTC) is only traded on Exchange A and has BTC, ETH, and USD trading pairs with the following rolling 24 hours trading volume:

Rolling 24 hours trading volume for LTC in Exchange A: LTC/BTC = 5,000 LTC LTC/ETH = 1,000 LTC LTC/USD = 2,000 LTC

Assuming 1 LTC = USD 100, the 24 hours trading volume for Litecoin will be 5,000 + 1,000 + 2,000 = 8,000 LTC or USD 800,000.

hussu010 commented 3 years ago

Market Capitalization (Cryptoasset)

The Market Capitalization of a crypto asset is calculated using the following formula:

Let: A = Current crypto asset price in USD B = Available supply of an asset

Market Capitalization = A * B

For example, the market capitalization of 0x is calculated by multiplying the Available Supply of ZRX with its price. Assuming the Available Supply of ZRX is 583,209,787 and the price of ZRX is USD 0.25, the market capitalization is then calculated as 583,209,787 * USD $0.25 = USD 145,802,446.75.

hussu010 commented 3 years ago

Market Capitalization (Global)

The Global Market Capitalization is the sum of the Market Capitalization of all projects tracked.

hussu010 commented 3 years ago

APIs to get all the symbols: https://api.gemini.com/v1/symbols https://api-public.sandbox.pro.coinbase.com/products https://api.kraken.com/0/public/AssetPairs https://api-pub.bitfinex.com/v2/tickers?symbols=ALL https://api.binance.us/api/v3/exchangeInfo

NoorAhmd commented 3 years ago

Here is the flow chart of the methodology. flow (1).pdf