While reading a report from Salty Protocol, I came across an interesting issue that I would like to share with you.
Did you know that you should be careful when using the Uniswap Oracle to calculate a current tick?
This function is used to get twap price tick. It uses pool.observe() to get tickCumulatives array which is then used to calculate int24 tick.
The problem is that in case if int24(tickCumulatives[1] - tickCumulatives[0]) is negative, then the tick should be rounded down.
Here is an example from Uniswap periphery contract OracleLibrary.sol where this case is shown:
As result, the returned tick in Salty code will be bigger then it should be, which opens possibility for some price manipulations and arbitrage opportunities.
So be careful and use ticks correctly.
#uniswap
#tick
Completely free courses
Learn more about the blockchain world
Free education videos
by RareSkills
by Jeiwan
by RareSkills
by RareSkills
by Andreas M. Antonopoulos, Gavin Wood
by Micah Dameron
Compare execution layer differences between chains
Dive deep into the storage of any contract