-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rust cleanup; add tests; simplify fn signatures #990
Merged
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
147c49e
to
5696bb6
Compare
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
slundqui
approved these changes
Apr 18, 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, but may want an additional review from @ryangoree wrt the removed parameter in calculate_open_short
.
5696bb6
to
1b66015
Compare
1b66015
to
00ea923
Compare
jalextowle
reviewed
Apr 18, 2024
jalextowle
approved these changes
Apr 18, 2024
ryangoree
approved these changes
Apr 19, 2024
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.
Resolved Issues
working towards resolving delvtech/hyperdrive-rs#29
Description
calculate_open_short
was called we would first computestate.calculate_spot_price
and then pass it in as an argument, I removed the argument and put the calculation inside the function. If one wants to calculate open short for a different spot price, they should adjust the state and then callstate.calculate_open_short(bond_amount)
. This is the same pattern we use for e.g.calc_spot_price_after_*
.maybe
" in front ofOption
parameters and changingshort_amount
tobond_amount
.wallet
andhyperdrive
attributes to the agent, which will be helpful for the calc_open_short test I'm writing in a follow-up PR.fuzz_*
if they are doing fuzzing (this makes it more consistent with the rest of the codebase).open_vault_share_price
to increase fuzz coverage.short_principal_derivative
code out ofmax.rs
and intoopen.rs
, which will be helpful for my later targeted short PR.short_principal
andshort_principal_derivative
short_principal
[_derivative
] tocalculate_short_principal
[_derivative
] to be consistent with the rest of the codebase.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
covering the full input space?
ensure that Rust matches Solidity?