Flash Loan

A flash loan is a short-lived, uncollateralized loan offered by some decentralized-finance protocols. In the common form, the borrower must return the assets plus a protocol fee within the same blockchain transaction. A smart contract can use the borrowed liquidity for a sequence of operations before repayment is checked. The exact terms vary by protocol: for example, Aave V3’s multi-asset flashLoan() can open a debt position when the borrower supplies the required collateral or has credit delegation; its single-asset flashLoanSimple() requires repayment in the transaction.

How a flash loan works

  1. A borrower contract requests an asset from a lending pool.
  2. The pool transfers it and calls the borrower’s contract.
  3. The contract performs its programmed steps, such as swapping between markets, refinancing a position, or repaying a liquidatable loan.
  4. In a repay-within-transaction flow, the contract must make the principal and fee available for collection before execution ends. If repayment fails, the protocol reverts the transaction.

On Ethereum, a revert rolls back state changes from the failed execution. That does not make a failed attempt free: the transaction can still consume gas, and network fees depend on the work performed and current conditions.

What flash loans are used for

Flash loans let a contract access temporary liquidity without first owning the principal. Common documented applications include arbitrage across markets, liquidation of undercollateralized borrowing positions, and changing a lending position’s collateral or debt. A strategy only works if the complete sequence covers the loan fee and other costs, fits the protocol’s rules, and executes at the expected prices. Competition, slippage, execution ordering, and contract bugs can turn a planned trade into a loss or a reverted transaction.

Flash loans and DeFi security

The loan mechanism is not itself an exploit: it enforces the protocol’s borrowing and repayment rules. However, temporary access to a large amount of capital can amplify an attack that takes advantage of another contract’s weak accounting, a manipulable spot price, or unsafe interactions between protocols. Research analyzing early DeFi incidents describes flash loans as a way to scale attacks that depended on flaws in the systems being targeted. Security therefore depends on the whole protocol design, including how prices and external calls are validated.

Flash loans are a developer-level tool, not a guaranteed-profit strategy or a normal consumer loan. A reverted attempt may leave the borrowed principal untouched while still costing the sender gas; a successful but poorly designed sequence can affect other protocol users.

Social Media Sentiment

A September 2023 r/CryptoCurrency discussion explaining flash loans drew interest from readers who praised the detailed explanation, alongside concerns about exploits, gas costs, and competition from trading bots. The comments show reactions in one self-selected thread; they are not a representative survey of DeFi users.

Last updated: 2026-10

Related Terms

See Also

Sources