Glossary TermApril 20, 2024

Flash Loan

An uncollateralized loan that must be borrowed and repaid within a single blockchain transaction — enabling risk-free arbitrage, instant liquidations, and some of the largest DeFi exploits in history.

flash-loandefiarbitrageliquidationuncollateralized

Definition

An uncollateralized loan that must be borrowed and repaid within a single blockchain transaction — enabling risk-free arbitrage, instant liquidations, and some of the largest DeFi exploits in history.

Flash Loan

In Simple Terms: You borrow $10 million with zero collateral, use it to make a profit (arbitrage, liquidation), repay the $10 million plus a tiny fee, and pocket the difference — all in one blockchain transaction that takes less than 15 seconds. If you cannot repay by the end of the transaction, the entire thing reverses as if it never happened. The lender never loses a cent. This is only possible on a blockchain.

A flash loan is an uncollateralized loan executed within a single atomic blockchain transaction. The borrower receives funds at the start of the transaction, must use those funds to generate a profit (net of fees), and must repay the full loan amount plus a fee by the end of the same transaction. If any step fails — if the loan is not fully repaid — the entire transaction reverts, and no funds leave the lending pool. This makes flash loans essentially risk-free for lenders and uniquely powerful for borrowers with the skills to deploy them.

For traders, flash loans are the most democratic capital access mechanism ever created. A retail trader with the right code can access millions in instantaneous leverage — something that traditionally required prime brokerage relationships, credit checks, and institutional infrastructure. Flash loans power legitimate DeFi activities (arbitrage between pools, self-liquidation to avoid penalties, refinancing loans across protocols) but are also the primary tool behind most major DeFi exploits (price oracle manipulation, governance attacks, reentrancy attacks). Understanding flash loan mechanics helps you identify both trading opportunities and structural risks in protocols you use.

How It Works

The mechanics of a flash loan are defined by Ethereum's (and other chains') atomic transaction model. A transaction either fully executes — every operation succeeds — or it fully reverts, as if nothing happened.

A flash loan transaction typically follows this pattern:

  1. Borrow: Request a flash loan from a lending pool (Aave, dYdX, Uniswap, etc.) for a specific amount.
  2. Execute: Use the borrowed funds for one or more operations — arbitrage trades, collateral swaps, debt refinancing, liquidations.
  3. Repay: Return the borrowed amount plus a fee (typically 0.05-0.3% of the loan amount) to the lending pool.
  4. Profit: If the operations generated more than the fee, the remaining profit is sent to the borrower's address.

The lending pool's smart contract verifies at the end of the transaction that its balance is at least the original amount plus the fee. If it is, the transaction succeeds. If it is not, the entire transaction reverts — the pool's balance never changes, and the "borrower" only loses gas fees.

The limitation: the entire loan must be repaid within one transaction. You cannot take a flash loan and hold the funds across multiple blocks, move them to different chains, or withdraw them to an exchange. The atomicity constraint means flash loans are tools for instantaneous, single-transaction operations, not for long-term leverage.

Why It Matters for Traders

Flash loan arbitrage democratizes profit opportunities. When the same token trades at different prices on different DEXes, a flash loan allows you to: borrow $1M of USDC, buy the token on the cheaper pool, sell it on the more expensive pool, repay the loan plus fee, and keep the spread — all without committing your own capital. Before flash loans, this required maintaining inventory on both exchanges and managing execution risk. Now anyone with the coding skills to build a flash loan contract can compete. The catch: this space is highly competitive, with professional MEV searchers using sophisticated bots and low-latency infrastructure. For manual traders, the realistic play is not competing on execution speed but identifying opportunities that persist due to cross-chain complexity or market structure inefficiencies.

Flash loans reveal protocol vulnerabilities before they are exploited against you. The signature of a flash loan attack on a protocol: a massive flash loan funds an operation that manipulates the protocol's pricing oracle or governance mechanism, extracting value that the protocol cannot recover. By understanding how flash loan attacks work, you can evaluate whether the protocols you use are vulnerable and exit before an attack occurs. Warning signs: protocols that rely on single-source spot price oracles (easily manipulated in a single transaction), protocols with concentrated governance token holdings (single flash loan can swing a vote), and protocols with complex composability chains where failure in one component cascades.

Self-liquidation via flash loans can save capital. If you have an undercollateralized loan approaching liquidation, you can use a flash loan to self-liquidate: borrow the required amount, repay your debt, claim your collateral, and repay the flash loan — all atomically. This avoids the liquidation penalty (typically 5-15% of the position) that third-party liquidators would capture. This is a legitimate, defensive use of flash loans that sophisticated DeFi users employ to protect their positions from unfavorable liquidations.

Common Mistakes

  1. Thinking flash loans are only for exploits and criminals. Legitimate flash loan usage far exceeds exploit usage by transaction count and value. Arbitrage, self-liquidation, collateral swapping, and debt refinancing are routine, beneficial operations that flash loans enable. The visibility of large exploits creates a skewed perception. Flash loans are a neutral tool — like a knife, they can be used productively or destructively depending on who wields them.
  2. Assuming protocols with flash loan attacks are inherently broken. Some protocols have been flash-loaned not due to fundamental code bugs but due to economic design flaws (manipulable oracles, insufficient liquidity buffers). After such an attack, the protocol often fixes the design flaw and continues operating safely. A protocol that survived a flash loan attack and implemented fixes may be more robust than one that has never been tested.
  3. Underestimating the technical barrier to flash loan arbitrage. Flash loan execution requires: writing and deploying a smart contract, calculating optimal trade sizes, accounting for gas costs and MEV risks, and competing against professional bots with sub-100ms latency. The economic opportunity is real but the competitive landscape is fierce. For manual traders, monitoring flash loan activity as a market signal is more practical than attempting to execute flash loan trades directly.

FAQ

Q: What prevents someone from taking a flash loan and not repaying? A: The transaction atomicity. The smart contract that issues the flash loan checks at the end of the transaction that its balance equals or exceeds the pre-loan balance plus fee. If it does not, the entire transaction reverts — all state changes are undone. There is no separate "repayment" step; if repayment fails, the transaction never happened from the blockchain's perspective. The only cost to the would-be defaulter is the gas fee for the failed transaction.

Q: Which protocols offer flash loans? A: Aave, dYdX (Solo), Uniswap V2/V3, Balancer, MakerDAO (via DssFlash), and many others. Each has different fee structures and supported assets. Aave is the most commonly used flash loan provider due to its deep liquidity and wide asset support. Flash loan aggregators (Furucombo, DeFi Saver) provide user-friendly interfaces for constructing flash loan transactions without writing custom smart contracts.

Q: Are flash loans possible outside of Ethereum? A: Yes, on any blockchain that supports atomic transactions and smart contracts with composability features. Flash loans exist on BSC (PancakeSwap), Solana (Solend), Polygon, Avalanche, and most EVM-compatible chains. The mechanics are identical — borrow, use, repay, all within one transaction — but the liquidity available and fee structures differ by chain.

Deep Dive

Want to explore further? Check out:

Ready to Start Trading?

Join The Kingfisher community and get access to professional-grade trading tools and insights.