Today, we unveil the Public Allocator for Morpho (also known as Morpho Blue): a new feature that provides borrowers with just-in-time liquidity by reallocating liquidity between markets to increase the liquidity on a selected market.
Liquidity reallocation is made possible with Morpho Vaults and a separate contract called the Public Allocator. Typically, an address controlled by the risk curator allocates a vault's liquidity. However, a vault can also allow the Public Allocator contract to reallocate liquidity between listed markets within customizable limits.
Once enabled, users can call the contract and move liquidity from eligible markets to the market they wish to borrow from. This gives users access to just-in-time liquidity and significantly increases liquidity available to borrow from a market.
The Public Allocator will help facilitate more efficient capital allocation between isolated markets and further re-aggregate liquidity on Morpho. As deposits on underlying markets continue to grow, Morpho’s liquidity profile will be able to scale beyond what is possible on monolithic multi-asset lending pools.
Users do not interact with the Public Allocator directly. Front ends integrate the contract and bundle liquidity reallocation with a borrow transaction when required.
For example, on the Morpho Interface, the borrow tab has a property called Available Liquidity which displays Market Liquidity plus liquidity on other markets with the same loan asset that can be reallocated to the selected market using the Public Allocator.
When a user needs to borrow an amount of liquidity greater than the Market Liquidity, the interface triggers the Public Allocator to transfer liquidity from another market(s) and fills the borrower’s order with just-in-time liquidity.
Intuitively, standard isolated markets would have less liquidity than a multi-asset lending pool.
For example, a borrower with wstETH collateral can only borrow $20 WETH from the wstETH/WETH market even though there is a total of $100 WETH liquidity across the five markets.
However, things change when a vault enables the Public Allocator contract. To borrow more than $20 of liquidity on the wstETH/WETH market, the user can call the Public Allocator to reallocate liquidity from the other markets with WETH liquidity.
As the chart below demonstrates, the borrower reallocates $60 liquidity from the other markets to the wstETH/WETH market and increases the borrowable amount by 4x from $20 to $80.
Liquidity reallocation is not limited to just one vault but can extend to any vaults with the Public Allocator enabled. As illustrated below, a user can reallocate from multiple vaults to increase borrowable liquidity even further.
Assuming both vaults have enabled the Public Allocator without restrictions, the available liquidity on each WETH market is equal to the total WETH liquidity supplied on the five markets.
The available liquidity for the wstETH/WETH market would be $120, not just $40.
The Public Allocator can only reallocate liquidity between markets listed by a given vault within the limits described below to avoid altering its risk profile.
The vault owner or admin can set the following restrictions:
Max flows: Each market has a max inflow and outflow, which the vault owner or admin can set. This can be useful to prevent reallocations from negatively impacting market rates or over/under-exposing the vault to a certain market.
Fees: The vault owner or admin can set a fee in ETH, paid by the user, to call the reallocate function. Setting a fee can help prevent attempts at malicious reallocations.
The code for the PublicAllocator is fully open-source and can be found here.