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

1
  • Welcome to Bitcoin.SE! I see you already have experience in other SE sites so I will leave you to it.
    – Willtech
    Feb 11, 2018 at 5:32

2 Answers 2

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 :)

0
0

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

1
  • yes but where can i create a formula for that, any way to do it with the data provided?
    – cup_of
    Feb 10, 2018 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.