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

fix: improve precision loss when unstaking and add testso #8

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

0x-r4bbit
Copy link
Collaborator

This commit changes the calculation for when MPs are reduced globally and for the user that is unstaking.

Instead of getting an amountRatio first and using that the multiplication, we're now applying the SCALE_FACTOR to both, the numerator and denominator to maintain the ratio while increasing precision.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran pnpm adorno?
  • Ran pnpm verify?

This commit changes the calculation for when MPs are reduced globally
and for the user that is unstaking.

Instead of getting an `amountRatio` first and using that the
multiplication, we're now applying the `SCALE_FACTOR` to both, the
numerator and denominator to maintain the ratio while increasing
precision.
@0x-r4bbit 0x-r4bbit merged commit 8b718ee into lockup-tests Oct 9, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants