Skip to content

Conversation

@codewithgun
Copy link
Contributor

@codewithgun codewithgun commented May 2, 2025

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 lock before claim action after this PR deployment, the claim will fail.

@codewithgun codewithgun force-pushed the fix/damm-separate-fee-lock branch from 27ead09 to b932148 Compare May 5, 2025 05:21
@codewithgun codewithgun force-pushed the fix/damm-separate-fee-lock branch from b932148 to bdffde8 Compare May 5, 2025 18:05

self.inner.actual_partner_locked_lp = actual_lock_amount
.safe_mul(self.inner.partner_locked_lp)?
.safe_div(total_lp_to_lock)?;
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

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.

3 participants