Price impact (slippage) on AMM pools: Uniswap V2 & V3 vs BrownFi
February 21st, 2025

Keys to take away:

  • The only thing a trader cares is average trading price with small slippage as possible. Higher liquidity concentration makes lower price impact, smaller slippage.

  • BrownFi AMM offers capital efficiency and trading experience equivalently to Uniswap V3 pools. Particularly, BrownFi pool with K=0.001K=0.001 is mostly equivalent to Uniswap V3 range Β±1%\pm1\%.

  • If K=2K=2, then BrownFi pool and Uniswap V2 are identical.

A little math of AMMs

Uniswap V2 introduced automated market making (AMM) based on a constant product market making (CPMM) formula xβˆ—y=kx * y=k, where the token price is defined by token reserve in the pool p=y/xp=y/x. Consider the pool with token reserve (10, 10), liquidity and swap constant xβˆ—y=10βˆ—10=100x* y=10* 10=100 with the initial price P=1P= 1. A swap out of Ξ”x\Delta x of token X must provide Ξ”y\Delta y of token Y in exchange. The CPMM formula gives us (xβˆ’Ξ”x)(y+Ξ”y)=kβ‡’Ξ”y=kxβˆ’Ξ”xβˆ’y.(x-\Delta x)(y+\Delta y)=k \Rightarrow \Delta y = \frac{k}{x-\Delta x}-y.

Uniswap V3 introduced the concentrated liquidity market making (CLMM) based on the orginal constant product (i.e. the CPMM formula), allowing us to find a curve limited by a price range such that it can serve the trade with optimal capital. Regarding Uniswap V3 model, a liquidity position is defined by both token reserve (x,y)(x, y) and a price range [pa,pb][p_a, p_b]. The liquidity and swap constant of V3 model reads

(x+LpB)(y+Lpa)=L2(x+\frac{L}{\sqrt{p_B}})(y+L\sqrt{p_a})=L^2,

where L is the virtual liquidity (comparable to the equivalent V2 model, i.e. xβˆ—y=L2x* y =L^2).

For simplicity and without loss of generality, we take price lower bound pa=1.0001βˆ’np_a = 1.0001^{-n}, price upper bound pb=1.0001np_b = 1.0001^n, symmetrically. For n=100,pa=1.0001βˆ’100β‰ˆ0.99n=100, p_a= 1.0001^{-100} \approx 0.99 and pb=1.0001100β‰ˆ1.01p_b=1.0001^{100} \approx 1.01, resulting Β±1%\pm1\% range. For n=200,pa=1.0001βˆ’200β‰ˆ0.98n=200, p_a= 1.0001^{-200} \approx 0.98 and pb=1.0001200β‰ˆ1.02p_b = 1.0001^{200} \approx 1.02, resulting Β±2%\pm2\% range. Let consider 3 ranges of the same token reserve.

  • Uniswap V3 pool1 has reserve (10,10), range [-9.5%, +10.5%] (i.e. n=1000n=1000). The constant product is (x+2051.0001500)(y+2051.0001500)β‰ˆ2052(x+\frac{205}{1.0001^{500}})(y+\frac{205}{1.0001^{500}})\approx 205^2 having liquidity leverage (so capital efficiency) 20510β‰ˆ20.5\frac{205}{10} \approx 20.5

  • Uniswap V3 pool2 has reserve (10,10), range Β±2%\pm2\%. The constant product is (x+10001.0001100)(y+10001.0001100)β‰ˆ10002(x+\frac{1000}{1.0001^{100}})(y+\frac{1000}{1.0001^{100}})\approx 1000^2, having capital efficiency 100010β‰ˆ100\frac{1000}{10} \approx 100

  • Uniswap V3 pool3 has reserve (10,10), range Β±1%\pm1\%. The constant product is (x+20001.000150)(y+20001.000150)β‰ˆ20002(x+\frac{2000}{1.0001^{50}})(y+\frac{2000}{1.0001^{50}})\approx 2000^2, having capital efficiency 200010β‰ˆ200\frac{2000}{10} \approx 200

Because x=yx=y and 1pB=pa\frac{1}{\sqrt{p_B}}=\sqrt{p_a}, we have (x+LpB)2=L2,x+LpB=L(x+\frac{L}{\sqrt{p_B}})^2=L^2, x+\frac{L}{\sqrt{p_B}}=L. A swap out of Ξ”x\Delta x of token X must provide Ξ”y\Delta y of token Y in exchange. The CLMM formula gives (x+LpBβˆ’Ξ”x)(y+Lpa+Ξ”y)=L2⇔(Lβˆ’Ξ”x)(L+Ξ”y)=L2(x+\frac{L}{\sqrt{p_B}}-\Delta x)(y+L\sqrt{p_a} +\Delta y)=L^2 \Leftrightarrow (L-\Delta x)(L +\Delta y)=L^2

and hence Ξ”y=L2Lβˆ’Ξ”xβˆ’L.\Delta y=\frac{L^2}{L-\Delta x}-L.

BrownFi AMM introduced a novel oracle-based AMM model. Given a token reserve (x,y)(x, y) and an amount Ξ”x\Delta x of token X to be swapped out, trader must pay Ξ”y\Delta y of token Y in exchange, simply defined by:

  • Ξ”y=P(1+R2)Ξ”x\Delta y = P(1+\frac{R}{2})\Delta x, where PP is the global price fed by oracle;

  • The term R2\frac{R}{2} is related to slippage (alternatively, price impact), where R=Kβˆ—Ξ”xxβˆ’Ξ”xR=\frac{K * \Delta x}{x-\Delta x};

  • Kappa (KK) is the parameter controlling liquidity concentration on BrownFi's pools.

We consider four liquidity concentration on BrownFi AMM, controlled by K1=1,K2=0.1,K3=0.01,K4=0.001K_1=1, K_2=0.1, K_3=0.01, K_4=0.001.

What do traders care?

The average trading price is the only thing a trader cares, defined by Ξ”yΞ”x\frac{\Delta y}{\Delta x}. Smaller price impact, closer trading price to global price, better experience for average traders. Higher liquidity concentration makes lower price impact, smaller slippage, better trading experience. Standardizing token reserve (10,10), initial price P=1P=1 for all pools of Uniswap and BrownFi's AMMs, we will compare price slippage Ξ”yΞ”xβˆ’1\frac{\Delta y}{\Delta x}-1 between them. In prior to comparison, we find the intersections of the slippage curves (equivalently price impact curves). Each intersection represents order size (over the total of 10 token reserve) and percentage of slippage.

Intersections between slippage curves
Intersections between slippage curves
Slippage curves: Uniswap V2 & V3 vs BrownFi's pools
Slippage curves: Uniswap V2 & V3 vs BrownFi's pools

Slippage (price impact) comparison

  • Easily see that Uniswap V2 causes greater slippage than all BrownFi pool (for K<2K<2). Particularly, if K=2K=2, then BrownFi and Uniswap V2 are identical.

  • Regarding three Uniswap V3 pools, each BrownFi pool (K3,K4K_3, K_4) has lower slippage on the left side of the intersecting point, greater on the right, respectively. Particularly, BrownFi K4=0.001K_4=0.001 is mostly equivalent to Uniswap V3 range Β±1%\pm1\%.

Further on capital efficiency comparison, we have:

Capital efficiency: BrownFi vs Uniswap
Capital efficiency: BrownFi vs Uniswap

Contact us

Website, Twitter, Telegram, blog

Subscribe to BrownFi AMM
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from BrownFi AMM

Skeleton

Skeleton

Skeleton