-
Notifications
You must be signed in to change notification settings - Fork 5
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_open_long
negative interest check, fix get_spot_price_after_short
#919
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ryangoree
requested review from
jalextowle,
jrhea,
mcclurejt,
dpaiton and
slundqui
as code owners
April 2, 2024 15:57
slundqui
reviewed
Apr 2, 2024
ryangoree
force-pushed
the
ryangoree/patch-negative-interest-checks
branch
from
April 2, 2024 22:12
382527d
to
aacdc67
Compare
slundqui
approved these changes
Apr 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing tests should cover these changes. LGTM
mcclurejt
approved these changes
Apr 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the redundant import
ryangoree
force-pushed
the
ryangoree/patch-negative-interest-checks
branch
from
April 3, 2024 15:24
aacdc67
to
83d485d
Compare
ryangoree
commented
Apr 3, 2024
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes
calculate_open_long
to use the internalspot_price_after_long
for it's negative interest check to ensure the governance fee is accounted for. It also updates thecalculate_spot_price_after_short
to take anOption<base_amount>
similar tocalculate_spot_price_after_long
with logic to determine the shares delta, accounting for fees, if none is given.Required for delvtech/hyperdrive-rs#33, delvtech/hyperdrive-rs#21
Related to #833
noticed while reviewing #916
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.
Sheng
Rust
covering the full input space?
ensure that Rust matches Solidity?