Skip to content

feat: add Aave V3 action provider (supply/withdraw)#1378

Open
Stakemate369 wants to merge 1 commit into
coinbase:mainfrom
Stakemate369:feat/aave-v3-action-provider
Open

feat: add Aave V3 action provider (supply/withdraw)#1378
Stakemate369 wants to merge 1 commit into
coinbase:mainfrom
Stakemate369:feat/aave-v3-action-provider

Conversation

@Stakemate369

Copy link
Copy Markdown

Summary

Adds an AaveActionProvider for supplying/withdrawing ERC-20 reserves on the Aave V3 Pool contract, on Base mainnet and Base Sepolia. Closes #323.

A previous attempt at this (#326) got closed without merging — the reviewer's main concern was that it pulled in @aave/contract-helpers, which depends on ethers-v5, inconsistent with the rest of AgentKit's viem-based wallet providers (see the PR review and the follow-up discussion on #323).

This version talks to the Pool contract directly via a minimal ABI (only supply/withdraw) using viem — the same pattern the built-in MorphoActionProvider and CompoundActionProvider already use — so it adds zero new dependencies.

What's included

  • constants.ts — Aave V3 Pool proxy addresses per network (sourced from bgd-labs/aave-address-book, cross-checked against BaseScan's verified "Aave: Pool Proxy Base" contract) + a minimal IPool ABI
  • schemas.ts — Zod schemas for supply/withdraw
  • aaveActionProvider.tssupply and withdraw actions; decimals are read dynamically from the asset's own ERC-20 contract (via viem's erc20Abi) rather than hardcoded, so any Aave V3 reserve is supported, not just USDC
  • aaveActionProvider.test.ts — 13 unit tests: successful supply/withdraw, zero-amount rejection, unsupported network, approval failure, transaction errors
  • README.md for the new provider folder
  • Registered in action-providers/index.ts
  • Changeset added

Scope

This initial version covers ERC-20 reserves only (no native ETH via WETHGateway) — keeping the surface area minimal and directly verifiable against the standard IPool interface. Happy to extend it in a follow-up if there's interest.

Test plan

  • pnpm build — clean
  • pnpm lint (scoped to src/action-providers/aave) — clean
  • pnpm test (scoped to src/action-providers/aave) — 13/13 passing
  • The underlying supply/withdraw calldata (same IPool.supply/IPool.withdraw ABI) has been exercised against Base mainnet with real funds in a separate project, so the contract interaction itself is field-tested, not just unit-tested against a mock.

Adds AaveActionProvider for supplying/withdrawing ERC-20 reserves on the
Aave V3 Pool contract (Base mainnet + Base Sepolia).

Closes coinbase#323. A previous attempt at this (coinbase#326) stalled and was closed
because it pulled in @aave/contract-helpers, which depends on ethers-v5 —
inconsistent with AgentKit's viem-based wallet providers. This version
talks to the Pool contract directly via a minimal ABI (supply/withdraw
only), the same pattern already used by the built-in Morpho and Compound
action providers, so it adds zero new dependencies.

- constants.ts: Pool proxy addresses (sourced from bgd-labs/aave-address-book,
  cross-checked against BaseScan) + minimal IPool ABI
- schemas.ts: Zod schemas for supply/withdraw
- aaveActionProvider.ts: supply/withdraw actions, decimals read dynamically
  via the standard ERC-20 abi (viem's erc20Abi), matching the Morpho provider
- 13 unit tests covering success paths, zero-amount rejection, unsupported
  network, approval failure, and transaction errors

Verified: pnpm build, pnpm lint (scoped), and pnpm test all pass clean for
this package.
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

Aave v3 Action provider

2 participants