Commit Graph

79 Commits

Author SHA1 Message Date
wiz
8e3b727d07
Increase our mempool fee estimation from "medium" to "high" priority
Bisq currently uses the mempool.space API for fee estimation, selecting
the "medium" priority fee, which generally works very well. However, if
your timing is bad, sometimes the mempool can quickly fill up and your
TX can get stuck for several hours or even days, which degrades the UX
of Bisq.

This PR changes the Pricenode code to always use "high" priority fees,
which would at the time of writing use 99 sat/vB instead of 85 sat/vB,
and hopefully prevent the above-mentioned issue from occuring. Of
course if the mempool is empty the minimum fees would still be used, as
this only changes the "priority" from medium to high.

Fee estimates: https://mempool.space/
API endpoint: https://mempool.space/api/v1/fees/recommended
2020-10-02 05:15:40 +09:00
Devin Bileck
51f318d47f
Add mempool.bisq.services explorer and mempool fee estimation provider 2020-08-26 00:01:22 -07:00
wiz
0c4b6a50f4
Modify pricenode install script to use master instead of release tag 2020-08-23 09:14:36 +09:00
wiz
bff4865ca7
Pricenode tweak: completely remove Coinmate and cex.io as data providers
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.
2020-08-21 17:53:14 +09:00
wiz
1d784211c2
Add mempool.ninja to pricenodes as 3rd mempool fee estimation backend 2020-08-17 23:36:09 +09:00
sqrrm
06e533bb81
Merge pull request #4315 from cd2357/xchange-integration-introduce-aggregate-rates
PriceNode: Add support for multiple ExchangeRateProviders
2020-08-17 14:44:16 +02:00
cd2357
d972a7571a
Improve exception handling to match Codacy rules
Rewrite a few generic parts of the code to be more specific in what they
 handle, or how they handle the resulting data structure.
2020-08-08 17:12:39 +02:00
cd2357
0c2703848c
Apply Codacy style changes
Apply various changes in coding style, required by the Codacy check.
2020-08-08 16:05:15 +02:00
cd2357
9fb5c0bb53
Remove unused imports
Removed unused imports from pricenode classes.
2020-08-08 15:24:08 +02:00
cd2357
11076e773d
Set quiet flag for java install command
Reduce verbosity of install command to only errors

Co-authored-by: wiz <j@wiz.biz>
2020-08-06 10:26:13 +02:00
cd2357
36dbb2e943
Upgrade Java to v11
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.
2020-08-05 23:26:03 +02:00
cd2357
82bbb2dafa
Upgrade Tor to v3
Use tor v3 addresses during a new pricenode setup.
2020-08-05 23:20:14 +02:00
cd2357
4dc24e5606
Disable BitcoinAverage
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.
2020-08-05 23:17:18 +02:00
Christoph Atteneder
41f7350217
Merge pull request #4382 from cd2357/patch-1
Force non-interactive install of git lfs
2020-07-30 09:50:40 +02:00
cd2357
33550caab2
Remove unused maxBlocks param from pricenode
As the new fee estimation API does not require this parameter
anymore, remove it and all references to it.

See bisq-network/projects#27
2020-07-28 22:11:46 +02:00
cd2357
8d335441c3
Fix Bitpay and CoinGecko altcoin rates
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).
2020-07-28 21:10:25 +02:00
cd2357
efda45fa78
Integrate Hitbtc exchange API
Add Hitbtc ExchangeRateProvider and corresponding unit test.
2020-07-27 18:55:11 +02:00
cd2357
b362b4c8d2
Integrate Huobi exchange API
Add Huobi ExchangeRateProvider and corresponding unit test.
2020-07-27 18:53:13 +02:00
cd2357
5a194420ed
Integrate Coinpaprika API
Add Coinpaprika ExchangeRateProvider and corresponding unit test.
2020-07-27 16:17:38 +02:00
cd2357
399f65d404
Integrate CoinGecko API
Add CoinGecko ExchangeRateProvider and corresponding unit test.
2020-07-27 14:53:03 +02:00
cd2357
9be2a5bbb4
Integrate Bitpay exchange rate API
Add a Bitpay exchange rate provider and corresponding unit test.
2020-07-27 14:52:36 +02:00
cd2357
637378b58a
Integrate more exchanges using knowm xchange
Add more exchange providers supported by the knowm xchange library.

This extends support for a few new currencies.
2020-07-27 13:02:25 +02:00
cd2357
7fc5191798
Reuse sets of supported currencies
Reuse sets of supported currencies between pricenode classes and tests.
2020-07-20 18:14:38 +02:00
cd2357
329188db1d
Reduce number of exchange API calls when polling
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.
2020-07-20 18:14:38 +02:00
cd2357
aceb7eef15
Renamed ExchangeRateProvider test class
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.
2020-07-20 18:14:37 +02:00
cd2357
75a0a47a1e
Mark new ExchangeRateProviders as package-private
Remove public modifier in their class definitions to
preserve their package-private scope.
2020-07-20 18:14:37 +02:00
cd2357
020547e19b
Remove Order annotation from ExchangeRateProviders
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.
2020-07-20 18:14:37 +02:00
cd2357
5cffddc9ae
Rewrite else-if clause
Simplify if-else block to avoid redundant use of else-if
in combination with an empty check and a return statement.
2020-07-20 18:14:37 +02:00
cd2357
3e314a9d24
Rename exception variables to ex
Update the name of exception variables to ex for
consistency and better readability.
2020-07-20 18:14:37 +02:00
cd2357
141ead0b2f
Wrap comments at 90 characters
Update comments to reflect bisq-network/style#5 guideline
2020-07-20 18:14:37 +02:00
cd2357
671e80929a
Integrate initial set of ExchangeRateProviders
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.
2020-07-20 18:14:37 +02:00
cd2357
f650115580
ExchangeRateService: Support 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.
2020-07-20 18:14:37 +02:00
cd2357
f2085b4bf0
Simplify validation in ExchangeRateServiceTest
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.
2020-07-20 18:14:37 +02:00
cd2357
a8cff75988
Force non-interactive install of git lfs
Update install command to not need user interaction
2020-07-12 17:02:12 +02:00
Devin Bileck
0bab863ee9
Fix command shown in README used to install collectd service
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.
2020-06-17 22:35:02 -07:00
Devin Bileck
83e194686d
Update install scripts for Git LFS 2020-06-17 22:35:01 -07:00
mrosseel
54cfc7b563
add commands to update the pricenode 2020-06-04 10:53:21 +02:00
Chris Beams
7064f0f2fe
Rename properties used to configure mempool hostnames 2020-05-11 11:45:33 +02:00
Chris Beams
c79bf3edf1
Eliminate unnecessary use of GenericXmlApplicationContext 2020-05-11 11:45:33 +02:00
Chris Beams
714e49461f
Rename BitcoinFeeRateProvider to MempoolFeeRateProvider
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.
2020-05-11 11:45:33 +02:00
Chris Beams
d160d9ec5f
Restore BitcoinFeeRateProvider to package-private visibility
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.
2020-05-11 11:45:33 +02:00
Chris Beams
ae4c256103
Eliminate unnecessary TestBase class 2020-05-11 11:45:33 +02:00
Chris Beams
f8c9c72bc7
Polish style
- 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
2020-05-11 11:45:33 +02:00
cd2357
45636f160e
Fix unit test
Fix a unit test that failed after a few related classes were refactored.
2020-05-09 18:32:57 +02:00
cd2357
9f7eca2734
Update README.md
Add a section explaining how the mining fee average is calculated and
how the queried API endpoints can be modified.
2020-05-09 18:02:49 +02:00
cd2357
1c6a5b22a3
Scale number of fee providers using config
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.
2020-05-09 17:50:46 +02:00
cd2357
a5e1d75cfa
Add support for N>1 providers in FeeRateService
Extend FeeRateService with necessary logic to support multiple
BitcoinFeeRateProvider instances. Average the retrieved rates and
provide the average via the service getFee() API.
2020-05-09 16:20:09 +02:00
cd2357
efb1fd835f
Add ExchangeRateService test for N>1 providers
Add unit test which covers the scenario that an ExchangeRateService
queries multiple ExchangeRateProviders.
2020-05-09 12:43:56 +02:00
cd2357
a2c9b18f6a
Extend unit tests for ExchangeRateService
Extend the unit tests with more granular checks.
2020-05-09 12:34:02 +02:00
cd2357
1ad7169682
Add unit test for Version controller
Add unit test for existing functionality of the Version controller.
2020-05-09 09:40:52 +02:00