bisq-network / bisq-pricenode

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

Outlier price filtering #13

Closed ghost closed 1 year ago

ghost commented 1 year ago

Sometimes an exchange may report a stale price, esp. on thinly traded markets. This PR filters out prices too far away from the consensus average. Standard deviation of 2.2 chosen to determine outliers, configurable in application.properties.

From experimentation:


Current results:

 INFO  b.p.s.ExchangeRateController: Incoming /getAllMarketPrices request
 WARN  b.p.s.ExchangeRateService: outlier price removed=16700.0, source=QUOINE, ccy=EUR, consensus price=25651.2922 
 WARN  b.p.s.ExchangeRateService: outlier price removed=0.00172711, source=BTCMARKETS, ccy=LTC, consensus price=0.003372445 
 WARN  b.p.s.ExchangeRateService: outlier price removed=16200.0, source=QUOINE, ccy=USD, consensus price=27619.204166666666 
 WARN  b.p.s.ExchangeRateService: outlier price removed=0.07346, source=QUOINE, ccy=ETH, consensus price=0.0631171025