Architecture
Last updated
Last updated
Key Benefits
Composability and Integration (B2B): The DynaVaults framework implements the ERC4626 vault standard, first introduced by Yearn Finance to enable smooth integration across DeFi protocols. This standard creates flexible, interconnected "money legos" for yield-bearing vaults. Users who deposit assets receive vault shares, which they can later redeem for their underlying assets. The share amount depends on two factors: the user's deposit size and the vault's current exchange rate, which is determined by total vault liquidity.
Value Extraction Protection:
To protect against value extraction by external actors during vault operations, the framework also implements EIP-5143. Slippage occurs when the actual execution price of a transaction differs from the expected price, typically due to market volatility, low liquidity, or delays in transaction processing. EIP-5143 is a standard for ensuring transaction integrity in scenarios where slippage can occur. It introduces a mechanism to revert transactions during execution, when the slippage exceeds a given threshold. This blocks attackers from exploiting vault operations by manipulating prices or draining liquidity.
Strategy Compatibility and Consistency:
The DynaStrategy framework, inspired by the Yearn Finance Strategy API, incorporates configurable parameters such as debt thresholds, reporting intervals, profit factors, and automated keepers. This design enables seamless integration of automated keepers, complete with built-in health checks for efficient harvesting and asset management.
Reusable DynaStrategy Component reduces strategy complexity:
DynaStrategy allows developers to focus on integration by abstracting the standard management of strategies. The framework provides a set of pre-built functions for standard operations, simplifying the development process.
Deployment optimizations:
Using the EIP-1167 minimal proxy pattern in our smart contract significantly reduces deployment costs for cloned smart contract instances. The addition of the initializer pattern allows us to create new instances in a data-driven manner without needing to verify the smart contract each time.
Security architecture:
For coarse-grained access control, Singularity Finance uses the Role-Based Access Control (RBAC) component called AccessControl from OpenZeppelin. For fine-grained access control within the vaults and strategies, the team has developed a generic Identity & Access Management (IAM) contract that enables functional access control per resource.
Proportional Redemption:
Due to the multi-token nature of the vault, Singularity Finance has extended its functionality to include secure proportional redemption. This feature prevents slippage and reduces gas costs associated with exchanging all other assets back to deposit tokens.