Update DAIInterestRateModel to v4 (fixes #230)#231
Open
fmorisan wants to merge 8 commits intocompound-finance:masterfrom
Open
Update DAIInterestRateModel to v4 (fixes #230)#231fmorisan wants to merge 8 commits intocompound-finance:masterfrom
fmorisan wants to merge 8 commits intocompound-finance:masterfrom
Conversation
MathisGD
reviewed
Dec 22, 2022
| * @param owner_ The address of the owner, i.e. the Timelock contract (which has the ability to update parameters directly) | ||
| */ | ||
| constructor(uint jumpMultiplierPerYear, uint kink_, address pot_, address jug_, address owner_) JumpRateModelV2(0, 0, jumpMultiplierPerYear, kink_, owner_) public { | ||
| gapPerBlock = 4e16 / blocksPerYear; |
There was a problem hiding this comment.
I think that the gap should be discussed.
ETH-B stability fee + 4% = 7%, vs 5.13% at the moment.
Author
There was a problem hiding this comment.
I don't think I get this. Should we discuss this in the governance forum?
There was a problem hiding this comment.
I meant that there is no real reason why we would keep the same as before. @monnet-supply proposed some parameters here, for example: https://www.comp.xyz/t/compound-dsr-proposal/3856/7?u=mathisgd
Author
|
Updated the contract and did some cleanup. Left a comment on one of the suggested changes. Thanks @MathisGD |
abfe401 to
ccd8b99
Compare
ccd8b99 to
a4e8d65
Compare
red-swan
reviewed
Apr 7, 2023
red-swan
reviewed
Apr 7, 2023
The older version of BaseJumpRateModel has a blocksPerYear constant that reflects the amount of blocks produced in a 15-second block time environment. After the Merge, block times have gone down from 15 seconds to 12 seconds, this being reflected in DAIInterestRateModelV4. This brings the constant in line with the new state of the Ethereum Network.
7252629 to
2a6a050
Compare
red-swan
reviewed
Apr 14, 2023
|
|
||
| constructor(uint baseRatePerYear, uint multiplierPerYear, uint jumpMultiplierPerYear, uint kink_, address owner_) | ||
|
|
||
| BaseJumpRateModelV2(baseRatePerYear,multiplierPerYear,jumpMultiplierPerYear,kink_,owner_) public {} |
There was a problem hiding this comment.
Suggested change
| BaseJumpRateModelV2(baseRatePerYear,multiplierPerYear,jumpMultiplierPerYear,kink_,owner_) public {} | |
| BaseJumpRateModelV3(baseRatePerYear,multiplierPerYear,jumpMultiplierPerYear,kink_,owner_) public {} |
This file contains hidden or 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
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.
This patch changes the DAIInterestRateModel contract to use a
SECONDS_PER_BLOCKparameter of12, reflecting post-merge protocol changes. It also updates the IRM to look at theETH-Bstability fee in order to calculate the borrow rate, instead of using the more conservativeETH-Aas a reference.This fixes #230 and enables reactivation of the Dai Savings Rate for cDAI holders, once the contract is deployed and the IRM for cDAI is updated to the new version.
Related governance forum thread: https://www.comp.xyz/t/compound-dsr-proposal/3856