-
Notifications
You must be signed in to change notification settings - Fork 52
fix: separate lp fee from being locked #72
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
base: main
Are you sure you want to change the base?
Conversation
...s/dynamic-bonding-curve/src/instructions/migration/meteora_damm/meteora_damm_claim_lp_fee.rs
Outdated
Show resolved
Hide resolved
.../dynamic-bonding-curve/src/instructions/migration/meteora_damm/meteora_damm_lock_lp_token.rs
Outdated
Show resolved
Hide resolved
.../dynamic-bonding-curve/src/instructions/migration/meteora_damm/meteora_damm_lock_lp_token.rs
Outdated
Show resolved
Hide resolved
27ead09 to
b932148
Compare
b932148 to
bdffde8
Compare
|
|
||
| self.inner.actual_partner_locked_lp = actual_lock_amount | ||
| .safe_mul(self.inner.partner_locked_lp)? | ||
| .safe_div(total_lp_to_lock)?; |
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 total_lp_to_lock be zero?
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.
Fixed
| self.inner | ||
| .common_validate_self_partnered_creator_claim_lp_action()?; | ||
|
|
||
| // Must lock first to know actual locked lp amount |
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.
What happen if percentage of locked lp is zero? they actually they dont need to lock, just claim directly
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.
Fixed
Context
After DAMM pool migrated, if lock LP action was delayed a lot, a lot of the trading fees will be locked into the pool and become non claimable.
Solution
During lock LP action, we attempt to separate fee LP from lock LP amount based on virtual price increased and do not lock the fee lp amount.
Breaking change
If migrator doesn't
lockbeforeclaimaction after this PR deployment, theclaimwill fail.