[bisq-network/projects] Remove the need for Bisq to trust Bitcoin Average by querying exchange APIs directly and calculating our own weighted average for fiat and altcoin prices (#35)

cd2357 notifications at github.com
Wed Jun 10 14:31:32 UTC 2020


My understanding is that
* the pricenodes
  * have providers which query different exchanges or other endpoints (like BitcoinAverage), that return the latest exchange rates for certain currency pairs
  * schedule such providers to run at different intervals, based on API rate limits
  * expose an API to the Bisq clients, which present the current / latest known exchange rates
* the Bisq clients
  * query the pricenodes regularly for price data

There are about 6 pricenodes now which basically run the same code and should provide the same exchange rate data (within some margin of error, since the pricenodes could poll BitcoinAverage within a few seconds from each other, so they could get slightly different data).

The Bisq clients then poll these pricenodes (one of them? several of them? not sure) and for each currency pair, the exchange rate with the latest timestamp gets used in the client.

So if I understand this correctly, the only ways two Bisq clients can have massively different exchange rates is either:
* if they change the client code locally and use some custom exchange rate, bypassing the data from the pricenodes, or
* if they provide a custom pricenode as a commandline argument when starting Bisq
  * they would control the pricenode, so they could get whatever rates they want

I guess this is possible now as well, but Bisq defends against this by using this narrow allowance (which you mentioned @sqrrm ) for an acceptable exchange rate difference between traders. So even if a Bisq client tries to game the system and use favorable exchange rates at the expense of someone they trade with, the protocol would not allow a big difference between their rates.

Again, assuming my understanding is correct, what this project proposes is to have the pricenodes use more providers to get exchange rate data from multiple exchanges. Then each pricenode would aggregate the data and calculate some kind of "weighted average" (prioritizing values from exchanges with more liquidity, or the more established ones, or the more reputable, etc; specific logic TBD). When Bisq clients poll the pricenodes, instead of getting the BitcoinAverage rates, they would get these weighted average rates.

And if all 6 Bisq pricenodes use the same code, meaning
* the same providers
* the same logic for aggregating the values (weighted average params, or simply a normal average from all available providers)

then they should basically report very similar exchange rates to the Bisq clients.

Basically it's a similar situation to now, cause the pricenodes could report slightly different BitcoinAverage rates (cause they query BitcoinAverage at different times).

So I think this risk exists only to the same degree that it already exists now, and the narrow allowance check in the Bisq clients already mitigate against it.

But please correct me if I'm wrong, it's quite a complex system so it's easy to overlook smth.

-- 
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/projects/issues/35#issuecomment-642048634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200610/fdd588f2/attachment.html>


More information about the bisq-github mailing list