Closed zgfzgf closed 3 years ago
it is correct. (atOrAfter.tickCumulative - beforeOrAt.tickCumulative) % observationTimeDelta == 0
is an invariant tested in the echidna tests, so division before multiplication is safe.
I see. tick == (atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta I think. may should test it. @moodysalem
(atOrAfter.tickCumulative - beforeOrAt.tickCumulative) * targetDelta / observationTimeDelta
corresponding L283
https://github.com/Uniswap/uniswap-v3-core-optimism/blob/da89f9b88a1616be1ef075ad4313e8aeb3532906/contracts/libraries/Oracle.sol#L276-L284