Flash Loan
In simple terms
A flash loan lends any amount with no collateral, on one condition: it must be paid back before the transaction ends. If it is not, the whole transaction is cancelled as though it never happened.
Definition
An uncollateralised loan that must be borrowed and repaid inside a single transaction.
In depth
A flash loan exploits transaction atomicity. The lending contract transfers funds, calls back into the borrower's contract, and asserts on return that the principal plus fee has been repaid; if the assertion fails the entire transaction reverts and no state change persists, so the lender is never at risk. Legitimate uses are arbitrage, collateral swaps and refinancing without capital. The same primitive also underpins a large share of DeFi exploits, because it lets an attacker with no capital temporarily control enough assets to move a manipulable price.
How does Flash Loan work?
A contract requests the loan, performs its operations — an arbitrage across two venues, or repaying a debt and reopening it against different collateral — and repays the principal plus fee before returning. The lending contract checks its balance and either accepts the outcome or reverts everything. Because the loan lives and dies within one transaction, it needs no collateral and carries no default risk for the lender.
An example
An arbitrageur borrows an illustrative $2m for one transaction, buys an asset where it is cheaper, sells it where it is dearer, repays the loan plus a fee of roughly $1,800, and keeps the difference. No capital was required and no risk was carried between blocks.
Figures are illustrative only.
What beginners get wrong
- Thinking flash loans are available to ordinary users through an app. They require writing and deploying a contract.
- Calling every flash-loan exploit a flash-loan vulnerability. The loan supplies capital; the flaw is nearly always a manipulable price source elsewhere.
- Assuming a protocol is compromised because a large flash loan touched it. Most are ordinary arbitrage.
Related terms
Part of
What is DeFi, and how does decentralized finance work? — the subject page for defi, with all 18 of its definitions in one place.
Educational only — not financial advice.
