-
Notifications
You must be signed in to change notification settings - Fork 222
Consider implementing Bitfinex websocket API #8
Comments
Hi,
So, in
However, the above methods seems to allow constructing subscribe/unsubscribe message only based on channel name, while Bitfinex also requires a symbol when creating subscribe message. I compared the above with another similar Streaming Exchange implementation - GDAX - and there I see that it is possible to use the above methods with only channel name (actually it is mapped to currency pair) to create subscribe message like the foloowing:
Appreciate your help. |
Hmm either we should do some refactoring and add varargs into these methods. Then you could be able to pass additional data for the subscribe / unsubscribe messages. Or create another implementation with different interface. I am not sure what's best approach :). |
@dozd thank you for the prompt response. |
@dozd I have only addressed subscribing to channel, I haven't looked at unsubscribing yet. Please have a look here - develop...LeonidShamis:develop |
I've sort of hit a roadblock due to limited knowledge of RxJava :(
I know how the data returned by the WebSocket feed looks like, but I haven't figured a way of mapping it (.map(...)) to respective Observable<> streams. I also noticed that v1 data looks slightly different (and simpler) that v2 data. See attached. |
@LeonidShamis that change to varags seems working for me, create PR. About mapping - it won't be much different to another exchanges, just look there. You also need to create proper mapping class if they are not similar to polling ones. |
Created PR#12 |
Merged. I'd like to see implementation that uses these varargs in subscribing :-). |
In case it helps, I had a working Bitfinex WebSocket v2 client using tyrus-standalone-client and dependencies pulled in from xchange-bitfinex. The code is available on BitBucket, and the two important classes are BitfinexWebSocketSecureClient and BitfinexHmacWebsocketAuthDigest. The rest is largely related to saving data, building order books, and executing a strategy. I haven't cleaned it up, and I'm not exactly sure if the libraries are easy to port to from tyrus-standalone-client to whatever xchange-stream uses, so it may be more trouble than its worth. If you happen to have questions about the implementation, let me know. Edit: it looks like the API has added a few more fields since I wrote the client a year or so ago, so it will likely need to be extended a bit. |
Thanks to @lukaszaoralek |
https://docs.bitfinex.com/v2/docs/ws-general
The text was updated successfully, but these errors were encountered: