
Aave V3 Core
- 8 installs
- 4 repo stars
- Updated February 25, 2026
- hairyf/blockchain-master
Integrate Aave Protocol V3 core contracts: Pool supply/borrow/repay/liquidate, flash loans, addresses provider, eMode, and isolation mode.
About
A reference for Aave V3 core interfaces centered on IPool, DataTypes bitmaps, flash loans, and the addresses provider. A developer uses it when building on or integrating with Aave V3 lending markets.
- Covers IPool actions, flashLoan vs flashLoanSimple, and IPoolAddressesProvider lookups
- Documents eMode/isolation risk modes and @aave/core-v3 integration patterns
Aave V3 Core by the numbers
- 8 all-time installs (skills.sh)
- Ranked #326 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
- Data as of Jul 13, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hairyf/blockchain-master --skill aave-v3-coreAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 8 |
|---|---|
| repo stars | ★ 4 |
| Last updated | February 25, 2026 |
| Repository | hairyf/blockchain-master ↗ |
What it does
Integrate Aave Protocol V3 core contracts: Pool supply/borrow/repay/liquidate, flash loans, addresses provider, eMode, and isolation mode.
Files
Skill based on Aave V3 Core (contracts as of 2026-02-09), generated from sources/aave-v3. Note: repo is deprecated; latest V3 lives at aave-dao/aave-v3-origin. This skill still applies to the core interfaces and patterns.Aave V3 is a decentralized liquidity market: supply assets to earn yield, borrow over- or under-collateralized. Core entry is IPool (supply, withdraw, borrow, repay, liquidation, flash loans). Use IPoolAddressesProvider to get Pool and oracle/configurator addresses per market. DataTypes define reserve and user config bitmaps and structs. Flash loans use IFlashLoanReceiver / IFlashLoanSimpleReceiver. eMode and isolation mode affect LTV and which collateral can back debt.
Core References
| Topic | Description | Reference |
|---|---|---|
| Pool (IPool) | Supply, withdraw, borrow, repay, liquidation, views | core-pool |
| DataTypes | ReserveData, ReserveConfigurationMap, UserConfigurationMap, EModeCategory, InterestRateMode | core-data-types |
| Flash Loans | IFlashLoanReceiver, IFlashLoanSimpleReceiver, flashLoan vs flashLoanSimple | core-flashloan |
| Addresses Provider | getPool, getMarketId, getAddress, oracle/configurator/ACL | core-addresses-provider |
Features
Risk & Modes
| Topic | Description | Reference |
|---|---|---|
| EMode & Isolation | eMode categories, setUserEMode; isolation mode and siloed borrowing | features-emode-isolation |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| Integration | NPM @aave/core-v3, imports, permit, reading reserve/user data | best-practices-integration |
Generation Info
- Source:
sources/aave-v3 - Git SHA:
782f51917056a53a2c228701058a6c3fb233684a - Generated: 2026-02-09
Aave V3 Integration
NPM and imports
- Install:
npm install @aave/core-v3. - Solidity:
import {IPool} from "@aave/core-v3/contracts/interfaces/IPool.sol";(and same path pattern for other interfaces). - ABI/artifacts:
require('@aave/core-v3/artifacts/contracts/protocol/pool/Pool.sol/Pool.json')for ABI and bytecode.
Getting Pool address
Use the PoolAddressesProvider for the target network (address in Aave docs). Then:
address pool = IPoolAddressesProvider(provider).getPool();
IPool(pool).supply(asset, amount, onBehalfOf, referralCode);Permit (gasless approve)
- Supply:
supplyWithPermit(asset, amount, onBehalfOf, referralCode, deadline, permitV, permitR, permitS). - Repay:
repayWithPermit(asset, amount, interestRateMode, onBehalfOf, deadline, permitV, permitR, permitS).
Asset must implement EIP-2612; use EIP-712 typed data for signing off-chain.
Reading data
- User:
getUserAccountData(user)for health factor, LTV, collateral, debt (in base currency). - Reserve:
getReserveData(asset)for full state;getConfiguration(asset)for config bitmap;getReservesList()andgetReserveAddressById(id)for listing. - Normalized indices:
getReserveNormalizedIncome(asset),getReserveNormalizedVariableDebt(asset)for aToken/debt balance math if building off-chain or custom logic.
Referral and onBehalfOf
referralCode: 0 for no referrer; otherwise use program code.onBehalfOf: beneficiary of supply (receives aTokens) or of repay (debt reduced); can be same as msg.sender.
Documentation
- Technical paper: repo
techpaper/Aave_V3_Technical_Paper.pdf. - Developer docs: https://docs.aave.com/developers/.
<!-- Source references:
- sources/aave-v3/README.md
- sources/aave-v3/contracts/interfaces/IPool.sol
-->
Aave V3 PoolAddressesProvider
Central registry for a market: pool, configurator, oracle, ACL, data provider. Use it to resolve Pool and other contract addresses by market.
Usage
- Market id:
getMarketId() returns (string);setMarketId(newMarketId)(admin). - Pool:
getPool() returns (address)— main entry for supply/borrow/flash loan. - Generic:
getAddress(bytes32 id) returns (address)for any registered id. - Setters (admin):
setPoolImpl,setPoolConfiguratorImpl,setPriceOracle,setACLManager,setACLAdmin,setPriceOracleSentinel,setPoolDataProvider,setAddress(id, addr),setAddressAsProxy(id, impl).
Key getters
getPool()— Pool proxy.getPoolConfigurator()— PoolConfigurator (reserve init, config, rate strategy).getPriceOracle()— Price oracle for reserves.getACLManager()/getACLAdmin()— Access control.getPriceOracleSentinel()— L2 sequencer / circuit breaker.getPoolDataProvider()— AaveProtocolDataProvider (convenience view helpers).
Integration
Frontend or bot: get provider address for the target network (e.g. from Aave docs or deployment), then IPoolAddressesProvider(provider).getPool() to get Pool and call IPool(pool).supply/borrow/getUserAccountData(...).
<!-- Source references:
- sources/aave-v3/contracts/interfaces/IPoolAddressesProvider.sol
-->
Aave V3 DataTypes
Core structs and enums used across Pool, Configurator, and libraries. Import: import {DataTypes} from "@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol";
ReserveData
Per-reserve state: configuration (ReserveConfigurationMap), liquidityIndex, currentLiquidityRate, variableBorrowIndex, currentVariableBorrowRate, currentStableBorrowRate, lastUpdateTimestamp, id, aTokenAddress, stableDebtTokenAddress, variableDebtTokenAddress, interestRateStrategyAddress, accruedToTreasury, unbacked, isolationModeTotalDebt.
ReserveConfigurationMap
Single uint256 data bitmap. Bits (see ReserveConfiguration.sol): LTV (0–15), liquidation threshold (16–31), liquidation bonus (32–47), decimals (48–55), active/frozen/borrowing/stable borrowing/paused (56–60), borrowable in isolation, siloed borrowing, flashloan (61–63), reserve factor (64–79), borrow cap (80–115), supply cap (116–151), liquidation protocol fee (152–167), eMode category (168–175), unbacked mint cap (176–211), debt ceiling isolation (212–251). Use ReserveConfiguration library getters/setters when working in protocol code; for read-only use pool.getConfiguration(asset).
UserConfigurationMap
uint256 data: bitmap of user collateral/borrow per asset (pairs of bits per reserve). Use UserConfiguration library to decode; or use getUserAccountData(user) for aggregated metrics.
EModeCategory
ltv, liquidationThreshold, liquidationBonus, priceSource, label. Category 0 = default (volatile). eMode allows higher LTV for same-category assets.
InterestRateMode
Enum: NONE (0), STABLE (1), VARIABLE (2). Used in borrow/repay and flash loan modes (0 = no debt, 1/2 = open stable/variable debt if not repaid).
Other structs
Internal/params structs: ReserveCache, ExecuteLiquidationCallParams, ExecuteSupplyParams, ExecuteBorrowParams, ExecuteRepayParams, ExecuteWithdrawParams, FlashloanParams, FlashloanSimpleParams, ValidateBorrowParams, CalculateInterestRatesParams, InitReserveParams, etc. Used by Pool logic libraries, not typically needed for integration.
<!-- Source references:
- sources/aave-v3/contracts/protocol/libraries/types/DataTypes.sol
- sources/aave-v3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol
-->
Aave V3 Flash Loans
Uncollateralized borrow within one transaction; debt + premium must be repaid by end of callback.
Two entry points on IPool
1. flashLoan (batch): flashLoan(receiverAddress, assets[], amounts[], interestRateModes[], onBehalfOf, params, referralCode). interestRateModes: 0 = no debt if not repaid (revert), 1 = open stable debt, 2 = open variable debt for onBehalfOf. 2. flashLoanSimple (single asset): flashLoanSimple(receiverAddress, asset, amount, params, referralCode). No debt opened; must repay amount + premium or tx reverts.
Receiver interfaces
- IFlashLoanReceiver (batch): implement
executeOperation(assets[], amounts[], premiums[], initiator, params) returns (bool). Also exposeADDRESSES_PROVIDER()andPOOL(). - IFlashLoanSimpleReceiver (single): implement
executeOperation(asset, amount, premium, initiator, params) returns (bool); sameADDRESSES_PROVIDER()andPOOL().
Flow
1. User/protocol calls pool.flashLoan or pool.flashLoanSimple with receiver contract address. 2. Pool transfers assets to receiver, then calls receiver’s executeOperation. 3. In executeOperation, use the funds (arbitrage, liquidate, repay other debt, etc.), then approve Pool for amount + premium (per asset) and return true. 4. Pool pulls the approved amounts; if any shortfall or false, entire tx reverts.
Security
- Receiver must repay exactly amount + premium (and have approved Pool) before returning from
executeOperation. See Aave developer docs for reentrancy and validation patterns. - Prefer
flashLoanSimplewhen only one asset is needed; no risk of opening unintended debt.
Base contracts
Inherit FlashLoanReceiverBase or FlashLoanSimpleReceiverBase from contracts/flashloan/base/ for a pre-wired POOL and ADDRESSES_PROVIDER.
<!-- Source references:
- sources/aave-v3/contracts/interfaces/IPool.sol (flashLoan, flashLoanSimple)
- sources/aave-v3/contracts/flashloan/interfaces/IFlashLoanReceiver.sol
- sources/aave-v3/contracts/flashloan/interfaces/IFlashLoanSimpleReceiver.sol
- sources/aave-v3/README.md
-->
Aave V3 Pool (IPool)
Main entry for liquidity: supply/withdraw, borrow/repay, liquidate, flash loans. Get pool and user state via view functions.
Usage
- Supply:
supply(asset, amount, onBehalfOf, referralCode)orsupplyWithPermit(...)for gasless approve. - Withdraw:
withdraw(asset, amount, to); usetype(uint256).maxto withdraw full aToken balance. - Borrow:
borrow(asset, amount, interestRateMode, referralCode, onBehalfOf).interestRateMode: 1 = Stable, 2 = Variable. - Repay:
repay(asset, amount, interestRateMode, onBehalfOf), orrepayWithPermit(...), orrepayWithATokens(asset, amount, interestRateMode)to repay with aTokens. - Collateral:
setUserUseReserveAsCollateral(asset, useAsCollateral). - Liquidate:
liquidationCall(collateralAsset, debtAsset, user, debtToCover, receiveAToken)when health factor < 1. - Rates:
swapBorrowRateMode(asset, interestRateMode);rebalanceStableBorrowRate(asset, user)(when conditions allow).
Key view functions
getUserAccountData(user)→ totalCollateralBase, totalDebtBase, availableBorrowsBase, currentLiquidationThreshold, ltv, healthFactor.getReserveData(asset)→ fullReserveData(configuration, aToken/stableDebt/variableDebt addresses, rates, liquidity index, etc.).getConfiguration(asset)→ReserveConfigurationMap.getUserConfiguration(user)→UserConfigurationMap(bitmap of collateral/borrow per reserve).getReservesList()→ list of underlying asset addresses;getReserveAddressById(id)for id → asset.getReserveNormalizedIncome(asset),getReserveNormalizedVariableDebt(asset)for index math.
Constants / fees
MAX_STABLE_RATE_BORROW_SIZE_PERCENT(),FLASHLOAN_PREMIUM_TOTAL(),FLASHLOAN_PREMIUM_TO_PROTOCOL(),BRIDGE_PROTOCOL_FEE(),MAX_NUMBER_RESERVES().
EMode and isolation
setUserEMode(categoryId),getUserEMode(user),getEModeCategoryData(id),configureEModeCategory(id, config)(config).resetIsolationModeTotalDebt(asset)when asset has zero debt ceiling.
Pool address: get from IPoolAddressesProvider(provider).getPool().
<!-- Source references:
- sources/aave-v3/contracts/interfaces/IPool.sol
- sources/aave-v3/README.md
-->
Aave V3 EMode and Isolation Mode
EMode (Efficiency Mode)
- Purpose: Same-category assets (e.g. correlated stablecoins) get a custom LTV and liquidation threshold for higher capital efficiency.
- Category 0: Default for volatile assets; no special eMode.
- User:
setUserEMode(categoryId)to opt in;getUserEMode(user)to read. - Config (PoolConfigurator):
configureEModeCategory(id, EModeCategory(ltv, liquidationThreshold, liquidationBonus, priceSource, label)). - Read:
getEModeCategoryData(id)on Pool.
Isolation Mode
- Purpose: New/capsule assets can be borrowable only in isolation: debt is capped per asset and only specific collateral can back it; avoids contaminating main pool risk.
- Reserve config: “Borrowable in isolation” and “debt ceiling” (and optionally “siloed borrowing”) are set in
ReserveConfigurationMapvia PoolConfigurator. - Total debt:
isolationModeTotalDebtinReserveData;resetIsolationModeTotalDebt(asset)when ceiling is 0. - Event:
IsolationModeTotalDebtUpdated(asset, totalDebt).
Siloed Borrowing
- Reserve config bit: “Siloed borrowing” — when set, borrowing that asset is restricted (siloed) to reduce risk. Check reserve config or docs for current behavior per market.
When to use
- Agents: When building liquidations or health checks, respect
getUserEMode(user)and eMode category data (custom LTV/liq threshold). For isolation, consider only allowed collateral and debt ceiling when computing borrow capacity and liquidatability.
<!-- Source references:
- sources/aave-v3/contracts/interfaces/IPool.sol (setUserEMode, getEModeCategoryData, configureEModeCategory, resetIsolationModeTotalDebt)
- sources/aave-v3/contracts/protocol/libraries/types/DataTypes.sol (EModeCategory, isolationModeTotalDebt)
- sources/aave-v3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol (bits)
-->