Skip to content

Fixing bug in average time remaining calculation in present value#968

Merged
slundqui merged 5 commits intomainfrom
slundquist/present-value-bugfix
Apr 15, 2024
Merged

Fixing bug in average time remaining calculation in present value#968
slundqui merged 5 commits intomainfrom
slundquist/present-value-bugfix

Conversation

@slundqui
Copy link
Copy Markdown
Contributor

@slundqui slundqui commented Apr 15, 2024

Resolved Issues

  • State generation for long_average_maturity_time and short_average_maturity_time in tests do not cover full range of possible values, due to the underlying fields in pool info being scaled by 1e18.
  • Fixing time remaining calculation in calculate_present_value to account for average maturity time being scaled.

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?

Co-authored-by: Dylan Paiton <dpaiton@users.noreply.github.com>
Sheng Lundquist and others added 2 commits April 15, 2024 13:34
Sheng Lundquist and others added 2 commits April 15, 2024 13:55
Co-authored-by: Dylan Paiton <dpaiton@users.noreply.github.com>
@slundqui slundqui added this pull request to the merge queue Apr 15, 2024
Merged via the queue into main with commit e95dcac Apr 15, 2024
@slundqui slundqui deleted the slundquist/present-value-bugfix branch April 15, 2024 22:12
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.

3 participants