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

chore: support max capacity unstake #429

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Apr 2, 2024

There's currently a bug that for accounts that have reached the maximum number of positions the Unstake button doesn't work.
This is because sometimes when closing a position the position gets closed partially and a new position gets created with the rest of the balance. If the maximum number of positions has been attained, it will fail with TooManyPositions.

We need to avoid this behavior in the sdk when the maximum number of position has been attained. The solution is if the maximum number of positions has been attained we "round down" the amount unstaked and avoid closing a position partially.

Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 11:29am
staking-devnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 11:29am

@guibescos guibescos merged commit 31a9cc1 into main Apr 12, 2024
8 checks passed
@guibescos guibescos deleted the chore/support-max-capacity-unstake branch April 12, 2024 15:21
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.

2 participants