v4-core
v4-core copied to clipboard
Optimize liquidity flipping calculations in `Pool`
trafficstars
Related Issue
Which issue does this pull request resolve?
Description of changes
A new function LiquidityMath.flipLiquidityDelta is added to optimize the process of flipping the sign of a liquidity delta if certain conditions are met. Code complexity has been reduced by avoiding the need to use unchecked blocks and applied assembly for efficiency. The refactoring also resulted in changes in the snapshot files.
Replaces #569