Yieldinator Adapters Overview
The Yieldinator Facet uses a modular adapter pattern to integrate with various DeFi protocols. This architecture allows for easy addition of new protocols and standardizes the interaction between the Yieldinator Facet and external yield sources.
Adapter Architecture
All protocol adapters inherit from the YieldinatorAdapter base contract, which defines:
Standard Interface: Common functions for depositing, withdrawing, and harvesting yield.
Access Control: Role-based permissions for secure operations.
Event Emissions: Standardized events for tracking protocol interactions.
Error Handling: Consistent error messages and validation.
Available Protocol Adapters
The Yieldinator currently supports the following protocols:
Aave: Integration with Aave's lending and borrowing protocol.
Compound: Integration with Compound's money markets.
Curve: Integration with Curve Finance's stablecoin AMM and gauges.
Yearn: Integration with Yearn Finance's yield-optimizing vaults.
Convex: Integration with Convex Finance for boosted Curve rewards.
Sushi: Integration with SushiSwap's liquidity pools and SushiBar staking.
Maple: Integration with Maple Finance's undercollateralized lending protocol.
Badger: Integration with Badger DAO's Bitcoin-focused yield vaults.
Lido: Integration with Lido's liquid ETH staking protocol.
Ethena: Integration with Ethena's yield-bearing stablecoin protocol.
Uniswap: Integration with Uniswap's V2 and V3 liquidity pools.
Beefy Finance: Integration with Beefy's multi-chain yield optimization vaults.
Rocket Pool: Integration with Rocket Pool's decentralized ETH staking protocol.
Trader Joe: Integration with Trader Joe's DEX and liquidity provision features on Avalanche.
PancakeSwap: Integration with PancakeSwap's DEX and farming features across multiple chains.
Hyperliquid: Integration with Hyperliquid's high-performance perpetual exchange on a custom L1 blockchain.
DeFi Sectors and Protocol Categories
The Yieldinator Facet integrates with protocols across various DeFi sectors to provide a comprehensive yield generation solution. Below is a categorization of the supported protocols by their primary DeFi sector:
1. Lending and Borrowing Protocols
Lending protocols allow users to earn yield by providing liquidity to borrowers, generating returns through interest payments.
Aave: A decentralized, non-custodial liquidity protocol where users can participate as depositors or borrowers. Depositors earn passive income by providing liquidity, while borrowers can borrow in an overcollateralized or undercollateralized (flash loans) fashion.
Compound: An algorithmic money market protocol that allows users to lend and borrow crypto assets. Interest rates are determined by supply and demand dynamics.
Maple: A decentralized corporate credit market that enables institutions to efficiently access capital via undercollateralized lending. Maple focuses on providing capital to institutional borrowers with established credit histories.
2. Automated Market Makers (AMMs) and Liquidity Provision
AMMs enable decentralized trading and reward liquidity providers with trading fees and often governance tokens.
Curve: A decentralized exchange optimized for stablecoin trading with low slippage and fees. Liquidity providers earn trading fees and CRV rewards, which can be boosted by staking in the Curve DAO.
Sushi: A community-driven DeFi platform with a decentralized exchange (SushiSwap) where users can earn yield by providing liquidity and staking SUSHI tokens in SushiBar (xSUSHI).
Uniswap: The largest decentralized exchange by volume, offering both traditional 50/50 pools (V2) and concentrated liquidity positions (V3) that allow LPs to provide liquidity within specific price ranges for enhanced capital efficiency.
Trader Joe: A decentralized exchange on Avalanche that offers liquidity provision features and yield generation opportunities for users.
PancakeSwap: A decentralized exchange that operates across multiple chains, offering liquidity provision and farming features for users to generate yield.
3. Yield Aggregators and Optimizers
Yield aggregators automate yield farming strategies to maximize returns while minimizing gas costs and complexity.
Yearn: A yield aggregator that automates the process of finding the best yield farming opportunities. Yearn Vaults employ strategies that automatically shift capital as opportunities arise, optimizing returns while saving users on gas costs.
Convex: A platform built to maximize rewards for Curve liquidity providers and stakers. Convex boosts CRV rewards for liquidity providers and offers single-sided staking for CVX token holders.
Badger: A DAO focused on bringing Bitcoin to DeFi. Badger offers yield-bearing vaults for Bitcoin-related assets like WBTC, renBTC, and various tokenized Bitcoin derivatives.
Beefy Finance: A decentralized, multi-chain yield optimizer platform that automates the best yield farming opportunities across 15+ blockchain networks. Beefy's vaults auto-harvest rewards and reinvest them to maximize returns while minimizing gas costs.
4. Liquid Staking Protocols
Liquid staking solutions allow users to stake assets while maintaining liquidity through derivative tokens.
Lido: A liquid staking solution for Ethereum that allows users to stake ETH without maintaining infrastructure or locking assets. Users receive stETH tokens that represent their staked ETH plus staking rewards.
Rocket Pool: A decentralized ETH staking protocol that allows users to stake ETH and receive rETH tokens, which represent their staked ETH plus staking rewards.
5. Yield-Bearing Stablecoins
These protocols issue stablecoins that automatically generate yield for holders.
Ethena: A protocol that offers USDe, a yield-bearing stablecoin, and sUSDe, a staked version that generates yield from delta-neutral strategies. Ethena maintains the dollar peg while generating yield through sophisticated market-neutral positions.
6. Options and Derivatives Protocols
Options and derivatives protocols provide advanced trading instruments and strategies for generating yield through market movements.
Hyperliquid: A high-performance, fully on-chain perpetual exchange built on a custom L1 blockchain. It offers perpetual futures trading with up to 50x leverage, cross-margining, and a unique liquidity provision system that allows users to earn yield through trading fees and rewards.
Common Adapter Functions
All adapters implement the following core functions:
deposit: Deposits tokens into the protocol.
withdraw: Withdraws tokens from the protocol.
harvestYield: Harvests accrued yield without withdrawing principal.
emergencyWithdraw: Performs an emergency withdrawal of all funds.
getCurrentAPY: Returns the current APY for a token in the protocol.
getTotalDeposited: Returns the total amount of tokens deposited.
Adding New Adapters
To add a new protocol adapter:
Create a new contract that inherits from
YieldinatorAdapter.Implement all required interface functions.
Add protocol-specific functionality and optimizations.
Register the adapter with the Yieldinator Facet.
For detailed instructions, see the Adding New Protocols guide.
Security Considerations
When implementing or using adapters, consider the following:
Protocol Risk: Each protocol has its own risk profile and security considerations.
Smart Contract Risk: Adapters interact with external protocols that may have vulnerabilities.
Slippage Protection: Ensure adequate slippage protection for AMM interactions.
Emergency Procedures: Test emergency withdrawal functionality regularly.
Access Control: Maintain strict access control for adapter administration.
Performance Optimization
Adapters include various optimizations to minimize gas costs:
Batched operations where possible
Efficient token approval management
Optimized yield harvesting timing
Gas-aware rebalancing strategies