feat: AAVE V3 reserve catalog (aaveV3.reserves)#15
Merged
Conversation
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>
There was a problem hiding this comment.
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 writesrc/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.
| * Generated from chain via `scripts/generate-aave-reserves.ts` | ||
| * (Pool.getReservesList + Pool.getReserveData + ERC-20 metadata). | ||
| */ | ||
| export interface AaveV3Reserve { |
Comment on lines
+133
to
+134
| expect(reserve.decimals).toBeGreaterThan(0); | ||
| expect(reserve.symbol.length).toBeGreaterThan(0); |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-20symbol/decimals), run withyarn 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 (theaToken) without an on-chain round-trip. First consumer: a studio AAVE supply-token picker + live health-factor settings field.Changes
src/protocols/types.ts—AaveV3Reserve/AaveV3ReservesByChaintypessrc/protocols/aave-v3-reserves.ts— generated data (do not hand-edit)src/protocols/aave-v3.ts— exposesaaveV3.reservesscripts/generate-aave-reserves.ts+generate:aave-reservesscripttests/catalog.test.ts— 3 reserve tests (60 pass total)Verified: Sepolia LINK's
underlyingmatches the existingaaveV3.tokens.LINK[Sepolia]and now carries its aToken;yarn build+typecheckclean.🤖 Generated with Claude Code