Skip to content

Commit

Permalink
remove bug resetting value of amount0
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Dec 4, 2024
1 parent 64c6fc7 commit 32e081c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/AutoRedemption.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract AutoRedemption is AutomationCompatibleInterface, FunctionsClient, Confi
while (TickMath.getSqrtRatioAtTick(_lowerTick) < TARGET_PRICE) {
uint256 _amount0;
if (_tick > _lowerTick && _tick < _upperTick) {
(uint256 _amount0,) = LiquidityAmounts.getAmountsForLiquidity(
(_amount0,) = LiquidityAmounts.getAmountsForLiquidity(
_sqrtPriceX96,
TickMath.getSqrtRatioAtTick(_lowerTick),
TickMath.getSqrtRatioAtTick(_upperTick),
Expand All @@ -98,7 +98,7 @@ contract AutoRedemption is AutomationCompatibleInterface, FunctionsClient, Confi
} else {
(, int128 _liquidityNet,,,,,,) = pool.ticks(_lowerTick);
_liquidity += uint128(_liquidityNet);
(uint256 _amount0,) = LiquidityAmounts.getAmountsForLiquidity(
(_amount0,) = LiquidityAmounts.getAmountsForLiquidity(
_sqrtPriceX96,
TickMath.getSqrtRatioAtTick(_lowerTick),
TickMath.getSqrtRatioAtTick(_upperTick),
Expand Down

0 comments on commit 32e081c

Please sign in to comment.