MIMORebalance
The MIMOLeverage
action contract handle the super vault empty vault logic described in Rebalancing.
Write Methods
executeAction(bytes calldata _calldata) external
executeAction(bytes calldata _calldata) external
Uses a flash loan to repay all debts for a vault and send all collateral in the vault to the owner.
Requirements :
Contract must be unpaused
Must be called through the
MIMOProxy
execute()
functionTargeted vault must have been created by the
MIMOProxy
Param Name | Type | Description |
---|---|---|
_callData | bytes | Abi encoded bytes with :
|
RebalanceData
Param Name | Type | Description |
---|---|---|
| IERC20 | Collateral to rebalance to |
| uint256 | Id of the vault to rebalance |
| uint256 | Amount of stableX to mint on rebalancing vault to swap and repay flash loan |
executeOperation(address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata params
executeOperation(address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata params
AAVE Pool
contract flash loan callback function.
Requirements :
Contract must be unpaused
Can only be called by the AAVE
Pool
contractFlash loan initiator must be the
MIMOProxy
Param Name | Type | Description |
---|---|---|
| address[] | Address array with one element corresponding to the address of the target vault asset |
| uint256[] | Uint array with one element corresponding to the amount of the target vault asset |
| uint256[] | Uint array with one element corresponding to the flashLoan fees |
| address | Initiator of the flashloan; can only be MIMOProxy owner |
| bytes | Bytes sent by this contract containing MIMOProxy owner, target vault id, SwapData struct |
rebalanceOperation(IERC20 fromCollateral, uint256 swapAmount, uint256 flashLoanRepayAmount, uint256 fee, RebalanceData calldata rbData, SwapData calldata swapData)
(IERC20 fromCollateral, uint256 swapAmount, uint256 flashLoanRepayAmount, uint256 fee, RebalanceData calldata rbData, SwapData calldata swapData)
Performs a rebalance logic within MIMOProxy context.
Requirements :
Contract must be unpaused
Contract must be unpaused
Must be called through the
MIMOProxy
execute()
function
Param Name | Type | Description |
---|---|---|
| IERC20 | Collateral of the vault to rebalance |
| uint256 | The amount of collateral to swap to for stableX to repay vaultdebt |
| uint256 | Amount of collateral to repay to flash loan protocol at the end of the transaction |
| uint256 | Optional fee to be passed in the context of a |
| struct |
|
| struct | SwapData passed from the flash loan call |
View Methods
proxyFactory()
Returns the MIMOProxyFactory
address.
Last updated