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

Rewrite P-Rep delegation based on veOMM #278

Open
redlarva opened this issue Feb 7, 2022 · 0 comments · May be fixed by #299
Open

Rewrite P-Rep delegation based on veOMM #278

redlarva opened this issue Feb 7, 2022 · 0 comments · May be fixed by #299
Labels
enhancement New feature or request veOMM

Comments

@redlarva
Copy link
Member

redlarva commented Feb 7, 2022

There will be 2 types of token based on which the user's delegation will be updated.

  • base token i.e balance of locked OMM
  • boosted token i.e veOMM

veOMM acts as a booster to the existing user delegation, up to a certain point.

delegation weight = min((ommLockedByUser * 40 / 100) + (totalOMMlocked * veOMMBalanceOfUser / total_veOMMBalance * (100 - 40) / 100), ommLockedByUser)

For example, :

Case 1:
Let's assume, Bob has locked 1,000 OMM for 4 years and there is 1,000,000 OMM locked and 500,000 veOMM in a boosted OMM contract.

  • Bob locked OMM token : 1,000 OMM
  • Bob veOMM balance : 1,000 veOMM (locked for 4 year)
  • Total OMM locked : 10,000,000 OMM
  • Total veOMM balance : 5,001,000 veOMM

Bob’s delegation weight = min ((1000 * 0.4) + (10,000,000 * 1000/ 5,001,000* 0.6), 1000)

Bob’s delegation weight = min(1599, 1000) = 1000

Case 2:
Now lets say instead of 4 years Bob lock OMM token for only 1 years

  • Bob locked OMM token : 1000 OMM
  • Bob veOMM balance : 250 veOMM (locked for 1 year)
  • Total OMM locked : 10,000,000 OMM
  • Total veOMM balance : 5,000,250 veOMM

Bob’s delegation weight = min ((1000 * 0.4) + (10,000,000 * 250/ 5,000,250* 0.6), 1000)

Bob’s delegation weight = min(699, 1000) = 699

Case 3:
Now let's assume, Bob’s locking period is expired however, Bob has not interacted with OMM application and has not withdrawn the locked amount of OMM. If nobody kick this user to reset its boost user delegation weight will remain the same as before

  • Bob locked OMM token : 1000 OMM
  • Bob veOMM balance : 250 veOMM (locked for 1 year)
  • Total OMM locked : 10,000,000 OMM
  • Total veOMM balance : 5,000,250 veOMM

Bob’s delegation weight = min ((1000 * 0.4) + (10,000,000 * 250/ 5,000,250* 0.6), 1000)

Bob’s delegation weight = min(699, 1000) = 699

Case 4:
Now let's assume, Bob’s locking period is expired but has not withdrawn the locked amount of OMM. If anyone kicks this user after the locking period expires its boost will reset to 0

  • Bob locked OMM token : 1000 OMM
  • Bob veOMM balance : 0 veOMM (no boost)
  • Total OMM locked : 10,000,000 OMM
  • Total veOMM balance : 5,000,000 veOMM

Bob’s delegation weight = min ((1000 * 0.4) + (10,000,000 * 0/ 5,000,000* 0.6), 1000)

Bob’s delegation weight = min(400, 1000) = 400

@redlarva redlarva added enhancement New feature or request veOMM labels Feb 7, 2022
@redlarva redlarva linked a pull request Apr 6, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request veOMM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant