Manage Allocations
In Vault V2, curators no longer manage allocations by setting network limits and operator shares directly. Instead, vault assets are allocated through the vault's Universal Delegator, which routes capital across the vault's configured adapters.
As a curator, the main allocation flow is:
- Get the vault's delegator address
- Make sure the relevant adapters have been added and configured
- Allocate assets across adapters using the Universal Delegator
- Deallocate assets from adapters when needed
Allocate to Adapters
The Universal Delegator exposes an allocateAll(uint256 amount) method that allocates vault assets across configured adapters.
The default allocation helper script calls:
IUniversalDelegator.allocateAll(amount)on the delegator associated with a given Vault V2.
Allocation Script
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IVaultV2} from "../../../../src/interfaces/vault/IVaultV2.sol";
import {IUniversalDelegator} from "../../../../src/interfaces/delegator/IUniversalDelegator.sol";
import {Logs} from "../../../utils/Logs.sol";
import {ScriptBase} from "../../../utils/ScriptBase.s.sol";
contract AllocateAdaptersBaseScript is ScriptBase {
function runBase(address vault, uint256 amount) public virtual returns (bytes memory data, address target) {
target = IVaultV2(vault).delegator();
data = abi.encodeCall(IUniversalDelegator.allocateAll, (amount));
sendTransaction(target, data);
Logs.log(
string.concat("Allocate adapters", "\n vault:", vm.toString(vault), "\n amount:", vm.toString(amount))
);
Logs.logSimulationLink(target, data);
}
}This script:
- Receives the Vault V2 address and the amount to allocate
- Fetches the Universal Delegator address from the vault
- Encodes a call to
allocateAll(amount) - Sends the transaction to the delegator
Allocation Parameters
| Parameter | Description |
|---|---|
vault | Address of the Vault V2 whose assets should be allocated. |
amount | Amount of the vault asset to allocate across adapters. |
target | The Universal Delegator address returned by IVaultV2(vault).delegator(). |
data | Encoded calldata for IUniversalDelegator.allocateAll(amount). |
Using Safe
To allocate assets through Safe:
- Open Safe
- Open Transaction Builder
- Get the Vault V2 address
- Read the vault's
delegator()address using the UI, CLI, Etherscan, or another block explorer - Enter the delegator address as the contract address
- Click Use Implementation ABI
- Choose the
allocateAll(uint256 amount)method - Enter the amount of assets to allocate
- Sign and execute the transaction
Verify Allocation
To verify allocation state, use the Universal Delegator read methods and the relevant adapter read methods.
At a high level, you should verify:
- The vault's
delegator()points to the Universal Delegator used for the transaction - The relevant adapters are configured on the delegator
- The allocation transaction was executed successfully
- The target adapters received or accounted for the allocated assets
Verify the Delegator
- Open the Vault V2 contract in a block explorer
- Open the Read Contract tab
- Query
delegator() - Confirm that the returned address matches the delegator used for the allocation transaction
Verify the Allocation Transaction
- Open the allocation transaction in a block explorer
- Confirm that the transaction target is the Universal Delegator
- Confirm that the calldata corresponds to
allocateAll(uint256 amount) - Confirm that the transaction succeeded
Deallocations
Deallocations are also handled through the Universal Delegator. The exact method depends on the desired deallocation flow and adapter configuration.
Common deallocation-related permissions are assigned during Vault V2 deployment:
| Role holder | Description |
|---|---|
deallocateRoleHolder | Address allowed to deallocate assets from adapters. |
forceDeallocateRoleHolder | Address allowed to force deallocation from adapters. |
Adapter Management
Before assets can be allocated, the relevant adapters must be added and configured on the Universal Delegator.
Vault V2 deployment assigns the following adapter-management roles:
| Role holder | Description |
|---|---|
addAdapterRoleHolder | Address allowed to add new adapters. |
removeAdapterRoleHolder | Address allowed to remove adapters. |
swapAdaptersRoleHolder | Address allowed to reorder or swap adapters. |
setAdapterLimitsRoleHolder | Address allowed to configure adapter limits. |
setAutoAllocateAdaptersRoleHolder | Address allowed to configure auto-allocation adapters. |
Example Flow
A typical Vault V2 allocation flow looks like this:
- Deploy the Vault V2
- Add the required adapters to the Universal Delegator
- Configure adapter limits
- Configure auto-allocation adapters if applicable
- Deposit assets into the vault
- Call
allocateAll(amount)on the Universal Delegator - Verify that assets were allocated as expected
Deprecated Flow
The previous curator allocation flow used network and operator allocation methods such as:
setNetworkLimit(...)
setOperatorNetworkShares(...)These methods are part of the older delegator model. For Vault V2, allocation is performed through the Universal Delegator and its configured adapters.
If you are using Vault V2, use the adapter allocation flow described above instead.
