Repository navigation
Fix: label the vault countdown "Unlocks Start In", then show "% Unlocked" - #122
Merged
Merged
Conversation
…gins Since #121 the countdown runs to the start of the unlock, after which tokens release linearly every block. Under the old "Unlocks In" label, "21 days" read as the whole vault unlocking in 21 days. Show "Unlocks Start In" while that countdown is running. Once the unlock has started the value is "Available now" (or "Milestone still locked" for a milestone vault), and the label goes back to "Unlocks In": "Unlocks Start In: Available now" would read oddly. NCATP vaults count down to a full unlock at their withdrawal timestamp, so they keep "Unlocks In".
After the unlock starts, the card showed "Unlocks In: Available now", which says nothing about how far through the schedule the vault is. Show "% Unlocked" with the share of the allocation the schedule has released instead, computed by useVestingCalculation so it matches the vesting chart in the details modal. The share is rounded down to 0.01% so no vault reads 100% before its last token unlocks. A milestone vault whose milestone is not achieved follows the same schedule but can release nothing, so it shows the same percentage with "Milestone still locked" underneath, and the tooltip says the unlocked tokens can't be withdrawn yet. Previously "Milestone still locked" replaced the value. Vaults without a lock schedule, and NCATP vaults, keep "Unlocks In" and their existing values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #121 (A-2456).
Since #121 the Token Vault countdown runs to the start of the unlock; after that, tokens release linearly every block. With the label still "Unlocks In", "21 days" read as the whole vault unlocking in 21 days, and once the unlock started the card said only "Available now".
21 days/4 hours27.39%27.39%, with Milestone still locked underneathcurrentVestedAmount / allocationfromuseVestingCalculation, the same calculation the vesting chart uses, so the card and the chart can't disagree. It's rounded down to 0.01%, so no vault shows 100% before its last token unlocks.Testing
yarn type-checkpasses.eslinton the changed file passes.yarn buildpasses with placeholderVITE_*values.