Function hydra_dx_math::ema::volume_weighted_average
source · pub fn volume_weighted_average(
prev: EmaVolume,
incoming: EmaVolume,
weight: Fraction
) -> EmaVolumeExpand description
Calculate a weighted average for the givenEmaVolumes.
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.