-
Notifications
You must be signed in to change notification settings - Fork 1
feat: collateral update injector #7
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
| debtCeiling: EngineFlags.KEEP_CURRENT, | ||
| liqProtocolFee: EngineFlags.KEEP_CURRENT | ||
| }); | ||
| } else { |
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 sudgest to make else if here, and revert on else, in case we see unknown type
|
|
||
| capUpdate = new IEngine.CapsUpdate[](1); | ||
| IEngine.CapsUpdate[] memory capUpdate = new IEngine.CapsUpdate[](1); | ||
| if (riskParams.updateType.equal('supplyCap')) { |
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 sudgest to make else if here, and revert on else, in case we see unknown type
| IRiskOracle.RiskParameterUpdate memory riskParams | ||
| ) internal pure returns (IEngine.RateStrategyUpdate[] memory) { | ||
| ) internal override { | ||
| IEngine.RateStrategyUpdate[] memory rateUpdate = new IEngine.RateStrategyUpdate[](1); |
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 sudgest to make if here, and revert on else, in case we see unknown type
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.
On the _canUpdateBeInjected method, we validate that the updateType is valid and revert if there is unknown type already.
Can add it here as well, but I think unknown type would be caught and reverted before we reach here
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.
Yes, but still better to add it here as well, and maybe do it here only
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.
ok can add it here too, if we remove from _canUpdateBeInjected method the checkUpkeep will return true even if wrong updateType is passed as over here is called only during on-chain execution
AaveStewardInjectorCollateral
This PR adds the AaveStewardInjectorCollateral contract to fetch collateral updates (LTV, LT, LB) from the EdgeRiskOracle and inject them via the AaveRiskSteward into the protocol.
Changelog:
Misc Considerations:
ltv,liquidationThreshold,liquidationBonus. If the updateTypes from EdgeRiskOracle is updated it should be updated on the injector contract too.aTokenaddress.