Uniswap Insights Part 3 of 6 β€” Liquidity Distributions

πŸ¦„ ck.eth πŸ¦„
5 min readJun 7, 2023

TLDR:

The Asymmetric Laplace Distribution is linked to power law distributions: https://www2.seas.gwu.edu/~dorpjr/Publications/JournalPapers/SPL2005.pdf

In part 2 we looked into slicing up our range into multiple LP positions. Here we will use the same concept to model the liquidity distribution and see how we can fit to it and then adjust for risk.

Left ETH/USD liquidity distribution varies from ETH/BTC on the right.

Recall that we are competing with other LPs on how the price evolves. Conduct the following thought experiment. Suppose nobody knows where price will go, gas is non-existent so anybody can create infinitely many LP positions, and everybody wants to optimize for yield and minimize risk of divergence loss. Given that there are different LPs with different time horizons, they may allocate their forecast along different curves.

Some LPs may allocate for longer and widen their potential forecast of price movement. Other LPs who allocate for a shorter time will narrow their distribution. Both allocations would intersect and provide liquidity in the crossed range.
More risk averse LPs with the same time horizon would spread their distribution (dark blue) relative to those who want to get more yield by concentrating near the current price and expose themselves to more potential divergence loss (light blue).

If we stack all such distributions together, we get a liquidity distribution which happens to resemble a Laplace distribution.

Laplace distribution β€” https://en.wikipedia.org/wiki/Asymmetric_Laplace_distribution

For cases where the numeraire is a stablecoin (X/USD instead of X/Y), the log-Laplace distribution happens to fit.

Log-Laplace distribution in price space assuming price of $1.

Why does Laplace work? When volatility evolves with the square root of time each LP allocating for one additional day would have to widen his forecast non-linearly as the price stands to disperse further away from the origin. If we assume a price of $1 at the origin and let the price decay with the square root in either direction, then the Laplace distribution in the price-space happens to be a match.

I use the asymmetric Laplace distribution which has an extra parameter kappa, to account for asymmetry. For example, consider the distribution of MKR/ETH below, it seems like it’s skewed so an asymmetric parameter in desmos can help you capture this very well. Additionally, the parameters lambda help us capture the volatility while mu captures the center.

We can combine the Laplace distribution to use with our ranges from part 1&2 which acts as a cutoff boundary. Remember though that in the real world we have gas fees to worry about so we can’t create infinitely many LP positions to match the distribution perfectly instead we have to optimize for a number of discrete LP positions with calculus by using Riemann integrals as in part 2. Fortunately, I’ve built this already in desmos.

Asymmetric skew with kappa for MKR/WETH pair. Desmos https://www.desmos.com/calculator/h6dk3cvfne

The sum of the blue rectangles would equal the area underneath our Laplace distribution. Creating too many rectangles would work yet is overkill and will consume our gas, but creating only one rectangle misses out on the extra yield we could capture by splitting our capital into multiple LP positions.

3 LP positions versus 7 LP positions.

So how many should we create? For every additional LP position we add, we capture less additional information about our distribution. Using three LP positions allows us to capture skew, but not enough of the whole area under the curve, but going from seven to eight does not add as much as going from six to seven. So the minimum for capturing a distribution forecast would be three, but going beyond seven and the gas fees start to pile up while capturing marginally less of the distribution.

Note that the narrower one makes the distribution (increase lambda), the likelier the outcome of divergence loss as one concentrates more liquidity in the center (mu). In order to avoid that one can flatten the top of the Laplace distribution by reducing the size of lambda or simply by mowing down the top bar at mu.

Trimming down those Laplace peaks by pushing the value of lambda down.

There are of course many other distributions one can use for forecasting. The generalized hyperbolic distribution (of which the Laplace is a subclass) is used to model heavy tail events in finance, which can be of use as well here: https://en.wikipedia.org/wiki/Generalised_hyperbolic_distribution.
Or using another distribution from the list of hundreds from Wikipedia: https://en.wikipedia.org/wiki/List_of_probability_distributions.

  • Stay tuned for next week for Part 4 where we will look into using hedges for an LP position! 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.

--

--