How a token's price actually works: the constant product formula, explained

A token's price on Uniswap isn't set by anyone - it emerges from one equation, x times y equals k. We walk through it with real numbers: why buying moves the price, why you never pay the price you see (slippage), why thin liquidity makes the price violent, and why a token's market cap can be almost entirely fake. The same math is what separates a real market from a honeypot.

Beginners assume a token has a price the way a shelf in a shop has a price tag: someone decided it, and you pay it. On a decentralized exchange that is not how it works at all. Nobody sets the price. It emerges from one equation, and once you can run the arithmetic, almost everything else about trading risk becomes obvious.

The one rule: x · y = k

A Uniswap v2 pool holds two reserves: some amount of the token (call it x) and some amount of ETH (call it y). The pool’s only job is to keep their product constant:

x · y = k

The price isn’t stored anywhere. It’s just the ratio of what’s in the pool right now:

spot price = y / x   (ETH per token)

Start with a fresh pool: 1,000 tokens and 1,000 ETH.

k = 1,000 · 1,000 = 1,000,000
spot price = 1,000 / 1,000 = 1 ETH per token

So far this matches the intuition: 1 token = 1 ETH. Now watch what happens when someone trades, because this is where intuition breaks.

Buying does not work the way you’d guess

Here’s the trap. You might think: “I’ll buy 100 tokens for 100 ETH, so the pool becomes 900 tokens and 1,100 ETH.” But check the rule:

900 · 1,100 = 990,000   ≠   1,000,000

That violates x · y = k, so the pool will never let it happen. The invariant is sacred - every trade has to leave k unchanged. Let’s do it correctly, both ways.

If you put in 100 ETH:

new ETH reserve  y' = 1,100
new token reserve x' = k / y' = 1,000,000 / 1,100 = 909.09
tokens you receive = 1,000 − 909.09 = 90.9 tokens   (not 100)

You paid 100 ETH for 90.9 tokens, an average of 1.10 ETH each - even though the price started at 1.00. And you left the pool at a new spot price of 1,100 / 909.09 = 1.21 ETH per token.

If instead you demand exactly 100 tokens:

new token reserve x' = 900
new ETH reserve   y' = k / x' = 1,000,000 / 900 = 1,111.11
ETH you must pay = 1,111.11 − 1,000 = 111.11 ETH   (not 100)

Either way, the naive “100 for 100” is impossible. You get fewer tokens, or you pay more ETH, than a fixed price would suggest.

What you doYou get / payAvg priceNew spot price
Start - - 1.00 ETH
Spend 100 ETHget 90.9 tokens1.10 ETH1.21 ETH
Buy 100 tokenspay 111.11 ETH1.11 ETH1.23 ETH

(For clarity these ignore the 0.3% swap fee, which shaves a little more off what you receive. The shape of the result is identical.)

Plotted, the rule is a curve, and a trade is a slide along it. Every possible state of the pool lives on the line x · y = 1,000,000. Buying with 100 ETH slides you from the green dot to the red one - fewer tokens left, more ETH in, a steeper price:

start: 1000 / 1000 - price 1.00after +100 ETH: 909 / 1100 - price 1.2110001000token reserve →ETH reserve →x · y = 1,000,000

This gap has a name: slippage

The difference between the price you saw (1.00) and the average price you actually paid (1.10) is slippage, and the difference between the price before and after your trade (1.00 to 1.21) is price impact. Both come from the same fact: buying removes tokens from the pool, which makes the remaining ones scarcer, which raises the price as you go. You are climbing the price while you buy it.

The bigger your order relative to the pool, the steeper the climb. Tiny trades barely move it; large trades move it a lot. That single relationship is the whole game.

Why liquidity is the number that matters

Run the exact same 100 ETH buy against pools of different sizes and the difference is dramatic:

Pool size (token / ETH)Spot beforeSpot after 100 ETH buyPrice impact
100 / 1001.002.00+100%
1,000 / 1,0001.001.21+21%
10,000 / 10,0001.001.02+2%
100,000 / 100,0001.001.002+0.2%

Same trade, wildly different outcomes - the same 100 ETH buy is a sledgehammer on a thin pool and a feather on a deep one:

Same 100 ETH buy - price impact by pool depth+100%+21%+2%+0.2%pool 100/1001,000/1,00010k/10k100k/100k(thin = dangerous)(deep = stable)

On a thin pool, 100 ETH doubles the price; on a deep one it barely registers. This is why liquidity is the single most important number on any token you look at. It decides whether the price is real or whether it can be shoved around by anyone with a modest bag.

And it cuts both ways. A thin pool that a small buy can double is also a thin pool that a small sell can collapse to near zero. There is no “rug pull” event needed when the pool is paper-thin to begin with - the exit is already a cliff.

The illusion: market cap

People quote a token’s “market cap” as spot price × total supply and treat it as money that exists. It usually doesn’t.

That spot price is only valid for an infinitesimally small trade. The moment you try to sell any meaningful amount, you walk down the same curve you climbed buying - each token you sell lowers the price for the next. On a token with 5 ETH of liquidity and a quoted 5,000,000 market cap, you cannot extract 5,000,000. You can extract roughly what’s in the pool, and the act of trying craters the quoted price. The market cap was a number on a screen, not a treasury.

This is exactly where most scams live. A deployer seeds a tiny pool, the constant-product math prints an enormous “price” and “market cap,” screenshots circulate, buyers arrive - and the only liquidity in the building is the few ETH the deployer can pull at any moment.

The honeypot: this same machine, exit bolted shut

Everything above assumes the curve runs both directions: you can climb it buying and walk back down selling. A honeypot is this exact pool with the sell path disabled in the contract. The constant-product math still quotes you a beautiful rising price as people buy. But when you try to sell, the contract reverts. You climbed the curve in; there’s no path out.

That’s why we don’t just read the quoted price. RektRadar simulates a buy and a sell against the live contract, measures the real price impact the pool would inflict, and checks whether the liquidity is locked or sitting in the deployer’s wallet ready to leave. The price on the screen is the output of x · y = k. The questions that actually protect you are: how deep is the pool, who controls it, and does the sell side even work?

Paste any Ethereum token into the free rug pull detector at app.rektradar.io and it answers those three before you send anything in.