Protocols / Lending
Aave V2
The previous generation Aave lending market, still holding funds on Ethereum, Avalanche and Polygon. An agent can supply assets to earn aTokens, withdraw them, borrow against collateral and repay debt. New activity is better done on Aave V3.
On-chainEVM4 contractsWebsite · Docs
get_protocol({ "protocol": "aave-v2" })Risks an agent should know
- Aave V2 is the legacy market. Aave points new users to V3, and V2 receives fewer updates. Check the Aave announcements before using it.
- Positions can be liquidated if the health factor falls below 1. Keep a margin above 1 and check it after each borrow or price move.
- Stable rate borrowing exists on V2 but is only available on some reserves. Check the reserve configuration first.
- Aave governance and its guardians can freeze reserves or pause the market.
- The Pool is an upgradeable proxy. Its implementation can change through governance.
What an agent can do
| supply | Deposit an asset to earn interest approve the Pool for the amount, then Pool.deposit(asset, amount, onBehalfOf, 0); aTokens are minted to onBehalfOf |
| withdraw | Withdraw a supplied asset Pool.withdraw(asset, amount, to); pass type(uint256).max to withdraw the full balance |
| borrow | Borrow against collateral check getUserAccountData(user).healthFactor first, then Pool.borrow(asset, amount, 2, 0, onBehalfOf) for variable rate (or 1 for stable where enabled) |
| repay | Repay a borrow approve the Pool for the amount, then Pool.repay(asset, amount, rateMode, onBehalfOf); use type(uint256).max to clear the debt |
| toggle-collateral | Enable or disable a supplied asset as collateral Pool.setUserUseReserveAsCollateral(asset, true or false) |
| check-position | Read collateral, debt and health factor Pool.getUserAccountData(user); healthFactor below 1e18 means liquidatable |
Contracts
ethereum · chain id 1
| Contract | Address | Key functions | Try |
|---|---|---|---|
| LendingPool (Ethereum main market) pool · proxy | 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9 source | writedeposit(address,uint256,address,uint16) writewithdraw(address,uint256,address) writeborrow(address,uint256,uint256,uint16,address) writerepay(address,uint256,uint256,address) writesetUserUseReserveAsCollateral(address,bool) writeswapBorrowRateMode(address,uint256) readgetUserAccountData(address) readgetReserveData(address) +1 more via get_protocol | Full ABI |
| AaveProtocolDataProvider (Ethereum) other | 0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d source | readgetAllReservesTokens() readgetUserReserveData(address,address) readgetReserveConfigurationData(address) | Full ABI |
avalanche · chain id 43114
| Contract | Address | Key functions | Try |
|---|---|---|---|
| LendingPool (Avalanche main market) pool · proxy | 0x4F01AeD16D97E3aB5ab2B501154DC9bb0F1A5A2C source | writedeposit(address,uint256,address,uint16) writewithdraw(address,uint256,address) writeborrow(address,uint256,uint256,uint16,address) writerepay(address,uint256,uint256,address) readgetUserAccountData(address) | Full ABI |
polygon · chain id 137
| Contract | Address | Key functions | Try |
|---|---|---|---|
| LendingPool (Polygon main market) pool · proxy | 0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf source | writedeposit(address,uint256,address,uint16) writewithdraw(address,uint256,address) writeborrow(address,uint256,uint256,uint16,address) writerepay(address,uint256,uint256,address) readgetUserAccountData(address) | Full ABI |
Notes
Addresses come from Aave's bgd-labs address book (AaveV2Ethereum.sol, AaveV2Avalanche.sol, AaveV2Polygon.sol), which links each address to its block explorer page. On Ethereum, the pool proxy, its implementation (0x02D84abD89Ee9DB409572f19B6e1596c301F3c81, verified on Sourcify, source of the function signatures above) and the data provider were checked on chain. The Avalanche and Polygon pool proxies and data providers have code on chain, but their implementations were not checked on Sourcify, so their function lists assume the same V2 interface as Ethereum. The pool proxies are upgradeable, so read the current Pool from the LendingPoolAddressesProvider (Ethereum 0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5, Avalanche 0xb6A86025F0FE1862B372cb0ca18CE3EDe02A318f, Polygon 0xd05e3E715d945B59290df0ae8eF85c1BdB684744) if you need to confirm the address at run time.
Sources
- https://raw.githubusercontent.com/bgd-labs/aave-address-book/main/src/AaveV2Ethereum.sol
- https://raw.githubusercontent.com/bgd-labs/aave-address-book/main/src/AaveV2Avalanche.sol
- https://raw.githubusercontent.com/bgd-labs/aave-address-book/main/src/AaveV2Polygon.sol
- https://github.com/bgd-labs/aave-address-book
- https://sourcify.dev/server/v2/contract/1/0x02D84abD89Ee9DB409572f19B6e1596c301F3c81?fields=abi
- https://sourcify.dev/server/v2/contract/1/0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d?fields=abi
- https://aave.com/docs
- https://api.llama.fi/protocol/aave-v2
Researched 2026-11-28. Addresses are copied from the official sources above; check them before moving large amounts.