You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let vesting_in_balance = total_amount_still_vesting - total_delegated_vesting;
215
+
// this is a hard edegcase to handle in the current implementation. If someone has delegated and not touched their delegation for a long time
216
+
// vesting events have elapsed but their delegated vesting number has not been updated. In this case we can be confident that the total_delegated_vesting
217
+
// is the original amount they have delegated out of their vesting total. So what has vested since then can't be in their balance since that would require them
218
+
// to interact with thier account and update the total_delegated_vesting number.
219
+
let vesting_in_balance = if total_delegated_vesting > total_amount_still_vesting {
220
+
// vested tokens show up in the balance first, so we take what they originally left in their balance
221
+
// subtract it from what's vested so far and that's what's delegated and still vesting in this case
222
+
let org_vest_bal = original_vesting_amount - total_delegated_vesting;
223
+
let delegated_vesting = total_amount_vested - org_vest_bal;
0 commit comments