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

CryptoYa: Exclude Binance #31

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

alvasw
Copy link
Contributor

@alvasw alvasw commented Sep 13, 2023

Our Binance price provider gets the exchange rate from Binance already.

Based on #30.

@ghost
Copy link

ghost commented Sep 13, 2023

Binance is providing an ARS blue rate (since 2023-06-20 apparently). Then it is getting transformed to approx 2x by the BlueRateTransformer. Is the solution enough to mark Binance as implements BlueRateProvider ?

INFO  b.p.s.p.Binance: BTC/ARS: 1.9447208E7
INFO  b.p.s.ExchangeRateService: ARS transformed from 1.9447208E7 to 3.8947405667574935E7

image

@ghost
Copy link

ghost commented Sep 13, 2023

If the provider is a BlueRateProvider, can we return Optional.empty() instead of the source rate in order to not get the log entries about transforming a rate which is not transformed?

public Optional<ExchangeRate> apply(ExchangeRateProvider provider, ExchangeRate originalExchangeRate) {
if (provider instanceof BlueRateProvider) {
return Optional.of(originalExchangeRate);

Sep-13 16:12:38.595 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateController: Incoming /getAllMarketPrices request from: curl/7.74.0 
Sep-13 16:12:38.606 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.9385829E7 to 1.9385829E7 
Sep-13 16:12:38.607 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.977498364E7 to 1.977498364E7 
Sep-13 16:12:38.607 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.91121221E7 to 1.91121221E7 
Sep-13 16:12:38.612 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 3.448917347E7 to 3.448917347E7 
Sep-13 16:12:38.614 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.924531346E7 to 1.924531346E7 
Sep-13 16:12:38.615 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.948487433E7 to 1.948487433E7 
Sep-13 16:12:38.615 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.935150975E7 to 1.935150975E7 
Sep-13 16:12:38.616 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.945385919E7 to 1.945385919E7 
Sep-13 16:12:38.616 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.9574875E7 to 1.9574875E7 
Sep-13 16:12:38.616 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.981790931E7 to 1.981790931E7 
Sep-13 16:12:38.616 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.986981407E7 to 1.986981407E7 
Sep-13 16:12:38.618 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.949855053E7 to 1.949855053E7 
Sep-13 16:12:38.618 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.979064466E7 to 1.979064466E7 
Sep-13 16:12:38.619 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.939909099E7 to 1.939909099E7 
Sep-13 16:12:38.619 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.938285981E7 to 1.938285981E7 
Sep-13 16:12:38.620 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.981663887E7 to 1.981663887E7 
Sep-13 16:12:38.620 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.95194E7 to 1.95194E7 
Sep-13 16:12:38.620 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.914822415E7 to 1.914822415E7 
Sep-13 16:12:38.621 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.9444018E7 to 1.9444018E7 
Sep-13 16:12:38.621 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 1.973578779E7 to 1.973578779E7 
Sep-13 16:12:38.632 [http-nio-8080-exec-1] INFO  b.p.s.ExchangeRateService: ARS transformed from 9176884.39 to 1.837877391457766E7 

@ghost ghost mentioned this pull request Sep 14, 2023
@ghost
Copy link

ghost commented Sep 15, 2023

I tested 👍 with the 2 suggested changes above. Would be good to get them included @alvasw.

CryptoYa queries 20 exchanges and returns their data. It makes more
sense to pass the data from each exchange separately to the
ExchangeRateService. The ExchangeRateService aggregates all exchange
rates later.
@alvasw alvasw force-pushed the cryptoya_exclude_binance branch from b845b53 to 330e5ed Compare September 16, 2023 12:16
@alvasw
Copy link
Contributor Author

alvasw commented Sep 16, 2023

I created opened a new PR (#32) in which I mark Binance as BlueRateProvider and only log the transformed exchange rates.

Our Binance price provider gets the exchange rate from Binance already.
@alvasw alvasw force-pushed the cryptoya_exclude_binance branch from 330e5ed to 8ce245d Compare September 17, 2023 13:57
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

ACK

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 based on #31 (review).

@gabernard gabernard merged commit c9c8296 into bisq-network:main Sep 18, 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.

2 participants