Aave token logo
Aave token mark used to identify this flash-loan protocol example.Credit: Aave token mark via Cryptocurrency IconsOriginal sourceLicenseAll image credits

A flash loan lets a smart contract borrow assets without conventional collateral, provided the loan and fee are returned in the same transaction. If repayment conditions are not met, the transaction reverts as a whole.

The borrow and repayment happen atomically

Aave’s flash-loan flow transfers assets, invokes the borrower’s contract, and checks the result before the transaction completes. The borrower contract must implement the callback and approve repayment according to the protocol interface.

Repayment includes protocol-defined fees

The borrower must account for the applicable premium and protocol interface.

Atomicity does not remove execution risk

Contract bugs, incorrect assumptions, slippage, liquidity changes, or an unprofitable route can cause the transaction to fail and still consume gas. Flash loans are primarily a smart-contract primitive, not an ordinary retail credit product.

A reverted transaction can still cost gas

Atomic rollback prevents partial state changes, but execution fees may still be charged.

Sources

  1. Aave — Flash Loans
  2. Aave — V3 developer documentation