v4-core icon indicating copy to clipboard operation
v4-core copied to clipboard

Optimize liquidity flipping calculations in `Pool`

Open shuhuiluo opened this issue 1 year ago • 1 comments
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.

shuhuiluo avatar Apr 24 '24 07:04 shuhuiluo

Replaces #569

hensha256 avatar May 14 '24 17:05 hensha256