Use Java 11 to run the pricenode service, since v11 includes by
default some root certificates needed when establishing SSH connections
to some of the new API endpoints.
Disable BitcoinAverage provider. Keep it registered as a provider to
ensure that the data structure returned by the pricenode to the Bisq
clients contain the hardcoded "btcAverageTs" key.
Correctly interpret the alt conversion rate reported by the API. For
alts, Bisq needs the Alt/BTC rate, whereas the API returns the BTC/Alt
one. Calculate the inverse of the reported values before storing them as
Bisq internal datastructures (ExchangeRates).
Retrieve the exchange rates in bulk, when possible. This reduces
the number of calls the pricenode makes to the exchange API from N =
"number of exchange rates to retrieve" to N = 1.
The replaced approach, which made a separate call to the exchange API
for each exchange rate, was sometimes failing due to reaching API rate
limits.
Give a more accurate name to the abstract test class
which contains common methods used by all
ExchangeRateProvider tests, like BinanceTest or KrakenTest.
Mark this test class as abstract, to indicate that it
should not be run as a standalone test.
Remove Order annotation from rate providers, which was
used in the case that multiple providers would retrieve
rates for the same currency.
The ExchangeRateService now handles such scenarios, thus
eliminating the need for deciding provider precedence via
the Order annotation.
Revert from latest v5.0.0 to v4.2.2, since the newer version libraries
are compiled with Java 11, so they cannot be used as part of the Bisq
build process which still partially relies on Java 10.
Add support for a few exchanges to demonstrate and test the pricenode
aggregate rates.
The chose exchanges were selected because they each provide a varied
list of fiat and altcoins, with a substantial overlap between them. This
provides a robust initial set of datapoints and scenarios for aggregate
rates.
Add support for aggregate rates in the ExchangeRateService. If multiple
ExchangeRateProviders contain rates for the same currency, then these
rates will be automatically aggregated (averaged) into one.
This allows the service to transparently scale to multiple providers for
any specific currency.
The clients index the rates received from the pricenode by currency
code, which means they expect at most a single rate per currency. By
aggregating rates from multiple providers into one per currency, the
ExchangeRateService provides more accurate price data. At the same time,
the service API data structure remains intact, thus preserving backward
compatibility with all clients.
Update sanity check methods to allow for deeper and more comprehensive
validations of the input data. Accept full ExchangeRateProviders in the
method signatures, instead of just the provider prefix, to allow for
more complex sanity checks within those validation methods.
There is a race condition in PopupManager when with a stack of 2 popups,
the top popup is being replaced by another top-level popup. The base
layer popup ends up on top of the z-order, obscuring the correct one.
The race condition in PopupManager was within the onHidden() method
which invokes the next window in the queue. The call to displayNext()
needs to be asynchronous so that a newer popup can take precedence.
Fixes#4293
Issue: if a taker used exactly all BSQ from the BSQ inputs to pay the
trading fee, there was no BSQ change in the takeOfferFeeTx. It was
assumed that the second output was the reservedForTrade output, but in
the case of missing BSQ change it was the first output.
Fix: added a check to make sure the value of the inputs to the deposit
tx match the expected inputAmount.
Added a check that if there is no BSQ outputs in the bsqTradingFeeTx a
change output is added of value 1 satoshi more than the BSQ input value.
This ensures that the second output is always the reservedForTrade
output. It also ensures that the BSQ is burnt, even in the very unlikely
case that the amount of BSQ burnt is larger than the reservedForTrade
amount.
Issue: if a taker used exactly all BSQ from the BSQ inputs to pay the
trading fee, there was no BSQ change in the takeOfferFeeTx. It was
assumed that the second output was the reservedForTrade output, but in
the case of missing BSQ change it was the first output.
Fix: added a check to make sure the value of the inputs to the deposit
tx match the expected inputAmount.
Added a check that if there is no BSQ outputs in the bsqTradingFeeTx a
change output is added of value 1 satoshi more than the BSQ input value.
This ensures that the second output is always the reservedForTrade
output. It also ensures that the BSQ is burnt, even in the very unlikely
case that the amount of BSQ burnt is larger than the reservedForTrade
amount.