Flash loans let you borrow large sums with no collateral because the loan must be repaid within the same blockchain transaction. If the repayment does not happen, the entire transaction reverts as if the borrow never occurred. This atomicity is what makes them safe for protocols to offer — but the protocol fee plus gas costs create a hard floor on how thin an arbitrage can be. This calculator shows exactly what that floor is.
How it works
The protocol charges a flat premium on the notional borrowed amount. That fee, plus the gas cost of the transaction bundle, is your total cost. The break-even spread is the minimum price difference needed just to cover those costs:
protocol fee = amount × fee_rate
total repayment = amount + protocol_fee
total cost = protocol_fee + gas_cost
break-even % = (total_cost ÷ amount) × 100
net profit = (amount × target_spread%) − total_cost
Protocol fee rates
| Protocol | Flash loan fee | Notes |
|---|---|---|
| Aave V3 | 0.05% | Governance-adjustable premium |
| dYdX | 0.00% | No protocol fee; gas only |
| Balancer V2 | 0.00% | No protocol fee; gas only |
| Uniswap V3 | 0.30% (typical) | Pool fee tier — varies by pool |
The zero-fee protocols look attractive but Uniswap V3 flash swaps route through a pool with a real fee tier, so the effective cost depends on which pool you use (0.05%, 0.30%, or 1.00%).
Worked example
Borrowing 100,000 USD on Aave V3 with 40 USD estimated gas:
- Protocol fee: 100,000 × 0.0005 = $50
- Total cost: 50 + 40 = $90
- Break-even spread: (90 ÷ 100,000) × 100 = 0.09%
- Net profit at 0.5% target spread: (100,000 × 0.005) − 90 = $410
For a dYdX flash loan of the same size with 40 USD gas:
- Protocol fee: $0
- Break-even spread: (40 ÷ 100,000) × 100 = 0.04%
- Net profit at 0.5%: 500 − 40 = $460
What this calculator does not model
- Slippage and price impact: large trades move pool prices, especially in thinner markets. Your real spread narrows with every dollar of volume relative to pool liquidity.
- MEV competition: if the arbitrage opportunity is visible on-chain, other bots may race to capture it, compressing the spread to zero or requiring tips to block builders.
- Multi-hop routes: routing through multiple pools multiplies fees and slippage.
- Failed transaction gas: a flash loan that reverts still consumes gas. The gas cost field should reflect the full bundle cost, not just the fee.
Always simulate the full route against live reserves before deploying capital. Fee rates are protocol governance parameters and may change; verify current rates in the protocol’s documentation before sending any transaction.