What is flash loan in DeFi?

November 30th, 2025, 6:47 am
A flash loan is a type of uncollateralized loan in decentralized finance (DeFi) that must be repaid within a single blockchain transaction

If the loan isn't repaid by the end of the transaction, the entire operation is reverted, as if the loan never happened. Flash loans are designed for use cases like arbitrage and collateral swaps, but they can also be exploited for malicious activities, such as manipulating prices in a decentralized exchange.


  1. Borrow without collateral: Unlike traditional loans, flash loans do not require any collateral to be posted beforehand.
  2. Atomic transactions: The loan and its repayment must occur within the same transaction. This "all-or-nothing" approach ensures that the lender is never at risk, because if the repayment fails, the entire transaction is rolled back.
  3. Legitimate uses: Common legitimate uses include arbitrage, where a user borrows an asset to take advantage of a price difference on another exchange and repays the loan instantly, and collateral swapping, where a user swaps the collateral on a loan without needing to repay it first.
  4. Potential for misuse: Flash loans can be exploited by malicious actors for activities like manipulating prices on decentralized exchanges to their advantage, which can result in draining funds from other users or protocols.


How Do Flash Loans Work?

In traditional collateralized lending, borrowers need to put up resources (collateral) to borrow funds. If the borrower fails to meet the loan terms, the lender can cover the loan using the borrower’s collateral. Flash loans, however, do not have this requirement; the loan can only exist if the borrower pays it back within the same transaction. This means defaulting on a flash loan is not possible, as the entire transaction would simply revert. For a short period—the span of a single transaction—a flash loan can provide anyone with substantial resources, creating unique opportunities for arbitrage, liquidations, collateral swapping, and the creation of leveraged positions.


What Are Flash Loans Used For?

Flash loans are commonly used for arbitrage, where a large amount of resources is used to fill a market inefficiency, such as differing exchange rates on different markets. This can generate a profit by bringing the market to equilibrium and improving liquidity for everyone in the DeFi market. Flash loans are also used for liquidations, where third-party liquidators may receive compensation for processing loan liquidations that fail to meet a certain collateralization ratio requirement. Other use cases include collateral swaps, creating leveraged positions, and transferring loans across protocols.


Flash Loans and Price Oracle Attacks

Flash loans have a controversial reputation as they can also be used to fund various types of attacks on DeFi protocols. Once a vulnerability is uncovered by a malicious actor, the attacker can manipulate certain functions of the protocol using a flash loan. This highlights the importance of understanding the risks associated with flash loans and the need for robust applications to be built for users.


Flash Loans vs Traditional Loans

Flash loans differ significantly from traditional loans. They are unsecured, meaning no collateral is needed. Instead, smart contracts on the blockchain enforce the loan. If the loan is not paid back immediately, the blockchain does not confirm the transaction, and the loan does not proceed. This is a stark contrast to traditional loans, which can last for decades and require collateral. Flash loans, on the other hand, require repayment within minutes, with a smart contract executing the loan and immediately settling it with a fee.