Skip to content
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

feat: steward injector robot #12

Closed
wants to merge 18 commits into from

Conversation

brotherlymite
Copy link
Collaborator

@brotherlymite brotherlymite commented Sep 30, 2024

Short Summary:

  • AaveStewardInjector: new robot contract to fetch updates from risk oracle and inject into the risk steward.
  • RiskSteward: all keepCurrent values and same updates not allowed
  • EdgeRiskSteward: modified risk steward which only allows interest rate updates.

Aave Steward Injector:

The AaveStewardsInjector is a chainlink automation compatible contract which checks if updates from the Edge Risk Oracle could be pushed to the Risk Steward, and if so it injects the update from the Edge Risk Oracle to the Risk Stewards. The AaveStewardsInjector should be set as the riskCouncil on the Risk Steward contract so it can inject updates.

Some important things to note about the AaveStewardInjector:

  • Although the AaveStewardInjector will be triggered by chainlink automation nodes, but the method to inject the update performUpkeep() is made permissionless by design to allow for manual trigger.
  • The steward injector guardian has access to whitelist assets and also the updateType for which the update can be injected. In case of any emergency the guardian can also disable injection of an updateId to the risk steward. Initially WETH asset and the update type RateStrategyUpdate will be whitelisted on the steward injector.
  • The latest update from the RiskOracle will be injected first into the risk stewards and then the previous and so on. If someone manually tries to inject an updateId, while the latest update id is not executed the injector contract will revert till all the updates after the current one is executed.
  • If the update on the RiskOracle is invalid or not within the bounds of the RiskSteward, the call to the RiskSteward will revert. In practise, since it will be automated by chainlink automation, the automation nodes does an simulation before execution and as the simulation fails there will be no on-chain call.
  • If there is an update on the Risk Oracle which is not correct, the injector contract will not check the previous updates relative to that update, as the previous states on the RiskOracle could be thought as corrupted. The AaveStewardInjector will inject new updates from there if there will be any.

Risk Steward:

The Aave Generalised Risk Steward does not allow updates which does not change the protocol state and instead reverts in those cases.

  • In the case where all the params were EngineFlags.KEEP_CURRENT, we were not reverting before but it makes sense to revert as it does not change any risk params on the protocol and is simply a waste of gas.
  • We also revert now in the case where instead of using EngineFlags.KEEP_CURRENT for a param update with no changes, we use the current param value which does not make much sense.
  • We also introduced Edge Risk Stewards which inherits from the Risk Steward contract and only allows Interest rate updates. This is done as a security measure, as at the time of activation we only wish to automate InterestRateUpdates for WETH on the lido instance.

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.

1 participant