-
Notifications
You must be signed in to change notification settings - Fork 45
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: burn 1e3 shares for first mint into BinPool #212
Conversation
|
137102 |
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.
can see it cost 30k more gas when there's 3 empty bins (eg. add-remove liquidity from bin however bin id still in TreeMath due to minShare)
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.
Yeah, and once a bin get "polluted", it will never get back 😂
What if we add a "symmetric operation" i.e. the last ppl removing liquidity receives MINIUM_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.
* feat: example if we tweak add/remove bin to tree * feat: updated gas cost * feat: add test around getNextNonEmptyBin
Description
Whenever a first mint happen for BinPool, we'll burn 1e3 liquidity. The goal of this is to prevent share inflation attack.
Potentially
Can also #215 -- i would suggest we also merge that as
swaps
likely happen more often thatmint/burn
and the PR would optimise swap gas cost greatly