uniswap – Understanding Price Differences Between Pair Contracts and Swap Pair Contracts

pairingsswapsuniswap

I created a few bots to pull data from Uniswap. For example, using ETH/DAI. Even though the pairs are the same, the contract ID's are different for pairs and swap. Why is it that the swap price predominantly lower than the pair price?

enter image description here

Best Answer

The pair price is the price that you will get if you trade an infinitesimally small amount. It is a theoretical equilibrium price that you will never get in practice.

The swap price is the price that you will get if you swap the given amount (1 Eth in your screenshot). The swap price will always be lower than the pair price because of the "price impact" (something referred to as slippage), which is inherent to how AMM work. The bigger the swap in relation to the size of the pool, the worst price you will get. You can learn more about it here. The swap price most likely also include the swap fee that you pay to the liquidity providers (often 0.2% or 0.3%).

Related Topic