Loading...
FinchTrade

Definition

Flash Loan

A flash loan provides uncollateralized DeFi liquidity that must be repaid within one transaction. Learn how atomic repayment works, its uses and its risks.

A flash loan is temporary, uncollateralized borrowing in decentralized finance (DeFi) that must be repaid, including any applicable lender fee, before the same blockchain transaction completes. It supplies assets for operations performed inside that transaction, not for spending or holding afterward. The absence of upfront collateral is possible because smart contracts enforce repayment as part of the same atomic operation.

How a Flash Loan Works

A flash loan begins when a lending contract makes assets available to a borrowing contract. That contract uses the assets for predefined operations, which may call other smart contracts, and arranges repayment. Before the transaction can complete successfully, the lending contract checks that its repayment conditions have been met. The borrowed amount and any required lender fee must be returned according to the facility's rules. The available amount depends on the facility's design, liquidity and borrowing limits.

If repayment conditions are not met, the transaction's contract state changes revert. The transfer of borrowed funds and the operations performed with them are undone rather than leaving an unpaid balance. This all-or-nothing behavior is called atomicity. It makes a flash loan transaction-bound, not simply a conventional loan delivered quickly: the borrower cannot extend the repayment deadline into a later transaction. Reversion does not refund network fees consumed by execution, so a failed attempt can still cost money. Repayment enforcement also depends on the lending contract's logic functioning correctly.

Looking for liquidity, exploring on-ramp/off-ramp services, or seeking expert guidance?

Common Uses

Arbitrage uses temporary liquidity to buy an asset where its price is lower and sell it where its price is higher. For a profit to remain, proceeds must exceed the repayment amount and other execution costs. Funds from a flash loan can also support a collateral swap, allowing an existing lending position to be restructured within one transaction. A swap can repay existing debt, release and exchange collateral, then deposit the replacement asset and borrow against it to settle the temporary loan. The ongoing position must still satisfy the lending protocol's collateral and borrowing rules.

In a liquidation, borrowed assets can repay eligible debt and allow the liquidator to receive collateral under the target protocol's rules. The liquidator must obtain enough of the borrowed asset to settle the temporary loan before completion.

Costs and Security Risks

A lack of upfront collateral does not mean the operation is cost-free. Lender fees depend on the facility and are not universally required. Network fees are separate, while exchange fees, slippage and price impact can reduce or eliminate any trading surplus. An executable price difference is therefore more important than an apparent difference between quoted prices. Successful repayment proves that the loan's settlement conditions were satisfied; it does not prove that the borrower made a profit.

A flash loan can finance an exploit by giving an attacker temporary access to substantial assets. Vulnerable price inputs or smart-contract flaws may allow that liquidity to be used to manipulate calculations or extract value from another protocol. In such cases, the loan can be repaid even while the target protocol suffers losses. The liquidity amplifies the exploit but is not necessarily the underlying vulnerability. Atomic repayment protects against an unpaid loan under correctly functioning logic; it does not guarantee the safety of the lender's contract or every system involved.

Power your growth with seamless crypto liquidity

A single gateway to liquidity with competitive prices, fast settlements, and lightning-fast issue resolution

Get started