Skip to content

Conversation

@kyzia551
Copy link

@kyzia551 kyzia551 commented Apr 3, 2025

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:

  • Adds the new AaveStewardInjectorCollateral contract for collateral update injection
  • Adds the EdgeRiskStewardCollateral contract to only allow collateral updates on the Steward to be used by the new injector. We also forbid updated the debtCeiling when doing the collateral updates.
  • Adds a method to pause / unpause the injector for all updates, this method can be called by the guardian.
  • Refactored the AaveStewardInjectorBase contract and migrated all the base logic there.
  • Refactored also AaveStewardInjectorRates and AaveStewardInjectorCaps according to the new AaveStewardInjectorBase base contract.

Misc Considerations:

  • On the AaveStewardInjectorCaps contract, the owner / governance has access to update the markets for cap updates.
  • The injector contract assumes updates for LTV, LT, LB coming from EdgeRiskOracle are independent and has its own update type of the following: ltv, liquidationThreshold, liquidationBonus. If the updateTypes from EdgeRiskOracle is updated it should be updated on the injector contract too.
  • The injector contract assumes the LTV, LT, LB updates coming from EdgeRiskOracle is encoded in bps format.
  • The injector contract also assumes the market address passed from the update is an aToken address.

@brotherlymite brotherlymite changed the title DRAFT: EdgeRiskStewardCollateralPT feat: collateral update injector Apr 4, 2025
debtCeiling: EngineFlags.KEEP_CURRENT,
liqProtocolFee: EngineFlags.KEEP_CURRENT
});
} else {
Copy link
Author

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')) {
Copy link
Author

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);
Copy link
Author

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

Copy link
Collaborator

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

Copy link
Author

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

Copy link
Collaborator

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

@kyzia551 kyzia551 merged commit c4f6bac into refactor/config Apr 14, 2025
2 checks passed
@kyzia551 kyzia551 deleted the fear/edge-steward-collateral-pt branch April 14, 2025 09:39
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.

3 participants