-
Notifications
You must be signed in to change notification settings - Fork 154
Remove price history and add rebaseLag parameter #2
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
Conversation
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.
Looks good, just some comments on naming.
contracts/UFragmentsPolicy.sol
Outdated
int256 smoothedSupplyDelta = calcSmoothedSupplyDelta(); | ||
uFrags.rebase(smoothedSupplyDelta); | ||
emit Rebase(epoch, smoothedSupplyDelta); | ||
int256 supplyAdjustment = calcSupplyAdjustment(supplyDelta); |
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.
The names supplyDelta
and supplyAdjustment
are a little confusing next to each other. Maybe we can find better names.
supplyDelta -> The adjustment we'd make in a perfectly efficient market....
maxSupplyDelta?
theoreticalSupplyDelta?
perfectMarketSupplyDelta?
supplyAdjustment -> The actual delta we've decided to apply.
actualSupplyDelta?
adjustedSupplyDelta?
laggedSupplyDelta?
(Also update the terminology in the calcSupplyAdjustment function)
contracts/UFragmentsPolicy.sol
Outdated
} | ||
|
||
/** | ||
* @notice Allows setting of the rebase lag parameter which controls the amount of supply |
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.
How about this?
The rebase lag parameter controls how long it takes, in cycles, to apply the effects of a rebase operation.
If the lag equals the smallest value of 1, it means we apply the full supply correction needed to completely
react to the existing exchange rate each rebase cycle. If it is a high number like 100, it means we only
apply 1/100th of the theoretical correction.
The purpose of this parameter is to avoid overreacting to current market conditions, and also to avoid
outpacing how fast the markets can react to the policy changes that are made.
Whatever you end up with, also update the contract parameter comment.
@brandoniles this is ready as well! Let me know if it looks good. |
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.
Looks great, thanks!
contracts/UFragmentsPolicy.sol
Outdated
* rates up until now. | ||
* @return Damps the supply delta value so that only small changes to supply are made. | ||
* This is currently set to supplyDelta / rebaseLag. | ||
* |
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.
Extra line
* implemented rebase window * code review fixes: * changes round #2 * fixed incorrect test spec message * added minRebaseTimeIntervalSec_>0 check back
No description provided.