What is a flash loan, and how does it differ from a typical loan?
A flash loan is a special lending mechanism offered by DeFi lending protocols: a borrower can take out any amount with zero collateral, subject to one strict condition — the entire process of borrowing, using the funds, and repaying must complete within a single blockchain transaction. If the principal plus fee isn't repaid by the end of the transaction, the blockchain automatically reverts the entire transaction, as if the loan never happened.
The key difference from a typical loan lies in risk structure: traditional lenders bear the risk of borrower default and need collateral or credit checks to hedge against it. Flash loan protocols need none of these mechanisms, because 'not repaying' is technically impossible — it's not that the borrower chooses not to repay, it's that if repayment fails, the entire transaction, including the loan itself, gets undone.
Why do flash loans exist, and what problem do they solve?
In traditional finance, operations like arbitrage, liquidation, and collateral swaps typically require a large amount of upfront capital to execute the moment a price discrepancy appears — a high barrier for participants with limited capital. Flash loans let anyone capable of writing the correct smart contract logic 'borrow' capital far exceeding their own holdings to execute these one-off operations and repay immediately afterward, effectively participating in market activity that would otherwise require substantial capital, at zero capital cost.
For the broader DeFi ecosystem, flash loans also act as a market-efficiency corrector — arbitrageurs use flash loans to quickly close price gaps between different protocols, helping prices converge to fair value faster, which in theory reduces long-term inefficiency and arbitrage opportunity over time.
How does a flash loan actually work — what happens within a single transaction?
Technically, the core of a flash loan is a smart contract's callback function mechanism. The process generally works as follows:
This entire process completes within a single transaction, usually taking just seconds — which is where the name 'flash' comes from.
What's the practical impact of flash loans on everyday users, and what should they watch for?
For most retail users, directly using a flash loan has a high barrier — it requires the ability to write smart contract logic to execute arbitrage or liquidation within the borrowing window, not something achievable by simply clicking through an interface. The impact on retail users is usually indirect: on one hand, arbitrageurs using flash loans to quickly correct cross-protocol price gaps may make prices more consistent when you trade across different DEXs; on the other hand, flash loans are also a key tool in most major DeFi attack incidents, where attackers use them to manipulate price oracles or governance votes, indirectly affecting the safety of protocols where you hold funds.
If you're a DeFi depositor or liquidity provider, understanding flash loans helps you judge whether a protocol's pricing mechanism is resistant to this kind of attack — protocols using a time-weighted average price (TWAP) rather than a single live-source quote are generally more resilient against flash-loan-driven price manipulation.
The 2020 bZx protocol attack is an early well-known case: the attacker borrowed a large amount of ETH via flash loan, executed a massive trade on a thinly liquid decentralized exchange to inflate a token's price, then used this distorted price to borrow assets from bZx far exceeding normal limits — netting hundreds of thousands of dollars in a single attack, all completed within one transaction lasting seconds.
The advantage is executing large-scale capital operations with zero upfront capital, dramatically lowering the barrier to arbitrage, liquidation, and other market-efficiency-correcting activities; the drawback is that the same mechanism can be used by attackers to mobilize capital far exceeding their own holdings to manipulate prices or governance, posing systemic risk to protocols with insufficiently robust pricing mechanism design.