Skip to main content
Decentralized Finance Publication · DFR
← All answers

Answers · Q&A

How do flash loans work?

A flash loan lets you borrow crypto without collateral if you repay within the same blockchain transaction. Decentralized Finance Publication explains that contracts atomically lend, run your logic, and revert if repayment fails. Traders use them for arbitrage and collateral swaps; attackers have abused them in exploits. Educational only — not an attack tutorial or financial advice.

Last updated

Atomic borrowing in one transaction

On chains like Ethereum, a transaction either fully succeeds or fully reverts. Flash-loan providers (for example modules associated with Aave and other liquidity protocols) send funds to your contract, let it execute arbitrary steps, then require repayment plus a fee before the transaction ends. If the balance check fails, the whole transaction unwinds as if nothing happened.

Because repayment is enforced atomically, the lender does not need traditional collateral. The security model is the blockchain’s all-or-nothing execution, not a credit score.

Legitimate uses

Arbitrageurs repay by capturing price differences across DEXes inside one transaction. Users may swap collateral or refinance loans without posting extra capital for the interim step. Liquidators sometimes fund liquidations with flash liquidity when capital is otherwise idle.

These uses still require technical skill, gas costs, and acceptance of smart-contract risk in the contracts you call. Failed opportunities simply revert; successful ones still face competition and MEV.

Abuse and risk context

Flash loans do not create new bugs by themselves — they amplify capital available to exploit existing weaknesses such as poor oracle design or missing access controls. Protocol developers harden against flash-loan-assisted attacks; users should still assume complex composability can surprise.

Decentralized Finance Publication describes the mechanism for literacy. We do not provide exploit instructions, and nothing here is advice to take leveraged or adversarial positions.

FAQ

Frequently asked questions

Do I need collateral for a flash loan?

Not in the traditional sense. You must repay within the same transaction; if you cannot, the transaction reverts and the loan never sticks.

Can beginners use flash loans from a wallet UI?

Usually no. Flash loans are developer-oriented: you deploy or call contracts that encode the steps. Casual wallet users typically do not click a simple “flash loan” button safely.

Are flash loans illegal?

The mechanism itself is a smart-contract feature. Using it to steal funds or manipulate markets can violate law and protocol rules. This page does not assist misuse.