classic-terra / oracle-feeder

Oracle Feeder Daemon
Apache License 2.0
6 stars 8 forks source link

Incorrect price issue #20

Closed inon-man closed 1 year ago

inon-man commented 1 year ago

Current price server implementation has a critical problem when there's outliers.

I found this issue from osmosis quoter that is giving us wrong prices.

OSMO/USD [
  '0.4118924558508812112',
  '0.4641259483175584384',
  '0.412509620505478',
  '2.42313054728825999446459519069408776' <<< From osmosis
]

LUNC/USD [
  '0.000064687554046759707352',
  '0.000064663116612706302768',
  '0.000064777165916171',
  '0.0003523269676174480252667618521923637841811431519101776' <<< From osmosis
]

As shown above, obtaining an average from a list with an outlier will result in an invalid value.