V3Oracle.sol was calculating the TWAP price incorrectly, leading to distorted prices and potential DOS of different functions.
The problem stemmed from the fact that V3Oracle::_getReferencePoolPriceX96() did not round down in case tickCumulativesDelta is negative as uniswap lib does.
Mitigation
PR-10 successfully mitigates the original issue by adding the negative round down check present in the Unsiwap library
Lines of code
Vulnerability details
TEMPLATE
C4 Issue
H-05: _getReferencePoolPriceX96() will show incorrect price...
Issue Details
V3Oracle.sol
was calculating the TWAP price incorrectly, leading to distorted prices and potential DOS of different functions.The problem stemmed from the fact that
V3Oracle::_getReferencePoolPriceX96()
did not round down in casetickCumulativesDelta
is negative as uniswap lib does.Mitigation
PR-10 successfully mitigates the original issue by adding the negative round down check present in the Unsiwap library
Conclusion
Mitigation Confirmed