Flash Loan Calculator
Free Flash Loan Calculator. Estimate flash loan profitability including protocol fees, gas costs, and arbitrage spread for Aave, dYdX, and Uniswap.
Flash loans are repaid in the same transaction. If arbitrage fails, the transaction reverts and only gas is lost. Actual profitability depends on DEX liquidity and slippage.
How to use Flash Loan Calculator
The Flash Loan Calculator estimates the profitability of atomic flash loan arbitrage opportunities across DeFi protocols. Enter the loan amount, the price spread between two DEXes (e.g., Uniswap vs. SushiSwap), and the gas cost — the tool calculates whether the arbitrage profit exceeds the flash loan fee (typically 0.05-0.09% on Aave) plus gas costs.
A flash loan borrows and repays within a single transaction, requiring zero collateral. For example, borrowing $100,000 USDC to exploit a 0.3% price difference on ETH between two DEXes yields $300 gross profit minus ~$9 flash loan fee minus ~$30 in gas = $261 net. The calculator helps you determine the minimum spread needed for profitability at different loan sizes.
Input guide and assumptions
Loan amount sets the borrowed capital — flash loans on Aave V3 support up to the full liquidity pool size, often $100M+. The price spread percentage is the difference between buy and sell prices across the two venues. Gas cost in gwei converts to a dollar amount based on current ETH price and estimated transaction complexity (~300,000-500,000 gas units for a typical flash loan arbitrage).
The protocol fee is preset by the lending protocol (Aave: 0.05%, dYdX: 0%). The output shows gross revenue, total costs (fee + gas), net profit, and the breakeven spread. It also calculates the maximum gas price you can pay while remaining profitable, helping you set gas limits for your MEV bot or arbitrage script.
How to interpret results correctly
The flash loan calculator estimates the profitability of a flash loan operation by comparing the arbitrage or liquidation opportunity size against the loan fee (typically 0.05–0.09% of borrowed amount on Aave, 0.3% on Uniswap), gas costs for all transactions in the atomic bundle, and any DEX swap fees along the route. If the net profit after all costs is negative or under $50, the opportunity is not viable — gas price spikes during execution can easily consume thin margins.
The calculator's 'minimum spread required' output tells you the minimum price difference between venues needed for the flash loan to be profitable at current gas prices. If the minimum spread is 0.8% but the current arbitrage opportunity is only 0.5%, the trade loses money. This metric is your go/no-go signal. For <a href="/gas-calculator/">gas cost</a> optimization, consider executing during low-gas periods (weekends, early UTC morning) when the minimum spread requirement drops.
Practical scenarios and planning workflow
DEX arbitrage: ETH is $2,419 on Uniswap and $2,339 on SushiSwap — a 0.52% spread. Flash loan 100 ETH ($232,700) from Aave: loan fee 0.05% ($116.35) + buy gas ($3) + sell gas ($3) + swap fee 0.3% ($698.10 on the buy side). Gross profit: 100 × $12 = $1,200. Net profit: $1,200 - $116.35 - $6 - $698.10 = $379.55. Viable, but only if execution is atomic and the spread persists through the block.
Liquidation flash loan: a borrower on Aave has $50,000 in collateral with a health factor of 0.98 (undercollateralized). Flash borrow $25,000 USDC, repay the borrower's debt to claim $27,500 in collateral (10% liquidation bonus), swap collateral to USDC, repay flash loan. Gross profit: $2,500. Costs: flash loan fee $12.50 + gas $5–$20 + swap slippage ~$50. Net: ~$2,430. Liquidation flash loans are consistently profitable for monitored positions.
Risk and execution checklist
- Before executing a flash loan: 1) Verify the arbitrage opportunity exists in the current block (not a stale quote). 2) Simulate the full transaction using Tenderly or a local fork to confirm profitability. 3) Check mempool for competing bots that may front-run your transaction. 4) Ensure gas price assumptions in the calculator match current network conditions — a 2x gas spike erases most flash loan profits.
- After calculating: if the estimated profit margin is under 20% of total costs, skip the opportunity — execution risk (reverted transactions, gas waste, front-running) makes thin margins unprofitable in practice. Target opportunities where profit exceeds costs by at least 50% to account for execution variability.
Common mistakes to avoid
- The biggest mistake for beginners is attempting flash loan arbitrage without understanding atomic execution. A flash loan must borrow, trade, and repay within a single transaction. If any step fails, the entire transaction reverts — you lose gas but not the borrowed funds. However, failed transactions still cost gas ($5–$50 per attempt), and repeated failures from stale opportunities or front-running can drain hundreds of dollars in wasted gas.
- Another critical error is ignoring MEV (Maximum Extractable Value) competition. Professional MEV bots with direct relationships to block builders will outcompete your flash loan transaction by paying higher priority fees. Unless you use private transaction submission (Flashbots Protect, MEV Blocker) or have a custom MEV strategy, most obvious arbitrage opportunities will be captured before your transaction is included. Use our <a href="/mev-calculator/">MEV calculator</a> to assess competition.
Performance benchmarks and expectation ranges
Flash loan fee benchmarks: Aave V3 0.05%, dYdX 0% (but limited assets), Uniswap V3 flash swaps 0.3% (pool fee), Balancer 0% flash loans. For cost minimization, prefer Aave or Balancer for borrowing, and route swaps through the lowest-fee DEX pools available for the specific pair.
Profitability benchmarks: successful flash loan arbitrages in 2025–2026 average $200–$2,000 net profit per trade for non-MEV operators. Professional MEV bots average $50–$500 per opportunity but execute 100x more frequently. The market is highly competitive — solo operators without custom infrastructure typically find 1–5 profitable opportunities per week.
Execution templates you can reuse
Flash loan execution pipeline: 1) Monitor price feeds across 5+ DEXs for spread opportunities. 2) When spread exceeds calculated minimum, simulate the full transaction. 3) If simulation shows profit >50% above costs, submit via Flashbots Protect (prevents front-running). 4) Monitor transaction inclusion. 5) If reverted, analyze why before retrying — the opportunity may have been captured by a competing bot.
For liquidation monitoring: watch Aave/Compound health factors using The Graph or direct RPC calls. When health factor drops below 1.0, calculate the liquidation bonus minus your execution costs. Submit liquidation transaction immediately — competition for liquidations is measured in milliseconds.
Data hygiene and model maintenance
Track every flash loan attempt: timestamp, opportunity type, estimated profit, actual profit/loss, gas spent, transaction hash. This log reveals your hit rate (profitable vs failed attempts) and average profit per successful trade. If hit rate drops below 30%, your detection infrastructure is too slow or opportunity identification criteria need tightening.
Keep your flash loan contracts updated with the latest protocol interfaces. Aave V3, Uniswap V4, and other protocols release upgrades that change function signatures and fee structures. An outdated contract will revert on execution, wasting gas on every attempt.
Final validation before capital deployment
Always simulate flash loan transactions on a mainnet fork before live execution. Tenderly, Hardhat, and Foundry all support fork testing. If the simulation reverts or shows different profit than the calculator estimated, debug the discrepancy before risking gas on a live transaction. Common causes: stale price data, incorrect pool addresses, or insufficient liquidity at the quoted price.
Validate your profitability tracking against on-chain data. Use Etherscan to verify that the value received in your flash loan transactions matches what your internal accounting records. MEV extraction can sometimes result in partial fills or different-than-expected swap rates that your calculator may not have predicted.
Authoritative sources
Frequently asked questions
What is a flash loan?
A flash loan is a DeFi loan borrowed and repaid within a single transaction — no collateral required because if repayment fails, the entire tx reverts atomically. Aave charges 0.05% fee, dYdX is fee-free. Used for arbitrage, collateral swaps, and liquidations.
How much can I flash-loan?
Limited by pool liquidity. Aave V3 has ~$2B available across networks (USDC, USDT, ETH, WBTC). Single-tx flash loans of $50M+ have been observed. Practical limit for arbitrage is whatever the target pool can absorb without slippage eating profits.
How do flash loan arbitrages work?
(1) Borrow $1M USDC via flash loan. (2) Buy BTC on Exchange A at $70,000. (3) Sell BTC on Exchange B at $70,300. (4) Repay $1M + 0.05% fee = $1,000,500. (5) Pocket $300 profit ÷ all in one atomic tx. Spread must exceed fees + gas (typically $30–200 on mainnet).
What is the most common flash loan mistake?
Underestimating gas. Mainnet flash-loan arbitrage can cost $100–500 per attempt; if your bot misjudges the spread by 0.02%, you net negative. Pros run on Arbitrum/Base ($1–5 gas) and use private mempools (Flashbots, MEV-Share) to avoid frontrunning by other bots.
Are flash loans the same as flash loan attacks?
Flash loans are a legitimate primitive; flash loan attacks exploit underlying protocol bugs (oracle manipulation, reentrancy) using the loan as leverage. The Mango Markets ($117M, Oct 2022) and Euler ($197M, March 2023) attacks used flash loans, but the loans themselves were not the vulnerability.
Aave vs dYdX vs Balancer flash loans — which to use?
Aave: most liquidity, 0.05% fee, supports 30+ tokens. Balancer: fee-free, supports any pool token, lower liquidity. dYdX: fee-free historically, now V4 on Cosmos so flash loans are limited. Maker has fee-free DAI flash mints up to ~500M DAI.
Related calculators
← ← All DeFi & Yield calculators