irufus / gdax-java

Java based wrapper for Coinbase Pro (Formerly known as GDAX API and Coinbase Exchange API)
MIT License
177 stars 131 forks source link

Pricing API? How do I get buy, sell or spot prices? #25

Open venkateshthallam opened 6 years ago

venkateshthallam commented 6 years ago

I see coinbase has a Pricing API to retrieve all these details, but didn't find anything in the GDAX documentation? Should I use coinbase API for pricing instead?

robevansuk commented 6 years ago

You have a few choices.

  1. For the best bid/ask you will need to call the MarketDataService.getMarketData(product, level) which will return a MarketData object with bids/asks. Do with this what you will. Request level 1 data
  2. For the top 50 I believe you can do a level 2 getMarketData request - this will return something like the top 50 bids/asks in the same way as above.
  3. Download the entire orderbook as it currently stands - this is a level 3 request for the product Id. This will provide a snapshot in time of all bids/asks.
  4. to maintain a live orderbook - this is being worked on and will be available as soon as reasonably possible.

Please see the GDAX documentation for more info https://docs.gdax.com/#market-data

robevansuk commented 6 years ago

Better documentation needed in this lib so people don't get lost in the Gdax Api Docs

robevansuk commented 6 years ago

Live orderbook is completed now. Just need a few minor tweaks and I can probably create a pull request tomorrow.