Crypto Newbie

Crypto Newbie / Simulators / Uniswap V2

Uniswap V2 Simulator — Bonding Curve x·y=k

Uniswap V2 was the first AMM to succeed at scale. A pool holds two tokens, swap pricing is set by x · y = k. The simulator below is fully interactive — swap to see the bonding curve move, change the external price to watch impermanent loss in real time.

After swapNowETHUSDC
100%75%50%25%0
1,000
ETH
100%75%50%25%0
2M
USDC
You give
ETH
You receive
19,743.1607USDC
1,974.3161 USDC/ETH
2,000 USDC/ETH
-1.967%
-1.284%
0.03 ETH

Quick try — pick a scenario

No swap yet

Press "Execute swap" above to see a step-by-step breakdown of what happened in the pool.

Bonding curve x · y = k — the simple explanation

Say a pool holds 1,000 ETH (x) and 2,000,000 USDC (y). k = 2,000,000,000. When you add 10 ETH, x rises to 1,010. To keep k constant, y must fall to 2,000,000,000 / 1,010 ≈ 1,980,198. You receive 2,000,000 − 1,980,198 = 19,802 USDC. The effective rate is 1,980.2 USDC/ETH — worse than the spot 2,000 because the curve bends: the bigger the trade, the worse the price.

How do liquidity providers earn?

Every swap adds 0.3% in fees to the reserves. Reserves grow → each LP share is worth more. On high-volume pools (USDC/ETH) those 0.3% × daily volume can compound to a 10–50% APY. But LPs also bear impermanent loss when price moves — net yield ≈ fees − IL.

Why is V2 capital-inefficient?

In V2, liquidity is spread across all prices from 0 to infinity — but most trades happen in a narrow band around spot. So most of the liquidity sits idle. V3 fixed this by letting LPs concentrate liquidity into a chosen price range.

🎯 Uniswap V3 Simulator

Frequently asked questions

+How does Uniswap V2 work?

V2 uses the constant-product formula x · y = k — the product of the two token reserves stays constant (except for fees). When you swap, one reserve grows and the other shrinks along the curve, producing an automatic price.

+What does x · y = k mean?

x and y are the amounts of token A and B in the pool. k is the invariant — unchanged by any swap. The curve x · y = k is a hyperbola; the current point on it is the effective exchange rate between A and B.

+What is price impact?

It's how much the price moves after your swap. A big trade against a small pool pushes you far along the bonding curve → worse price. The deeper the pool, the smaller the price impact.

+Is impermanent loss real?

Yes. If ETH doubles after you add liquidity to an ETH/USDC pool, your LP position is worth about 5.7% less than simply holding the original ETH. The larger the move, the larger the IL. Try the 'Impermanent Loss' tab in the simulator.

+Where does the 0.3% fee go?

On the real Uniswap, 0.3% of every swap is added to the pool reserves — increasing each LP share's value. This simulator uses the V2 default of 0.3%. That's how LPs still earn despite IL.

+Will I lose real money using the simulator?

No. The simulator runs entirely in your browser with simulated math. There's no wallet connection and no on-chain transaction.