Skip to main content

Key features

MetaVault AI combines cutting-edge AI agent technology with battle-tested DeFi protocols to deliver a vault that actively manages your capital.

Autonomous strategy monitoring

The Strategy Sentinel agent continuously monitors vault health without human intervention.

Real-time health checks

  • Strategy balances: Tracks deposited amounts, borrowed positions, and net exposure
  • Loan-to-Value (LTV) monitoring: Calculates current LTV ratio for leveraged positions
  • Liquidation risk detection: Identifies positions approaching danger zones
  • Price tracking: Fetches live LINK and WETH prices from CoinGecko API

Intelligent alerting

The agent evaluates multiple risk factors:
  • LTV exceeding 70% threshold
  • Rapid price movements (>10% change)
  • Divergence from target allocations
  • Low buffer to liquidation threshold
  • Excessive leverage ratios
The Strategy Sentinel uses rule-based decision logic, not guesses. All actions are based on on-chain data and real market prices.

Dynamic risk management

MetaVault AI actively manages risk through multiple mechanisms.

Automatic deleveraging

When liquidation risk is detected, the system automatically reduces leverage:
  1. Withdraw LINK collateral from Aave
  2. Swap LINK → WETH via Uniswap
  3. Repay WETH debt
  4. Repeat until LTV is safe

Leverage parameter tuning

The Strategy Sentinel can adjust leverage aggressiveness based on market conditions: Parameters:
  • maxDepth (1-6): Number of leverage loops
  • borrowFactor (0-8000 bps): Percentage to borrow per loop
  • paused (bool): Emergency pause flag
Adjustment strategy:
  • High volatility → reduce maxDepth and borrowFactor
  • Stable markets → maintain or increase parameters
  • Extreme risk → set paused = true

Strategy pause mechanism

The leverage strategy can be paused instantly to prevent new risky investments:

Intelligent portfolio rebalancing

MetaVault AI maintains optimal allocation across strategies based on risk profile and market conditions.

Target weight management

Default allocation:
  • Leverage strategy: 80% (high yield, high risk)
  • Aave safe strategy: 20% (stable yield, low risk)
The Strategy Sentinel can adjust these weights dynamically:

Automatic rebalancing

The rebalance() function reallocates funds to match target weights:
  1. Calculate total managed assets
  2. Pull excess from overweight strategies
  3. Push funds to underweight strategies
  4. Update bookkeeping

Rebalancing triggers

The agent triggers rebalancing when:
  • Allocation drift exceeds 5%
  • Market conditions change significantly
  • New deposits increase vault balance
  • After updating target weights

Automated yield harvesting

The vault automatically compounds profits back into strategies.

Harvest mechanism

Each strategy implements a harvest() function:

Performance fee application

The vault takes a configurable performance fee on harvested profits:

Harvest all strategies

The router can harvest all strategies in a single transaction:

Natural language interface

The Chat agent provides an intuitive way to interact with the vault.

User-friendly commands

Users can chat naturally:
  • “What’s my balance?”
  • “Deposit 10 LINK”
  • “Show me the current APY”
  • “Withdraw all my funds”
  • “How much is LINK worth?”

Smart transaction preparation

The agent handles the complex approval flow:
  1. Check if user has approved LINK spending
  2. If not, prepare approval transaction
  3. After approval, prepare deposit transaction
  4. Return unsigned transactions for wallet signature

Privacy and security

The Chat agent enforces strict boundaries:
  • Only accesses data for the requesting user’s wallet
  • Never exposes admin functions (rebalance, harvest, risk parameters)
  • Cannot view other users’ balances or positions
  • Returns only public vault information (total assets, APY)
The Chat agent responds in JSON format for transactional operations, making it easy to integrate with frontend wallets.

Transparent performance tracking

Every user can track their individual performance.

User growth calculation

The vault maintains detailed accounting:

Share-based accounting

The vault uses ERC20 shares for fair profit distribution:
  • New deposits receive shares at current price
  • Yields increase total assets, raising share price
  • Withdrawals burn shares at current price
  • All users benefit proportionally from yields

Built with ADK-TS

MetaVault AI showcases the power of the Agent Development Kit for TypeScript.

Key ADK-TS features used

Conversation orchestration:
  • Session memory across interactions
  • Context state management for caching APY updates
  • Tool response formatting and guidance
TypeScript integration:
  • Fully typed agent logic and tools
  • Seamless Next.js/React integration
  • Developer-friendly experience
Modular architecture:

Benefits of ADK-TS

  1. Reduced complexity: Frontend doesn’t need complex state management
  2. Type safety: Compile-time checks for agent logic and tools
  3. Tool orchestration: Structured calling conventions and error handling
  4. Conversation memory: Agents remember context across messages
  5. Modular design: Easy to add new specialized agents

Error handling and safety

MetaVault AI includes comprehensive error handling.

Strategy operation safety

All strategy operations use try-catch blocks:

Withdrawal protection

The vault ensures users can always withdraw (if liquidity exists):

Leverage safety mechanisms

The leverage strategy includes multiple safeguards:
  • Maximum depth capped at 6 iterations
  • Borrow factor limited to 80% (8000 bps)
  • Conservative borrowing based on pool liquidity
  • Automatic loop breaking on swap failures
  • Try-catch on all Aave interactions

Next steps

Getting started

Set up and run MetaVault AI locally

API reference

Explore smart contract interfaces and agent tools