For the contract interface, see the Public Allocator contract.
Core integration: reallocateTo
Call reallocateTo to withdraw from one or more source markets in a vault and supply the total to a single destination market in one atomic transaction.
Function signature
Parameters
- vault: MetaMorpho vault to withdraw from.
- withdrawals: Array of
Withdrawal(source market + amount). Must be sorted by market ID ascending.Withdrawal:marketParams(MarketParams for source market),amount(uint128).
- supplyMarketParams: Destination market (single market) that receives the total withdrawn amount.
Requirements
- Sorted withdrawals:
withdrawalsmust be ordered by market ID ascending. - Fee: Send the required ETH as
msg.value. Query the fee withfee(vaultAddress)on the Public Allocator. - Flow caps: Withdrawals and supply must not exceed the vault curator’s
maxOutandmaxInper market. - Enabled markets: All source and destination markets must be enabled for the vault.
- No self-supply: The destination market must not appear in
withdrawals.