Flash Loans Explained: Borrowing Millions with Zero Collateral
Flash loans let you borrow unlimited crypto with zero collateral — if you return it in the same transaction. Here is how they work and what they are used for.
Flash loans are one of the most extraordinary innovations in DeFi: a loan of any size, requiring zero collateral, that must be borrowed and repaid within a single blockchain transaction. If the loan is not repaid by the end of the transaction, the entire transaction is reversed as if it never happened. This creates a powerful tool for arbitrage, liquidations, and collateral swaps.
How Flash Loans Work
- Request a flash loan from Aave or other protocols — borrow up to available pool size
- In the same transaction: use the funds for your strategy (arbitrage, liquidation, etc.)
- Return the borrowed amount + fee (typically 0.05-0.09%) in the same transaction
- If repayment fails, entire transaction reverts — no loss for the protocol, no gain for borrower
- Gas cost is the only upfront cost — the loan itself requires nothing except repayment
Legitimate Uses of Flash Loans
- Arbitrage: borrow $1M in USDC, buy ETH cheaply on Exchange A, sell at higher price on Exchange B, repay loan, keep profit
- Collateral swap: replace your USDC collateral with ETH in a single transaction — no manual multi-step process
- Liquidation: borrow to fund a liquidation, earn liquidation bonus, repay loan, keep bonus
- Self-liquidation: avoid penalties by using a flash loan to repay your own undercollateralised loan elegantly
Flash Loan Attacks
Flash loans have also been used to exploit vulnerable DeFi protocols. By borrowing large amounts and manipulating oracle prices within a single transaction, attackers have stolen hundreds of millions. Notable exploits: bZx (2020, $1M), Pancake Bunny (2021, $45M), Mango Markets (2022, $116M). Steyble only integrates protocols with oracle manipulation resistance — time-weighted average prices (TWAP) rather than spot price oracles.