Skip to content
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

Feat: Tracking unlockRates #5

Merged
merged 13 commits into from
Dec 15, 2023
Merged

Feat: Tracking unlockRates #5

merged 13 commits into from
Dec 15, 2023

Conversation

vm06007
Copy link
Member

@vm06007 vm06007 commented Dec 14, 2023

new function globalLocked:

  • gives back result how many tokens are still locked globally
  • calculation is based on all rates for unlock timestamps
  • each timestamp keeps track of its own unlock rate

use:

  • this way we measure earned amount by comparing user unlocked amount to totally unlocked supply.
  • to achieve this we take total supply and subtract amount that is still locked globally based on unlock rates.
  • to get amount still locked iterate from available timestamps and figure out remainingLockDuration
  • then multiply by unlockRate to calculate how much still remaining to be unlocked

- now it is okay to do for loops from 0.8.22
- so calculation does not go off, just given back to master
- these for globalLocked calculation
- this will store data necessary to calculate globalLocked by keeping track of unlock rates
easier calculation for crateTime and unlockTime
- gives back result how many tokens are still locked globally
- calculation is based on all rates for unlock timestamps
- each timestamp keeps track of its own unlock rate
- so array of available stamps does not inflate too much
- this way we measure compares to totally unlocked supply
- we take total supply and subtract amount still locked
- renamed to remainingDuration
@vm06007 vm06007 marked this pull request as ready for review December 14, 2023 06:16
@vm06007 vm06007 merged commit c8cea87 into main Dec 15, 2023
2 checks passed
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.

1 participant