-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Currency Pair cleanup discussion thread #448
Comments
Agreed! Also, somewhat related, I never understood the reasoning for BaseExchangeService::verify(CurrencyPair currencyPair). Why not just let the exchange return the error. Is it to make debugging easier? What happens is that it prevents users from using newly added currency pairs to an exchange, forcing them to wait until someone updates XChange and forcing them to always use the latest snapshot release. The good thing is that it is more motivating to keep XChange up to date, but I'm not sure how reasonable that actually is as more exchanges are added. And how about combining all three polling services into a single service? I think it probably makes the code cleaner to have three different services. But as a user it always felt clunky to me and wish I could just call getPollingService. If you still prefer all three; how about changing to composition instead of extension for the BasePollingService's, this way we could share the same instance (same currency pairs) across all three. |
@timmolter Agreed, that should make it cleaner. @jamespedwards42 Also agreed, the I have another issue which we could discuss before a bigger refactor, but maybe I'll raise it in a separate issue as this is about CurrencyPair. |
OK, thanks for your feedback, guys. I will get rid of the I will get rid of the The merging of the services would be lots of work. Whether it's necessary even, I personally don't think so. I do like the separation. I'm open to discussing the pros and cons though. |
Actually, before I go removing stuff, I'll leave this tread open a couple of days to see if anyone has any legitimate objections. |
I didn't know of BaseExchangeService.getExchangeSymbols(). |
done. |
The only issue I'm seeing with this is that there is no getBaseService method that I know of. For instance, in my app, some of the exchanges that I support have ExchangeInfo.getPairs() and some do not. The ones that do not I had to manually go in and call for instance KrakenBaseService.getExchangeSymbols(). So removing ExchangeInfo.getPairs() takes away the unified method of getting exchange symbols, and people who are using this library will now need to implement a case for every exchange that their program supports. ie (if currentExchange == BITSTAMP) { Also: |
@shortkeys That was my problem also. But I found a way out. |
I just refactored the base service classes/interfaces. The casting was very ugly. Actually, everything is much cleaner now, including some other things not related directly to this issue. |
Sorry, this was my fault. A clean start worked ok. |
Hey Guys Was that moved? Or is there another method that gives me all currencypairs of an exchange? |
PollingMarketDataService has it
|
thanks |
knowm#448 Kraken exchange orderbook timestamp parse incorrect - fixed
Hi all!
Currently there are two XChange API methods one could call to get an exchange's currency pairs:
PollingMarketDataService.getExchangeInfo().getPairs()
BaseExchangeService.getExchangeSymbols()
This has lead to some confusion. We should probably clean this up and only have one option. To me, it makes more sense that getting currency pairs is general enough to not just be focused in the marketdata service but rather in the
BaseExchangeService
.I suggest removing the
PollingMarketDataService.getExchangeInfo()
and theExchangeInfo
DTO from XChange. Do you agree??The text was updated successfully, but these errors were encountered: