Dex Swap Fee Calculator
Calculate total swap costs on Uniswap, SushiSwap, and PancakeSwap including slippage and gas. Enter values for instant results with step-by-step formulas.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Dex Swap Fee Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Total Cost = Trading Fee + Slippage + Gas Cost + Price Impact
Worked example โ Total swap cost: ~$54.00 (1.08% of trade). You receive approximately $4,946 in ETH.
Formula
Total Cost = Trading Fee + Slippage + Gas Cost + Price Impact
Trading fee is the LP fee percentage of trade amount. Slippage is the expected price movement tolerance. Gas cost equals gas units times gas price in gwei times 10^-9 times ETH price. Price impact depends on trade size relative to pool liquidity.
Worked Examples
Example 1: Standard Uniswap V3 ETH/USDC Swap
Problem:Swap $5,000 USDC to ETH on Uniswap V3 (0.30% tier), with 0.5% slippage tolerance, gas at 30 gwei, ETH at $3,000.
Solution:Trading fee = $5,000 * 0.30% = $15.00 Slippage (expected) = $5,000 * 0.5% = $25.00 Gas cost = 150,000 * 30 gwei * 10^-9 * $3,000 = $13.50 Price impact (est.) = ~$0.50 Total cost = $15.00 + $25.00 + $13.50 + $0.50 = $54.00
Result:Total swap cost: ~$54.00 (1.08% of trade). You receive approximately $4,946 in ETH.
Example 2: Small Trade Gas Impact Analysis
Problem:Compare the effective cost rate for a $200 vs $10,000 swap on Uniswap V3 (0.30% tier) with gas at 25 gwei.
Solution:$200 trade: Trading fee: $0.60 | Gas: ~$11.25 | Total: ~$11.85 | Rate: 5.93% $10,000 trade: Trading fee: $30.00 | Gas: ~$11.25 | Total: ~$41.25 | Rate: 0.41% Gas is fixed regardless of trade size.
Result:The $200 trade costs 5.93% in fees vs 0.41% for $10,000. Gas dominates small trades.
Frequently Asked Questions
What fees do decentralized exchanges charge for swaps?
Decentralized exchanges charge multiple fees that traders must account for. The primary cost is the liquidity provider fee, which is a percentage of the trade amount paid to users who supply liquidity to the pool. On Uniswap V3, this ranges from 0.01 percent for stablecoin pairs to 1 percent for exotic tokens, with 0.05 percent and 0.30 percent being the most common tiers. SushiSwap charges a flat 0.30 percent with 0.25 percent going to liquidity providers and 0.05 percent to the protocol treasury. PancakeSwap on BNB Chain charges 0.25 percent. Beyond the LP fee, traders also pay blockchain gas fees for transaction execution, and may experience slippage and price impact depending on trade size and pool liquidity.
What is slippage and how does it affect my swap cost?
Slippage is the difference between the expected price of a trade and the actual executed price. It occurs because prices can change between when you submit a transaction and when it is confirmed on the blockchain. In decentralized exchanges, slippage has two components: market slippage from natural price movement during confirmation time, and price impact from your trade itself changing the pool ratio. Setting a slippage tolerance protects you by reverting the transaction if the price moves beyond your threshold. A typical tolerance of 0.5 to 1 percent works for most trades, but volatile tokens or low-liquidity pools may require higher tolerances of 2 to 5 percent. Setting slippage too high exposes you to sandwich attacks by MEV bots.
How do gas fees impact small trades on Ethereum?
Gas fees on Ethereum can make small trades economically impractical. A typical Uniswap swap costs approximately 120,000 to 200,000 gas units. At a gas price of 25 gwei with ETH at $3,000, this translates to roughly $9 to $15 per swap regardless of trade size. For a $100 trade, gas alone adds 9 to 15 percent in costs, making the trade barely worthwhile. For a $10,000 trade, gas represents only 0.09 to 0.15 percent, which is negligible. This is why Layer 2 solutions like Arbitrum, Optimism, and Base have gained popularity, offering gas costs of pennies rather than dollars. The break-even trade size where gas becomes less than 1 percent of the trade varies with network conditions.
Which Uniswap V3 fee tier should I use for my swap?
Uniswap V3 offers four fee tiers optimized for different asset types. The 0.01 percent tier is designed for stablecoin-to-stablecoin swaps like USDC to USDT where prices barely move. The 0.05 percent tier works well for correlated pairs like ETH to stETH or different wrapped Bitcoin versions. The 0.30 percent tier is the standard for most token pairs like ETH to USDC or popular ERC-20 tokens, offering deep liquidity and reasonable fees. The 1.0 percent tier exists for exotic or very volatile tokens where liquidity providers need higher compensation for impermanent loss risk. Always check which tier has the deepest liquidity for your specific pair, as routing through the highest-liquidity pool typically gives the best execution price.
How can I minimize total swap costs on DEXes?
Several strategies can significantly reduce your swap costs on decentralized exchanges. First, use DEX aggregators like 1inch, Paraswap, or CowSwap that automatically route your trade across multiple pools and protocols to find the best price including all fees. Second, trade during periods of low gas prices, typically weekends and late nights in US time zones, when Ethereum network congestion is lower. Third, consider Layer 2 networks where gas fees are dramatically lower. Fourth, for large trades, split them into smaller orders over time to reduce price impact. Fifth, use limit orders instead of market swaps when possible to avoid slippage entirely. Sixth, set appropriate slippage tolerance to prevent MEV sandwich attacks while avoiding failed transactions from setting it too low.
What are gas fees and why do they vary?
Gas fees are transaction costs paid to network validators. They vary based on network congestion. Ethereum gas can spike during high demand. Layer-2 solutions like Arbitrum and Optimism offer significantly lower fees.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎCrypto Exchange Fee Comparison Calculator
Compare trading fees across Binance, Coinbase, Kraken, and Bybit for your volume tier.
๐งฎGas Fee Optimizer
Estimate optimal gas price and transaction timing for Ethereum network transactions.
๐งฎCross-Chain Bridge Fee Calculator
Compare bridging fees across Stargate, Across, LayerZero, and Wormhole for token transfers.
๐งฎLayer 2 Fee Comparison Calculator
Compare transaction fees across Arbitrum, Optimism, Base, zkSync, and Polygon.
๐งฎCardano Staking Calculator
Calculate ADA staking rewards from delegation amount, pool fee, and epoch returns.
โฝCrypto Gas Fee
Estimate Ethereum and EVM chain gas fees in Gwei, USD, and native token for transfers, swaps, and smart contract interactions
๐งฎCrypto Tax Lot Calculator
Calculate capital gains using FIFO, LIFO, HIFO, and specific identification for crypto trades.
๐งฎCrypto Airdrop Tax Calculator
Calculate tax liability on crypto airdrops based on fair market value at time of receipt.