About AMMs (automated market makers):
Uniswap V2 uses a constant product model: ignoring fees, the product of the amounts of the two tokens in the pool remains unchanged before and after a swap.
AMM quotes are calculated solely from the ratio of the amounts of the two tokens in the pool. When the pool price diverges from the external market price, arbitrageurs bring it back toward the external price.
$UNI 4.702(-1.67%)