Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Oct 25, 2024
1 parent 753ad10 commit 82d50bb
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,8 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {

_updateUnderlyingAssets();

// safe since _liquidity != 0 check happens above
uint256 _liquidityToDecreasePct = _liquidityToDecrease / _liquidity;

emit LiquidityRemoved(
_liquidityToRemove,
_liquidityToDecrease,
_amountWeth, //removedWethAmount
_amountOethb, //removedOethbAmount
_amountWethCollected,
Expand Down Expand Up @@ -836,10 +833,6 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {
}

require(tokenId != 0, "No liquidity available");
// there are rounding issues when calling the combination of `estimateAmount1` &
// `getLiquidityForAmounts` when estimating the exact required amount of liquidity
// to withdraw in order to get the desired amount of tokens. For that reason we overshoot
// for 1 wei offsetting the potential rounding error.
uint256 _additionalWethRequired = _amount - _wethBalance;
(uint256 _wethInThePool, ) = getPositionPrincipal();

Expand All @@ -854,7 +847,6 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {
_additionalWethRequired.divPrecisely(_wethInThePool) + 1,
1e18
);

_removeLiquidity(shareOfWethToRemove);
}

Expand Down

0 comments on commit 82d50bb

Please sign in to comment.