bisq-network / bisq-pricenode

GNU General Public License v3.0
5 stars 12 forks source link

Improving price consistency between nodes. #46

Open ghost opened 9 months ago

ghost commented 9 months ago

Currently, pricenodes poll their providers once per minute. They do not poll at the same time as each other since there is no coordination. Observing price consistency shows that 0.5% is the typical max deviation, with 0.1% to 0.2% being normal.

Increasing the frequency of polling does not seem feasible because we'd run the risk of being banned by providers.

One option might be to poll at the same time rather than randomly during a minute. Without centralized coordination, perhaps the PC clock can be used as a trigger, which is presumably sync'd via NTP (accuracy). Then the pricenodes' code can stipulate that provider 1 is polled at minute+0 seconds, provider 2 at minute+5 seconds, etc. This should improve consistency at the expense of adding some complexity to the code

dutu commented 9 months ago

For improving the update frequency and taking into consideration that price node list is fixed (hard-coded), would it be feasible to have the nodes updating the prices between themselves? (For example nodes 0, 1, 2 and 3 update from providers at minute+0s, minute+15s, m+30s and m+45. Node 0 will update from other nodes at m+15, m+30 and m+45. Similarly node 1, 2 and 3 will update from price node pears at other intervals).