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

Normalizing by decimal delta between asset and vault #123

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alcueca
Copy link
Collaborator

@alcueca alcueca commented Nov 11, 2024

Not as elegant as normalizing by assets, but hopefully safer.

If the vault has a higher decimal count that its asset, we use the difference as a scalar to:

  1. Normalize the rate up when accumulating rewards per token
  2. Rewards down when accumulating rewards per user.

I haven't included the tweak to only pull rewards that are expected to be distributed.

Normalizing the rate up shouldn't overflow, because we upcast from u96 to u256.

There would be some rounding down of user rewards when accumulating them, I do not know the actual impact.

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