MathFin
Map / Valuation · Static replication and model-free bounds / MathFin.Markets.DeFi.LPContract

Liquidity positions as payoffs

MathFin.Markets.DeFi.LPContractMSC 91G80JEL G23 source

A fee-free automated-market-maker position is a function of the price P of token X in token Y at the date it is read, so it is a Contracts.Payoff on the single underlying (), and paying it at T is a Contract. Both positions are functions of √P, which is the rpow of the payoff language with exponent 1/2:

  • the constant-product position with invariant k = x₀ y₀ is worth 2 √k √P in token Y (lpPortfolioValue_eq: 2 y₀ √r at the price ratio r = P x₀ / y₀);
  • the concentrated-liquidity position with liquidity L on the square-root range [a, b] is worth v3PositionValue L a b (√P), which is L (2u − a − u²/b) + L (1/a − 1/b) (m² − a²) for u = max a (min √P b) and m = min √P a: concave inside the range, the quadratic L (1/a − 1/b) P below it, constant above.

Main definitions

  • constantProductPayoff: the constant-product position as a payoff.
  • lpPayoff: the concentrated-liquidity position as a payoff.

Main results

  • eval_lpPayoff: the payoff is v3PositionValue L a b of √P.
  • eval_constantProductPayoff: the payoff is the reserves impermanentLossReservesX/Y of UniswapMechanics valued at P.
  • price_lpPayoff: in any market, paying either position at T is worth the discounted expectation of that position's value.
  • hodlPayoff: holding the deposit x₀ of X and y₀ of Y, as a payoff.
  • price_constantProductPayoff_eq: the constant-product position is worth the discounted expectation of the hold value times 1 + impermanentLoss r, r = P x₀ / y₀.
  • price_constantProductPayoff_le_hodl: hence, for an integrable hold value, it is worth no more than the hold (impermanentLoss_nonpos).

Scope

The price is a Market.price under an arbitrary measure Q; it is a price in the sense of IsPricingMeasure only when Q is one, and its closed form under Black–Scholes is not stated.

References

Tags

liquidity position, constant-product market maker, Uniswap v3, concentrated liquidity, payoff language, MSC 91G80, JEL G23

Import neighbourhood

Above: what it imports. Below: what imports it.

Corpus entries

mf-lp-position-price · defi.json · full statement
An AMM Liquidity Position Is Priced as a Contract

In a market with a positive price of X in Y at T, under any measure Q: paying the concentrated-liquidity payoff (a payoff in the square root of the price, range 0 < a <= b) at T is worth the integral of the deflator times v3PositionValue L a b (sqrt P_T), and paying the constant-product payoff of invariant x0 y0 is worth the integral of the deflator times the rebalanced reserves impermanentLossReservesX/Y valued at P_T. Q is arbitrary: the price is a pricing-measure price only when Q is one, and no closed form under Black-Scholes is stated.

Declarations 12

defMathFin.DeFi.sqrtObssource
NNReal → Payoff Unit

The square root √P of the price observed at T, as a payoff.

defMathFin.DeFi.constantProductPayoffsource
ℝ → NNReal → Payoff Unit

The constant-product position with invariant k = x₀ y₀, as a payoff on the price of X in Y observed at T: 2 √k √P.

defMathFin.DeFi.lpPayoffsource
ℝ → ℝ → ℝ → NNReal → Payoff Unit

The concentrated-liquidity position with liquidity L on the square-root range [a, b], as a payoff on the price of X in Y observed at T: L (2u − a − u²/b) + L (1/a − 1/b) (m² − a²) with u = max a (min √P b) and m = min √P a.

theoremMathFin.DeFi.eval_sqrtObssource
∀ (T : NNReal) (s : Scenario Unit), Payoff.eval s (sqrtObs T) = √(s () T)
theoremMathFin.DeFi.eval_lpPayoffsource
∀ {L a b : ℝ}, 0 < a → a ≤ b → ∀ (T : NNReal) (s : Scenario Unit), Payoff.eval s (lpPayoff L a b T) = v3PositionValue L a b √(s () T)

The concentrated-liquidity payoff is the position value v3PositionValue of UniswapMechanics at the square root of the observed price.

theoremMathFin.DeFi.eval_constantProductPayoffsource
∀ {x₀ y₀ : ℝ}, 0 < x₀ → 0 < y₀ → ∀ (T : NNReal) (s : Scenario Unit), 0 < s () T → Payoff.eval s (constantProductPayoff (x₀ * y₀) T) = impermanentLossReservesX x₀ y₀ (s () T * x₀ / y₀) * s () T + impermanentLossReservesY x₀ y₀ (s () T * x₀ / y₀)

The constant-product payoff is the rebalanced reserves impermanentLossReservesX/Y of an invariant x₀ y₀ valued at the observed price P > 0, the reserves being read at the price ratio P x₀ / y₀.

theoremMathFin.DeFi.price_lpPayoffsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (M : Market Unit Ω) (Q : Measure Ω) (T : NNReal), (∀ (ω : Ω), 0 < M.asset () T ω) → (∀ (L a b : ℝ), 0 < a → a ≤ b → M.price Q (Contract.pay T (lpPayoff L a b T)) = ∫ (ω : Ω), M.deflator T ω * v3PositionValue L a b √(M.asset () T ω) ∂Q) ∧ ∀ (x₀ y₀ : ℝ), 0 < x₀ → 0 < y₀ → M.price Q (Contract.pay T (constantProductPayoff (x₀ * y₀) T)) = ∫ (ω : Ω), M.deflator T ω * (impermanentLossReservesX x₀ y₀ (M.asset () T ω * x₀ / y₀) * M.asset () T ω + impermanentLossReservesY x₀ y₀ (M.asset () T ω * x₀ / y₀)) ∂Q

The price of a liquidity position is the discounted expectation of its value. In a market with a positive price of X in Y at T, under any measure Q: the concentrated-liquidity payoff lpPayoff L a b T (for 0 < a ≤ b) is worth ∫ D_T · v3PositionValue L a b (√P_T), and the constant-product payoff of invariant x₀ y₀ is worth the discounted expectation of the reserves impermanentLossReservesX/Y valued at the price P_T.

defMathFin.DeFi.hodlPayoffsource
ℝ → ℝ → NNReal → Payoff Unit

Holding the deposit of x₀ units of X and y₀ units of Y, as a payoff on the price of X in Y observed at T: x₀ P + y₀.

theoremMathFin.DeFi.eval_hodlPayoffsource
∀ (x₀ y₀ : ℝ) (T : NNReal) (s : Scenario Unit), Payoff.eval s (hodlPayoff x₀ y₀ T) = x₀ * s () T + y₀
theoremMathFin.DeFi.eval_constantProductPayoff_eq_hodl_mulsource
∀ {x₀ y₀ : ℝ}, 0 < x₀ → 0 < y₀ → ∀ (T : NNReal) (s : Scenario Unit), 0 < s () T → Payoff.eval s (constantProductPayoff (x₀ * y₀) T) = (x₀ * s () T + y₀) * (1 + impermanentLoss (s () T * x₀ / y₀))

The constant-product payoff is the hold value times 1 + impermanentLoss: at a positive price P, the position of invariant x₀ y₀ is worth (x₀ P + y₀) (1 + IL(P x₀ / y₀)), where impermanentLoss is the closed form 2√r/(1 + r) − 1 of UniswapMechanics.

theoremMathFin.DeFi.price_constantProductPayoff_eqsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (M : Market Unit Ω) (Q : Measure Ω) (T : NNReal), (∀ (ω : Ω), 0 < M.asset () T ω) → ∀ {x₀ y₀ : ℝ}, 0 < x₀ → 0 < y₀ → M.price Q (Contract.pay T (constantProductPayoff (x₀ * y₀) T)) = ∫ (ω : Ω), M.deflator T ω * ((x₀ * M.asset () T ω + y₀) * (1 + impermanentLoss (M.asset () T ω * x₀ / y₀))) ∂Q

The price of the constant-product position is the discounted expectation of the hold value times 1 + impermanentLoss, in any market with a positive price of X in Y at T, under any measure Q: ∫ D_T (x₀ P_T + y₀)(1 + IL(P_T x₀ / y₀)).

theoremMathFin.DeFi.price_constantProductPayoff_le_hodlsource
∀ {Ω : Type u_1} [MeasurableSpace Ω] (M : Market Unit Ω) (Q : Measure Ω) (T : NNReal), (∀ (ω : Ω), 0 < M.asset () T ω) → ∀ {x₀ y₀ : ℝ}, 0 < x₀ → 0 < y₀ → Integrable (fun ω => M.deflator T ω * (x₀ * M.asset () T ω + y₀)) Q → M.price Q (Contract.pay T (constantProductPayoff (x₀ * y₀) T)) ≤ M.price Q (Contract.pay T (hodlPayoff x₀ y₀ T))

Impermanent loss, priced. In a market with a positive price of X in Y at T, under any measure Q for which the deflated hold value D_T (x₀ P_T + y₀) is integrable, the constant-product position of invariant x₀ y₀ is worth no more than holding the deposit: price (pay T (constantProductPayoff (x₀ y₀) T)) ≤ price (pay T (hodlPayoff x₀ y₀ T)). It is the pathwise impermanentLoss_nonpos integrated against the deflator.