Skip to content

Commit

Permalink
feat: increasing max swap fee to 99.999%
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Jul 16, 2024
1 parent 28fbf44 commit a926bf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/contracts/BConst.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract BConst {
/// @notice The minimum swap fee that can be set.
uint256 public constant MIN_FEE = BONE / 10 ** 6;
/// @notice The maximum swap fee that can be set.
uint256 public constant MAX_FEE = BONE / 10;
uint256 public constant MAX_FEE = BONE - MIN_FEE;
/// @notice The immutable exit fee percentage
uint256 public constant EXIT_FEE = 0;

Expand Down
2 changes: 2 additions & 0 deletions test/unit/BPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ abstract contract BasePoolTest is Test, BConst, Utils, BMath {
uint256 _zoo = bsub(BONE, _normalizedWeight);
uint256 _zar = bmul(_zoo, _swapFee);
uint256 _tokenAmountOutBeforeSwapFee = bdiv(_tokenAmountOut, bsub(BONE, _zar));
vm.assume(_tokenOutBalance >= _tokenAmountOutBeforeSwapFee);
uint256 _newTokenOutBalance = bsub(_tokenOutBalance, _tokenAmountOutBeforeSwapFee);
vm.assume(_newTokenOutBalance < type(uint256).max / _tokenOutBalance);

Expand Down Expand Up @@ -1379,6 +1380,7 @@ contract BPool_Unit_ExitswapPoolAmountIn is BasePoolTest {
_fuzz.poolAmountIn,
_fuzz.swapFee
);
vm.assume(_fuzz.tokenOutBalance < type(uint256).max / MAX_OUT_RATIO);
vm.assume(_tokenAmountOut > bmul(_fuzz.tokenOutBalance, MAX_OUT_RATIO));

_setValues(_fuzz);
Expand Down

0 comments on commit a926bf8

Please sign in to comment.