Skip to content

Hereโ€™s the updated architecture.md content with the image embedded properly using Markdown syntax. You can place this in your docs-site/docs/architecture.md:


๐Ÿ—๏ธ Protocol Architecture

This yield optimization protocol combines smart contract-based vaults with an AI agent and Chainlink Automation to intelligently allocate funds based on market conditions and user risk preference.


๐Ÿ–ผ๏ธ System Diagram

Protocol Architecture


๐Ÿงฉ Components

๐Ÿ‘ค User

  • Interacts via a simple Frontend UI.
  • Can view balances and deposit into AI-driven vaults.

๐Ÿ’ป Frontend UI

  • Contains two main tabs:

  • Assets โ€“ view deposits, APY, etc.

  • AI Vault โ€“ deposit into Low or High risk vaults.

๐Ÿค– AI Agent (ElizaOS Plugin)

  • Uses 7-day and 25-day market trend analysis.
  • Fetches DeFi data from:

  • CoinGecko (price history)

  • DeFiLlama (APYs, TVLs)

  • Stores chosen strategy in ElizaOS KV Store.


  • Periodically or immediately calls allocateFunds() on the vaults.
  • Triggers allocation only if AI agent has posted a valid strategy in ElizaOS KV.

๐Ÿ” AutomationOwner Contract

  • Trusted controller that mediates access from Chainlink Automation to YVault.
  • Ensures only secure, scheduled execution of allocation logic.

๐Ÿฆ Vaults

Two Yearn V2-style vaults:

  • LowRiskVault โ€” interacts with Aave-based strategy.
  • HighRiskVault โ€” interacts with Morpho Blue strategy.

๐Ÿ“Š Strategies

  • LowRiskAaveStrategy โ†’ invests in a mocked Aave USDC pool.
  • HighRiskMorphoStrategy โ†’ invests in a mocked Morpho Blue pool.
  • Strategies are modular and upgradable by governance.

๐Ÿ” Fund Flow Summary

  1. User deposits USDC into either vault.
  2. AI Agent selects optimal pool based on market signal.
  3. Result is stored in ElizaOS KV (off-chain).
  4. Chainlink Automation triggers fund allocation via AutomationOwner.
  5. Funds are routed from the vault into the selected strategy.
  6. Strategy contract executes on the corresponding protocol (mocked for testing).

Let me know if you'd like a sidebar entry for this or if you're using mkdocs.ymlโ€”I can help configure that too.