Key features
Morpho Vault V2 provides a comprehensive feature set designed to balance flexibility, security, and user protection. This page covers the key capabilities that make the protocol unique.Timelocks
Timelocks protect depositors by requiring a waiting period before critical configuration changes take effect.How timelocks work
- Submit: Curator submits a configuration change
- Wait: Change becomes executable after the timelock duration
- Execute: Anyone can execute the pending change
- Exit: Users can withdraw before execution if they disagree
All curator configuration changes are timelockable except
decreaseAbsoluteCap and decreaseRelativeCap, which can be executed immediately for risk reduction.Function-specific timelocks
Each function has its own timelock duration:setIsAllocator- Managing allocator rolesaddAdapter/removeAdapter- Enabling/disabling adapterssetAdapterRegistry- Changing adapter restrictionsincreaseAbsoluteCap/increaseRelativeCap- Increasing risk limitssetPerformanceFee/setManagementFee- Changing fees- Gate configuration functions
- And more…
Changing timelocks
Timelock durations can be modified:- Increase: Can be done immediately (use carefully!)
- Decrease: Requires waiting through the current timelock
Abdication
Functions can be permanently disabled:Revocation
Sentinels can revoke pending changes for emergency risk management:Caps system
The caps system manages risk by limiting allocations to positions with common risk factors.Risk IDs
Risk IDs are abstract identifiers for common risk factors:- Collateral type
- Oracle provider
- Protocol/market
- Any other risk dimension
Absolute caps
Hard limits on total allocation per ID:- Checked on every allocation
- Measured in asset units
- Can be decreased immediately by curator or sentinel
- Increases require timelock (if configured)
Relative caps
Proportional limits relative to total vault assets:- Checked on allocation, not withdrawal (“soft” caps)
- Measured in WAD (1e18 = 100%)
- Prevents flashloan manipulation using
firstTotalAssets - Can be exceeded by interest/donations in adapters
Relative caps use
firstTotalAssets (assets after first accrual in transaction) rather than real-time assets. This prevents bypassing caps with flashloans but can generate false positives for large deposits through the liquidity adapter.Cap management
Allocation tracking
The vault tracks current allocation per ID:Liquidity management
Vault V2 provides multiple mechanisms to ensure withdrawal liquidity:Idle assets
Assets held directly by the vault as ERC20 balance:- Used first for withdrawals
- No yield generation
- Allocators manage idle buffer size
Liquidity adapter
Optional adapter for highly liquid markets:- Assets deposited to vault
- Forwarded to liquidity adapter (if configured)
- Shares minted to depositor
- Idle assets used first
- Liquidity adapter deallocated if needed
- Assets transferred to user
Force deallocate
Permissionless function to extract liquidity from any adapter:- Anyone can call to deallocate assets from an adapter
- Assets moved to vault’s idle balance
- Caller pays a penalty (up to 2%) in shares
- Penalty shares go to specified beneficiary
- Emergency liquidity extraction
- In-kind redemptions
- Manipulating relative caps (disincentivized by penalty)
The penalty is configurable per adapter by the curator. Zero penalty means only gas cost prevents deallocations.
In-kind redemptions
Users can exit with underlying market positions instead of assets:- Flashloan liquidity
- Supply to adapter’s market
- Use
forceDeallocateto withdraw - Repay flashloan
- Keep underlying position
Max rate
Limits how fast the vault’s share price can increase:- Stabilizes distributed yield
- Builds buffer to absorb losses
- Prevents donation-based attacks
- Reduces opportunistic depositor dilution
maxRate accumulate in the vault, effectively creating a reserve buffer.
Donations and
forceDeallocate penalties increase share price, which can attract opportunistic depositors. The maxRate helps mitigate this.Fees
Vault V2 supports two types of fees:Performance fee
Cut on earned interest:- Unit: WAD (1e18 = 100%)
- Maximum: 50% (0.5e18)
- Charged on: Interest accrual
- Paid in: Vault shares minted to recipient
Management fee
Annual fee on principal:- Unit: WAD (1e18 = 100% per year)
- Maximum: 5% per year (0.05e18)
- Charged on: Total assets over time
- Paid in: Vault shares minted to recipient
Fee invariant
Gates
Gates are external contracts that control access to vault operations:Gate types
Receive shares gate:- Controls who can receive vault shares
- Can lock users out of getting shares back from other contracts
- Controls who can send vault shares
- Can lock users out of exiting the vault
- Controls who can withdraw assets from the vault
- Vault itself (address(this)) is always allowed
- Can lock users out of exiting
- Controls who can deposit assets to the vault
- Not critical (cannot block user funds)
- Useful for supply restrictions
Gate interface
Non-custodial guarantees
Morpho Vault V2 provides strong non-custodial guarantees through multiple mechanisms:1. In-kind redemptions
Users can always exit by converting shares to underlying positions:- Use
forceDeallocateto extract liquidity - Combine with flashloans for in-kind exits
- Works even when markets are illiquid
- Only cost is gas + optional penalty (max 2%)
2. Timelocks
Critical changes require waiting periods:- Users can monitor pending changes
- Time to exit before changes execute
- Curator cannot directly hurt users without delay
3. Immutability
No upgrade mechanisms:- Predictable behavior forever
- No governance risk
- Code is law
4. Role separation
No single role can rug users:- Owner: Sets curator but cannot configure vault
- Curator: Changes require timelocks
- Allocators: Limited to caps and enabled adapters
- Sentinels: Can only reduce risk
Multicall
Batch multiple operations in a single transaction:- Atomic configuration changes
- Gas optimization
- Coordinated allocations
- Initial vault setup
ERC-4626 compliance
Full standard compliance with some quirks:Standard functions
deposit()/mint()- Add assets, receive shareswithdraw()/redeem()- Burn shares, receive assetstotalAssets()- Total managed assetsconvertToShares()/convertToAssets()- Conversion functionspreviewDeposit()/previewMint()- Preview depositspreviewWithdraw()/previewRedeem()- Preview withdrawals
Non-conventional behavior
ERC-2612 permit
Supports gasless approvals:View functions
Access vault state without transactions:Interest accrual preview
Total assets
- Idle vault balance
- All adapter positions (via
realAssets()) - Unapplied interest/losses
totalSupply is not updated to include unminted fee shares. Call accrueInterestView() to compute the updated total supply.Next steps
Adapters
Learn about connecting to underlying markets
Roles
Understand the role-based access control system