-
Notifications
You must be signed in to change notification settings - Fork 0
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 open_short_curve_fee
#97
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
ryangoree
requested review from
jalextowle,
jrhea,
mcclurejt,
dpaiton,
sentilesdal,
slundqui and
wakamex
as code owners
May 14, 2024 05:03
jalextowle
approved these changes
May 14, 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.
As mentioned offline, we may want to wait on the Solidity fixes. I’ll approve in case this makes the fixes tonight/tomorrow easier, but we’ll want to revert this after v1.0.7 lands.
dpaiton
added a commit
that referenced
this pull request
May 14, 2024
6 tasks
dpaiton
added a commit
that referenced
this pull request
May 14, 2024
dpaiton
added a commit
that referenced
this pull request
May 14, 2024
dpaiton
added a commit
that referenced
this pull request
May 14, 2024
# Description This PR is the result of an audit of the fee functions. The following changes were made (one commit per bullet): 1. revert the rounding adjustment from #97. We realized that the bug actually lies in the solidity _test utils_. This has been fixed so I reverted the rounding behavior to match. 2. update docstrings to use a more consistent format. I introduce a convention of my own to use upper-case $\Phi_{c,ol}(...)$ for the fee function and lower-case $\phi_{c}$ for the fee multiplier constant. The subscript on the fee function is the fee type $\in c, g, f$ for curve, gov, and flat; as well as the trade type $\in ol, cl, os, cs$ for opening or closing a long or short. This replaces the inconsistent method of using e.g. `c(x)` at some times and `curve_fee` at other times, or using repeat symbols for different equations. 3. add `maybe_curve_fee` arg to gov fee calculations to fix #43 and reduce computation. 4. change the rounding behavior to match solidity (note it's matching the eqs in `internal/HyperdriveBase.sol` 5. the above changes revealed a unit issue in `calculate_targeted_long` where the gov fee (and derivative) was not converted to shares. I updated my [overleaf doc](https://www.overleaf.com/read/jkngspgyqzkf#1de6ce), the docstrings, and the code itself.
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
Related to #88
Description
We were using
mul_up
where the contracts usemulDown
: https://github.com/delvtech/hyperdrive/blob/33982bba72d861b3b90cb0b4083fec30accb649f/test/utils/HyperdriveUtils.sol#L1362Review 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.
covering the full input space?
ensure that Rust matches Solidity?