-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update DAIInterestRateModel to v4 (fixes #230) #231
base: master
Are you sure you want to change the base?
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.
Cool @fmorisan !
One question: why didn't you modified and renamed DAIInterestRateModelV3
? I'm not sure that it is useful to keep the third version in the repo, and it would have make the changes clearer.
contracts/DAIInterestRateModelV4.sol
Outdated
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the gap should be discussed.
ETH-B stability fee + 4% = 7%, vs 5.13% at the moment.
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.
I don't think I get this. Should we discuss this in the governance forum?
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.
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
Updated the contract and did some cleanup. Left a comment on one of the suggested changes. Thanks @MathisGD |
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.
abfe401
to
ccd8b99
Compare
ccd8b99
to
a4e8d65
Compare
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
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseJumpRateModelV2(baseRatePerYear,multiplierPerYear,jumpMultiplierPerYear,kink_,owner_) public {} | |
BaseJumpRateModelV3(baseRatePerYear,multiplierPerYear,jumpMultiplierPerYear,kink_,owner_) public {} |
This patch changes the DAIInterestRateModel contract to use a
SECONDS_PER_BLOCK
parameter of12
, reflecting post-merge protocol changes. It also updates the IRM to look at theETH-B
stability fee in order to calculate the borrow rate, instead of using the more conservativeETH-A
as 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