-
Notifications
You must be signed in to change notification settings - Fork 124
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
Clean up open-interest liquidity tier calculations (backport #1592) #1805
Clean up open-interest liquidity tier calculations (backport #1592) #1805
Conversation
(cherry picked from commit df00d84) # Conflicts: # .github/workflows/protocol-benchmark.yml
Cherry-pick of df00d84 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Changelist
Since IMF due to open-interest is calculated a lot, simplify the code paths, make them more testable, benchmark them, and improve performance by not using
big.Rat
.Note, this is a (slightly) breaking change as the adjusted IMF is now calculated as a ppm before applying. This is generally fine to round the initial margin requirement to the nearest ppm value (as the base IMF is already in ppm). When multiplying the value by the notional value of the position, the margin requirement is already rounded up.
Test Plan
Added benchmarks and additional tests.
Summary by CodeRabbit
New Features
Refactor
Bug Fixes
Chores
This is an automatic backport of pull request #1592 done by [Mergify](https://mergify.com).