FeeWrapperDeployer
An example deployer contract that creates “fee wrapper” VaultV2 instances. A fee wrapper is a VaultV2 that wraps an existing MetaMorpho vault (Vault V1) and allows charging additional performance or management fees on top of it.Overview
The FeeWrapperDeployer demonstrates a specific VaultV2 configuration pattern:- Single adapter - Uses only a
MorphoVaultV1Adapterpointing to an underlying MetaMorpho vault - Fixed underlying vault - The adapter configuration is permanently locked (abdicated)
- Configurable fees - Owner can set performance and management fees
- Automatic routing - Deposits and withdrawals automatically flow through the underlying vault
This is an example implementation, not the only way to configure a fee wrapper. You can customize the deployment process based on your requirements.
Fixed configuration
The following aspects are permanently fixed after deployment:addAdapterfunction is abdicated - Cannot add more adaptersremoveAdapterfunction is abdicated - Cannot remove the adapter- Single
MorphoVaultV1Adapterpointing to the child vault
Configurable aspects
The vault owner retains control over:- Performance and management fees
- Fee recipients
- Timelocks for curator functions
- Caps (absolute and relative)
- Sentinels and allocators
- Gates (receive/send shares and assets)
- Max rate
- Liquidity adapter and data
- Name and symbol
- Owner and curator addresses
- Force deallocate penalties
Function
createFeeWrapper
The VaultV2Factory address for deploying the wrapper vault
The MorphoVaultV1AdapterFactory address for creating the adapter
The address that will receive ownership and control of the fee wrapper
Salt for CREATE2 deployment of the wrapper vault
The underlying MetaMorpho vault address to wrap
The address of the newly deployed fee wrapper vault
Deployment process
ThecreateFeeWrapper function performs these steps:
Create and add adapter
- Creates a
MorphoVaultV1Adapterfor the child vault - Submits and executes
addAdaptertransaction
Abdicate adapter functions
- Abdicates
addAdapter- permanently prevents adding new adapters - Abdicates
removeAdapter- permanently prevents removing adapters
Usage example
Post-deployment configuration
After deployment, the owner should:-
Set fee parameters:
-
Configure timelocks (if desired):
-
Set gates (if needed for access control):
-
Customize metadata:
Use cases
Protocol revenue generation
Protocols can wrap existing high-performing MetaMorpho vaults and charge a small fee for providing a branded experience or additional services:White-label vault products
Create customized vault experiences on top of existing infrastructure:Security considerations
The deployer temporarily has allocator rights during deployment but removes itself before transferring ownership. The final owner starts with clean allocator permissions.
Related contracts
- VaultV2 - The wrapper vault contract
- VaultV2Factory - Factory for deploying vaults
- MorphoVaultV1Adapter - Adapter wrapping the child vault
- MorphoVaultV1AdapterFactory - Factory for creating adapters