A unified liquidity layer and modular architecture that enhances capital efficiency, scalability, and risk management.
The Aave V4 architecture follows a modular hub-and-spoke design that separates liquidity management from user-facing operations and collateralization.
aave-v4/
├── src/ # Main source code
│ ├── access/ # Access control contracts
│ ├── config-engine/ # Config engine for governance payload generation
│ ├── dependencies/ # Dependencies (Chainlink, OpenZeppelin, etc.)
│ ├── deployments/ # Deployment framework
│ ├── hub/ # Hub contracts and interfaces
│ ├── interfaces/ # Shared interfaces
│ ├── libraries/ # Shared libraries (math, types)
│ ├── position-manager/ # Position Managers, including gateway contracts
│ ├── spoke/ # Spoke contracts and interfaces
│ └── utils/ # Utility contracts (Multicall, etc.)
├── tests/ # Test suite
│ ├── config-engine/ # Config engine tests
│ ├── contracts/ # Contract tests (hub, spoke, tokenization, etc.)
│ ├── deployments/ # Deployment tests
│ ├── gas/ # Gas snapshot tests
│ ├── helpers/ # Test helpers and mocks
│ ├── misc/ # Symbolic tests, prototype development
│ ├── scripts/ # Script tests
│ ├── setup/ # Base test setup and fixtures
│ └── utils/ # Test utilities
├── scripts/ # Deployment scripts
│ ├── deploy/ # Deploy scripts (batch base, chain-specific, examples)
│ └── utils/ # Script utilities
├── output/ # Deployment output and reports
├── resources/ # Static resources (diagrams, etc.)
├── snapshots/ # Gas snapshots
└── lib/ # Foundry dependencies
-
Foundry - Development framework
curl -L https://foundry.paradigm.xyz | bash foundryup # Update to latest version
-
Node.js - For linting and tooling
# Verify installation node --version yarn --version # Install dependencies yarn install
-
Lcov - For coverage reports
# Ubuntu sudo apt install lcov # macOS brew install lcov
Dependencies are located in the src/dependencies subfolder rather than managed through external package managers. This approach:
- Mitigates supply chain attack vectors
- Ensures dependency immutability
- Minimizes installation overhead
- Provides simplified version control and auditability
git clone https://github.com/aave/aave-v4.git
cd aave-v4# Copy environment template and populate
cp .env.example .env
# Install Foundry dependencies
forge install
# Install Node.js dependencies (required for linting)
yarn installforge build- Run full test suite:
make testorforge test -vvv - Run specific test file:
forge test --match-contract ... - Run with gas reporting:
make gas-report - Generate coverage report:
make coverage
- Check contract sizes:
forge build --sizes - Check linting:
yarn lint - Fix linting issues:
yarn lint:fix - Generate Rust bindings:
yarn rs:generate
Gas snapshots are automatically generated and stored in the snapshots/ directory. To update snapshots:
make gas-reportSnapshot files generated:
Hub.Operations.json: Gas for Hub actions or treasury operations invoked by Spokes.Spoke.Operations.json: Gas for user-facing Spoke operations.Spoke.Operations.ZeroRiskPremium.json: Same scenarios asSpoke.Operations.jsonbut with Collateral Risk set to 0, to show baseline gas excluding risk-premium computation.Spoke.Getters.json: Gas for getters across different combinations of supplies/borrows.BabylonSpoke.Operations.json: TheSpoke.Operations.jsonscenarios that fit the single collateral and debt reserve limit of the BabylonSpoke, plus the manager-gated liquidations.NativeTokenGateway.Operations.json: Gas for native-asset (ETH) gateway flows.SignatureGateway.Operations.json: Gas for EIP-712 meta-transactions.
You can find all audit reports under audits:
- 2025-10-20 - Aave V4 - Blackthorn
- 2025-11-06 - Aave V4 - TrailOfBits
- 2026-01-28 - Aave V4 - ChainSecurity
- 2026-02-10 - TokenizationSpoke - ChainSecurity
- 2026-02-24 - Aave V4 - Blackthorn
- 2026-03-09 - Hub Formal Verification - Certora
- 2026-03-09 - Libraries Formal Verification - Certora
- 2026-03-09 - Spoke Formal Verification - Certora
- 2026-03-23 - Aave V4 - ChainSecurity
- 2026-04-13 - TokenizationSpoke Formal Verification - Certora
- 2026-11-02 - Config and Deploy Engine - Certora
Aave V4 has an active bug bounty program on Sherlock.
Aave V4 is licensed under the Business Source License, see LICENSE. Each Solidity file in Aave V4 states the applicable license. As a customized license, BUSL uses the LicenseRef- prefix per SPDX Spec v2.3, Annex E.
Contributions are licensed under the Aave Protocol Contributor License Agreement, see CLA_LICENSE. See CONTRIBUTING for further details and guidelines.