[bisq-network/bisq] [WIP] PriceNode: Add support for multiple ExchangeRateProviders (#4315)

cd2357 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)

Addresses bisq-network/projects#35

You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4315

-- 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 --

https://github.com/bisq-network/bisq/pull/4315.patch
https://github.com/bisq-network/bisq/pull/4315.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4315
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200616/383f8131/attachment.html>


More information about the bisq-github mailing list