Flash Loan
- Category
- Decentralised Finance
- Level
- Expert
Simple definition
A loan taken and repaid inside a single transaction. Nothing is pledged, because if the money is not returned by the end of that transaction, the whole thing is undone as if it never happened.
Professional definition
Uncollateralised borrowing whose only security is atomicity: the contract lends, the borrower's code runs, and repayment with a fee is checked before the transaction commits. Failure reverts every step, so the lender cannot lose principal while the borrower needs no credit standing at all.
Technical definition
Credit risk is removed by making default impossible rather than costly, which means the loan carries no term, no collateral and no counterparty assessment — only a fee and a gas cost. The consequence is that capital ceases to be a constraint on any strategy that is profitable within one transaction. That is useful for arbitrage, collateral swaps and self-liquidation, and it is also what turns a pricing weakness anywhere in the composable stack into an attack that needs no funding.
Academic definition
An uncollateralised credit instrument secured by transaction atomicity, in which the borrowing and repayment legs are state transitions within a single atomic unit, eliminating default risk and decoupling strategy scale from the borrower's capital.
Mechanism
Ordinary lending prices the chance that a borrower will not repay. Atomicity deletes that chance: the state only persists if the repayment check passes, so there is nothing to price but the fee. What remains is not a credit risk but a systemic one, because every protocol that reads a manipulable price now faces an adversary with unlimited size for the length of one transaction.
In practice
- Who uses it
- Arbitrageurs closing a price gap, borrowers swapping collateral or refinancing without unwinding, liquidators funding a repayment, and protocol security teams modelling the attack surface.
- Why it matters
- It lets a strategy that nets out within one transaction be executed at any size, so execution capital stops being the binding constraint.
- Limitations
- It only works for strategies that are self-financing inside a single transaction. Gas and the loan fee set a floor on profitable size, and a reverted attempt still costs the gas.
Common mistakes
- Assuming an atomic loan is riskless because the lender cannot lose principal.
- Designing a protocol that reads an instantaneous pool price while flash loans exist.
- Describing every flash-loan-funded exploit as a flash-loan vulnerability.
Examples
A 1,000,000 atomic loan at a fee of 0.05 percent costs 500, plus gas. Closing a price gap worth 0.12 percent across two venues returns about 1,200, so the trade clears its costs; a 0.04 percent gap would not.
- loan principal = 1,000,000
- flash-loan fee = 0.05%
- price gap captured = 0.12%
- gas and swap fees ignored for clarity
- fee = 1,000,000 x 0.0005 = 500
- gross capture = 1,000,000 x 0.0012 = 1,200
- net before gas = 1,200 - 500 = 700
- at a 0.04% gap: 400 - 500 = -100, so the transaction would not be sent
Fees differ by protocol and the swap legs carry their own costs; the figures are illustrative.
A borrower moves a loan from one collateral asset to another without repaying from their own funds: the atomic transaction borrows the debt amount, closes the old position, opens the new one and repays. Nothing is at risk if any step fails.
Related terminology
- parent
- Lending Protocol
- related
- Lending Protocol Oracle Manipulation Arbitrage Liquidation Smart Contract Maximal Extractable Value Collateral Ratio Smart Contract Audit
Leverage
Leverage holds borrowed exposure over time and can be margin-called. An atomic loan cannot outlive its transaction, so it creates no ongoing exposure at all.
Sources
BIS Quarterly Review · 2021-12 · discussion of composability and flash loans as an amplifier of protocol weaknesses
https://www.bis.org/publ/qtrpdf/r_qt2112b.pdf URL verified
BIS · uncollateralised atomic borrowing within collateral-based lending
https://www.bis.org/publ/bisbull57.pdf URL verified
IOSCO · recommendations on operational and manipulation risk in DeFi
https://www.iosco.org/library/pubdocs/pdf/ioscopd754.pdf URL verified
Editorial status
Flagged by the editor as uncertain on a linguistic, mathematical or regulatory point.
