-
Notifications
You must be signed in to change notification settings - Fork 46
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
<poc> Example of option 1 #213
base: main
Are you sure you want to change the base?
Conversation
|
src/pool-bin/libraries/BinPool.sol
Outdated
/// <WIP> to discuss if we want to enforce this -- otherwise user can potentially add below 1e9 liquidity | ||
/// but can't withdraw if there's no other lp to help push the min share up | ||
uint256 balanceShare = self.shareOfBin[binId]; | ||
if (balanceShare > 0 && balanceShare < MINIMUM_SHARE) { |
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.
[wip] if this option is taken, to discuss if we want this check.
uint256 balanceShare = self.shareOfBin[binId]; | ||
if (balanceShare > 0 && balanceShare < MINIMUM_SHARE) { | ||
revert BinPool__BelowMinimumShare(balanceShare); | ||
} |
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.
only concern is that user maybe will always get revert when try to withdraw all , if left shares of bin is below MINIMUM_SHARE.
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.
nice, this would be a con of this approach
So example would be:
- alice added min_share + 1 liquidity = 1e9 + 1 (pool has 1e9 + 1 share)
- bob added 10 liquidity (pool has 1e9 + 1 + 10 share)
- alice remove 11 liquidity (pool left with 1e9 share)
- bob is stuck and cannot remove his share
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.
per discussion with Snoopy, might worth to consider to limit from the perspective of user position instead of the whole bin.
No description provided.