mess110 / coinmarketcap.northpole.ro

A straightforward JSON API for all the currencies and assets found on coinmarketcap.com crawled every 5 minutes
MIT License
41 stars 11 forks source link

"volume24" question (v6 API) #4

Closed ekerstein closed 7 years ago

ekerstein commented 7 years ago

Is this the volume in terms of the given coin, or in terms of Bitcoin? It seems like it's Bitcoin but I just want to make sure.

Assuming it's Bitcoin, one issue/difficulty I've noticed with that is it makes it hard to convert volume over time to fiat currency. Let's say I want to see the USD volume of Ripple over the last month. If the "volume24" was in terms of Ripple then I could just multiply each day's volume by that day's Ripple price. Easy.

However, if the "volume24" is in terms of Bitcoin, that means I have to pull Ripple and Bitcoin data and then multiply day-for-day what the volume of Ripple was versus the price of Bitcoin. A little harder.

Maybe that's not an analysis most people are doing but I personally would like to do it. Just a thought.

Below is what CoinMarketCap.com API gives. Notice the volume is in terms of USD.

        "id": "bitcoin", 
        "name": "Bitcoin", 
        "symbol": "BTC", 
        "rank": "1", 
        "price_usd": "2282.09", 
        "price_btc": "1.0", 
        "24h_volume_usd": "1136650000.0", 
        "market_cap_usd": "37335533255.0", 
        "available_supply": "16360237.0", 
        "total_supply": "16360237.0", 
        "percent_change_1h": "0.3", 
        "percent_change_24h": "6.14", 
        "percent_change_7d": "2.07", 
        "last_updated": "1496126050"
mess110 commented 7 years ago

Ok thanks for the info. I believe I can help. v6 will return the volume in all supported currencies calculated at "runtime". I will take the price and multiply by total BTC transfered.

I will have to finish work first. Should be able to do it later today

ekerstein commented 7 years ago

Thank you! Sounds good.

ekerstein commented 7 years ago

@mess110 I think something isn't calculating right. I just pulled a couple coins:

Are you multiplying BTC volume by coin price? I think you need to multiply BTC volume by BTC price for that given day. Does that make sense?

mess110 commented 7 years ago

Ok, the numbers should be more correct now. I say more correct because I used an estimate value for the BTC price: I divide the cost of 1 coin in a specific currency by the btc price of that coin, getting the btc price. Once I have the btc price, I multiply that with the volume.

Hope that makes sense.

Also, the history should now be in a consistent format.

Thx

ekerstein commented 7 years ago

Looks much better, thank you!