-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: increasing max swap fee to 99.9999% #158
Conversation
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why set it to BONE - MIN_FEE
instead of just BONE
? It doesn't seem to trigger any errors, which tells me that either
- it's perfectly lawful
- we're not testing for high fee values because of other pre-existing
vm.assume
orbound
I'm currently trying to make sure it's not the latter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it was chosen in order to avoid edge cases, which now that i'm looking at the BMath tree it reverts in every swap operation (because of the calcSpotPrice
division by zero), but it doesn't revert in joinswap
or exitswap
, causing an unconsistent behaviour
because of this, i believe is better to provide a highly taxed normal behaviour than fall into unchecked reverting cases, i think now is better 99.9999% instead of allowing 100%
9c90725
to
755dbc0
Compare
by request of CoW team, this change is intended to allow the pool owner from desincentivizing direct swaps on the pool (via BPool methods)