A flash loan is an uncollateralized loan in decentralized finance (DeFi) that must be borrowed and repaid within a single blockchain transaction. It is enabled by smart contracts, which enforce an all-or-nothing rule: if the borrower cannot repay the principal plus any fees by the end of that transaction, the entire transaction fails and the blockchain state reverts as if nothing happened.
How flash loans work on-chain
Unlike traditional loans, flash loans do not rely on credit checks or posted collateral. Instead, the security comes from transaction atomicity, meaning multiple actions can be bundled into one transaction and either all succeed or all fail. A typical flash loan flow includes borrowing assets from a liquidity pool, executing a sequence of trades or protocol interactions, then repaying the pool before the transaction ends. Because the repayment is guaranteed by code, lenders can offer capital without taking the usual default risk.
Common uses and real-world context
Flash loans are often used for capital-efficient strategies that need large temporary liquidity. For example, a trader might borrow a large amount to perform arbitrage, buying an asset where it is cheaper and selling where it is more expensive, then repaying the loan from the profit. They can also be used to refinance debt positions, swap collateral types, or rebalance leveraged positions across lending protocols without needing the user to front significant funds.
However, the same power can be abused. Attackers have used flash loans to amplify economic attacks, such as manipulating thin-liquidity prices or exploiting flawed smart contract logic, then extracting value before repaying.
Flash loans matter because they highlight both the composability and the risks of DeFi, enabling sophisticated, automated liquidity use while raising the bar for secure protocol design.