Skip to content

Conversation

truncs
Copy link
Contributor

@truncs truncs commented Jun 11, 2018

No description provided.

@truncs truncs force-pushed the monetary_policy branch from af8fe0f to b21308a Compare June 11, 2018 21:54
Copy link
Member

@brandoniles brandoniles left a 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.

int256 smoothedSupplyDelta = calcSmoothedSupplyDelta();
uFrags.rebase(smoothedSupplyDelta);
emit Rebase(epoch, smoothedSupplyDelta);
int256 supplyAdjustment = calcSupplyAdjustment(supplyDelta);
Copy link
Member

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)

}

/**
* @notice Allows setting of the rebase lag parameter which controls the amount of supply
Copy link
Member

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.

@truncs truncs force-pushed the monetary_policy branch from b21308a to ce00294 Compare June 14, 2018 00:42
@truncs
Copy link
Contributor Author

truncs commented Jun 14, 2018

@brandoniles this is ready as well! Let me know if it looks good.

Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

* 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.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line

@truncs truncs force-pushed the monetary_policy branch from ce00294 to daf9e6a Compare June 14, 2018 23:12
@truncs truncs merged commit 8ea603b into master Jun 14, 2018
@truncs truncs deleted the monetary_policy branch June 14, 2018 23:14
aalavandhan added a commit that referenced this pull request Jun 12, 2019
aalavandhan added a commit that referenced this pull request Jun 12, 2019
aalavandhan added a commit that referenced this pull request Jun 12, 2019
* implemented rebase window

* code review fixes:

* changes round #2

* fixed incorrect test spec message

* added minRebaseTimeIntervalSec_>0 check back
aalavandhan added a commit that referenced this pull request Jun 12, 2019
* Revert "If oracle data is invalid apply 0 supply change instead of reverting transaction."

* Implemented rebase window (#132)

* implemented rebase window

* code review fixes:

* changes round #2

* fixed incorrect test spec message

* added minRebaseTimeIntervalSec_>0 check back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants