Flash loans are uncollateralized loans in decentralized finance (DeFi) that must be borrowed and repaid within a single blockchain transaction. They are executed by smart contracts, which enforce the rule that if repayment does not occur by the end of the transaction, the entire transaction is reverted as if it never happened.
How flash loans work on-chain
In traditional lending, collateral protects the lender if the borrower defaults. Flash loans replace collateral with atomic execution, meaning a sequence of actions either completes fully or fails entirely. A borrower typically requests a flash loan from a lending protocol, uses the borrowed funds immediately for one or more on-chain actions, then repays the principal plus a fee before the transaction finishes. If repayment cannot be made, the smart contract cancels all intermediate steps, so the protocol is not left with unpaid debt.
Common use cases in DeFi
Flash loans are often used for arbitrage, where a trader exploits price differences between decentralized exchanges by buying an asset on one venue and selling it on another within the same transaction. They can also support collateral swaps or debt refinancing, for example repaying a loan on one lending platform and opening a new position on another without needing upfront capital. More advanced users combine flash loans with liquidations, where a borrower’s undercollateralized position is repaid and the liquidator receives a reward, all orchestrated programmatically.
Risks and why they matter
While flash loans are legitimate tools, they can amplify vulnerabilities in smart contracts and DeFi market structure. Attackers may use flash-borrowed liquidity to manipulate thin markets, exploit flawed pricing or oracle designs, or trigger cascading liquidations. Understanding flash loans matters because they illustrate both the power of composable DeFi and the need for robust protocol design, secure oracles, and careful risk management across the crypto ecosystem.