Skip to content

fix: vesting logic to match rust #2706

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

Merged
merged 1 commit into from
May 19, 2025
Merged

fix: vesting logic to match rust #2706

merged 1 commit into from
May 19, 2025

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented May 19, 2025

Summary

Fix the vesting schedule logic to match rust.
The rust logic: https://github.com/pyth-network/governance/blob/feat/add-new-recover-instruction/staking/programs/staking/src/state/vesting.rs#L172

Rationale

Some users have been running in to error when trying to withdraw the max amount because Javascript underestimates the number of locked tokens.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • [X ] Manually tested the code

I have Sherlocked with a wallet that has this issue.

Copy link

vercel bot commented May 19, 2025

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

Name Status Preview Comments Updated (UTC)
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 5:42pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 5:42pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 5:42pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Skipped (Inspect) May 19, 2025 5:42pm
entropy-debugger ⬜️ Skipped (Inspect) May 19, 2025 5:42pm
entropy-explorer ⬜️ Skipped (Inspect) May 19, 2025 5:42pm
proposals ⬜️ Skipped (Inspect) May 19, 2025 5:42pm

@guibescos guibescos merged commit a58e20a into main May 19, 2025
10 checks passed
@guibescos guibescos deleted the fix/vesting-logic branch May 19, 2025 17:45
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