Skip to content
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

[CL Incentives] Allow early withdrawals for frozen positions #4456

Closed
Tracked by #3991
AlpinYukseloglu opened this issue Feb 28, 2023 · 0 comments · Fixed by #4525
Closed
Tracked by #3991

[CL Incentives] Allow early withdrawals for frozen positions #4456

AlpinYukseloglu opened this issue Feb 28, 2023 · 0 comments · Fixed by #4525
Assignees
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

We've internally agreed that hard-enforcing freezes by not allowing early withdrawals at all might be a little too constraining for users, even though freezing is a major relaxation compared to bonding already.

The simplest and cleanest approach (both as a mechanism and from an implementation standpoint) seems to be to simply deposit any accrued rewards from an early exit back into its respective accumulator. This effectively causes the early withdrawer to forfeit their earnings such that they are redistributed pro-rata to the existing LPs.

Suggested Design

  • Remove the following check:
    // Check if position is still frozen
    if position.FrozenUntil.After(ctx.BlockTime()) {
    return sdk.Int{}, sdk.Int{}, types.PositionStillFrozenError{FrozenUntil: position.FrozenUntil}
    }
  • Replace it with (roughly) the following logic:
preparePositionAccumulator(...)
rewards := ClaimRewards(...)
AddToAccumulator(rewards / liquidity)

Acceptance Criteria

  • All new and existing tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant