Skip to content

What Is a Flash Loan?

A loan of any size with zero collateral, borrowed and repaid in the same breath as the blockchain. Here's how that's possible, and why it's also a favorite tool for exploits.

Last updated July 2026

What a flash loan actually is

A flash loan is a loan, sometimes an enormous one, that requires no collateral at all. That alone should sound wrong, since every other form of crypto lending asks you to post collateral worth more than what you're borrowing (see our DeFi guide if you haven't come across over-collateralized lending yet). Flash loans skip that requirement entirely.

The catch is timing. You have to borrow the funds, do whatever you want with them, and repay the loan plus a small fee, all within a single blockchain transaction. If you don't repay by the time that transaction finishes, the entire transaction gets reversed automatically, including the loan itself. It's as if it never happened.

Why this unusual structure is even possible

This only works because of how smart contracts execute. A smart contract is code deployed on a blockchain that runs exactly as written, and a single transaction calling that code can bundle multiple steps together: borrow the funds, use them for something, then repay. The blockchain treats all of those steps as one atomic unit. Either every step succeeds, or none of them do.

That "all or nothing" property is called atomicity, and it's the whole trick. If your repayment step fails for any reason, whether you simply didn't send the money back or a condition in your code wasn't met, the blockchain undoes the whole transaction as though it never started. The lender's balance is exactly where it was before you touched it.

Because of that guarantee, the lender is never actually at risk of not being repaid. There's no scenario where you walk away with the money and the lender is left holding nothing, because that scenario simply doesn't get written to the chain. That's the entire reason no collateral is needed: the lending protocol isn't trusting you, it's trusting the blockchain's execution model to make non-repayment impossible.

What flash loans are legitimately used for

Setting aside the exploits for a moment, flash loans solve real problems for people who understand how to use them.

The well-documented dark side

Flash loans have also become the tool of choice behind a large share of major DeFi exploits, and it's worth understanding why honestly rather than glossing over it. The same property that makes flash loans useful, the ability to temporarily command enormous capital, is exactly what an attacker needs to manipulate a protocol.

A common pattern looks like this: an attacker borrows a huge sum via a flash loan, uses it to push the price on a thinly-traded pool or a poorly designed price oracle far away from its real value, then exploits another protocol that trusted that distorted price, all within the same transaction. Once the exploit pays out, the attacker repays the flash loan and keeps the difference. They never needed to own that capital, only to hold it for a few seconds.

Other exploits target logic flaws rather than price oracles directly: a flash loan can be used to briefly inflate a balance, trigger a reward calculation, or satisfy some on-chain condition that was never designed to be tested at that scale. The specifics vary, but the pattern is the same. Borrow big, exploit a weakness, repay, walk away, all in one atomic step.

Why this matters for risk assessment

This changes what "secure" actually means for a DeFi protocol. It's not enough for a protocol's own code to be free of bugs. It also has to hold up against someone briefly wielding capital far larger than they could ever actually afford, capital that shows up and disappears within seconds. That's a threat model traditional finance basically never has to deal with, since nobody can walk into a bank, borrow a billion dollars with nothing to show for it, and pay it back before the teller finishes the transaction.

In practice, that means protocols relying on a single price source, or ones that assume balances and positions can't swing wildly within one transaction, are the ones most exposed. Well-designed protocols account for this by using price oracles that are harder to manipulate in a single block, and by building in checks that don't assume normal, gradual market conditions.

The bottom line

Flash loans are a genuinely novel financial primitive, something that simply couldn't exist before programmable blockchains made atomic, all-or-nothing transactions possible. Used well, they're a clever bit of financial engineering: efficient, capital-free arbitrage and position management that traditional finance has no real equivalent for. Used maliciously, they're one of the most reliable weapons in an attacker's toolkit.

Their existence is one more reason smart contract audits matter, and one more reason to stay skeptical of newer, less battle-tested protocols promising high yields. If you want the vocabulary to keep reading further into this corner of DeFi, oracle manipulation, atomic transaction, and price oracle are all covered in our crypto glossary.

Keep learning the fundamentals

Free · No sign-up · Part of the LabelYX Learn series