Why this matters
Decentralized exchanges like Uniswap use constant-product automated market maker formulas to price token swaps. When you trade token A for token B, the AMM maintains the invariant that the product of the two reserve balances stays constant after each trade. This means large swaps move the price against you, a phenomenon known as slippage. Knowing the output amount before you execute a trade lets you set appropriate slippage tolerances and avoid unpleasant surprises where you receive far fewer tokens than expected.
The constant-product formula states that (x minus delta-x) multiplied by (y plus delta-y) equals k, where x is the input reserve, delta-x is the amount you are trading in, y is the output reserve, and delta-y is the amount you receive out. The fee is deducted from the input before the calculation, which means the effective delta-x is the input amount multiplied by (1 minus the fee rate). This tool implements that exact math so you can enter the reserve sizes from any Uniswap v3 pool and get a precise output estimate without connecting a wallet or interacting with the blockchain.
Understanding swap math is essential for arbitrage analysis, liquidity provision decisions, and simply making informed trades. If a pool has shallow liquidity relative to your trade size, the output will deviate significantly from the spot price. By running the numbers through this calculator first, you can decide whether the trade is worth executing or whether you should split it into smaller amounts across multiple pools.
Reference table
| Parameter | Description |
|---|---|
| Input amount | Quantity of the token you are selling |
| Input reserve | Total liquidity of the input token in the pool |
| Output reserve | Total liquidity of the output token in the pool |
| Fee tier | Pool fee: 0.05% for stable pairs, 0.30% for standard, 1.00% for exotic |
| Output amount | Estimated tokens received after fees and price impact |
How to use it
Enter the amount of the input token you want to swap.
Enter the current reserve size of the input token in the liquidity pool.
Enter the reserve size of the output token in the same pool.
Select the fee tier that matches your pool: 0.05%, 0.30%, or 1.00%.
Read the estimated output amount and the effective exchange rate.
Testing your result
Compare the tool's output against the same swap simulated on the Uniswap interface. Enter identical reserve sizes and input amounts, then check whether the quoted output matches within a small rounding tolerance. For small swaps relative to the pool size, the output should be very close to the spot price ratio. For large swaps, the difference between the spot price and the actual output reveals the price impact. You can also verify the math manually by computing (input reserve minus net input) multiplied by (output reserve plus output) and confirming the product equals the original k value.
Common mistakes
Using stale reserve data from a block explorer instead of the current on-chain reserves, which can change with every transaction.
Selecting the wrong fee tier, which causes the output estimate to be slightly higher or lower than the actual swap result.
Entering the token price instead of the reserve size, which produces a completely meaningless output.
Ignoring that the formula applies only to single-pool direct swaps and not to multi-hop routes through intermediate tokens.
Edge cases and options
If you attempt to swap an amount larger than the input reserve, the formula produces a negative or nonsensical output, because the pool does not have enough liquidity. The tool handles this gracefully by showing an error or warning. Stablecoin pairs like USDC/USDT typically use the 0.05% fee tier, which means the fee deduction is minimal and the output closely tracks the 1:1 ratio. Exotic or low-liquidity pairs use the 1.00% tier, where the fee has a more noticeable impact on the output. For multi-hop swaps, you would need to chain calculations manually: compute the output of the first pool, then use that as the input for the second pool.
Real-world use cases
Estimating the output of a large ETH-to-USDC swap before executing it on-chain to set an appropriate slippage tolerance.
Comparing swap outputs across different pools for the same token pair to find the best route.
Analyzing the price impact of adding or removing liquidity from a pool as part of yield farming decisions.
Backtesting hypothetical trades using historical reserve data to evaluate AMM strategy performance.
Frequently asked questions
Q: How is the output calculated?
A: Using the constant-product AMM formula: (x minus delta-x) multiplied by (y plus delta-y) equals k, where delta-x is the net input after fees and delta-y is the output. This gives a precise estimate for single-pool trades.
Q: Does this account for slippage?
A: The calculator shows the estimated output at current pool prices, which inherently includes the price impact of your trade size. For explicit slippage tolerance setting, use the Slippage Calculator.
Q: What if the pool uses a different fee?
A: The calculator supports the three standard Uniswap v3 fee tiers: 0.05% for stable pairs, 0.30% for standard pairs, and 1.00% for exotic pairs. Select the one that matches your target pool.
Q: Can I use this for multi-hop swaps?
A: Not directly. This tool computes single-pool swaps. For multi-hop routes, run the calculation for each hop sequentially, using the output of the first pool as the input for the second.
Start using it now
Try the Token Swap Calculator tool. See also Slippage Calculator, Impermanent Loss Calculator, and Gas Fee Calculator.