# Configure the Public Allocator

Enable and configure the Public Allocator for a Morpho Vault V2.

Source: https://docs.morpho.org/curate/tutorials-v2/public-allocator



The Public Allocator adds liquidity to your vault's markets when borrowers need it, without waiting for you to reallocate. Once you enable it, anyone can move the vault's assets into a market that needs liquidity, but only within the limits you set: which markets can receive assets, how much each market can hold, and which markets or idle assets can supply them. For main concepts, see the [Public Allocator](/learn/concepts/public-allocator/) and [Liquidity Curation](/curate/tutorials-v2/liquidity-curation/) pages.

## Why enable it [#why-enable-it]

* Markets your vault supplies get more borrowable liquidity when demand rises, which can increase utilization and yield for the vault.
* You decide which markets can send and receive assets, and how much each market can hold.
* Any penalty you set is paid to the vault and accrues to users.
* Markets keep isolated risk; the Public Allocator does not merge their collateral, oracles, or risk parameters.
* The vault's absolute and relative caps remain binding.
* The caller never takes custody of the vault's assets.

## The controls [#the-controls]

| Control                     | What it does                                                                                                                                                                                                          |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Allocator role              | The vault's allocator role, given to the Public Allocator with a timelocked `setIsAllocator` change.                                                                                                                  |
| Active adapter              | Enables a `MorphoMarketV1AdapterV2` to participate. Only adapters belonging to this vault can be used.                                                                                                                |
| Public Allocator cap        | Maximum allocation a market can hold after a Public Allocator move, in the vault asset. It limits the market's total allocation; it is not a budget that refills. The vault's absolute and relative caps still apply. |
| Allow deallocation          | Per-market permission to use that market as a source. It has no amount limit, so the market can be pulled down to zero.                                                                                               |
| Allow allocations from idle | Vault-wide permission to allocate the vault's idle assets.                                                                                                                                                            |
| Penalty                     | Percentage of each amount moved, paid by the caller in the vault asset to the vault. It accrues to users, so there is nothing to claim.                                                                               |

Public Allocator configuration changes are sent to the Public Allocator contract, require the vault's allocator role, and apply immediately. Only adding or removing the Public Allocator as a vault allocator is timelocked.

## Prerequisites [#prerequisites]

* The vault is a Vault V2 on a chain where the [Public Allocator is deployed](/developers/contracts/addresses/#morpho-vault-v2).
* The vault has at least one `MorphoMarketV1AdapterV2` with markets that have vault caps set. See [(De)List Adapters](/curate/tutorials-v2/listing-adapters/).

## Tutorial: Enable the Public Allocator in the Curator App V2 [#tutorial-enable-the-public-allocator-in-the-curator-app-v2]

Open the vault in the [Curator App V2](https://curator.morpho.org/vaults).

<Steps>
  <Step>
    ### 1. Add the Public Allocator as an allocator [#1-add-the-public-allocator-as-an-allocator]

    Connect the vault's **Curator** wallet. In the vault's **Overview**, open **Roles & Permissions**. In the **Allocators** list, find the **Public Allocator** row and click **Add**. Review **Add Public Allocator** and submit.

    Adding the role submits a timelocked `setIsAllocator` change. The row shows **Addition pending** until it is executable. Execute it from pending actions once the timelock ends. See [Timelock](/curate/concepts/timelock/).

    Keep at least one other allocator, such as a team wallet or multisig, for manual allocation and recovery. The app warns if the Public Allocator would be the vault's only allocator.
  </Step>

  <Step>
    ### 2. Enable the Public Allocator on a market adapter [#2-enable-the-public-allocator-on-a-market-adapter]

    Connect an **Allocator** wallet; steps 2 to 4 require the vault's allocator role. In **Overview**, open **Adapters**. On a `MorphoMarketV1AdapterV2` row, toggle **Enable Public Allocator** and confirm.

    > "Anyone can then rebalance liquidity across markets served by this adapter, within the Public Allocator caps you set."

    This change applies immediately. When the adapter is not enabled, the **Allocators** row also links to **Enable the Public Allocator on a market adapter**.
  </Step>

  <Step>
    ### 3. Set caps and sources [#3-set-caps-and-sources]

    Open the vault's **Caps** page and select the **Public Allocator** tab. The table shows **Market**, **Allocation**, **Vault Absolute Cap**, **Public Allocator cap**, and **Allow Deallocation**. The page also has an **Allow allocations from idle** switch.

    Click **Edit**. Set a Public Allocator cap on each market it may allocate to, and allow deallocation on markets it may pull from. You can also allow allocations from idle. Review and commit the changes. **All Public Allocator changes are sent in one transaction** and apply immediately.

    A Public Allocator cap above the vault's absolute cap or below the current allocation is allowed. It limits the market's total allocation, not one movement, and does not force assets out. A market with a zero vault cap cannot be a destination.
  </Step>

  <Step>
    ### 4. Set an optional penalty [#4-set-an-optional-penalty]

    In **Overview**, open **Vault State** and then **Fees and penalties**. Find **Public Allocator penalty**, click **Edit**, and enter a value under **Penalty percentage** in the **Set Public Allocator penalty** dialog. Review and submit.

    <Callout type="info">
      A penalty is optional. It can act as an economic deterrent, for example against repeated moves made only to disrupt the vault's allocation. It also makes each move more expensive for the borrowers and apps that trigger it, which can worsen their experience or lead them to use other liquidity.
    </Callout>
  </Step>

  <Step>
    ### 5. Check the setup status [#5-check-the-setup-status]

    In the **Allocators** list, check the badge on the **Public Allocator** row:

    * **Not added** means the allocator role is not set.
    * **Setup incomplete** means a required setup step is missing. Hover over the badge to see the **Setup checklist**: Public Allocator added; Market adapter enabled; Cap set on a market it can allocate to; A market or idle allowed as the source.
    * **Active** means the required setup is complete.
  </Step>
</Steps>

## Configure via Etherscan [#configure-via-etherscan]

Configuration uses two contracts: your vault and the Public Allocator. Find the Public Allocator address for your chain in the [Morpho Vault V2 addresses](/developers/contracts/addresses/#morpho-vault-v2) (`BluePublicAllocator`).

1. **On your vault**, with the Curator wallet: call [`submit`](/developers/contracts/morpho-vaults-v2/#submit) with the encoded call `setIsAllocator(publicAllocator, true)`. After the timelock ends, call [`setIsAllocator`](/developers/contracts/morpho-vaults-v2/#setisallocator) with the same arguments.
2. **On the Public Allocator**, with an Allocator wallet, passing your vault address to each function:
   * [`setIsActiveAdapter`](/developers/contracts/blue-public-allocator/#setisactiveadapter) to enable your `MorphoMarketV1AdapterV2`.
   * [`setAbsoluteCap`](/developers/contracts/blue-public-allocator/#setabsolutecap) to set a Public Allocator cap on each destination market.
   * [`setCanPullFromMarket`](/developers/contracts/blue-public-allocator/#setcanpullfrommarket) to allow deallocation from each source market.
   * [`setCanPullFromIdle`](/developers/contracts/blue-public-allocator/#setcanpullfromidle) to allow allocations from idle assets (optional).
   * [`setPenalty`](/developers/contracts/blue-public-allocator/#setpenalty) to set the penalty (optional).

The Public Allocator changes apply immediately. See the [Public Allocator contract reference](/developers/contracts/blue-public-allocator/) for parameters.

## Risk considerations [#risk-considerations]

* The vault's relative caps are checked against its total assets at the time of each move. A large temporary deposit raises that limit, so anyone with enough capital can make a Public Allocator move exceed the exposure a relative cap normally allows. Set each Public Allocator cap, which is always an absolute amount, at the maximum exposure you accept for that market.
* Allowing deallocation from a market lets the Public Allocator pull it down to zero. If that market backs the vault's liquidity adapter, this can reduce instant withdrawal liquidity. See [Liquidity Curation](/curate/tutorials-v2/liquidity-curation/).
* The app warns if the Public Allocator is still active on an adapter the vault no longer lists or an adapter created for another vault. Turn off the stale activation; moves through an adapter created for another vault revert.

## Disable or pause [#disable-or-pause]

* Toggle **Disable Public Allocator** on an adapter to stop moves through it. Its caps stay set, and other enabled adapters keep working.
* Set destination caps to zero or remove source permissions to restrict moves.
* Click **Remove** on the Public Allocator row to remove its allocator role. This change is timelocked.