Yield AI
Yield AI is a advanced DeFi yield dashboard and transaction toolkit on Aptos and Solana. It provides a secure, personal vault architecture and a suite of automation tools for yield optimization and risk management.
Goal
Build a safe on-chain vault where a user deposits assets into their personal safe (one Object per user), and a designated AI-executor can only call restricted entrypoints under strict on-chain policy limits.
Security Model
Security is at the core of Yield AI. Our model ensures:
- No Private Key Access: The AI agent never receives user private keys.
- Restricted Withdrawals: The AI agent cannot withdraw funds to its own address.
- Protocol Whitelisting: The agent can only interact with audited and whitelisted adapters.
- User Agency: The owner can always pause, withdraw, or revoke the executor at any time.
- Isolation: Each user's funds are in their own safe object; there are no shared pools.
High-Level Architecture
Contract Architecture
flowchart TB
subgraph Protocol["Protocol (@yield_ai)"]
GC[GlobalConfig]
GC --> admin[admin]
GC --> treasury[treasury]
GC --> executor[executor]
GC --> fees[perf_bps, exec_bps]
GC --> paused[paused]
GC --> adapters_whitelist[allowed_adapters]
end
subgraph User["User (owner)"]
SafeRef[SafeRef]
SafeRef --> safes_list["safes: vector<address>"]
end
subgraph Safe["Personal Safe (Aptos Object)"]
VP[VaultPosition]
VP --> extend_ref[ExtendRef]
VP --> owner[owner, shares, principal, hwm]
VP --> policy[policy: executor, max_per_tx, max_daily, paused]
VP --> fees_in_pos[fees: perf_bps, exec_bps, treasury]
VP --> day_spent[day, spent_today]
FA_store[primary_fungible_store]
end
subgraph Adapters["Adapters (whitelisted)"]
mock[adapter_mock]
moar[adapter_moar]
echelon[adapter_echelon]
end
User -->|"init_vault в†’ creates"| Safe
User -->|"deposit / withdraw"| Safe
Protocol -->|"executor, fees, treasury"| Safe
Safe -->|"execute() в†’ internal safe signer"| Adapters
Adapters -->|"only via vault"| Protocol
Main Flows
sequenceDiagram
participant U as User (owner)
participant V as Vault
participant S as Safe (Object)
participant P as Protocol
participant A as Adapter
Note over U,P: Setup
P->>P: init_protocol (admin)
U->>V: init_vault(max_per_tx, max_daily)
V->>S: create Object + VaultPosition
V->>U: SafeRef.safes.push(safe_address)
Note over U,P: User operations
U->>V: deposit(safe, metadata, amount)
V->>U: FA withdraw from owner
V->>S: FA deposit to safe
V->>S: update shares, principal, hwm
U->>V: withdraw(safe, metadata, amount)
V->>S: ExtendRef в†’ safe_signer
V->>S: FA withdraw from safe
V->>U: FA deposit to owner
V->>S: update shares, principal, hwm
Note over U,P: AI executor (execute)
A->>V: execute(user, action, amount, adapter_id, params)
V->>P: protocol paused? adapter allowed?
V->>S: user policy paused? signer == executor?
V->>S: amount ≤ max_per_tx? spent_today + amount ≤ max_daily?
V->>P: execution fee в†’ treasury
V->>S: ExtendRef в†’ safe_signer (internal)
V->>A: adapter(safe_signer, ...) — only this safe's assets
Yield AI is not a custodial exchange. Your assets remain in your wallet or within the personal safes you control.