Skip to content

Commit a58e20a

Browse files
authored
fix: vesting logic to match rust (#2706)
1 parent cf61e90 commit a58e20a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

governance/pyth_staking_sdk/src/utils/vesting.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const getPeriodicUnlockSchedule = (options: {
5757
if (currentTimeStamp < unlockTimeStamp || includePastPeriods) {
5858
unlockSchedule.push({
5959
date: new Date(unlockTimeStamp * 1000),
60-
amount: balance / numPeriods,
60+
amount:
61+
((numPeriods - BigInt(i)) * balance) / numPeriods -
62+
((numPeriods - BigInt(i + 1)) * balance) / numPeriods,
6163
});
6264
}
6365
}

0 commit comments

Comments
 (0)