[bisq-network/bisq] [WIP] PriceNode: Add support for multiple ExchangeRateProviders (#4315)
notifications at github.com
Tue Jun 16 19:47:19 UTC 2020
Extend ExchangeRateService in pricenode to add basic support for multiple providers per currency.
When the service detects that multiple providers have exchange rates for the same currency, it automatically aggregates (averages) these rates into a single ExchangeRate.
The client thus receives a single ExchangeRate per currency, regardless of the number of providers which gathered exchange rates for it (be it a single provider, or multiple). This ensures compatibility with previous and existing clients.
The purpose of this WIP is to test and review whether:
* this approach to support multiple ExchangeRateProviders is viable
* the client transparently handles both normal and aggregate rates "as is" (so without any client modifications)
* the pricenode correctly handles multiple providers (multi-threading, caching of rates, calculation of aggregate price, etc)
* there are any fundamental showstoppers with this approach (risks, incompatibilities, etc)
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* Simplify validation in ExchangeRateServiceTest
* ExchangeRateService: Support aggregate rates
* Integrate initial set of ExchangeRateProviders
-- File Changes --
M pricenode/src/main/java/bisq/price/spot/ExchangeRateProvider.java (93)
M pricenode/src/main/java/bisq/price/spot/ExchangeRateService.java (79)
A pricenode/src/main/java/bisq/price/spot/providers/Binance.java (46)
A pricenode/src/main/java/bisq/price/spot/providers/Bitfinex.java (46)
A pricenode/src/main/java/bisq/price/spot/providers/Kraken.java (46)
M pricenode/src/main/java/bisq/price/spot/providers/Poloniex.java (58)
A pricenode/src/test/java/bisq/price/ExchangeTestBase.java (74)
M pricenode/src/test/java/bisq/price/spot/ExchangeRateServiceTest.java (149)
A pricenode/src/test/java/bisq/price/spot/providers/BinanceTest.java (34)
A pricenode/src/test/java/bisq/price/spot/providers/BitfinexTest.java (34)
A pricenode/src/test/java/bisq/price/spot/providers/KrakenTest.java (34)
A pricenode/src/test/java/bisq/price/spot/providers/PoloniexTest.java (34)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bisq-github