Based on user feedback, these exchanges are too illiquid and do not
accurately reflect the true price of the market. After research, I found
the user's feedback to be correct and this PR removes both exchanges.
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.
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.
The install_collectd_debian.sh script reads user input to obtain the
onion address. However, when you pipe the output of curl into the shell
you're making the script text be standard input of the shell, which
takes it in as commands to run. After that, there's nothing left to
read. Even if it were to try, it wouldn't get anything from the terminal
input, because it's not connected to it. The pipe has replaced standard
input for the shell process.
Instead, create a pipe for bash to read the output of curl from and
provide it as the script file argument. In this case, the standard input
of the script is still connected to the terminal, and read will work.
The BitcoinFeeRateProvider name was never great; it should technically
have been something like EarnDotComFeeRateProvider. This change renames
the class to reflect that it (and its new subclasses) are specifically
designed to query the Mempool API as found at https://mempool.space.
This class had been made public in order to access the MIN/MAX_FEE_RATE
fields and to construct dummy instances in FeeRateServiceTest. This
introduced package cycles between bisq.price.mining and
bisq.price.mining.provider, making the implementation more difficult to
understand and maintain. This commit moves these fields to the
already-public FeeRateProvider base class, where they make more sense
to reside anyway. It also reworks tests to remove the need to access
BitcoinFeeRateProvider directly from FeeRateServiceTest. In the end,
BitcoinFeeRateProvider's visibility is returned to package-private as it
originally was, and all package cycles have been eliminated.
- Wrap comments at 90 chars per bisq-network/style#5
- Wrap code at 120 chars per bisq-network/style#3
- Remove unused imports
- Remove extra newlines
- Format code where appropriate
- Remove unused Javadoc tags, e.g. @return, @param
- End Javadoc summary sentence with a period where missing
- Remove HTML formatting in Javadoc, e.g. extra <br>s
Automatically instantiate up to 5 parallel fee estimation providers
based on configured API endpoints in application.properties.
By default, two endpoints are active.
When none are configured, one primary provider defaults to querying
mempool.space.
Extend FeeRateService with necessary logic to support multiple
BitcoinFeeRateProvider instances. Average the retrieved rates and
provide the average via the service getFee() API.
- Polish whitespace and newlines; wrap comments at 90 chars
- Use package-private vs protected visibility when exposing
BitcoinFeeRateProvider constants for testing
- Document that 'maxBlocks' is dead code, but do not remove it yet, as
it would disrupt the process of getting this fix out quickly because
it would require operators to change the way they start their
pricenodes.