Open theKata opened 2 years ago
https://github.com/sushiswap/trident/blob/ef1f4ed9de50325c8f84edd90aecfafbcfe31ee5/contracts/pool/concentrated/ConcentratedLiquidityPool.sol#L561-L566
When calculating feeGrowth, currentTick must be calculated based on the current price for it to be calculated correctly.
AS-IS
int24 currentTick = nearestTick;
TO-BE
int24 currentTick = TickMath.getTickAtSqrtRatio(price);
https://github.com/sushiswap/trident/blob/ef1f4ed9de50325c8f84edd90aecfafbcfe31ee5/contracts/pool/concentrated/ConcentratedLiquidityPool.sol#L561-L566
When calculating feeGrowth, currentTick must be calculated based on the current price for it to be calculated correctly.
AS-IS
TO-BE