Open everycoinprice opened 1 year ago
could you share the coinmarketcap links that you're talking about? It's hard to know why it's different without anything to look into with regards to how they calculate total volume
I can point out that CCXT does not have support for every crypto exchange, so the actual number will be much higher than what you're calculating, I don't know how many exchanges coinmarketcap or coingecko list
Coinmarketcap links-
Bitcoin's volume - https://coinmarketcap.com/currencies/bitcoin/
Volume methodology- https://support.coinmarketcap.com/hc/en-us/articles/360043395912-Volume-Market-Pair-Cryptoasset-Exchange-Aggregate-
could you share the coinmarketcap links that you're talking about? It's hard to know why it's different without anything to look into with regards to how they calculate total volume
I can point out that CCXT does not have support for every crypto exchange, so the actual number will be much higher than what you're calculating, I don't know how many exchanges coinmarketcap or coingecko list
Yes true, that is why CCXT's total volume for a cryptocurrency should be lower than that calculated by coinmarketcap or coingecko. As CCXT might be supporting lower exchanges than them. But, in reality it is higher. While both coingecko and coinmarketcap have similar volume numbers
For bitcoin's volume 24H on 05/12/2022-> Coinmarketcap says volume is $21,443,030,192 while Coingecko says $22,598,703,601
while through CCXT would be at least 10 to 100 times higher than these
The reason could be because ccxt includes not only spot markets, but some exchanges also load derivatives (swap, futures, ...) and thus, all tickers are including them too. I don't remind whether CMC/CG might be including only spot, check that. If so, then you might try smth like this:
if(tickers[t].symbol.split("/")[0] == symbol) {
const market = binance.market(symbol);
if (market.type === 'spot') {
totalVolume = totalVolume + tickers[t].baseVolume;
}
let us know the results.
So I am trying to calculate total volume of a cryptocurrency in the past 24 hours by adding all the baseVolume's from fetchTicker property of exchanges. Yet the total volume always comes up more than what popular ranking websites like coinmarketcap and coingecko post for the past 24 hours in volume
`
`
NOTE- This is just part of the code block (just for binance)- i repeat the same loop for all exchanges in ccxt.exchanges
Using this code i get totalVolume close to 80 million Bitcoins(BTC) traded in the past 24 hours, while coinmarketcap and coingecko report it close to 1 million
What i a missing?
Thanks for the help!