A flash loan is a loan you take and repay inside a single blockchain transaction. There's no collateral and no credit check, because the lender can't lose. If the money isn't back, with a fee, by the end of that transaction, the whole thing is cancelled as though it never happened. You can borrow millions this way for a few seconds. You can't walk off with it.
How a flash loan works
A blockchain transaction is all or nothing. Either every step in it succeeds, or none of it counts. A flash loan is built on that one rule.
- Your contract asks a lending pool for the money. Say one million dollars in USDC.
- The pool sends it. No questions about who you are.
- Your contract uses it. A trade, a debt repayment, a swap of collateral.
- Your contract pays back the million, plus the fee.
- The pool checks its balance. If it's short by a cent, every step above is undone. You've lost the network fee and nothing else. The pool has lost nothing.
All five steps happen inside one block. On Ethereum that's about twelve seconds.
What is required to take out a flash loan
Code. You can't take a flash loan from a wallet by pressing a button, because the borrowing, the using and the repaying have to be bundled into one transaction. That takes a smart contract. You need three things:
- A contract that receives the loan and carries out your steps.
- Enough of the network's own coin to pay the transaction fee.
- A plan that leaves you holding at least the loan plus the fee at the end.
Tools such as DeFi Saver and Furucombo wrap this up for common jobs, like moving a loan from one protocol to another, so you don't write the contract yourself.
What a flash loan costs
| Where | Fee | On a $1 million loan |
|---|---|---|
| Aave V3 | 0.05% by default, set by a governance vote | $500 |
| Balancer | None | $0 |
| Uniswap V3 | The pool's own fee tier: 0.05%, 0.3% or 1% | $500 to $10,000 |
The network fee comes on top, and you pay it whether the loan succeeds or not.
What people use them for
- Flash loan arbitrage. A token costs slightly less on one exchange than another. Borrow, buy low, sell high, repay, keep the gap. In practice this is a race between bots, and the gaps close within the block. Finding one by hand is rare.
- Swapping collateral. You've borrowed against ETH and want to hold a different asset behind the loan. A flash loan lets you switch without closing the position first.
- Refinancing. Moving a debt from one lending protocol to another with a better rate, in one step.
- Paying off your own loan before it's liquidated. Repay, release the collateral, sell enough of it to cover the flash loan. It usually costs less than the liquidation penalty.
If lending pools and collateral are new to you, start with what DeFi is and how liquidity pools work.
What makes a flash loan attack possible
A flash loan hands anyone, for one transaction, the buying power of a large fund. Any protocol with a flaw that only big money can reach is then open to everybody. Two flaws come up again and again.
- A price read from one pool. The attacker uses the borrowed money to push a token's price in that pool, then borrows or trades against the false price somewhere else.
- Votes counted by what you hold right now. The attacker borrows enough governance tokens to outvote everyone for the length of one transaction.
| Protocol | When | Loss | What happened |
|---|---|---|---|
| Beanstalk | April 2022 | $182 million | About $1 billion borrowed, a voting majority bought, and a proposal passed that emptied the protocol |
| Euler Finance | March 2023 | $197 million | A flaw in one function let borrowed funds drain five pools. Most of the money was later returned |
The first well-known cases hit the lending protocol bZx in February 2020. The pattern hasn't changed since. The loan supplies the money and a bug does the rest.
You won't be the target of a flash loan attack. The protocol holding your deposit might be. Before you put money into one, find out whether the code has been audited, whether it takes prices from more than one source, and whether a governance vote has a waiting period before it takes effect. Our due diligence checklist covers where to look.
Are flash loans legit?
Flash loans are real and built into some of the largest protocols in DeFi. Most of what turns up when you search for a "flash loan arbitrage bot" or a "flash loan app" is a scam.
The usual one is a video. It gives you a block of code to paste into a contract tool and promises profit once you fund the contract with your own ETH. The code sends your ETH to the scammer's wallet. A real flash loan never needs your money up front, beyond the network fee. Anyone telling you to deposit first is robbing you. The same habits that catch a rug pull catch this one.

