Skip to content

Commit

Permalink
fix: correct computation of slippage for XEVT
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Sep 20, 2024
1 parent c2c6d06 commit 7b96168
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/helpers/MultiBlockRebalancer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ contract MultiBlockRebalancer is BaseRebalancer {
if (slippage > maxSlippage) revert SlippageTooHigh();
} else if (collateral == XEVT) {
// Assumer 1:1 ratio between the underlying asset of the vault
uint256 slippage = ((amountIn - IPool(depositAddress).convertToAssets(amountOut)) * 1e9) / amountIn;
uint256 slippage = ((IPool(depositAddress).convertToAssets(amountIn) - amountOut) * 1e9) / amountIn;
if (slippage > maxSlippage) revert SlippageTooHigh();
} else revert InvalidParam();
}
Expand Down

0 comments on commit 7b96168

Please sign in to comment.