Flash Loan Profit Calculator
Calculate potential flash loan arbitrage profit from price difference, loan amount, and gas. Enter values for instant results with step-by-step formulas.
Calculator
Adjust values & calculateFee Breakdown
Formula
Net profit from flash loan arbitrage equals the gross revenue from selling tokens at the higher price, minus the original loan amount, flash loan protocol fee, DEX trading fees on both swaps, slippage costs, and Ethereum gas fees.
Last reviewed: December 2025
Worked Examples
Example 1: ETH Arbitrage Between Uniswap and SushiSwap
Example 2: Small Spread Arbitrage (Unprofitable)
Background & Theory
The Flash Loan Profit Calculator applies the following established principles and formulas. Cryptocurrency and Web3 systems are built on distributed ledger technology, most commonly implemented as blockchains. A blockchain is an append-only sequence of blocks, where each block contains a set of transactions and a cryptographic hash of the preceding block. This chaining structure means altering any historical record requires recomputing all subsequent blocks, making tampering computationally prohibitive on sufficiently large networks. Cryptographic hash functions are deterministic algorithms that map arbitrary-length inputs to fixed-length outputs called digests. Bitcoin uses SHA-256: a tiny change in input produces a completely different 256-bit hash. Digital signatures based on elliptic-curve cryptography allow users to prove ownership of funds without revealing private keys. A wallet address is derived from the public key through hashing, providing a publicly shareable identifier while keeping the private key secret. Proof of Work (PoW), used by Bitcoin, requires miners to repeatedly hash candidate blocks until the resulting digest falls below a difficulty target. This process is computationally expensive and energy-intensive, but the cost of attack scales with the honest network's total hash rate. Proof of Stake (PoS), adopted by Ethereum in 2022, replaces computational work with economic collateral: validators lock up native tokens as a security deposit and are chosen to propose blocks proportional to their stake. Misbehavior results in slashing โ destruction of part of the deposit โ aligning incentives without large energy expenditure. Market capitalization is calculated as the circulating supply of tokens multiplied by the current unit price, analogous to equity market cap. Fully diluted market cap extends this to all tokens that will ever be issued under the protocol's emission schedule. Decentralized Finance (DeFi) protocols replicate financial services โ lending, borrowing, trading, and derivatives โ using self-executing smart contracts on programmable blockchains, eliminating traditional intermediaries. Total Value Locked (TVL) is the standard measure of capital deployed in DeFi, capturing the aggregate value of assets deposited into protocols. Non-fungible tokens (NFTs) apply the same smart-contract infrastructure to represent unique digital or physical assets, with ownership recorded on-chain and verifiable by any participant without a central registry.
History
The history behind the Flash Loan Profit Calculator traces back through the following developments. The conceptual foundations of digital cash were laid through decades of cryptographic research. David Chaum proposed blind signatures for untraceable electronic payments in 1982, and his DigiCash company launched eCash in the early 1990s before filing for bankruptcy in 1998. The cypherpunk movement of the 1990s produced a community committed to using cryptography for individual privacy and financial sovereignty, with contributors including Wei Dai (b-money proposal, 1998) and Nick Szabo (bit gold proposal, 1998). On October 31, 2008, the pseudonymous Satoshi Nakamoto published a whitepaper titled Bitcoin: A Peer-to-Peer Electronic Cash System, proposing a solution to the double-spend problem without a central authority. The Bitcoin genesis block was mined on January 3, 2009, embedding a reference to a newspaper headline about bank bailouts. Nakamoto's identity remains unknown. By 2010, the first commercial transaction occurred when Laszlo Hanyecz paid 10,000 BTC for two pizzas, a date now celebrated annually as Bitcoin Pizza Day. Mt. Gox, at its peak handling approximately 70 percent of all Bitcoin trading volume, suffered a catastrophic hack that was disclosed in February 2014, resulting in the loss of approximately 850,000 BTC and the exchange's subsequent bankruptcy. The incident highlighted custody risks and spurred demand for regulated custodial services. Vitalik Buterin published the Ethereum whitepaper in 2013 and the network launched in 2015, introducing Turing-complete smart contracts and enabling programmable financial applications. The DAO hack of 2016 drained roughly 60 million dollars from a decentralized autonomous organization and led to a controversial hard fork of the Ethereum blockchain. The DeFi summer of 2020 saw total value locked in DeFi protocols surge from under one billion to over fifteen billion dollars. NFTs reached mainstream awareness in 2021 with high-profile sales at Christie's and Sotheby's. Regulatory scrutiny intensified globally through 2022 and 2023, with the collapse of the FTX exchange in November 2022 accelerating calls for comprehensive crypto asset legislation.
Frequently Asked Questions
Formula
Net Profit = (Tokens ร Sell Price) โ Loan โ Flash Fee โ DEX Fees โ Slippage โ Gas
Net profit from flash loan arbitrage equals the gross revenue from selling tokens at the higher price, minus the original loan amount, flash loan protocol fee, DEX trading fees on both swaps, slippage costs, and Ethereum gas fees.
Worked Examples
Example 1: ETH Arbitrage Between Uniswap and SushiSwap
Problem: Borrow $100,000 via Aave flash loan (0.09% fee). Buy ETH at $1,800 on Uniswap, sell at $1,825 on SushiSwap. Gas: 30 Gwei, DEX fee: 0.3%, slippage: 0.5%.
Solution: Tokens bought: 100,000 / 1,800 = 55.556 ETH\nGross revenue: 55.556 ร $1,825 = $101,388.89\nGross profit: $1,388.89\nFlash loan fee: $100,000 ร 0.09% = $90.00\nDEX fees: $100,000 ร 0.3% + $101,389 ร 0.3% = $604.17\nSlippage: $101,389 ร 0.5% = $506.94\nGas: ~$27.00\nTotal fees: $1,228.11\nNet profit: $1,388.89 - $1,228.11 = $160.78
Result: Net Profit: $160.78 | ROI: 0.16% | Profitable: Yes
Example 2: Small Spread Arbitrage (Unprofitable)
Problem: Borrow $50,000 via flash loan. Buy token at $100, sell at $100.50 (0.5% spread). Gas: 50 Gwei.
Solution: Tokens bought: 50,000 / 100 = 500 tokens\nGross revenue: 500 ร $100.50 = $50,250\nGross profit: $250\nFlash loan fee: $50,000 ร 0.09% = $45\nDEX fees: $50,000 ร 0.3% + $50,250 ร 0.3% = $300.75\nSlippage: $50,250 ร 0.5% = $251.25\nGas: ~$45\nTotal fees: $642.00\nNet profit: $250 - $642 = -$392
Result: Net Profit: -$392.00 | Not profitable โ spread too small to cover fees
Frequently Asked Questions
What is a flash loan in DeFi?
A flash loan is an uncollateralized loan unique to decentralized finance (DeFi) that must be borrowed and repaid within a single blockchain transaction. Introduced by Aave in 2020, flash loans allow anyone to borrow millions of dollars instantly without any collateral, provided the full amount plus fees is returned before the transaction completes. If the loan is not repaid, the entire transaction is reverted as if it never happened, meaning the lender faces zero risk. Flash loans are primarily used for arbitrage (exploiting price differences across exchanges), collateral swaps, and self-liquidation. They democratize access to large amounts of capital for trading opportunities that were previously only available to well-capitalized traders.
How does flash loan arbitrage work?
Flash loan arbitrage exploits price discrepancies of the same asset across different decentralized exchanges (DEXs). The process works in a single transaction: first, you borrow a large sum via a flash loan from a protocol like Aave or dYdX. Second, you buy the underpriced asset on one DEX (e.g., Uniswap). Third, you sell the same asset at the higher price on another DEX (e.g., SushiSwap). Fourth, you repay the flash loan plus fees. Fifth, you keep the remaining profit. All of this happens atomically in one transaction, meaning if any step fails, everything reverts. The profit margin must exceed the combined costs of the flash loan fee, DEX trading fees, slippage, and gas costs.
What are the risks of flash loan arbitrage?
While flash loans themselves are risk-free (failed transactions simply revert), several practical risks exist. Gas costs can consume profits, especially during network congestion when gas prices spike. Front-running bots watch the mempool and can execute your arbitrage trade before you, eliminating the price difference. Slippage on large trades can significantly reduce the actual profit compared to the quoted price. Smart contract bugs in your arbitrage contract could lead to unexpected behavior. The price difference may disappear between when you submit the transaction and when it executes. Additionally, developing and deploying flash loan smart contracts requires substantial Solidity programming expertise, and vulnerabilities in your code could potentially be exploited.
What fees are involved in flash loan arbitrage?
Flash loan arbitrage involves multiple layers of fees that can quickly erode profits. The flash loan protocol fee is typically 0.09% on Aave and 0.3% on dYdX (though dYdX actually charges 0 for flash loans but requires 2 wei). DEX trading fees apply on both the buy and sell sides, typically 0.3% per swap on Uniswap V2 or 0.05-1% on Uniswap V3 depending on the pool. Gas fees for executing the transaction on Ethereum can range from $5 to $500+ depending on network congestion and transaction complexity. Price slippage on both trades further reduces returns. To be profitable, the price spread between exchanges must exceed all these combined costs, which typically means you need at least a 0.5-1% price difference for profitable arbitrage.
Which protocols support flash loans?
Several major DeFi protocols support flash loans across multiple blockchain networks. Aave is the most popular flash loan provider, available on Ethereum, Polygon, Avalanche, Arbitrum, and Optimism, charging a 0.09% fee (or 0% for Aave V3 when repaying with aTokens). dYdX offers flash loans on Ethereum with effectively zero fees. Uniswap V2 and V3 provide flash swaps, which function similarly to flash loans but operate through their liquidity pools. Balancer offers flash loans with no fees on their pool assets. DODO exchange provides flash loans as well. On Binance Smart Chain, PancakeSwap offers flash swaps. The choice of protocol affects fees, available assets, and maximum borrowable amounts, which can reach hundreds of millions of dollars.
How accurate are the results from Flash Loan Profit Calculator?
All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.
References
Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy