Skip to content

Use two decimals for delayed scale factor #114

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

Open
wants to merge 2 commits into
base: price-delayed-publications
Choose a base branch
from

Conversation

nikeshnazareth
Copy link
Collaborator

This PR make two changes.

Firstly, move the percentage calculations to a separate library. This is cleaner in code and it also makes it easier to use different precision amounts.

The second is to use two decimals of precision for the delayed fee percentage. As a uint16 there are 65536 possible values but in basis points we can only represent numbers between 0 and 6.5 (albeit with very high precision). With two decimals we can represent numbers up to 655 (with less precision).

This is cleaner in code and it also makes it possible to provide a
configurable percentage
This rebalances the bits to be more useful for anticipated values.
A uint16 proves 65536 possible possibilities, but using basis points
means that the values range from 0-6 with 4 decimals.

As a percentage, this can represent up to 655 with two decimals.
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