Skip to content
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

Merged
merged 4 commits into from
Jul 16, 2024
Merged

Conversation

wei3erHase
Copy link
Member

@wei3erHase wei3erHase commented Jul 16, 2024

by request of CoW team, this change is intended to allow the pool owner from desincentivizing direct swaps on the pool (via BPool methods)

@wei3erHase wei3erHase mentioned this pull request Jul 16, 2024
17 tasks
@wei3erHase wei3erHase changed the title feat: increasing max swap fee to 99.999% feat: increasing max swap fee to 99.9999% Jul 16, 2024
@@ -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;

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 or bound

I'm currently trying to make sure it's not the latter

Copy link
Member Author

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%

@wei3erHase wei3erHase changed the title feat: increasing max swap fee to 99.9999% feat: increasing max swap fee to 100% Jul 16, 2024
@wei3erHase wei3erHase changed the title feat: increasing max swap fee to 100% feat: increasing max swap fee to 99.9999% Jul 16, 2024
@wei3erHase wei3erHase merged commit 598b6ee into dev Jul 16, 2024
4 checks passed
@wei3erHase wei3erHase deleted the feat/max-swap-fee branch July 16, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants