Uniswap Insights Part 2 of 6
In part 1 we looked into finding boundaries for capital efficiency. In this article we will look for boundaries when we are optimistic or pessimistic on price. We will finish with figuring out what we need to do to optimize for yield by constructing multiple LP positions within our boundary with the help of desmos.
The TLDR:
- Pick a directional bias by skewing the capital efficiency boundary.
- Slice the LP range into multiple LP positions to form a histogram.
- Save on gas costs. Rearrange LP positions one on top of another instead of lining them up to reduce the number of LP positions.
- Fit an LP position to your own distribution with desmos.
1. Pick Directional Bias
Recall that we solved for a way to balance capital efficiency while still maximizing an LP range in part 1 by setting an LP range to +/- 84%. The 84% boundary approach does not aim to optimize for yield and is not biased towards positive price movements. Let’s adjust our boundary for price direction bias by simply adding a parameter ’a’ for a skewed view on price.
To get the original 84% bound in part 1 we have a=1 in blue above. If we think the returns will move twice as high up rather than down, we set a=2. See below a visualization of a=[0…3]
If we think the price is down only, we can set a=0 and even discover that 87% for the lower price range becomes the maximum boundary for capital efficiency. Providing liquidity beyond from the current price ratio is marginally inefficient.
As we increase skew to, say 5, our optimal peak shifts to 80% for the lower boundary while the upper boundary shifts to 5x80%=400%.
Visualizing boundaries for every possible directional bias is difficult in two dimensions, but if we create a third axis for the derivative of capital efficiency, we can look at where it peaks in three dimensions.
We can find our +/-84% and our -80%/+400% on the surface as well in red and green dots respectively.
The main takeaway is that setting the lower bound p_a to below 87% is marginally inefficient. For optimists the important takeaway is that the lower bound is not that sensitive to the skew. At a skew of 10 (you perceive that price could evolve 10% up for every 1% down) one still has a lower bound of 77%.
Depending on our level of optimism or pessimism of where the price can move, we can adjust our efficiency boundary with a desmos tool: https://www.desmos.com/calculator/0l7i8kmukx . Providing liquidity beyond the skewed range decreases the amount of bang for one’s buck.
Another approach to finding boundaries
Note that one can also solve for the maximum range based on how little capital one elects to deploy to a pool. We can solve the equation for capital efficiency backwards. For example, if one has a portfolio of $100, one may only want to risk deploying $20 and store the other $80 in a treasury bond yielding a fixed rate. The capital efficiency goal ‘E’ becomes $100/$20 = 5. What should the boundaries be given such a bias of a=2?
I’ve made the tool available for calculating efficiency bounds as well here: https://www.desmos.com/calculator/a8kt8g6kia
***
No matter which approach is used to find the boundaries, one can now work within these boundaries to optimize even further.
Well, how do we do that? Now comes the fun part. We are going to slice our LP position!
“We Slice the LP position”
-Jerry Seinfeld-
2. Chopping the range up into multiple LP Positions
Recall that price has the tendency to disperse as time goes on. This means that it does not conform to the shape of our rectangular range as we observe the price ratio over time. Instead the price distribution diffuses around the entry price kind of like this:
As we move away from our starting price we would need to adjust the rectangular shape. The easiest way to do that is to split up our rectangular LP range into multiple ranges and make them fit inside a distribution. The LP position would be the integral within the efficiency boundary.
Notice how we created three LP positions with three weights. One would allocate capital in the ranges and weights defined in the desmos link. But this approach can be improved by slicing vertically (Lebesgue integral approach instead of Riemann).
Note how the Gaussian is just a basic toy distribution and does not represent some of the distributions you’d see in the real world. You could try plugging in fancier distributions into f(x). But note that the real world differs a bit:
In order to capture these advanced distributions, we will need to learn more about liquidity fingerprints and use asymmetric log-Laplace distributions continued in part 3 here: https://medium.com/@med456789d/uniswap-insights-part-3-of-6-f49aa1e5523c.
- If you found this educational, feel free to give this hedgehog a follow on twitter: @CK_2049
Disclaimer: This research is for general information purposes only. The Uniswap Foundation was kind enough to sponsor the publication of previously private research. It does not constitute investment advice or a recommendation or solicitation to buy or sell any investment and should not be used in the evaluation of the merits of making any investment decision. It should not be relied upon for accounting, legal or tax advice or investment recommendations. This post reflects the current opinions of the author. The opinions reflected herein are subject to change without being updated.