LP Returns: All You Need is a Price Feed

Introduction

At Duality, we think that one of the most interesting aspects of AMMs is the role of Liquidity Providers (LPs). LPs are critical - without them, the AMM cannot survive.

However, many users have a limited view into what it means to take on an LP position. Admittedly this is a very deep topic, but in this post we wanted to share one frame that we find to be particularly helpful in estimating returns: all you need is a price feed.

We will show how the future value of a constant product LP position can be calculated solely by watching how the price moves over time. We’ll also show evidence of a closely related result: the fees accumulated by an LP share have an inherent connection to the realized volatility of the underlying asset.

For all of the results below, we’ll be working with constant product AMMs, with fees implemented in the same way as Uniswap v2. That is, we consider liquidity amounts L under the constant product formula Rₐ·Rᵦ = L².

Liquidity Growth

A key perk of LP positions is the fees you accumulate, which increase the liquidity L that your LP tokens represent over time. In our time discussing AMMs with those in the crypto community, we found most think about LP fees exactly how they are implemented:

Each trade in the AMM pays some fee on their input amount, which is shared proportionately among all LP shareholders. The AMM then executes the trade by calculating an output amount such that removing it from reserve Rᵦ and adding the input amount (minus fees) to reserve Rₐ maintains a constant product.

While this is accurate, it makes it seem difficult to reason about the fees you will earn. You would need to account for how much other LP capital is in the pool with you throughout the time you are holding the position. It turns out that this doesn’t actually matter.

You can calculate constant product LP returns purely using the AMM’s price feed and the pool trading fee. You do not need to know the size of the pool (Rₐ, Rᵦ, or L), and technically don’t even need all the individual price information that the price feed provides. This means that as an LP, all we really care about is how the AMM’s price changes while we are in the position. If you believe that you have a feel for the price movement that an AMM pool will see, that is all you need to ballpark your financial outcome.

Let’s dig into the math (Full derivations here): Let’s assume a trade is being made from asset α to asset β. Pₜ is defined as the price of asset α in terms of asset β according to the AMM pool at time step t (the ratio of reserves). Let (1 - 𝛾) be the pool fee. We can using the constant product invariant and the quadratic formula to solve for Δₐ, the amount paid by the trader:

The value that we are interested in is gₜ : how much the pool liquidity grows given a trade that moves our price from Pₜ to Pₜ₊₁. This is our new liquidity value, Lₜ₊₁, divided by our old liquidity value Lₜ:

As we can see, we’ve simplified to an equation that depends solely on 𝛾 and the ratio of our price before and after trading. This equation assumes that we’re trading from token α to β. If we are trading from β to α, we can simply replace the prices with their reciprocals. We can use a single variable ϕₜ to support trades in either direction:

If we want to calculate the total liquidity growth over T time steps we can do so with the equation:

What this makes explicit is that the growth of our liquidity is dependent on the pool fee (1 - 𝛾) and the movement of price in relative terms.

Valuing an LP position

Now that we’ve done our calculations for our liquidity growth, let’s calculate our end LP valuation and PnL after a feed of price changes.

To do this, we’ll need the value for L units of liquidity:

where Pₐ,ₜ and Pᵦ,ₜ represent the prices at time t of asset α and asset β respectively. We can multiply our total growth factor Gₜ to our initial liquidity L₀ to get our final liquidity with fee growth Lₜ:

Plugging this into our equation for the value of liquidity, we get our final LP value with accrued fees Vₜ, as well as our PnL Vₜ - V₀:

Realized Volatility

We have shown that LP position growth is dependent on the movement of price in relative terms. The main way financiers characterize the movement of price is through volatility. After deriving the above result, we wanted to see how closely LP returns compared to realized volatility.

We ran some simulations using standard Geometric Brownian Motion across several different volatility values, and compared the volatility of log returns at every price update to our total liquidity growth Gₜ (i.e. our APY). From these simulations we got the following:

This plot has a r^2 value of 0.998. Entering into an LP position is making the trade off of giving up convexity in price exposure (square root rises slower and drops faster than linear) in exchange for exposure to realized volatility.

Note that this is the realized vol of our AMM price feed, not necessarily that of the underlying asset from a more global perspective. These can differ for many reasons, including:

  • amount of price movement due to arbitrage, amount due to uninformed flow
  • block times, gas fees, pool fee, and total liquidity in how it relates to ability to arb
  • market behavior of traders (including LPs, MEV searchers)

Conclusion

With so many new derivatives on the DeFi horizon, and all of the surrounding talk about implied and realized volatility, it’s helpful to realize that it’s really not all so foreign to the ecosystem. As an example, you might find that a constant product AMM’s price exposure (raising the price to the ½ power) is awfully similar to recent CT rumblings.

If you enjoyed this post, follow us on Twitter and join our Discord for more on AMMs and DeFi derivatives. Alpha leak: Duality’s first product is closely related to everything in this post. More coming soon 👀 ☯️

Subscribe to Duality ☯️
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.