You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They provides exponential price average, which allows users to calculate an average price for any arbitrary elapsed time (1h, 1 day, 1week) to track the exponential moving average, uniswap records price * seconds:
and to calculate moving average for a period, a smart contract can record the difference between the price cumulatives, and divide by the time period, like this:
This is how Uniswap's price oracle works:
They provides exponential price average, which allows users to calculate an average price for any arbitrary elapsed time (1h, 1 day, 1week) to track the exponential moving average, uniswap records price * seconds:
and to calculate moving average for a period, a smart contract can record the difference between the price cumulatives, and divide by the time period, like this:
The text was updated successfully, but these errors were encountered: