DEX Swap Calculator
Calculate output amounts and price impact for decentralized exchange swaps
Report a Problem
Found a bug or have a suggestion? Help us improve this tool.
What is this tool?
The DEX Swap Calculator simulates token swaps on decentralized exchanges using the constant product formula (x × y = k). Input the trade amount, token reserve balances, and fee in basis points to see the output amount, price impact, and effective exchange rate. It visualizes the swap curve to help you understand slippage and liquidity dynamics.
How to use
- 1
Enter swap amount
Input how much of token 0 you want to swap.
- 2
Set pool reserves
Enter the current reserves of token 0 and token 1 in the liquidity pool.
- 3
Set fee and view results
Input the fee in basis points (e.g., 30 for 0.30%) and see the output amount, price impact, and swap curve.
Frequently Asked Questions
What is the constant product formula?
The formula x × y = k maintains the product of both token reserves as a constant. When you swap tokens, one reserve increases while the other decreases proportionally to keep the product unchanged. This is how Uniswap v2-style AMMs work.
What causes price impact?
Price impact occurs when your trade is large relative to the pool reserves. The larger the trade, the more the exchange rate shifts against you. This is why deep liquidity pools have less slippage.
What do basis points mean for fees?
One basis point = 0.01%. Uniswap charges 30 bps (0.30%), Sushiswap charges 30 bps (0.30%), and some concentrated liquidity pools charge as low as 1 bps (0.01%).