What Is a Flash Loan?
A flash loan is an uncollateralized loan that must be borrowed and repaid within a single blockchain transaction. If the borrower cannot repay the full amount plus fees by the end of the transaction, the entire operation is automatically reverted as if it never happened. Flash loans are unique to DeFi and enable arbitrage, collateral swaps, and self-liquidation without requiring upfront capital.
Table of Contents
What Is a Flash Loan?
A flash loan is a DeFi primitive that allows anyone to borrow any amount of available assets from a lending pool without posting collateral, provided the loan is repaid within the same transaction. This is possible because blockchain transactions are atomic: either every step succeeds, or the entire transaction reverts. Protocols like Aave and dYdX pioneered flash loans.
How Flash Loans Work
A flash loan transaction bundles multiple operations together. First, the borrower receives the loaned tokens. Then, they execute their desired operations (arbitrage, collateral swap, etc.). Finally, they repay the loan plus a small fee. If the final repayment step fails for any reason, the EVM reverts everything, including the initial borrowing. The lender faces zero risk of loss.
Legitimate Use Cases
Arbitrage traders use flash loans to exploit price differences across DEXs without needing capital. Borrowers on lending platforms use them to swap collateral types in a single transaction. Users facing liquidation can flash-loan funds to repay debt and avoid liquidation penalties. These operations were previously available only to well-capitalized traders and institutions.
Flash Loan Attacks
Flash loans can be used to manipulate oracle prices or exploit protocol vulnerabilities. An attacker might borrow a large amount, manipulate a price feed by trading on a low-liquidity pool, exploit the mispriced asset in another protocol, and repay the loan with profit. These attacks have resulted in hundreds of millions of dollars in losses across DeFi and have driven improvements in oracle design and protocol security.
Why Flash Loans Matter
Flash loans represent a financial primitive with no equivalent in traditional finance. They democratize access to large amounts of capital for anyone with the technical skill to construct the transaction. They also serve as a stress test for DeFi protocols, exposing vulnerabilities that might otherwise remain hidden until exploited by a well-funded attacker.
Frequently Asked Questions
Do I need collateral for a flash loan?
No. Flash loans require zero collateral because the loan must be repaid within the same transaction. If repayment fails, the blockchain reverts the entire transaction, so the lender never actually loses funds. The atomicity of blockchain transactions is what makes this possible.
Are flash loans only used for attacks?
No. While flash loan attacks receive the most attention, legitimate uses include arbitrage trading, collateral swapping in lending protocols, self-liquidation to avoid penalties, and complex DeFi position management. They democratize access to strategies that previously required large capital reserves.