Architecture & Flow of Funds
The BoringVault was built from the ground up to be the most secure and flexible framework for building enterprise-grade DeFi products.
Overview
Modular architecture with minimal core contract logic (~100 lines of code, hence "boring"). The architecture relies on several core utility smart contracts:
BoringVault
The central contract where users deposit assets. It minimizes the internal logic by delegating tasks to external modules enhancing flexibility and security.
Teller
Handles user interactions for minting and redeeming vault shares. It manages deposits, enforces share lock periods, and can refund deposits under certain conditions to protect users.
Hook
An optional module that triggers custom logic before share transfers such as enforcing transfer restrictions or implementing additional security checks. Use cases include compliance functionality at the smart contract level such as whitelisting deposit addresses, locking shares to prevent transfers, etc.
Manager
Responsible for rebalancing the vault’s assets. It uses Merkle proofs to ensure that only the authorized and predefined strategies are executed maintaining strict control over the vault’s actions
Accountant
Calculates and updates the exchange rate for vault shares. It ensures rate changes are within acceptable bounds and can pause updates if anomalies are detected, safeguarding against volatile market conditions.
uManagers (Micro Managers)
Provide additional logic during rebalancing. Examples use cases include enforcing allocation caps, verifying slippage checks, and automating strategies fully onchain.
DecoderAndSanitizer
Decodes and sanitizes data when integrating with new external protocols ensuring that only safe and intended operations are performed.
Oracle
Responsible for tracking yield and underlying asset value, subject to onchain checks and balances such as maximum update frequency, maximum deviation, etc.
Flow of Funds

User deposits through Teller which imposes transfer Hooks, and receives a vault share token at the exchange rate reported by the Accountant.
Funds sit in the vault contract until allocated (approximately every 24 hours)
The Curator allocates funds into selected DeFi protocols through the Merkle tree whitelist
When it's time to withdraw, the user sends their vault shares to the withdrawal contract in exchange for the underlying assets (after an optional unstaking period)
Note: Seperating the withdrawal logic from the core vault has security benefits
Every 24 hours, the Oracle updates the vault's exchange rate (tracking earned interest/yield) through the Accountant
Last updated