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 calculate_implied_rate to scale according to position duration #6

Merged
merged 8 commits into from
Apr 30, 2024

Conversation

MazyGio
Copy link
Contributor

@MazyGio MazyGio commented Apr 26, 2024

PR originally from delvtech/hyperdrive#1006

Resolved Issues

Fixes delvtech/hyperdrive/#1003

Description

Fixes calculate_implied_rate to adjust the variable rate according to the term duration and compounding frequency.

We should probably add a test with a position duration different than 1 year, but I couldn't easily figure out how to.

Review Checklists

Please check each item before approving the pull request. While going
through the checklist, it is recommended to leave comments on items that are
referenced in the checklist to make sure that they are reviewed. If there are
multiple reviewers, copy the checklists into sections titled ## [Reviewer Name].
If the PR doesn't touch Solidity and/or Rust, the corresponding checklist can
be removed.

[[Reviewer Name]]

Rust

  • Testing
    • Are there new or updated unit or integration tests?
    • Do the tests cover the happy paths?
    • Do the tests cover the unhappy paths?
    • Are there an adequate number of fuzz tests to ensure that we are
      covering the full input space?
    • If matching Solidity behavior, are there differential fuzz tests that
      ensure that Rust matches Solidity?

@MazyGio MazyGio marked this pull request as draft April 26, 2024 17:42
@MazyGio MazyGio marked this pull request as ready for review April 26, 2024 21:37
@MazyGio MazyGio force-pushed the mazygio/fix/calculate_implied_rate branch from aee2f08 to 958e2ab Compare April 30, 2024 17:10
@MazyGio MazyGio enabled auto-merge (squash) April 30, 2024 20:01
@MazyGio MazyGio merged commit 314037a into main Apr 30, 2024
4 checks passed
@MazyGio MazyGio deleted the mazygio/fix/calculate_implied_rate branch April 30, 2024 20:13
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.

Fix scaling bug in calculate_implied_rate sdk method
3 participants