Pool Reserves: How A DEX Sets Your Swap Price
A pool’s reserve ratio sets the starting exchange rate, while the amount you trade shifts that ratio and usually worsens your rate. For a constant-product pool, the rule is x × y = k: after a swap, the product of the two token balances must stay roughly constant, with fees accounted for.
How does a V2 pool set its starting price?
A V2 pool starts with two token reserves, and their ratio gives its mid-price: the pool’s current reference rate before a trade’s size and fee affect what you receive. If a pool holds 10,000 USDC and 5 ETH, its mid-price is 2,000 USDC per ETH, or 0.0005 ETH per USDC.
The pool has no order book listing buyers and sellers. Instead, a smart contract calculates how much of the output token can leave while keeping the reserve product near its starting value. As tokens enter and leave, the ratio changes, so the price adjusts automatically.
Here is a worked example. Suppose you swap 100 USDC into that pool, ignoring fees for a moment. The constant-product calculation gives about 0.049505 ETH: the pool’s USDC reserve rises to 10,100, and its ETH reserve falls to about 4.950495. The average rate is about 2,020 USDC per ETH, worse than the starting 2,000 rate.
That difference caused by your trade is price impact. It grows when your swap is large compared with the pool’s reserves, which is why a deeper pool usually gives a better rate for the same order. It is separate from the trading fee: for example, with a 0.30% fee, the pool applies the pricing formula to roughly 99.7 USDC of that 100 USDC input, leaving you with about 0.04936 ETH before any other costs.
V2 suits someone who wants a straightforward pool where liquidity is spread across the full price curve. The trade-off is that a large swap can move the price noticeably, while a small pool may have poor rates even for modest orders. On QuickSwap, V2 pools use this reserve-based model; the fee depends on the pool, so check the quote rather than assuming a single rate.
What changes when liquidity is concentrated in V3?
V3 still prices swaps through pool liquidity, but providers can concentrate their funds within a chosen price range instead of supporting every possible price. When the market price is inside that range, more liquidity may be available near the current price, which can reduce price impact for a given trade size.
Think of the reserve ratio as the starting point in V2, and active liquidity around the current price as the useful measure in V3. As a swap moves the price through a range, the pool applies its pricing rule along the way; it may cross multiple price steps, called ticks, and use liquidity from each active segment. That is why a V3 quote can depend on which ranges are funded, not simply on the total tokens deposited.
V3 can suit traders when enough liquidity is active near the price they need. It can fit less well when liquidity is thin there or a price move has taken a provider’s position out of range. In that case, the pool may offer less usable liquidity for the trade, even if its total deposits look large. This range-based model is the key trade-off behind QuickSwap V3.
What should you compare before a swap?
Start with the quoted output, then check the pool or route, the estimated fee, and the price impact. A route can use more than one pool, so the displayed rate may reflect several reserve changes rather than a single pair. Check that the selected network is also the one holding the tokens you intend to trade.
Keep slippage tolerance separate from price impact. Price impact is the estimated effect of your trade on the pool; slippage is how much the rate may change between the quote and transaction execution. The minimum received amount sets the lowest output you will accept. If the pool changes too much before confirmation, the swap can fail rather than deliver less than that limit.
The reserve calculation explains how a swap is priced; the separate choice of which QuickSwap pool suits your liquidity depends on how you plan to provide capital. For a trade, compare the final output and impact at your actual order size, because the most useful pool is the one with enough active liquidity for that swap.
Comments
Post a Comment