Based on the coinmarket cap api, how do they calculate the bitcoin percent change

0

I am trying to figure out how coinmarketcap calculates the bitcoin percent change for other coins. For example on ethereum:

enter image description here

I'm trying to figure out how they calculate that bottom BTC percent change 3.85%.

Their api (https://api.coinmarketcap.com/v1/ticker/?limit=100) spits out this data:

{
    "id": "bitcoin", 
    "name": "Bitcoin", 
    "symbol": "BTC", 
    "rank": "1", 
    "price_usd": "8397.08", 
    "price_btc": "1.0", 
    "24h_volume_usd": "8190950000.0", 
    "market_cap_usd": "141531834530", 
    "available_supply": "16854887.0", 
    "total_supply": "16854887.0", 
    "max_supply": "21000000.0", 
    "percent_change_1h": "-0.51", 
    "percent_change_24h": "1.0", 
    "percent_change_7d": "-1.88", 
    "last_updated": "1518191066"
}, 
{
    "id": "ethereum", 
    "name": "Ethereum", 
    "symbol": "ETH", 
    "rank": "2", 
    "price_usd": "846.675", 
    "price_btc": "0.101377", 
    "24h_volume_usd": "3096660000.0", 
    "market_cap_usd": "82559453770.0", 
    "available_supply": "97510206.0", 
    "total_supply": "97510206.0", 
    "max_supply": null, 
    "percent_change_1h": "-0.2", 
    "percent_change_24h": "4.14", 
    "percent_change_7d": "-5.14", 
    "last_updated": "1518191052"
}

The first number is stated in this "percent_change_24h": "4.14" but they dont show how they came up with that second number ( 3.85% ).

Is there some formula I can create with the data they provide?

Thanks

cup_of

Posted 2018-02-09T15:50:33.093

Reputation: 103

Welcome to Bitcoin.SE! I see you already have experience in other SE sites so I will leave you to it.Willtech 2018-02-11T05:32:55.350

Answers

2

Well, you have all the information you need:

  • Compute the price of your coin 24h ago (in USD)
  • Get the price of the bitcoin 24h ago (in USD)
  • Compute how much bitcoin your coin was worth in BTC 24h ago using the two previous results
  • Compare with the current BTC value of your coin

Done :)

Joris Vial

Posted 2018-02-09T15:50:33.093

Reputation: 36

0

it's just the current difference between (e.g.)ETH/BTC at this time.

Adam

Posted 2018-02-09T15:50:33.093

Reputation: 3 215

yes but where can i create a formula for that, any way to do it with the data provided?cup_of 2018-02-10T02:14:51.577