AgentKit Aave

Added Aave actions support to the AgentKit [PR Contribution]

Agentic EthereumShipped January 31, 2025Prize winner#ai-agents#ai#defi#payments#infra#base
Visit Repo
AgentKit Aave banner

About

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.

How it's made

# Aave Action Provider for AgentKit

## Overview

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.

## File Structure

```

agentkit/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 exports

```

## Core Features

### Supply Action

```typescript

@CreateAction({

name: "supply",

description: "Supply assets to Aave protocol",

schema: SupplySchema,

})

```

  • Supports USDC and ETH deposits
  • Handles token approvals automatically
  • Converts human amounts to protocol units

### Withdraw Action

```typescript

@CreateAction({

name: "withdraw",

description: "Withdraw assets from Aave protocol",

schema: WithdrawSchema,

})

```

  • Supports USDC and ETH withdrawals
  • Verifies aToken balances
  • Manages gas optimization

## Integration Example

```typescript

// 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 Details

### Dependencies

  • @aave/contract-helpers: Protocol interactions
  • @bgd-labs/aave-address-book: Contract addresses
  • ethers: Web3 provider
  • viem: Amount handling

### Error Handling

  • Balance verification
  • Network validation
  • Transaction failures
  • Approval errors

### Testing

  • Mocked provider interactions
  • Success and failure scenarios
  • Balance checks
  • Network validation

## Usage in AgentKit

```typescript

// agentkit/src/index.ts

export { AaveActionProvider } from './action-providers/aave';

// In your agent

import { AaveActionProvider } from 'agentkit';

```

## Environment Setup

```env

# examples/langchain-cdp-chatbot/.env

PROVIDER_URL=https://mainnet.base.org

WALLET_KEY=your_private_key

```

## Current Limitations

  • Base network only
  • USDC and ETH support
  • Single position management

## Future Enhancements

  • Multi-network support
  • Additional assets
  • Position optimization
  • Collateral management

This integration enables AI agents to interact with Aave through a secure, type-safe interface while maintaining protocol-level safety checks.

Prizes

  • Coinbase Developer Platform · AgentKit Pool Prize · AgentKit Pool Prize

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

LendingKit

Aotomatically onchain payment and borrowing functionality with AgentKit and AAVE. Not only onchain payment, but also provide natural language borrowing experience while being advised by your financial AI assistance.

Ailfred

Ailfred: Your Personal DeFi Butler - An AI Agent that Makes Web3 Investing Sophisticated Yet Simple

AgentSwap

An AI-powered autonomous agent using AgentKit to execute DeFi actions like swaps, lending, staking, and yield farming. Integrated with the CDP SDK for seamless onchain interactions, it optimizes strategies and automates portfolio management in real time