VaultModule is a core component of the modular vault architecture. It manages liquidity routing between the Vault and its connected Subvaults, enabling flexible strategy composition and modular upgrades. It supports hot-swapping of subvault contracts and ensures robust control over asset movement.
Factory contracts and local stateRiskManagerCREATE_SUBVAULT_ROLE: Allows creation of new subvaultsDISCONNECT_SUBVAULT_ROLE: Allows disconnection of active subvaultsRECONNECT_SUBVAULT_ROLE: Allows reattachment of disconnected or new properly configured subvaultsPULL_LIQUIDITY_ROLE: Grants permission to pull assets from subvaultsPUSH_LIQUIDITY_ROLE: Grants permission to send assets to subvaultsVaultModuleStorage)struct VaultModuleStorage {
address riskManager;
EnumerableSet.AddressSet subvaults;
}
riskManager: Module used to track and limit exposure per asset/subvaultsubvaults: Enumerable set of currently connected subvaultssubvaultFactory(): Returns IFactory used to deploy and check deployed subvaultsverifierFactory(): Returns IFactory used to deploy and check deployed verifierssubvaults(): Returns the total number of connected subvaults