How does Coinbase/GDAX calculate the "Volume" in candle data?

I'm pulling data from the GDAX API in 2 ways; 1, by requesting candles similar to this endpoint, and 2, by tallying up raw tick data from the GDAX WebSocket.

My problem is that when I try to create candle data from tick data, my volumes are very different than what GDAX reports for the same/similar periods. (See the blue and red outlines below...)

In my hand-made candles (shown below, highlighted red), I'm simply taking the sum of all the BTC transacted during that interval, but the numbers are much higher than what GDAX is reporting in similar periods.

What am I doing wrong?

Here's the format I'm using to make my candles: Raw tick data

Volume discrepancy?

While researching this, I found this post saying that Coinbase uses the # of transactions to calculate volume, but I tried that, and the numbers are still way off. I even tried dividing and multiplying the # of transactions with my calculated volume, but they're still way off.

  • Did you manage to find out the answer? I'm having the same issue
    – Nasir
    Commented Feb 13, 2018 at 9:08
  • 1
    I've been digging heavily into this and I'm reaching the conclusion that GDAX tradeview shows the wrong volume for each candle. I calculated several of these items and they don't match (even though OHLC are correct). Another reason was that I check TradingView chart as well and their calculation also matches mine but not GDAX
    – Nasir
    Commented Feb 13, 2018 at 9:40
  • @Nasir Glad I'm not the only one stuck here. Still no answer, but I did more investigating and have some ideas. The gray volume bars in the tradeview seem to be the sum of the live transaction amounts from the live ticker. It seems like everywhere else GDAX reports volume (such as in TradingView and the GDAX APIs), it's calculated differently. I noticed on TradingView they refer to the Volume as "Volume 20", so perhaps they're applying a rolling average? Commented Feb 13, 2018 at 19:27
  • Update: I just tried applying a bunch of rolling averages and emas to the Volume from Tick data, to see if it would match the volume from GDAX's candle data, with no luck. Commented Feb 13, 2018 at 21:46
  • I also tried it with the live ticker and it doesn't match. Clearly, the sum(size) of trades in an interval should be the volume but that just does not match the GDAX api. I have tested other exchanges and they are fine. so I take my calculated value as correct.
    – Nasir
    Commented Feb 14, 2018 at 13:53

1 Answer 1


I can't answer for the discrepancy that you're seeing, but the "right" way to calculate volume would be to add the "total" column from each trade that occurred during the period. That is, assuming that candle charts are based on stock market candle charts.

It doesn't surprise me that you're seeing this discrepancy, however. I've noticed a few different cryptocurrency APIs that have no idea how to calculate OHLCV data the right way. If your candle data isn't correct, then none of the traditional TA-Lib functions will mean anything!

Your Answer

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

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