Allocate & Rebalance

Submitting Actions

The Vault Owner or Curator can call submitActions() function to set up the reallocation or rebalancing of a vault.

function submitActions(
    bytes[] calldata actionsData
) external returns (uint256 nonce)

actionsData is an array that consists of selectors of a function of one of the facets included in the vault as well as parameters for that particular function.

Example: Building the input for submitting actions

Supplying to MORE Markets, Aave v3 or any fork of Aave v3 requires the interface for supplying via the MORE Markets facet looks like this:

function supply(
        address pool,
        address asset,
        uint256 amount,
        uint16 referralCode
    ) external

An example of the input for submitActions() would look like this:

[
    "0x57a31521000000000000000000000000bc92aac2dbbf42215248b5688eb3d3d2b32f2c8d0000000000000000000000001b97100ea1d7126c4d60027e231ea4cb25314bdb0000000000000000000000000000000000000000000001f4ec40e3d54225e8850000000000000000000000000000000000000000000000000000000000000000"
]

Where the included calldata would be composed as:

0x57a31521 // selector of supply function to execute
000000000000000000000000bc92aac2dbbf42215248b5688eb3d3d2b32f2c8d // address of the pool
0000000000000000000000001b97100ea1d7126c4d60027e231ea4cb25314bdb // asset address
0000000000000000000000000000000000000000000001f4ec40e3d54225e885 // amount of tokens to supply
0000000000000000000000000000000000000000000000000000000000000000 // referral code

Executing Actions

After submitActions() is called, the timelock period must elapse. The Vault Owner or Curator can then execute these actions by calling executeActions().

function executeActions(uint256 actionsNonce) external

If the timelock is set to 0, executeActions() will be executed automatically on the submitActions() call.

Max slippage will be applied to executeActions() after it is executed. If the max slippage is met or exceeded, the transaction will revert.

Guardian Veto

If the timelock is not 0, the Guardian can veto the transaction before the timelock expires by including the actionsNonces in vetoActions().

function vetoActions(uint256[] calldata actionsNonces) external

Last updated