← Back to home

AgentKit Aave

Added Aave actions support to the AgentKit [PR Contribution]

Problem Statement

The Aave Action Provider integrates Aave V3 lending protocol with AgentKit, enabling AI agents to perform DeFi operations through natural language commands. Currently supports Base network operations for USDC and ETH. Using Aave sdk for protocol interactions and agentkit chatbot for interacting with the ai agent.

Solution

Aave Action Provider for AgentKitOverviewThe Aave Action Provider integrates Aave V3 lending protocol with AgentKit, enabling AI agents to perform DeFi operations through natural language commands. Currently supports Base network operations for USDC and ETH.File Structureagentkit/src/action-providers/aave/ ├── aaveActionProvider.ts # Main provider implementation ├── aaveActionProvider.test.ts # Test suite ├── constants.ts # Protocol addresses & configs ├── schemas.ts # Zod validation schemas └── index.ts # Public exportsCore FeaturesSupply Action@CreateAction({ name: "supply", description: "Supply assets to Aave protocol", schema: SupplySchema, })Supports USDC and ETH depositsHandles token approvals automaticallyConverts human amounts to protocol unitsWithdraw Action@CreateAction({ name: "withdraw", description: "Withdraw assets from Aave protocol", schema: WithdrawSchema, })Supports USDC and ETH withdrawalsVerifies aToken balancesManages gas optimizationIntegration Example// examples/langchain-cdp-chatbot/test-aave.ts const agent = new Agent({ actionProviders: [new AaveActionProvider()], }); // Natural language command const result = await agent.chat(` Supply 100 USDC to Aave on Base network `);Technical DetailsDependencies@aave/contract-helpers: Protocol interactions@bgd-labs/aave-address-book: Contract addressesethers: Web3 providerviem: Amount handlingError HandlingBalance verificationNetwork validationTransaction failuresApproval errorsTestingMocked provider interactionsSuccess and failure scenariosBalance checksNetwork validationUsage in AgentKit// agentkit/src/index.ts export { AaveActionProvider } from './action-providers/aave'; // In your agent import { AaveActionProvider } from 'agentkit';Environment Setup# examples/langchain-cdp-chatbot/.env PROVIDER_URL=https://mainnet.base.org WALLET_KEY=your_private_keyCurrent LimitationsBase network onlyUSDC and ETH supportSingle position managementFuture EnhancementsMulti-network supportAdditional assetsPosition optimizationCollateral managementThis integration enables AI agents to interact with Aave through a secure, type-safe interface while maintaining protocol-level safety checks.

Hackathon

Agentic Ethereum

2025

Prizes

  • 🏆

    AgentKit Pool Prize

    Coinbase Developer Platform

Contributors