gdax-java icon indicating copy to clipboard operation
gdax-java copied to clipboard

Are Channels Implemented in the API?

Open verona-rupes opened this issue 7 years ago • 7 comments

I've been reading through the gdax official documentation and they mention that we need to subscribe to channels in order to get updates. I couldn't find any channel subscriptions in the code. Is the WebsocketFeed stream subscribe to a "full channel" ?

https://docs.gdax.com/#channels

verona-rupes avatar Dec 25 '17 00:12 verona-rupes

yes its not implemented yet - I'm attempting to build a full-channel + gui on top. Whilst that is hard to do its relatively simple to subscribe to the messages using the WebsocketFeed. I've attempted this in my own repo here: https://github.com/robevansuk/gdax-java/blob/master/src/main/java/com/coinbase/exchange/api/gui/orderbook/OrderBookView.java

robevansuk avatar Jan 22 '18 16:01 robevansuk

almost have a working example now. Essentially you need to process messages in sequential order. Since the websocketfeed relies on TCP based comms you should get all the messages, you just need to process them in the correct order... and timeout if the one you're waiting for next doesn't arrive in a sensible time frame.

robevansuk avatar Feb 19 '18 21:02 robevansuk

I have a working example - it will be available soon enough. Next few days or couple of weeks max I'm hoping

robevansuk avatar Feb 24 '18 22:02 robevansuk

I've implemented the LiveOrderbook now should be available any day now with any luck

robevansuk avatar Feb 25 '18 22:02 robevansuk

I kinda refactored your code for level2 and ticker channels. It was quick and dirty just to get my bot running. I realized that the connections through org.apache.tomcat.websocket.WsWebSocketContainer keeps disconnecting when using channels. Not sure why. so I switched the socket implementation to TooTallNate/Java-WebSocket. which is a standalone socket implementation and it worked fine.
Edit: l2update and ticker channels don't require authentication.

verona-rupes avatar Feb 25 '18 22:02 verona-rupes

ok - Full LiveOrderbook is available now over at my repo www.github.com/robevansuk/gdax-java. Fully tested and reconnects on timeouts if the message we're waiting for isn't received within 15 seconds.

robevansuk avatar Feb 25 '18 23:02 robevansuk

I figure realtime is likely to offer much better algo trading! imaging monitoring the rate of trades coming in, seeing a spike and being able to place a trade instantly. Surely that's going to make/save more than a few %?

robevansuk avatar Feb 25 '18 23:02 robevansuk