Function hydra_dx_math::ema::price_weighted_average
source · Expand description
Calculate a weighted average for the given prices.
prev
is the previous oracle value, incoming
is the new value to integrate.
weight
is how much weight to give the new value.
Note: Rounding is biased towards prev
.