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

Add restriction on Unlock as per MIN_COINS_ON_SHARES_POOL #135

Open
sjoshisupra opened this issue Dec 6, 2024 · 0 comments
Open

Add restriction on Unlock as per MIN_COINS_ON_SHARES_POOL #135

sjoshisupra opened this issue Dec 6, 2024 · 0 comments
Assignees

Comments

@sjoshisupra
Copy link

sjoshisupra commented Dec 6, 2024

As of now, to avoid larger loss to the user, it is enforced that both in active and pending_inactive pools, a user has at least MIN_COINS_ON_SHARES_POOL.

Therefore, if an unlock from a user is for an amount less than MIN_COINS_ON_SHARES_POOL, a larger amount is unlocked to ensure the above invariant. This, however, results in a surprise for the user.

Also see if same restriction need to be applied to add_stake, and whether this can cause any restriction on reward distribution/ restaking and any other flows except the ones triggered by the user.

We should add an assert that checks that unlock requested is always above MIN_COINS_ON_SHARES_POOL. This would always result in the amount being unlocked either exactly same as the amount requested or lesser by 1 quant (due to conversion from amount to shares and then back to amount).

@sjoshisupra sjoshisupra self-assigned this Dec 6, 2024
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

No branches or pull requests

1 participant