Skip to content

feat(aave-v3): ship UiPoolDataProvider + PoolAddressesProvider addresses (+ ABI) for reserve-config reads #19

Description

@chrisli30

Summary

Ship the Aave V3 UiPoolDataProvider + PoolAddressesProvider addresses (per chain) and their ABIs in @avaprotocol/protocols, so a consumer can read the whole market's per-reserve risk config + prices, and a user's per-reserve supply/debt, in ~2 calls. This is what the Aave UI uses (getReservesData(addressesProvider) / getUserReservesData(addressesProvider, user)).

Context

Studio is building an Aave Health-Factor top-up solver (guardian shadow mode): given a wallet near liquidation, compute "supply $X of asset Y → HF Z" (and the repay equivalent). That math needs, per candidate reserve:

  • liquidationThreshold, ltv, usageAsCollateralEnabled, isActive / isFrozen / isPaused
  • the user's per-reserve supplied balance + variable/stable debt + collateral flags

Today the SDK ships aaveV3.pool, aaveV3.oracle, poolEventsAbi / poolMethodsAbi, and the aaveV3.reserves catalog ({ symbol, underlying, aToken, decimals }). There is no data-provider address and no per-reserve risk config — so the config has to be read on-chain by the consumer.

Ask

  1. Add aaveV3.uiPoolDataProvider and aaveV3.poolAddressesProvider as per-chain address maps (same shape as aaveV3.pool / aaveV3.oracle).
  2. Ship the ABI fragments for UiPoolDataProvider.getReservesData(provider) and getUserReservesData(provider, user) (or extend poolMethodsAbi with getConfiguration(asset) / getUserConfiguration(user) / getReserveData(asset)).
  3. (Nice-to-have) Export the ReserveConfigurationMap bit-layout constants (LTV bits 0–15, liqThreshold 16–31, decimals 48–55, active 56, frozen 57, borrowing 58, paused 60, …) so consumers don't re-hardcode the bitmask decode.

Explicit non-goal (important)

Do NOT bake ltv / liquidationThreshold / usageAsCollateralEnabled VALUES into the static AaveV3Reserve catalog. These are governance-mutable and HF-critical — a stale bake produces wrong solver math. Ship the address to read from, not the values; the live read stays in the consumer. The existing AaveV3Reserve list ({symbol, underlying, aToken, decimals}) can stay static as-is.

Priority / interim

Not a blocker. Studio v1 reads config live off Pool.getConfiguration(asset) / Pool.getUserConfiguration(user) (the Pool address is already in the SDK) and decodes the bitmask itself — N calls for the small candidate set. This issue is the scale optimization (fewer round-trips + a whole-market sweep + oracle prices in one place), to adopt once volume justifies it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions