feat: AAVE V3 reserve-config reads (provider addrs + ABI + bit maps)#20
Conversation
…oolAddressesProvider addresses + config-read ABI + bit layouts) Adds the addresses and ABI a health-factor / liquidation solver needs to read AAVE V3 per-reserve risk config and a user's per-reserve position, per issue #19 (the scale optimization). - aaveV3.poolAddressesProvider + aaveV3.uiPoolDataProvider per-chain maps (Mainnet, Sepolia, Base, Base Sepolia, BNB). PoolAddressesProvider addresses verified on-chain (getPool() == catalog pool); UiPoolDataProvider verified as deployed bytecode. - Extend poolMethodsAbi with the version-stable Pool config reads getConfiguration(asset) / getUserConfiguration(user) / getReserveData(asset). - Export reserveConfigurationBits + userConfigurationBits (ReserveConfigurationMap / UserConfigurationMap bit layouts) so consumers decode the bitmaps without hardcoding offsets. Only version-stable low bits (0-167) are exported. Non-goal (issue #19): governance-mutable, HF-critical values are NOT baked into the static AaveV3Reserve catalog -- ship the address to read from, not the value. The UiPoolDataProvider return-struct ABI is intentionally omitted because that tuple is periphery-version-specific and already differs across covered chains (Ethereum/Base/BNB/Base Sepolia return the v3.3 layout, Sepolia an earlier one); pair the address with a version-aware ABI at the call site. A test guards the reserve catalog against a stale LTV/liqThreshold bake. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds Aave V3 “scale-optimization” read support to the catalog by shipping the additional per-chain provider addresses, the stable Pool ABI fragments needed for per-reserve/user configuration reads, and exported bitmap layouts so consumers can decode Aave’s config maps without hardcoding offsets.
Changes:
- Add per-chain
aaveV3.poolAddressesProviderandaaveV3.uiPoolDataProvideraddress maps for all currently covered chains. - Extend
aaveV3.poolMethodsAbiwith version-stable read methods:getConfiguration(asset),getUserConfiguration(user), andgetReserveData(asset). - Export
aaveV3.reserveConfigurationBitsandaaveV3.userConfigurationBits, and add tests/docs to ensure correct decoding and prevent baking governance-mutable risk params into the static reserves catalog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/catalog.test.ts |
Adds coverage for new ABI fragments, provider address presence across chains, bitmap decode helpers, and a guard against baking mutable risk values into the static reserves catalog. |
src/protocols/aave-v3.ts |
Introduces provider address maps, extends Pool method ABI with stable config reads, and exports Reserve/User configuration bitmap layouts. |
README.md |
Documents how to read/decode reserve risk config and clarifies provider usage and ABI/versioning expectations. |
.changeset/aave-v3-data-provider-addresses.md |
Publishes a minor release note describing the new Aave V3 read surface and non-goals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Audit vs #19 (and the repay follow-up, studio#1369) — LGTM, this over-deliversChecked against the issue's asks:
Two calls I especially like:
It also closes the repay path (studio#1369), not just the collateral solver. Studio-side follow-up (FYI): once this lands + bumps, studio's Two minor heads-ups (non-blocking):
Ready to merge from studio's side — I'll wire studio onto it after the version bump. |
…ode HF caveat Addresses non-blocking review heads-ups on PR #20: - Note in the getReserveData ABI comment that stableDebtTokenAddress is deprecated (zero on V3.1+ markets); consumers repay via variableDebtTokenAddress. - Add a README caveat that liquidationThreshold alone underspecifies collateral in isolation-mode / eMode cases (those bits are intentionally omitted from the version-stable low-bit map), so a top-up solver should also read the user collateral flags and the market contracts for those bits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds the addresses and ABI a health-factor / liquidation solver needs to
read AAVE V3 per-reserve risk config and a user's per-reserve position,
per issue #19 (the scale optimization).
(Mainnet, Sepolia, Base, Base Sepolia, BNB). PoolAddressesProvider
addresses verified on-chain (getPool() == catalog pool); UiPoolDataProvider
verified as deployed bytecode.
getConfiguration(asset) / getUserConfiguration(user) / getReserveData(asset).
/ UserConfigurationMap bit layouts) so consumers decode the bitmaps without
hardcoding offsets. Only version-stable low bits (0-167) are exported.
Non-goal (issue #19): governance-mutable, HF-critical values are NOT baked into
the static AaveV3Reserve catalog -- ship the address to read from, not the value.
The UiPoolDataProvider return-struct ABI is intentionally omitted because that
tuple is periphery-version-specific and already differs across covered chains
(Ethereum/Base/BNB/Base Sepolia return the v3.3 layout, Sepolia an earlier one);
pair the address with a version-aware ABI at the call site. A test guards the
reserve catalog against a stale LTV/liqThreshold bake.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code