Rescue strategy - #40
Open
dglowinski wants to merge 35 commits into
Open
Conversation
Rescue strategy euler batch
Rescue strategy audit fixes
There was a problem hiding this comment.
Verification Results
- Group ID: 17986bd1-3a60-42a2-9c10-edcfb764b6b0
| Job | Result | VERIFIED | Link |
|---|---|---|---|
| TimelockRemovableTime.conf | ✅ | 2 | Link |
| Timelock.conf | ✅ | 9 | Link |
| SolvencyInternal.conf | ✅ | 4 | Link |
| Solvency.conf | ✅ | 2 | Link |
| Roles.conf | ✅ | 4 | Link |
| Reverts.conf | ✅ | 19 | Link |
| Reentrancy.conf | ✅ | 1 | Link |
| Range.conf | ✅ | 6 | Link |
| PendingValues.conf | ✅ | 7 | Link |
| LostAssets.conf | ✅ | 8 | Link |
| Liveness.conf | ✅ | 2 | Link |
| Immutability.conf | ✅ | 1 | Link |
| ERC4626.conf | ✅ | 9 | Link |
| Enabled.conf | ✅ | 10 | Link |
| Conversions.conf | ✅ | 6 | Link |
| ConsistentStateExtras.conf | ✅ | 2 | Link |
| ConsistentStateExtras3Sanity.conf | ✅ | 2 | Link |
| ConsistentStateExtras2.conf | ✅ | 2 | Link |
| ConsistentState.conf | ✅ | 10 | Link |
| Balances.conf | ✅ | 6 | Link |
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.
The PR introduces a RescueStrategy. It allows curators to withdraw funds from strategies to distribute fairly to users when vault faces large debt socializations.
Rescue procedure:
- Euler installs a perspective in the earn factory which allows adding custom strategies
- RescueStrategy contracts are deployed for each earn vault to rescue.
Immutable params:
o Rescue account: is allowed to call the rescue functions and receives rescued assets and shares
o Earn vault: the strategy can only work with the specified vault. If another vault tries to enable it, it will revert on
acceptCap- Euler registers the strategies in the perspective
- Curator installs the strategy with unlimited cap (submit/acceptCap)
- Curator sets the new strategy as the only one in supply queue and moves it to the front of withdraw queue
o at this stage the regular users can't deposit or withdraw from earn
- Rescue account calls one of the
rescueXfunctions (for Euler, Morpho or Aave flash loan sources), specifying the asset amount to flashloano flash loan is used to create earn vault shares, it just passes through earn vault back to the rescue strategy where it is repaid
o the shares are used to withdraw as much as possible from the underlying strategies to the rescue account