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

Adapt to new Poloniex API. #21

Merged
merged 5 commits into from Sep 12, 2023
Merged

Adapt to new Poloniex API. #21

merged 5 commits into from Sep 12, 2023

Conversation

ghost
Copy link

@ghost ghost commented Aug 22, 2023

Fixes #20

As the official Poloniex library is broken, here is a custom Poloniex feed, inspired by prior work done by @rodvar in #15.

It provides the same functionality as the old Poloniex feed, while adapting to the new API.

(Plus, there were many unused dependencies in libs.versions.toml, I cleaned it up).

Sample run:

Aug-22 17:43:17.769 [Timer-21] INFO  b.p.s.p.Poloniex: refresh took 490 ms. 
Aug-22 17:43:17.769 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/ETC: 5.94E-4 
Aug-22 17:43:17.769 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/DOGE: 2.427E-6 
Aug-22 17:43:17.769 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/ZEC: 9.76E-4 
Aug-22 17:43:17.769 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/DCR: 4.92E-4 
Aug-22 17:43:17.770 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/LTC: 0.002483 
Aug-22 17:43:17.770 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/XMR: 0.005596 
Aug-22 17:43:17.770 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/ETH: 0.06275 
Aug-22 17:43:17.770 [Timer-21] INFO  b.p.s.p.Poloniex: BTC/DASH: 0.001013 

Copy link
Contributor

@rodvar rodvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also tested it. All tests pass now (its broken in main since Polinex test is not passing as the PR properly explains).

Also I can see it getting poloniex rates back again now! :)

   Aug.-23 16:06:41.935 [Timer-20] INFO  b.p.s.p.Poloniex: refresh took 480 ms. 

Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/XMR: 0.005568
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/ETH: 0.0629
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/ZEC: 9.68E-4
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/DASH: 0.001013
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/DCR: 4.92E-4
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/DOGE: 2.396E-6
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/LTC: 0.002492
Aug.-23 16:06:41.935 [Timer-20] INFO b.p.s.p.Poloniex: BTC/ETC: 6.0E-4

src/main/java/bisq/price/spot/providers/Poloniex.java Outdated Show resolved Hide resolved
jmacxx added 2 commits September 4, 2023 16:57
Also clean up unused dependencies.
Applied code review changes.
@ghost
Copy link
Author

ghost commented Sep 4, 2023

@alvasw I have updated this PR to migrate to WebClient, based on #26

Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!!

Nit

  1. Do you know why we removed Coinbase in the past [1]?

  2. WebClient supports JSON Arrays and can return these as Flux objects (see code review suggestions).

I pushed the suggestions too: alvasw@c958d25

[1] 453931b

gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
src/main/java/bisq/price/spot/providers/Poloniex.java Outdated Show resolved Hide resolved
src/main/java/bisq/price/spot/providers/Poloniex.java Outdated Show resolved Hide resolved
src/main/java/bisq/price/spot/providers/Poloniex.java Outdated Show resolved Hide resolved
src/main/java/bisq/price/spot/providers/Poloniex.java Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Sep 6, 2023

@alvasw, thanks for the detailed review! Changes applied.

  1. Do you know why we removed Coinbase in the past [1]?

Perhaps Coinmarketcap was removed because the API switched to requiring a key. As far as I'm aware we don't use any APIs that require keys. [Disclaimer: don't know the actual history].

@ghost ghost requested a review from alvasw September 6, 2023 17:58
Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Contributor

@gabernard gabernard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@gabernard gabernard merged commit 52f2307 into bisq-network:main Sep 12, 2023
@ghost ghost mentioned this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poloniex legacy API has been discontinued.
3 participants