-
Notifications
You must be signed in to change notification settings - Fork 17
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
Minimal Weighted Pool #87
Conversation
Comments addressed! @danielmkm @EndymionJkb would you please take another look? |
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.
This is changing out from under me, so will put in these comments for now.
uint256 private constant _MIN_TOKENS = 2; | ||
|
||
uint256 private constant _DEFAULT_MINIMUM_BPT = 1e6; | ||
uint256 private constant _SWAP_FEE_PERCENTAGE = 0; |
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.
From our earlier discussions, it seems like we don't need any limits (other than 0-1) on the swap fee percentage.
* @notice Return the current value of the swap fee percentage. | ||
*/ | ||
function getSwapFeePercentage() public pure virtual returns (uint256) { | ||
return _SWAP_FEE_PERCENTAGE; |
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.
Out of scope to actually implement static and dynamic swap fees (in the Vault as part of pool config + pool callback for dynamic), but for now we might want to hard-code this to something non-zero for testing.
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.
The strategy for pool validation in swap
is not the same as add/remove. I pushed a small change that removes the isInitialized modifier and does an inline check immediately after the registration check.
There appears to be an issue with bptAmountOut
in initialize now that we are minting BPT to the zero address.
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
As discussed offline, I brought back the modifier.
Therefore, if we ask the pool to be initialized, it means it's also registered. I've modified the code that handles revert reasons for wrong token indexes inside swaps accordingly.
Corrected so that Besides that, I'd like to wrap up this one. Hopefully this should be the last huge PR where we were in full draft mode, in favor of smaller, more focused PRs. I expect there will still be some exploration ahead as there are some base features to be implemented where we'll take a different path wrt. V2, but it should be more manageable. Let's please open tickets if you find something we're missing but can be addressed later. |
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.
Have a couple questions, but overall - and given that we know major things will change, such as moving scaling factors, so no point reviewing details of that - I think it's good enough to merge this monster so that we can address the remaining items with smaller PRs. (Renaming suggestions are so minor they could be done now; otherwise a followup PR is fine, as was done with multitoken.)
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
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.
Agree that we should get this merged! The bulk of my concerns have already been addressed, anything else is smaller details that we can address later on.
Description
This PR introduces the following enhancements and features:
IERC20MultiToken
IBasePool
interface, applicable to all V3 poolsBasePool
contract as a base class for all V3 pools to inherit fromIVault.initialize
method for explicit pool initialization, bypassing the need for joinsWeightedPool
class, covering methods such asaddLiquidity
,removeLiquidity
,initialize
, andswap
.Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution