Flash Loan
A flash loan is an uncollateralized crypto loan that must be borrowed and repaid, usually with a small fee, within a single blockchain transaction. If it is not repaid by the end of that transaction, the whole transaction is reversed.
A flash loan lets a smart contract borrow assets from a lending pool, use them, and return them plus a small fee before the transaction ends. Blockchain transactions are atomic: either every step succeeds or the whole transaction reverts as if it never happened. If the repayment is missing at the end, the loan is cancelled automatically. The lender never risks losing its funds, which is why no collateral is required.
Flash loans give anyone who can write or use the right code temporary access to large amounts of capital. Common legitimate uses include arbitrage, swapping the collateral behind an existing loan, and repaying a debt to avoid liquidation. Take a token that trades cheaper on one decentralized exchange than on another. A contract could borrow stablecoins, buy the token on the cheaper exchange, sell it on the pricier one, then repay the loan and fee. It keeps the difference minus gas costs, all within one transaction.
The same power enables flash loan attacks. An attacker borrows a huge sum to push around the price in a pool with thin liquidity. A protocol that uses that pool as its price oracle is then tricked into lending or paying out too much. The attacker repays the loan and keeps the profit. A common misconception is that flash loans are the flaw. The real weakness lies in the targeted protocol's design, such as relying on easily manipulated prices. Even a failed flash loan still costs the sender gas.