Skip to content

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.

@vercel
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.

3 participants