Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket APIs #6

Open
ainestal opened this issue Apr 2, 2017 · 7 comments
Open

Websocket APIs #6

ainestal opened this issue Apr 2, 2017 · 7 comments

Comments

@ainestal
Copy link
Contributor

ainestal commented Apr 2, 2017

I'd like to open the discussion about the approach to all the new APIs that implement websockets. More and more exchanges are going into the path of a continuous stream of data, instead of the pull approach of the classic APIs.

Would it be a useful feature to implement them? Is it even possible? Can the websockets work together within the same API as the classic exchanges?
So, what should we do about them?

@hugues31
Copy link
Owner

hugues31 commented Apr 2, 2017

I already did a simple websocket connection with OKCoin exchange with the rust-websocket crate. So yes it's possible (and fairly simple).
The thing is, websocket does not fit well with the current synchronous implementation of the coinnect api. Maybe we can create a branch that adds a websocket module, but this will be a lot of work.

@ainestal
Copy link
Contributor Author

ainestal commented Apr 2, 2017

Agree about the complexity of synchronous vs asynchronous and about the amount of work. This will probably be a long discussion. I just wanted to address the issue for the future.

@crackcomm
Copy link

crackcomm commented May 30, 2017

I have implemented Poloniex websocket stream.

I would like to discuss moving some code out of orca to coinnect, it doesn't make much of a sense to maintain two clients. Orca is mainly designed to be a platform for building trading software and markets simulations. It has lmdb trades database and in-memory orderbook. It fetches trades history from markets, the parts which could also be moved to coinnect. Not the database although, I don't think coinnect is the right place for that.

Let me know what your thoughts are.

I would also like to hear your opinion about incorporating currency and markets packages into coinnect.

@hugues31
Copy link
Owner

Hi, I'm not currently available to see your project, but when I'm back at home I will take a look and see what we can do :)

@Peltoche
Copy link
Contributor

Yop, for the asynchronous stuff, I have some work on it (See #9 ). Create a good implementation it's harder than what I expected first and I don't have much free time but soon :)

@crackcomm
Copy link

I think I have completed the interface for websockets.

I made sure that implementation of new websocket protocols is as simple as possible.

Poloniex is stable and tested, for now there are no plans for other exchanges (you can see beginnings of bitfinex parser though).

If we would like to merge our work together please see protocol buffers messages in orca. RawOrder, RawTrade those are very easy to bring to coinnect.

@crackcomm
Copy link

I am not entirely happy with this interface, but it works.

Some things I do not like in my current implementation

  • ~commands should be possible to receive again on disconnect
  • some streams respect subscribe commands separate for Trade and OrderBook

I would want to see better Currency and CurrencyPair implementation in coinnect along with Order, Trade and OrderBook data structures to make it possible to migrate this code to coinnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants