Yield Optimizer Protocol
Welcome to the documentation for the AI-powered Yield Optimizer Protocol. This protocol intelligently allocates user capital across DeFi strategies based on risk preference and market conditions using an off-chain AI agent and Chainlink Automation.
๐ Overview
Our protocol features:
- ๐ง AI Agent: An off-chain agent built using ElizaOS, analyzing DeFi market data (CoinGecko, DeFiLlama, etc.) to detect market trends and choose optimal strategies.
- ๐งพ Vaults (YVault): ERC4626-style Yearn V2 vaults that accept deposits, track shares, and allocate capital to active strategies.
- โ๏ธ Chainlink Automation: Automates on-chain execution of the AI agent's strategy recommendations.
- ๐ Risk-Based Strategies: Supports Low Risk (e.g., Aave) and High Risk (e.g., Morpho/Curve) strategies based on user selection.
๐งฑ Components
1. YVault
- Accepts USDC deposits.
- Tracks shares using
pricePerShare
. - Allocates capital to strategies via
setStrategy()
andreport()
.
2. Strategies
- Each vault supports one strategy at a time.
- Strategies implement a common
IStrategy
interface. - Examples:
LowRiskAaveStrategy
: Supplies funds to Aave.HighRiskMorphoStrategy
: Allocates to Morpho Blue/Curve pools.
3. AI Agent
- Runs off-chain using ElizaOS plugin.
- Periodically fetches market data.
- Decides the best pool per risk category.
- Stores result in KV (ElizaOS) for on-chain access.
4. Chainlink Automation
- Triggers
allocateFunds()
based on strategy output. - Can be scheduled or triggered on deposit events.
- Uses an
AutomationOwner
contract to act on behalf of the vault.
๐งช Testing
We use mocked contracts to simulate:
- ๐ USDC & USDY tokens
- ๐งช MockAavePool and MockMorphoPool
- ๐ง Mock AI outputs
- โ Chainlink upkeep triggers
๐ GitHub
View the source code on GitHub
Last updated: June 2025