Flash loan
Also called: flash loans · uncollateralized loan
Definition
A flash loan is an uncollateralized DeFi loan that must be borrowed and repaid, with a fee, within the same blockchain transaction, or the whole transaction is cancelled.
This entry is shown in English.
How Flash loan works
Smart contracts can bundle many steps into one transaction. A flash loan uses this: you borrow, use the funds, and repay in a single transaction. If repayment fails, the blockchain reverts everything, so the lender is never at risk of default. Aave popularised flash loans, and other protocols offer similar features.
Legitimate uses include arbitrage between DEXs, refinancing a loan from one protocol to another, and swapping collateral without first closing a position. They require writing or using a smart contract, so they are a developer and bot tool rather than something you request from an app.
Flash loans are also used in attacks. They give attackers temporary access to large capital to manipulate a thinly traded pool or a weak oracle. The weakness is usually in the targeted protocol's design, not in the flash loan itself.
Example
Suppose a token trades at 1.00 USDC on DEX A and 1.02 USDC on DEX B. A bot flash-borrows 500,000 USDC, buys about 500,000 tokens on DEX A, sells them on DEX B for about 509,000 USDC after price impact, repays 500,000 USDC plus a 0.05 percent fee of 250 USDC, and keeps roughly 8,750 USDC before gas. If prices moved and the bot could not repay, the transaction would revert.
Common mistakes
- Believing a flash loan lets an ordinary user borrow money for days without collateral.
- Blaming flash loans for exploits that were really caused by manipulable oracles.
- Paying for a flash loan bot or service advertised on social media, which is a common scam.
Learn and practise
FAQ
Can anyone take a flash loan?
Anyone who can deploy or call a suitable smart contract can. There is no credit check, but you need technical skill.
Are flash loans legal?
Flash loans are a standard DeFi feature. Using them to exploit protocols may be treated as illegal depending on the jurisdiction and the circumstances.