šŸ’°Related Pricing

As every economic system, the price will be determined by supply and demand. In our particular case scenario, prices of tokens in an LP are determined by the supply of the tokens, i.e., the amounts of reserves of the tokens that the pool is holding. Token prices are simply relations of reserves:

Px=yx;Py=xyP_x = \frac{y}{x} ; P_y = \frac{x}{y}

Where PxP_x and PyP_y are prices of tokens in terms of the other token. Such prices are called spot prices and they only reflect current market prices. Howe- ver, the actual price of a trade is calculated differently as high demand increases price. We want the price to be high when demand is high, and we can use pool reserves to measure the demand: the more tokens you want to remove from an LP, the higher the impact of demand is. Mathematically:

Ī”y=(yā‹…Ī”x)(x+Ī”x)\Delta y = \frac{(y \cdot \Delta x)}{(x + \Delta x)}

Ī”x=xā‹…yyāˆ’Ī”y)\Delta x = \frac{x \cdot y}{y - \Delta y)}

Last updated