knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.81k stars 1.93k forks source link

help getting started - strange values for coinbase ticker #1498

Closed npomfret closed 6 years ago

npomfret commented 7 years ago

Just following the getting start guides to get some tickers for GBP / BTC. I have connected to a few exchanges and the data looks fine except for the coinbase exchange which is returning the following:

Ticker [currencyPair=BTC/GBP, last=1994.30, bid=2558.46, ask=2584.19, high=null, low=null,avg=null, volume=null, timestamp=null]

The bid and ask look like very wrong, way to high (last price looks ok though). Maybe they're in USD!? And there are a bunch of nulls here too. I ran the same code for a few other exchanges and got more sensible looking data back:

Ticker [currencyPair=BTC/GBP, last=2036.8823, bid=2000.4208, ask=2036.8822, high=2037.9516, low=1910.1231,avg=null, volume=13.41790025, timestamp=1496504857000] class org.knowm.xchange.cexio.CexIOExchange
Ticker [currencyPair=BTC/GBP, last=2036.33580, bid=1982.35372, ask=2041.52134, high=2100.31132, low=1942.66431,avg=null, volume=32.69000092, timestamp=1496504856347] class org.knowm.xchange.anx.v2.ANXExchange
Ticker [currencyPair=BTC/GBP, last=1994.99300, bid=1980.00500, ask=1995.00000, high=1998.00000, low=1851.92700,avg=1929.27631, volume=37.22032759, timestamp=null] class org.knowm.xchange.kraken.KrakenExchange
Ticker [currencyPair=BTC/GBP, last=1978.7, bid=1976.32, ask=1983.04, high=null, low=null,avg=null, volume=61697.93, timestamp=1496504825000] class org.knowm.xchange.bitcoinaverage.BitcoinAverageExchange
Ticker [currencyPair=BTC/GBP, last=1990.00, bid=1988.00, ask=1990.00, high=1990.00, low=1878.00,avg=1921.90, volume=392.3735, timestamp=null] class org.knowm.xchange.coinfloor.CoinfloorExchange
Ticker [currencyPair=BTC/GBP, last=2002.51000000, bid=1998.11, ask=2004.82, high=2003.69000000, low=1872.25000000,avg=null, volume=262.32573541, timestamp=1496504813439] class org.knowm.xchange.gdax.GDAXExchange
timmolter commented 7 years ago

Definitely looks like a bug. Thanks.

dmitriypotyl commented 7 years ago

Hi, getting the same bug for BTC/EUR where its actually returning back BTC/USD, probably based on user default currency preferences like the webpage.

This coinbase api seems to give back the right results: https://developers.coinbase.com/api/v2#get-buy-price https://api.coinbase.com/v2/prices/BTC-EUR/buy https://api.coinbase.com/v2/prices/BTC-USD/buy

npomfret commented 7 years ago

Try the GDAX implementation instead.

timmolter commented 6 years ago

The coinbase V2 Api is not implemented. It seems like everyone is using the GDAX API for coinbase now.

Mearman commented 6 years ago

getting this issue with Kraken

albertbanez commented 5 years ago

how do u guys get sell/buy volume in coinbase?