Search projects, hackathons, sponsors and tech

    ← All projects

    crvUSD Metavault

    LlamaLend MetaVault: A smart contract optimizing yields across multiple LlamaLend markets. It automates allocations based on trusted third-party target weights, minimizing on-chain transactions while maintaining close-to-target distributions for maximum capital efficiency.

    About

    The LlamaLend MetaVault is an innovative DeFi solution designed to maximize returns for users by leveraging multiple LlamaLend markets. This ERC-4626 compliant contract acts as a meta-layer, automatically distributing user deposits across various LlamaLend markets based on target weights set by a trusted third party. Key features include: 1. Trusted weight setting: A designated third party can adjust target allocations across markets. 2. Efficiency-focused rebalancing: The contract realigns assets across markets while minimizing the number of on-chain transactions. 3. Automated deposit and withdrawal handling: The MetaVault optimizes asset distribution during user interactions, maintaining allocations close to target weights. 4. Fully on-chain operations: All logic and execution happen on-chain, ensuring transparency and eliminating off-chain dependencies. By using the MetaVault, users can benefit from expert-curated allocations and potentially higher yields without the need to manually manage multiple positions across LlamaLend markets. This project aims to enhance capital efficiency in the LlamaLend ecosystem and provide a streamlined experience for users seeking optimized returns.

    How it's made

    The LlamaLend MetaVault is built using Solidity and incorporates several sophisticated design patterns: 1. ERC-4626 Compliance: The contract inherits from OpenZeppelin's ERC4626 implementation, ensuring compatibility with the tokenized vault standard. 2. Efficient Market Management: A struct-based approach is used to manage multiple LlamaLend markets, allowing for flexible addition and removal of underlying strategies. 3. Transaction-Minimizing Algorithms: Custom algorithms for deposit allocation and withdrawal deallocation ensure optimal distribution of assets while minimizing the number of on-chain interactions with individual markets. 4. Precision Balancing: The implementation uses an EPSILON value (200 basis points) to allow for slight deviations from target allocations, reducing unnecessary rebalancing transactions. 5. Trusted Controls: The contract includes functions for a designated party to update target weights, enabling expert-driven allocation strategies. 6. Gas Optimization: Efficient looping and conditional checks are employed to minimize gas costs during operations. 7. Safety Measures: The contract includes checks to prevent actions that would leave no enabled markets or set invalid allocation targets. 8. On-Chain Execution: All logic, including complex rebalancing operations, is executed entirely on-chain, ensuring full transparency and eliminating off-chain dependencies. This implementation showcases advanced Solidity programming techniques and a deep understanding of DeFi mechanics, particularly in the realm of yield optimization and multi-market management within the LlamaLend ecosystem.