Questions about liquidity calculation #60
-
First of all, I'd like to acknowledge that this is probably the best material there exist regarding Uniswap V3. The book is just amazing. Regarding the question. I find it quite hard to grasp the section that describes the calculation of L. More specifically:
I'm not sure how to interpret this to, be honest. Why do we want to do that. What is our goal here. I mean why do we start calculating L based on this fact? The next part which again I'm struggling to understand is the two segments (Left and right).
I think the confusion stems from the fact that I find it hard to to conceptualise points b and a. What's the relation of these two points to the the the price boundaries in your example i.e. 4545 and 5500?
Does't the range between b and a include the liquidity that we're adding i.e. 1 ETH and 5000 USDC which means the entire area of that curve includes both tokens? Sorry for asking these questions, but I feel like this part if super vital to understand the remaining of the book and I'm kind of stuck at this point. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This comes from the nature of the constant product formula,
Points
Yes, but not in points |
Beta Was this translation helpful? Give feedback.
This comes from the nature of the constant product formula,$x * y = k$ : when liquidity is added, it must be spread evenly along the entire curve. This guarantees that there's liquidity at any point of the curve (at any price that's within the curve). Uniswap V2 used an infinite curve (it never crossed the axes) but Uniswap V3 uses curves that are limited by user-chosen prices. Thus, when a liquidity provider adds liquidity, it must be guaranteed that the liquidity is available at any price within the chosen price range, but not at the boundaries or outside of the price range.