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
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
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 x||Pool x||Pool y||Pool x’||Pool y’||Price||Price’||Increase|
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.