Function hydra_dx_math::ema::liquidity_weighted_average
source · pub fn liquidity_weighted_average(
prev: (Balance, Balance),
incoming: (Balance, Balance),
weight: Fraction
) -> (Balance, Balance)
Expand description
Calculate a weighted average for the givenEmaLiquidity values.
prev
is the previous oracle value, incoming
is the new value to integrate.
weight
is how much weight to give the new value.
Note: Just delegates to balance_weighted_average
under the hood.
Note: Rounding is biased towards prev
.