Flash Loans
Borrow any amount with zero collateral — as long as you repay within the same transaction. If you can't repay, the entire transaction reverts as if nothing happened. This impossible-sounding mechanic exists because Ethereum transactions are atomic: they either fully succeed or fully fail.
Flash Loan Transaction Lifecycle
Watch a flash loan execute step by step. The entire sequence happens in a single block — ~12 seconds of real time, but instant in EVM execution.
Call flashLoan() on Aave/dYdX/Uniswap. Pool transfers tokens to your contract.
Your contract does whatever it wants: arbitrage, liquidation, collateral swap, self-liquidation...
Return borrowed amount + fee (0.05-0.09%). If balance insufficient → entire tx reverts.
Keep the difference. If the strategy lost money, the repayment fails and everything unwinds.
Flash Loan Use Cases
Arbitrage
Buy cheap on one DEX, sell expensive on another. Flash loans mean you don't need capital — just a smart contract and a price discrepancy.
Liquidations
Liquidate undercollateralized positions without owning any DAI/USDC. Borrow → liquidate → sell collateral → repay.
Collateral Swaps
Switch your Aave collateral from ETH to WBTC in one transaction. Flash loan pays off debt → withdraw collateral → deposit new → re-borrow → repay flash loan.
Exploits & Attacks
Flash loans enable governance attacks (borrow voting tokens), oracle manipulation (inflate prices), and reentrancy exploits at scale.
Flash Loan Profit Calculator
Flash Loan Providers
Max: Full pool liquidity (~$10B+)
Best for: Liquidations, collateral swaps
Max: Full pool TVL
Best for: Token-pair arbs, flash swaps
Max: All vault tokens
Best for: Large arbs, multi-token
Max: Debt ceiling (500M DAI)
Best for: DAI-denominated arbs