Skip to main content
The Public Allocator reallocates vault liquidity between Bend markets so borrows can succeed even when a market has insufficient supply. You call it to move liquidity from other markets into the target market in one transaction. You get deep, unified liquidity while keeping Bend’s isolated market risk. For concepts and flow, see Public Allocator.
For the contract interface, see the Public Allocator contract.
Read Public Allocator for an overview of how it works and curator controls.

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: withdrawals must be ordered by market ID ascending.
  • Fee: Send the required ETH as msg.value. Query the fee with fee(vaultAddress) on the Public Allocator.
  • Flow caps: Withdrawals and supply must not exceed the vault curator’s maxOut and maxIn per 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.

Example