-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fee curve update #232
Fee curve update #232
Conversation
Fee curve update
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
b69f3ea
to
86ca566
Compare
aae3cd7
to
8fbec06
Compare
perpRolloverFee.growth, | ||
ONE.toInt256() | ||
if (dr <= ONE) { | ||
uint256 perpRate = MathUpgradeable.min( |
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.
Let's call this something like negPerpRate
(most accurate?) so it's more clear what this intermediate value is.
Then, maybe take the max of -1* negPerpRate
and the debasement limit? Seems more in the spirit of the computation.
8fbec06
to
36e93ac
Compare
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
Updated enrichment/debasement fee curve.
Motivation:
The current implementation caps the enrichment rate when dr is high. The side-effect of this is that the vault's effective funding rate (rate vault holders pay to get magnified exposure) reduces.
When dr = 2, for example the perpTVL:vaultTVL ratio is 1:6 and at dr = 3 its 1:9. Say there's a perp tvl of 1m$. Perp's enrichment would be ~200k at dr = 2 and at dr = 3. However, the vault's effective rate would be 200k/6m ~3.3% when dr =2 and 200k/9m ~2.2% when dr = 3 and so on. So it actually continues to go down. (As shown in the following figure)
Alternatively as dr continues to increase we want the vault's effective funding rate to increase or at least stay constant. This would mean that perp's enrichment rate is unbounded on the upside.
(As shown below)