Skip to content

Commit

Permalink
fix: add min amounts in deposit()
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneshASP committed Apr 15, 2024
1 parent dcdb9e3 commit b45a9e3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions contracts/contracts/strategies/AerodromeEthStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,12 @@ contract AerodromeEthStrategy is InitializableAbstractStrategy {
IVault(vaultAddress).mintForStrategy(oethToAdd);

// adjust for slippage
oethToAdd = oethToAdd.mulTruncate(uint256(1e18) - MAX_SLIPPAGE);
wethToAdd = wethToAdd.mulTruncate(uint256(1e18) - MAX_SLIPPAGE);

uint256 minOethToAdd = oethToAdd.mulTruncate(
uint256(1e18) - MAX_SLIPPAGE
);
uint256 minWethToAdd = wethToAdd.mulTruncate(
uint256(1e18) - MAX_SLIPPAGE
);
// Do the deposit to the Aerodrome pool
// slither-disable-next-line arbitrary-send
(, , uint256 lpReceived) = aeroRouterAddress.addLiquidity(
Expand All @@ -223,8 +226,8 @@ contract AerodromeEthStrategy is InitializableAbstractStrategy {
true,
wethToAdd,
oethToAdd,
0,
0,
minWethToAdd,
minOethToAdd,
address(this),
block.timestamp
);
Expand Down

0 comments on commit b45a9e3

Please sign in to comment.