Skip to content
Finic
Crypto

What is a flash loan attack?

A flash loan attack uses a large uncollateralized loan, borrowed and repaid within one blockchain transaction, to manipulate prices or exploit a flaw in a DeFi protocol for profit.

Also called: flash loan exploit

What a flash loan is

Some DeFi protocols offer flash loans: anyone can borrow a large amount with no collateral, as long as the loan is repaid in the same transaction. If it is not repaid, the whole transaction fails and nothing happens. Flash loans have honest uses, such as moving a position between protocols or trading on price gaps.

How the attack works

The flash loan is usually not the flaw itself. It gives an attacker huge, brief buying power to exploit a weakness elsewhere. A common pattern is price manipulation: the attacker uses borrowed funds to move the price in a thin liquidity pool, then uses that false price to borrow or withdraw too much from a protocol that trusts the pool as a price source.

Other attacks use the borrowed funds to gain voting power in governance for a moment, or to trigger a bug in a smart contract. The attacker repays the loan at the end of the transaction and keeps the profit.

Why it matters

Flash loans mean that an attacker does not need their own capital to exploit a bug. Any weakness that would be profitable with a large balance is open to anyone. Because everything happens in one transaction, there is no time to react while it is in progress.

How protocols defend against it

  • Use price feeds that are hard to move in one transaction, such as time-weighted prices or multiple sources.
  • Do not let voting power or limits depend on balances held for only one block.
  • Get independent code audits and test against extreme market conditions.
  • Add limits and pauses for unusually large or fast changes.
← All glossary terms

Ship fraud, bot and KYB checks in minutes.

Start with $5 of free credit, or copy a prompt and let your coding agent set Finic up.

Sign up See pricing