Skip to content

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() and report().

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.
  • 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