Skip to content

feat: AAVE V3 reserve catalog (aaveV3.reserves)#15

Merged
chrisli30 merged 2 commits into
mainfrom
feat/aave-v3-reserves
Jun 9, 2026
Merged

feat: AAVE V3 reserve catalog (aaveV3.reserves)#15
chrisli30 merged 2 commits into
mainfrom
feat/aave-v3-reserves

Conversation

@chrisli30

Copy link
Copy Markdown
Member

What

Adds aaveV3.reserves — a per-chain catalog of every AAVE V3 reserve as { symbol, underlying, aToken, variableDebtToken, decimals }.

Generated from chain via scripts/generate-aave-reserves.ts (Pool.getReservesList + Pool.getReserveData + ERC-20 symbol/decimals), run with yarn generate:aave-reserves. Pool addresses come from the catalog itself (aaveV3.pool), keeping a single source of truth.

Coverage: Ethereum (66), Base (15), BNB (8), Sepolia (9), Base Sepolia (6) — 104 reserves.

Why

Enables UIs to present the list of tokens a user can supply as AAVE collateral (the underlying) and the receipt token they receive (the aToken) without an on-chain round-trip. First consumer: a studio AAVE supply-token picker + live health-factor settings field.

Changes

  • src/protocols/types.tsAaveV3Reserve / AaveV3ReservesByChain types
  • src/protocols/aave-v3-reserves.ts — generated data (do not hand-edit)
  • src/protocols/aave-v3.ts — exposes aaveV3.reserves
  • scripts/generate-aave-reserves.ts + generate:aave-reserves script
  • tests/catalog.test.ts — 3 reserve tests (60 pass total)
  • changeset (minor)

Verified: Sepolia LINK's underlying matches the existing aaveV3.tokens.LINK[Sepolia] and now carries its aToken; yarn build + typecheck clean.

🤖 Generated with Claude Code

Per-chain underlying -> aToken / variableDebtToken / decimals for every
AAVE V3 reserve, generated from chain (Pool.getReservesList +
getReserveData + ERC-20 metadata) via scripts/generate-aave-reserves.ts.
Covers Ethereum, Base, BNB, Sepolia, Base Sepolia (104 reserves).

Lets consumers build AAVE supply-token pickers (underlying -> aToken
receipt) without an on-chain round-trip. Adds AaveV3Reserve /
AaveV3ReservesByChain types, catalog tests, and a changeset (minor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an AAVE V3 “reserve catalog” to the protocol constants package so consumers (especially UIs) can list supplyable assets and their corresponding Aave-issued receipt/debt tokens without additional on-chain lookups. This fits into the existing Protocols.* data-only catalog by extending Protocols.aaveV3 with a generated, per-chain reserve list.

Changes:

  • Add aaveV3.reserves (generated per-chain list of { symbol, underlying, aToken, variableDebtToken, decimals }).
  • Add a generator script (yarn generate:aave-reserves) to fetch reserves from each chain’s AAVE V3 Pool and write src/protocols/aave-v3-reserves.ts.
  • Add integrity tests covering presence and basic shape/consistency of the new reserve catalog.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/catalog.test.ts Adds tests asserting reserve lists exist and reserve entries have valid shapes.
src/protocols/types.ts Introduces AaveV3Reserve and AaveV3ReservesByChain type definitions.
src/protocols/aave-v3.ts Exposes the generated reserves catalog as aaveV3.reserves.
src/protocols/aave-v3-reserves.ts Generated per-chain reserve data.
scripts/generate-aave-reserves.ts Generator that queries Pools + ERC-20 metadata and renders the generated TS file.
package.json Adds generate:aave-reserves script entry.
.changeset/aave-v3-reserves.md Declares a minor release for the new reserve catalog API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/protocols/types.ts
* Generated from chain via `scripts/generate-aave-reserves.ts`
* (Pool.getReservesList + Pool.getReserveData + ERC-20 metadata).
*/
export interface AaveV3Reserve {
Comment thread tests/catalog.test.ts Outdated
Comment on lines +133 to +134
expect(reserve.decimals).toBeGreaterThan(0);
expect(reserve.symbol.length).toBeGreaterThan(0);
Comment thread src/protocols/aave-v3.ts
Comment on lines +241 to +247
/**
* Per-chain reserve catalog: every AAVE V3 reserve as
* `{ symbol, underlying, aToken, variableDebtToken, decimals }`. Drives
* supply-token pickers (the `underlying` is what users supply; `aToken`
* is the receipt they get). Generated from chain — see
* `scripts/generate-aave-reserves.ts` / `aave-v3-reserves.ts`.
*/
…arify doc)

- re-export AaveV3Reserve / AaveV3ReservesByChain from the package entrypoint
  so consumers can import them by name (matches AbiFragment / AddressByChain)
- catalog test: ERC-20 decimals is a uint8 — allow 0; validate integer 0..255
- aaveV3.reserves doc: clarify it is a Partial map over the covered chains

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chrisli30 chrisli30 merged commit 88236bb into main Jun 9, 2026
6 checks passed
@chrisli30 chrisli30 deleted the feat/aave-v3-reserves branch June 9, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants