pub fn price_weighted_average(
    prev: EmaPrice,
    incoming: EmaPrice,
    weight: Fraction
) -> EmaPrice
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.