BGD. Release - Aave Address Book


We have released the Aave Address Book, a library containing all the important addresses of the Aave ecosystem as easy-to-consume constants.

Current state

We have been supporting quite some governance proposal creations in the past and observed that there’s a part that all these proposals have in common: they need to lookup addresses for the addresses provider they are targeting and either hardcode or fetch the oracle, configurator, … within their proposals.

This is a cumbersome task so we set out to ease the pain - which is where the Aave Address Book begins to shine :rainbow:

Address book

As most addresses we regularly work with are immutable for a market, it’s only reasonable to persist them in a library so it’s easily consumable by developers.

The library consists out of a generator that will generate market-specific libraries for every registered market. The generator will also generate generic library allowing you to easily interact with multiple markets at once.

Market library

Market-specific libraries all follow a similar pattern and provide constants which developers can easily consume in their projects. They also provide a getToken(symbol) function which will return a Token struct containing the aToken, stableDebtToken, variableDebtToken and underlying token addresses.

library AaveV2Ethereum {
    ILendingPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER =

    ILendingPool internal constant POOL =

    ILendingPoolConfigurator internal constant POOL_CONFIGURATOR =

    IAaveOracle internal constant ORACLE =

    IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER =

    address internal constant POOL_ADMIN =

    address internal constant EMERGENCY_ADMIN =

    function getToken(string calldata symbol)
        returns (Token memory m)

Generic library

The generic library is best suited for tests & test helpers as using it might increase codeside and deployment cost. That said it behaves very similar to the Market libraries with the difference of not exporting constants, but providing a getMarket(marketName) and getToken(marketName, symbol) getter.


To demonstrate usage we added the address book to the v2-token-listing-template which resulted in boilerplate reduction feat: address book by sakulstra · Pull Request #1 · bgd-labs/example-aave-v2-listing · GitHub and even in small deployment cost reduction from 483918 to 480725.

In the actual payload we’ve been using AaveV2Ethereum to archive smallest possible overhead, while in the helpers we’ve been using the generic AaveAddressBookV2 entrypoint so they are easily reusable for any market & network.

Here’s a excerpt to highlight how easy this library can be used:

Token memory ens = AaveV2Ethereum.getToken('ENS');
AaveV2Ethereum.POOL_CONFIGURATOR.enableBorrowingOnReserve(ens.underlyingAsset, false);

In these two lines we managed to disable borrowing on ENS without looking up a single address.

Next steps

We are quite happy with what we have so far, but there’s obviously more that can be abstracted and reused in the ecosystem.

Therefore we plan to release some higher-level helpers like the ones used in v2-token-listing-template to help with more complex things, especially on the testing side of things.


Aave Address Book:
Usage example:


LOVE this. An address book can be very useful for a range of participants - developers, users, and inquisitive minds, sorting and aggregating the madness of numbers with some sort of organization.

As a data company, we applaud and urge further development of up-to-date resources such as this. It leads to powerful labels and tags that everyday analysts can use to learn more about Aave.

1 Like