dfinity / exchange-rate-canister

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.
Apache License 2.0
37 stars 10 forks source link

Changing the CXDR computation #185

Closed THLO closed 1 year ago

THLO commented 1 year ago

This PR changes the way the artificial CXDR rates are computed: Rather than using [median_rate-d, median_rate, median_rate+d], choosing d such that we get the right variance, the rates are now [median_rate, median_rate, median_rate+d'] for a d' that results in the same variance.

As a result, we can no longer get a rate 0 when the variance is large.