How Uniswap V2 Liquidity Depth Affects Trading and Price Action

This is the fifth article from the deep dive series on how Uniswap V2 liquidity pools work and it focuses on liquidity depth and how it affects trading and price action.

Liquidity depth and how it evolves over time is probably the most important concept traders should know. Surprisingly, most traders do not even know what liquidity depth means, much less how it precisely affects trading and price action.

To understand how the liquidity depth affects trading and price action, we first need to revisit the main Uniswap V2 math function

\(x*y=k\)

Here, k translates to the depth of the pool, and is calculated by multiplying x by y. A simple rule of thumb to follow is: the larger the depth of the pool, the less price action it will have. We will understand why that is the case in this article.

We have previously discussed how to determine the price of an asset denominated in another asset, this was explained in detail in the second article of this series how price is discovered in Uniswap V2. The calculation is simple, for example, if we want to determine the price of y in x, we calculate that by dividing x by y, i.e. price_y = x/y.

Through these series, we also have learned that when we exchange x tokens for y tokens, meaning we buy y tokens in exchange for x tokens, the price of y tokens increases, and this intuitively makes sense, but through the formula above it also makes sense, because after the exchange, the pool will have more x tokens and less y tokens and therefore the x/y division will result in a higher value, because we are dividing a now larger x by a now smaller y, and hence the price will have a higher value.

Mathematically, what we are saying is something like the following

\( Price_{y0} = \dfrac {x}{y} \)
\(Price_{y1} = \dfrac {x+\triangle x}{y – \triangle y}\)

We have also previously discussed (on the fourth article of these series about managing liquidity in liquidity pools) that we can add and remove liquidity from the liquidity pool. When we add liquidity, we need to add a proportional amount of x and y tokens respectively to each side of the pool, according to the current exchange rate between x and y. As we do that, we increase the amount of x and y tokens in the pool, and therefore the depth of the liquidity, too. As we stated before, the rule of thumb is the larger the depth the lesser the price action.

Let’s see that in practice. In the following table, we calculate how the same trade amount affects each side of the pool and price, at different pool depths.

Buy xPool xPool yPool x’Pool y’PricePrice’Increase
10101020514300%
1020203013.333333312.25125%
1030304022.511.777777878%
104040503211.562556%
1050506041.666666711.4444%
1060607051.428571411.361111136%
1070708061.2511.306122431%
1080809071.111111111.26562527%
1090901008111.234567923%
1010010011090.909090911.2121%
10110110120100.83333311.190082619%
10120120130110.76923111.173611117%
10130130140120.71428611.159763316%
10140140150130.66666711.147959215%
10150150160140.62511.137777814%
10160160170150.58823511.128906313%
10170170180160.55555611.121107312%
10180180190170.52631611.114197511%
10190190200180.511.108033211%
10200200210190.4761911.102510%

The table above clearly shows that as we increase the liquidity pool depth by increasing the amount of x and y tokens on each side of the pool, we get a lower and lower price action for the same trade amount of 10 x tokens. And intuitively this makes sense, because the same trade shifts around proportionally less tokens in the pool as the pool depth grows in size.

This in turn means that high liquidity depth will translate to a low price action. It is interesting to note here again that this is completely different to a traditional centralized exchange, where you have bids and asks from humans. Here, we have a completely different mechanism, where price is determined programmatically according to the current liquidity depth and incoming trades. It does mimic, to some extent, how traditional centralized exchanges work, but it is clearly different, and should be taken as different. Traders should use this information to their advantage, to better predict how prices will evolve taking into account what trades have occurred in the past and how liquidity will evolve over time.

As previously discussed, buys and sells only push slippage around if liquidity depth isn’t increased in between trades. This means that Uniswap V2 works like a slingshot, that over time pushes price back to its original position if liquidity depth doesn’t change in the meanwhile. This is why managing liquidity properly is fundamental to any token, and should be analyzed by all serious investors.

This concludes our last article on our deep dive into Uniswap V2. We hope you liked it, and have have considered them useful for your future DeFi trades.

«
»