{
  "axon_version": "1.0.0",
  "protocol": {
    "name": "Aave",
    "slug": "aave-v3-ethereum",
    "version": "v3",
    "description": "Decentralized non-custodial liquidity protocol on Ethereum. Users can supply assets to earn interest, borrow against collateral, and execute flash loans.",
    "category": "lending",
    "chain": {
      "id": 1,
      "name": "ethereum",
      "network": "mainnet"
    },
    "contracts": {
      "pool": {
        "address": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "label": "Pool (LendingPool V3)",
        "verified": true
      },
      "pool_addresses_provider": {
        "address": "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e",
        "label": "PoolAddressesProvider",
        "verified": true
      },
      "oracle": {
        "address": "0x54586bE62E3c3580375aE3723C145253060Ca0C2",
        "label": "AaveOracle",
        "verified": true
      },
      "pool_data_provider": {
        "address": "0x7B4EB56E7CD4b454BA8ff71E4518426c84552Dc7",
        "label": "PoolDataProvider (AaveProtocolDataProvider)",
        "verified": true
      },
      "a_token_impl": {
        "address": "0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d",
        "label": "AToken Implementation",
        "verified": true
      },
      "variable_debt_token_impl": {
        "address": "0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6",
        "label": "VariableDebtToken Implementation",
        "verified": true
      },
      "stable_debt_token_impl": {
        "address": "0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57",
        "label": "StableDebtToken Implementation",
        "verified": true
      }
    },
    "links": {
      "website": "https://aave.com",
      "docs": "https://docs.aave.com/developers",
      "github": "https://github.com/aave/aave-v3-core",
      "governance": "https://governance.aave.com"
    }
  },
  "actions": [
    {
      "id": "supply",
      "name": "Supply Asset",
      "description": "Supply (deposit) an ERC20 asset to the Aave V3 lending pool to earn interest. The depositor receives aTokens 1:1 which accrue interest in real-time via a rebasing mechanism.",
      "type": "supply",
      "parameters": [
        {
          "name": "asset",
          "type": "address",
          "required": true,
          "description": "Address of the ERC20 token to supply"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Amount to supply in the asset's smallest unit (wei). Use type(uint256).max to supply full wallet balance.",
          "constraints": {
            "min": "1"
          }
        },
        {
          "name": "onBehalfOf",
          "type": "address",
          "required": true,
          "description": "Address that will receive the aTokens. Use msg.sender for self."
        },
        {
          "name": "referralCode",
          "type": "uint16",
          "required": false,
          "description": "Referral code for integrator tracking. Use 0 for no referral.",
          "default": "0"
        }
      ],
      "constraints": {
        "min_amount": "1",
        "supported_tokens": "aave_listed_assets",
        "requires_position": false
      },
      "approvals": [
        {
          "type": "erc20_approve",
          "token": "asset",
          "spender": "pool",
          "amount": "exact_or_max"
        }
      ],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_reserve",
          "description": "Verify the asset is listed, active, and not paused on Aave. Check supply cap is not reached.",
          "contract": "pool_data_provider",
          "method": "getReserveConfigurationData(address)",
          "conditional": "always",
          "returns": ["ltv", "liquidationThreshold", "liquidationBonus", "reserveFactor", "usageAsCollateralEnabled", "borrowingEnabled", "isActive", "isFrozen"]
        },
        {
          "step": 2,
          "action": "check_supply_cap",
          "description": "Verify supply amount does not exceed the reserve's supply cap",
          "contract": "pool_data_provider",
          "method": "getReserveCaps(address)",
          "conditional": "always",
          "returns": ["borrowCap", "supplyCap"]
        },
        {
          "step": 3,
          "action": "check_allowance",
          "description": "Check if the Pool contract has sufficient allowance to transfer the supply token from the user",
          "contract": "asset",
          "method": "allowance(address,address)",
          "conditional": "always",
          "returns": ["allowance"]
        },
        {
          "step": 4,
          "action": "approve",
          "description": "Approve the Pool contract to spend the supply token. Can use exact amount or type(uint256).max for unlimited approval.",
          "contract": "asset",
          "method": "approve(address,uint256)",
          "conditional": "if_allowance_insufficient"
        },
        {
          "step": 5,
          "action": "execute",
          "description": "Supply the asset to the lending pool. Caller receives aTokens representing the deposit.",
          "contract": "pool",
          "method": "supply(address,uint256,address,uint16)",
          "returns": ["aTokensMinted"]
        }
      ],
      "risk_warnings": [
        "Supplied assets can be borrowed by others — smart contract risk",
        "Interest rates are variable and can change based on utilization",
        "If used as collateral, the position may be liquidated if health factor drops below 1.0"
      ]
    },
    {
      "id": "withdraw",
      "name": "Withdraw Asset",
      "description": "Withdraw a previously supplied asset from the Aave V3 lending pool. Burns aTokens and returns the underlying asset. If the asset is used as collateral, withdrawal may be limited by health factor.",
      "type": "withdraw",
      "parameters": [
        {
          "name": "asset",
          "type": "address",
          "required": true,
          "description": "Address of the underlying ERC20 token to withdraw"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Amount to withdraw in the asset's smallest unit. Use type(uint256).max to withdraw full balance.",
          "constraints": {
            "min": "1"
          }
        },
        {
          "name": "to",
          "type": "address",
          "required": true,
          "description": "Address that will receive the withdrawn tokens. Use msg.sender for self."
        }
      ],
      "constraints": {
        "min_amount": "1",
        "supported_tokens": "aave_listed_assets",
        "requires_position": true
      },
      "approvals": [],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_balance",
          "description": "Check the user's aToken balance for the asset to verify sufficient supply position exists",
          "contract": "pool_data_provider",
          "method": "getUserReserveData(address,address)",
          "conditional": "always",
          "returns": ["currentATokenBalance", "currentStableDebt", "currentVariableDebt", "principalStableDebt", "scaledVariableDebt", "stableBorrowRate", "liquidityRate", "stableRateLastUpdated", "usageAsCollateralEnabled"]
        },
        {
          "step": 2,
          "action": "check_health_factor",
          "description": "If the asset is used as collateral, verify that withdrawal will not bring health factor below 1.0",
          "contract": "pool",
          "method": "getUserAccountData(address)",
          "conditional": "if_used_as_collateral",
          "returns": ["totalCollateralBase", "totalDebtBase", "availableBorrowsBase", "currentLiquidationThreshold", "ltv", "healthFactor"]
        },
        {
          "step": 3,
          "action": "execute",
          "description": "Withdraw the asset. Burns aTokens from the user and transfers underlying tokens to the 'to' address.",
          "contract": "pool",
          "method": "withdraw(address,uint256,address)",
          "returns": ["amountWithdrawn"]
        }
      ],
      "risk_warnings": [
        "Withdrawing collateral reduces health factor — may trigger liquidation if health factor drops below 1.0",
        "Withdrawal may fail if pool liquidity is insufficient (all supplied tokens are currently borrowed)",
        "Using type(uint256).max as amount will withdraw the entire balance including accrued interest"
      ]
    },
    {
      "id": "borrow",
      "name": "Borrow Asset",
      "description": "Borrow an ERC20 asset from the Aave V3 lending pool against supplied collateral. Requires sufficient health factor. Supports variable and stable interest rate modes.",
      "type": "borrow",
      "parameters": [
        {
          "name": "asset",
          "type": "address",
          "required": true,
          "description": "Address of the ERC20 token to borrow"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Amount to borrow in the asset's smallest unit",
          "constraints": {
            "min": "1"
          }
        },
        {
          "name": "interestRateMode",
          "type": "uint256",
          "required": true,
          "description": "Interest rate mode: 1 for Stable, 2 for Variable. Variable is recommended for most cases.",
          "constraints": {
            "enum": [1, 2]
          }
        },
        {
          "name": "referralCode",
          "type": "uint16",
          "required": false,
          "description": "Referral code for integrator tracking. Use 0 for no referral.",
          "default": "0"
        },
        {
          "name": "onBehalfOf",
          "type": "address",
          "required": true,
          "description": "Address that will receive the borrowed tokens and accrue debt. Must have sufficient collateral. Use msg.sender for self."
        }
      ],
      "constraints": {
        "min_amount": "1",
        "supported_tokens": "aave_listed_borrowable_assets",
        "requires_position": true
      },
      "approvals": [],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_health_factor",
          "description": "Verify the user's current health factor and available borrowing power supports the requested borrow amount",
          "contract": "pool",
          "method": "getUserAccountData(address)",
          "conditional": "always",
          "returns": ["totalCollateralBase", "totalDebtBase", "availableBorrowsBase", "currentLiquidationThreshold", "ltv", "healthFactor"]
        },
        {
          "step": 2,
          "action": "check_borrow_cap",
          "description": "Ensure the borrow amount does not exceed the reserve's borrow cap",
          "contract": "pool_data_provider",
          "method": "getReserveCaps(address)",
          "conditional": "always",
          "returns": ["borrowCap", "supplyCap"]
        },
        {
          "step": 3,
          "action": "check_reserve_borrowable",
          "description": "Verify the asset is enabled for borrowing and the requested rate mode is available",
          "contract": "pool_data_provider",
          "method": "getReserveConfigurationData(address)",
          "conditional": "always",
          "returns": ["borrowingEnabled", "stableBorrowRateEnabled", "isActive", "isFrozen"]
        },
        {
          "step": 4,
          "action": "execute",
          "description": "Execute the borrow. Debt tokens are minted to onBehalfOf, and the borrowed asset is transferred to the caller.",
          "contract": "pool",
          "method": "borrow(address,uint256,uint256,uint16,address)",
          "returns": ["debtTokensMinted"]
        }
      ],
      "risk_warnings": [
        "Borrowing reduces health factor — if it drops below 1.0 your collateral will be liquidated",
        "Variable interest rates fluctuate with pool utilization and can increase significantly",
        "Stable rates can be rebalanced by governance under extreme market conditions",
        "Ensure borrowed amount leaves adequate safety margin (recommended health factor > 1.5)"
      ]
    },
    {
      "id": "repay",
      "name": "Repay Borrowed Asset",
      "description": "Repay a borrowed asset to the Aave V3 lending pool. Burns debt tokens and improves health factor. Supports repaying on behalf of another address.",
      "type": "repay",
      "parameters": [
        {
          "name": "asset",
          "type": "address",
          "required": true,
          "description": "Address of the borrowed ERC20 token to repay"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Amount to repay in the asset's smallest unit. Use type(uint256).max to repay the entire debt including accrued interest.",
          "constraints": {
            "min": "1"
          }
        },
        {
          "name": "interestRateMode",
          "type": "uint256",
          "required": true,
          "description": "Interest rate mode of the debt to repay: 1 for Stable, 2 for Variable. Must match the existing debt type.",
          "constraints": {
            "enum": [1, 2]
          }
        },
        {
          "name": "onBehalfOf",
          "type": "address",
          "required": true,
          "description": "Address of the user whose debt is being repaid. Use msg.sender to repay own debt."
        }
      ],
      "constraints": {
        "min_amount": "1",
        "supported_tokens": "aave_listed_borrowable_assets",
        "requires_position": true
      },
      "approvals": [
        {
          "type": "erc20_approve",
          "token": "asset",
          "spender": "pool",
          "amount": "exact_or_max"
        }
      ],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_debt",
          "description": "Check the user's current debt balance for the asset and rate mode to determine repayment amount",
          "contract": "pool_data_provider",
          "method": "getUserReserveData(address,address)",
          "conditional": "always",
          "returns": ["currentATokenBalance", "currentStableDebt", "currentVariableDebt", "principalStableDebt", "scaledVariableDebt", "stableBorrowRate", "liquidityRate"]
        },
        {
          "step": 2,
          "action": "check_allowance",
          "description": "Check if the Pool contract has sufficient allowance to transfer the repayment token",
          "contract": "asset",
          "method": "allowance(address,address)",
          "conditional": "always",
          "returns": ["allowance"]
        },
        {
          "step": 3,
          "action": "approve",
          "description": "Approve the Pool contract to spend the repayment token. When repaying max, approve slightly more than current debt to cover accruing interest.",
          "contract": "asset",
          "method": "approve(address,uint256)",
          "conditional": "if_allowance_insufficient"
        },
        {
          "step": 4,
          "action": "execute",
          "description": "Repay the borrowed asset. Burns corresponding debt tokens and improves health factor.",
          "contract": "pool",
          "method": "repay(address,uint256,uint256,address)",
          "returns": ["amountRepaid"]
        }
      ],
      "risk_warnings": [
        "When repaying with type(uint256).max, ensure wallet has sufficient balance to cover accrued interest",
        "Interest continues accruing between approval and repay transactions — approve slightly more than current debt",
        "Repaying does not automatically withdraw collateral"
      ]
    },
    {
      "id": "flash_loan",
      "name": "Flash Loan",
      "description": "Execute an atomic flash loan from the Aave V3 pool. Borrow any amount without collateral, execute arbitrary logic, and repay principal + 0.05% fee within the same transaction. Reverts if not repaid.",
      "type": "supply",
      "parameters": [
        {
          "name": "receiverAddress",
          "type": "address",
          "required": true,
          "description": "Address of the contract that implements IFlashLoanReceiver. Must implement executeOperation()."
        },
        {
          "name": "assets",
          "type": "address",
          "required": true,
          "description": "Array of ERC20 token addresses to flash borrow"
        },
        {
          "name": "amounts",
          "type": "uint256",
          "required": true,
          "description": "Array of amounts to flash borrow for each asset (in smallest unit)"
        },
        {
          "name": "interestRateModes",
          "type": "uint256",
          "required": true,
          "description": "Array of rate modes for each asset. Use 0 to repay in same tx (standard flash loan), 1 for stable debt, 2 for variable debt (opens a borrow position instead of repaying).",
          "constraints": {
            "enum": [0, 1, 2]
          }
        },
        {
          "name": "onBehalfOf",
          "type": "address",
          "required": true,
          "description": "Address that will incur the debt if interestRateMode != 0. Use receiverAddress for standard flash loans."
        },
        {
          "name": "params",
          "type": "bytes",
          "required": true,
          "description": "Arbitrary bytes passed to the receiver's executeOperation() function. Encode your custom logic parameters here."
        },
        {
          "name": "referralCode",
          "type": "uint16",
          "required": false,
          "description": "Referral code. Use 0 for no referral.",
          "default": "0"
        }
      ],
      "constraints": {
        "min_amount": "1",
        "supported_tokens": "aave_listed_assets",
        "requires_position": false
      },
      "approvals": [
        {
          "type": "erc20_approve",
          "token": "assets",
          "spender": "pool",
          "amount": "exact_or_max"
        }
      ],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_flash_loan_availability",
          "description": "Verify the requested assets are available for flash loans and the pool has sufficient liquidity",
          "contract": "pool_data_provider",
          "method": "getFlashLoanEnabled(address)",
          "conditional": "always",
          "returns": ["flashLoanEnabled"]
        },
        {
          "step": 2,
          "action": "check_receiver_contract",
          "description": "Verify the receiver contract implements IFlashLoanReceiver interface with executeOperation()",
          "contract": "receiverAddress",
          "method": "ADDRESSES_PROVIDER()",
          "conditional": "always",
          "returns": ["addressesProvider"]
        },
        {
          "step": 3,
          "action": "approve_repayment",
          "description": "The receiver contract must approve the Pool to pull back the loaned amount + premium (0.05% fee). This approval happens inside executeOperation().",
          "contract": "assets",
          "method": "approve(address,uint256)",
          "conditional": "inside_receiver_contract"
        },
        {
          "step": 4,
          "action": "execute",
          "description": "Execute the flash loan. Pool sends assets to receiver, calls executeOperation(), then pulls back principal + premium. Entire tx reverts if repayment fails.",
          "contract": "pool",
          "method": "flashLoan(address,address[],uint256[],uint256[],address,bytes,uint16)",
          "returns": ["success"]
        }
      ],
      "risk_warnings": [
        "Flash loans require a smart contract receiver — cannot be called directly from an EOA",
        "The entire transaction reverts if the loan + fee is not repaid within the same transaction",
        "Flash loan fee is 0.05% (5 bps) of borrowed amount — must be available in the receiver contract",
        "Reentrancy protections are in place but custom receiver logic must be audited",
        "If interestRateMode != 0, the flash loan opens a persistent borrow position instead of repaying"
      ]
    }
  ],
  "risk": {
    "audit_status": {
      "audited": true,
      "auditors": [
        "Trail of Bits",
        "SigmaPrime",
        "ABDK Consulting",
        "Certora (formal verification)",
        "PeckShield",
        "OpenZeppelin"
      ],
      "last_audit_date": "2022-12-01",
      "audit_reports": [
        "https://github.com/aave/aave-v3-core/tree/master/audits"
      ]
    },
    "tvl": {
      "current_usd": 12500000000,
      "source": "defillama",
      "last_updated": "2026-03-07T00:00:00Z"
    },
    "incidents": [
      {
        "date": "2022-11-22",
        "severity": "medium",
        "title": "CRV market freeze",
        "description": "Aave governance proactively froze CRV market after concerns about concentrated borrowing positions by a single entity. No user funds were lost. Demonstrated governance responsiveness.",
        "resolved": true,
        "post_mortem": "https://governance.aave.com/t/arc-risk-parameter-updates-for-aave-v2-ethereum-pool-2022-11-22/10757"
      },
      {
        "date": "2023-09-18",
        "severity": "low",
        "title": "GHO depeg and stablecoin rate adjustments",
        "description": "Aave's native stablecoin GHO experienced a brief depeg below $1. Governance adjusted borrow rates to restore the peg. No lending pool funds affected.",
        "resolved": true,
        "post_mortem": "https://governance.aave.com"
      }
    ],
    "risk_score": {
      "overall": "A+",
      "smart_contract": "A+",
      "centralization": "A",
      "oracle_dependence": "B+",
      "liquidity": "A"
    }
  },
  "fees": {
    "model": "interest_rate",
    "tiers": [
      {
        "name": "supply_yield",
        "fee_bps": null,
        "description": "Suppliers earn variable yield based on pool utilization. Typically 1-8% APY for stablecoins, 0.1-3% for volatile assets.",
        "conditions": "Earned on all supplied assets"
      },
      {
        "name": "variable_borrow",
        "fee_bps": null,
        "description": "Variable borrow rate — algorithmically determined by utilization curve. Base rate + slope1 below optimal utilization, base + slope1 + slope2 above. Typically 2-8% APY.",
        "conditions": "interestRateMode = 2"
      },
      {
        "name": "stable_borrow",
        "fee_bps": null,
        "description": "Stable borrow rate — fixed at time of borrow but rebalanceable by governance. Typically 5-12% APY. Higher than variable to compensate for rate certainty.",
        "conditions": "interestRateMode = 1 (not available on all reserves)"
      },
      {
        "name": "flash_loan_fee",
        "fee_bps": 5,
        "description": "0.05% flat fee on flash loan principal. Paid to liquidity providers. Fee can be 0 for whitelisted flash borrowers.",
        "conditions": "Flash loan operations only"
      },
      {
        "name": "reserve_factor",
        "fee_bps": null,
        "description": "Percentage of interest paid by borrowers that goes to the Aave DAO treasury. Varies per asset (typically 10-20%).",
        "conditions": "Applied automatically to all borrow interest"
      }
    ],
    "gas_estimates": {
      "supply": "250000",
      "withdraw": "260000",
      "borrow": "320000",
      "repay": "280000",
      "flash_loan": "500000",
      "approve": "46000"
    }
  }
}