betaFeedback

WorksComputer Science

Asymptotic Analysis of Trading Fees in CFMM

Abstract

As the dominant trading mechanism in decentralized finance, Automated Market Maker has been widely studied in research. However, limited research has been done with the trading fees taken into consideration. In this work, we study how much trading fee Liquidity Providers(LPs) can receive from arbitrage trading when the fee rate approaches zero. We give a closed-form formula for it and our result shows that the trading fees generated by arbitrage trading can fully offset the LVR loss when the price process is continuous. We further extend our conclusions to price processes with jumps and the theoretical analysis shows that jumps are the only cause of LP loss apart from market risks. Our results provide practical guidance for AMM designers as well as LPs.

Introduction and Related Work

In recent years, Decentralized finance (DeFi) has gained popularity in financial markets due to blockchain technology, which facilitates the trading of assets in a non-custodial manner. At the time of writing, the total value locked (TVL) in DeFi has exceeded $100 billion. Currently, the dominant trading mechanism in DeFi is the Automated Market Maker (AMM), which is commonly deployed as a Constant Function Market Maker (CFMM). The most famous examples of CFMMs include Uniswap, Curve, and Balancer. Unlike traditional market makers who use order books to execute trades, CFMMs rely on mathematical functions to determine prices and liquidity. In CFMMs, Liquidity Providers (LPs) deposit assets into the pool in exchange for a share of trading fees generated by the trades in the pool, and a trade is executed only if it preserves some function of reserves, known as ”the invariant”.

With the rapid development of CFMMs, an extensive body of work has focused on analyzing the Liquidity Provider (LP) returns. [1] derives explicit payoff and pricing functions for LP shares in Geometric mean market makers (G3Ms) with both static and dynamic weights. [7] quantifies general Constant Function Market Maker (CFMM) LP profits by Loss-Versus-Rebalancing (LVR). LVR evaluates the discrepancy between the returns of an CFMM LP position and the returns of the replicating rebalancing trading strategy, which maintains an exposure identical to the CFMM position but executes all rebalancing trades at centralized exchange (CEX) prices. [3] analyze the connections between LP Impermanent Loss in CFMMs and variance swaps, as well as gamma swaps.

However, a question left open by the above mentioned work concerns fees. Both [1] and [7] assume arbitrageurs do not pay trading fees, which is not the case in practice. In this work, we fill the gap by introducing trading fees into the model. More related to this work are [2] and [6]. [2] analyze optimal fees for G3Ms and show that LP loss is minimized as fees approach zero under the assumption of a quadratic tracking error. Instead of focusing on G3Ms, this article analyzes a broader family of AMMs, CFMMs, which include G3Ms as a subclass. Besides, this paper relaxes the geometric Brownian motion assumption to a semi-martingale process. [6] present a quantification of LP loss taking trading fees and discrete Poisson block generation times into consideration. More specifically, they focus on the expected instantaneous rate of arbitrage profit and derive a semi-closed-form expression for it. Unlike [6], this paper directly quantifies LP P&L (profit and loss) by calculating the trading fees received by LP and the LP loss incurred by arbitrage without the assumption of a discrete stochastic process.

To conclude, the main contributions of this work include:

  • This work presents a more accurate model for LP returns, which takes trading fees into consideration.

  • The price process in this work is extended to a general semi-martingale, which is more generalized than previous work.

  • This model shows that the trading fee received by LP is not zero when the fee rate approximates zero, and we derive a closed formula for it.

  • Our results naturally extend to price processes with jumps and we evaluate the impact of price jumps on trading fee and LP’s PnL.

Assumptions and Notation

An AMM is a pool of a trading pair between two assets. Without loss of generality, we assume asset A is the numeraire and asset B is a risky asset. The reserves of A and B at time tt are x(t)x(t) and y(t)y(t) respectively. For brevity, we use xx and yy to represent x(t)x(t) and y(t)y(t) in the following sections.

A trade against the AMM pool means that the AMM pool receives the input asset Δx\Delta x (or Δy\Delta y) and outputs a controlled amount of the other asset Δy\Delta y (or Δx\Delta x). Here Δx,Δy≥0\Delta x, \Delta y \ge0. In this work, a fixed portion γ\gamma of the input asset is collected as the trading fee and it is assumed to be a separate cash flow to LPs. More specifically, for a transaction exchanging Δx\Delta x asset A to Δy\Delta y asset B, the pool reserve changes from (x,y)(x,y) to (x+(1−γ)Δx,y−Δy)(x+(1-\gamma)\Delta x,y-\Delta y) and the trading fee would be γΔx\gamma\Delta x asset A.

For a transaction exchanging Δy\Delta y asset B to Δx\Delta x asset A, the pool reserve changes from (x,y)(x,y) to (x−Δx,y+(1−γ)Δy)(x-\Delta x,y+(1-\gamma)\Delta y) and the trading fee is γΔy\gamma\Delta y amount of asset B. Therefore, the value of the fee changes along with the price of asset B. To simplify the calculation, a reasonable choice is to use the average price of asset B during each transaction for the calculation. Under this assumption, the value of the collected fee is γ1−γΔx\frac{\gamma}{1-\gamma}\Delta x when the input asset is Δy\Delta y asset B.

Let TV(f,[a,b])TV(f,[a,b]) be the total variation of a function ff on interval [a,b][a,b]. The cumulative fee for a period of time [0,T][0,T] is a portion of the total variation of xx:

fee(T)=γ1−γTV(x,[0,T])=γ1−γsup⁡∥π∥→0sup⁡π∑i=1n−1∣x(ti+1)−x(ti)∣(1)\begin{aligned} fee(T) &= \frac{\gamma}{1-\gamma}TV(x,[0,T]) \\ &= \frac{\gamma}{1-\gamma}\sup_{\lVert\pi\rVert\to0}\sup_{\pi}\sum_{i=1}^{n-1}\lvert x(t_{i+1})-x(t_i)\rvert \tag*{(1)} \end{aligned}

where (π:=0≤t1<t2<⋯<tn≤T;∥π∥:=max⁡i(ti+1−ti))(\pi:= 0 \le t_1 < t_2 < \cdots< t_n \le T; \lVert\pi\rVert:= \max_i(t_{i+1}-t_i)).

CFMM is a specific class of AMM where the pool reserves before and after each trade follow the equation F(x,y)=F(x′,y′)F(x,y)=F(x',y'), where FF is a pre-defined function of a CFMM. In this work, we focus mainly on the CFMMs where F∈C2(R×R)F\in C^2(\mathbb{R}\times\mathbb{R}), in which case there exists and only exists one continuous non-negative orderbook density function gg such that xx and yy have the representation: x=∫0Pg(p)⋅p dpx=\int_0^P g(p)\cdot p\,dp, y=∫P∞g(p)dpy=\int_P^\infty g(p)dp. Here PP has the practical meaning pool price.

Denoting the price of the risky asset in the pool as PγP_\gamma and the value of the pool V=x+PγyV=x+P_\gamma y, we have the following properties:

  • xx and yy are two monotonic functions of PγP_\gamma

  • Pγ=−dxdyP_\gamma=-\frac{dx}{dy}

  • VV is a twice differentiable function of PγP_\gamma

  • dVdPγ=y\frac{dV}{dP_\gamma}=y

  • −d2VdPγ2=g-\frac{d^2V}{dP_\gamma^2}=g

Due to the passive nature of CFMM liquidity provision, CFMMs lags the CEX market in price change, resulting in opportunities of arbitrage. Arbitrageurs continuously monitor the price difference between the pool and the CEX and trade as long as the gap between the pool price and the CEX price becomes larger than the trading fee. These trades push the pool price close to the CEX price until the pool price reaches a “no-arbitrage interval”, where the trading fees are larger than the profits that arbitrageurs can get by exploiting the price deviation. Figure 1 illustrates how CEX price and AMM pool price change over time when trading fees are taking into consideration. In this work, we assume that there are only arbitrageurs trading against the pool. In other words, all the price changes in the CFMM pool result from arbitrage activities and there are no noise trades.

Figure 1. An illustration of CEX price change and the AMM pool price change when trading fees are present. The x axis is time. The y axis is the price of the risky asset.

Let CEX price be a process {Pt}\{P_t\} and {Pγ(t)}\{P_\gamma(t)\} be the pool price process (respectively written as PP and PγP_\gamma for brevity in the following sections). The arbitrage opportunity exists when (1−γ)Pγ−P>0(1-\gamma)P_\gamma-P>0 or (1−γ)P−Pγ>0(1-\gamma)P-P_\gamma>0. This indicates that the pool price PγP_\gamma changes only when ∣log⁡P−log⁡Pγ∣>−log⁡(1−γ)\lvert\log P-\log P_\gamma\rvert>-\log(1-\gamma). Since we assume that arbitrageurs immediately act on these opportunities and push the pool price back into the no-arbitrage interval, the pool price is a continuous adaptive process QQ with minimal total variation that satisfies ∣log⁡P−log⁡Q∣≤−log⁡(1−γ)\lvert\log P-\log Q\rvert\le-\log(1-\gamma). In other words, PγP_\gamma is defined as a solution QQ, which has

inf⁡{TV(log⁡Q,[0,T]):∥log⁡P−log⁡Q∥∞≤u2},(2)\inf\left\{TV(\log Q,[0,T]):\lVert\log P-\log Q\rVert_\infty\le\frac{u}{2}\right\}, \tag*{(2)}

where u=−2log⁡(1−γ)u=-2\log(1-\gamma).

Asymptotic Analysis of Fee

From [4], for a càdlàg function ff and c∈R+c\in\mathbb{R}^{+}, the truncated variation TVcTV^{c} of ff on interval [a,b][a,b] is defined as

TVc(f,[a,b])=sup⁡nsup⁡a≤t1<t2<⋯<tn≤b∑i=1n−1max⁡{∣f(ti+1)−f(ti)∣−c,0}.TV^{c}(f,[a,b])=\sup_{n}\sup_{a\le t_1<t_2<\cdots<t_n\le b}\sum_{i=1}^{n-1}\max\{\lvert f(t_{i+1})-f(t_i)\rvert-c,0\}.

and it has the following property:

TVc(f,[a,b])=inf⁡∥g−f∥∞≤c2TV(g,[a,b]).TV^{c}(f,[a,b])=\inf_{\lVert g-f\rVert_\infty\le\frac{c}{2}}TV(g,[a,b]).

Applying this property to {log⁡Pt}\{\log P_t\} and combining with equation 2 lead to the following proposition.

Proposition 1.

TV(log⁡Pγ,[a,b])=TVu(log⁡P,[a,b])TV(\log P_\gamma,[a,b])=TV^{u}(\log P,[a,b])

From [4], if {Xt}\{X_t\} is a continuous semi-martingale, lim⁡c↓0cTVc(X,[0,t])=⟨X⟩t\lim_{c\downarrow0}cTV^{c}(X,[0,t])=\langle X\rangle_t a.s., and the convergence is uniform for ∀t∈[0,T]\forall t\in[0,T]. Combining it with proposition 1, we have

Proposition 2. If {Pt}\{P_t\} is a continuous semi-martingale,

lim⁡u↓0uTV(log⁡Pγ,[0,t])=⟨log⁡P⟩ta.s.\lim_{u\downarrow0} uTV(\log P_\gamma,[0,t]) = \langle\log P\rangle_t \quad a.s.

The convergence is uniform for ∀t∈[0,T]\forall t\in[0,T].

Theorem 1. For a continuous semi-martingale process of CEX price {Pt}\{P_t\},

lim⁡γ→0fee(t)=∫0tg(P)2 d⟨P⟩a.s.\lim_{\gamma\to0} fee(t)=\int_0^t\frac{g(P)}{2}\,d\langle P\rangle\quad a.s.

The convergence is uniform for ∀t∈[0,T]\forall t\in[0,T].

Proof. Let z=log⁡Pγz=\log P_\gamma, we have dx(Pγ)dz=x′(Pγ)Pγ=g(Pγ)Pγ2≥0\frac{dx(P_\gamma)}{dz}=x'(P_\gamma)P_\gamma=g(P_\gamma)P_\gamma^2\geq0.

According to Mean Value Theorem and equation 1, there exists ξi\xi_i between Pγ(ti)P_\gamma(t_i) and Pγ(ti+1)P_\gamma(t_{i+1}) such that

fee(t)=γ1−γsup⁡∥π∥↓0sup⁡π∑i=1n−1g(ξi)ξi2∣z(ti+1)−z(ti)∣=γ1−γ∫0tg(Pγ(s))Pγ2(s)∣dz∣(3)\begin{aligned} fee(t)&=\frac{\gamma}{1-\gamma}\sup_{\|\pi\|\downarrow0}\sup_{\pi}\sum_{i=1}^{n-1}g(\xi_i)\xi_i^2|z(t_{i+1})-z(t_i)| \\ &=\frac{\gamma}{1-\gamma}\int_0^t g(P_\gamma(s))P_\gamma^2(s)|dz| \tag*{(3)} \end{aligned}

Let h(s)=g(P(s))P2(s)h(s)=g(P(s))P^2(s). hh is bounded and uniformly continuous on [0,t][0,t]. Thus we can use step function to approximate hh uniformly. That is, ∀ϵ∗>0,∃δ>0\forall\epsilon_* >0,\exists\delta>0 such that as long as ∣ti+1−ti∣<δ|t_{i+1}-t_i|<\delta, ∣h(ti+1)−h(ti)∣<ϵ∗|h(t_{i+1})-h(t_i)|<\epsilon_*. Let N(t)=⌈tδ⌉+1N(t)=\lceil\frac{t}{\delta}\rceil+1 and Ii=[(i−1)tN(t),itN(t)]I_i=[\frac{(i-1)t}{N(t)},\frac{it}{N(t)}]. Let ϕ(s)=∑i=1N(t)1s∈Iih(itN(t))\phi(s)=\sum_{i=1}^{N(t)}\mathbf{1}_{s\in I_i}h(\frac{it}{N(t)}) and ϕ(0)=h(0)\phi(0)=h(0). Then we have ∥ϕ−h∥∞<ϵ∗\|\phi-h\|_\infty<\epsilon_* on [0,t][0,t]. Denote J(t)=⟨log⁡P⟩tJ(t)=\langle\log P\rangle_t, and let ∣h∣≤M(t)|h|\leq M(t) on [0,t][0,t], we get the following result:

∣u∫0th(s)∣dz∣−∫0th(s)d⟨log⁡P⟩∣≤∣u∫0th(s)∣dz∣−u∫0tϕ(s)∣dz∣∣+∣u∫0tϕ(s)∣dz∣−∫0tϕ(s)d⟨log⁡P⟩∣+∣∫0tϕ(s)d⟨log⁡P⟩−∫0th(s)d⟨log⁡P⟩∣≤ϵ∗∫0tu∣dz∣+∑i=1N(t)h(itN(t))(∣∫Iiu∣dz∣−∫Iid⟨log⁡P⟩∣)+ϵ∗∫0td⟨log⁡P⟩(4)\begin{aligned} \left|u\int_0^t h(s)|dz|-\int_0^t h(s)d\langle\log P\rangle\right| &\leq\left|u\int_0^t h(s)|dz|-u\int_0^t\phi(s)|dz|\right| \\ &\quad+\left|u\int_0^t\phi(s)|dz|-\int_0^t\phi(s)d\langle\log P\rangle\right| \\ &\quad+\left|\int_0^t\phi(s)d\langle\log P\rangle-\int_0^t h(s)d\langle\log P\rangle\right| \\ &\leq\epsilon_*\int_0^t u|dz|+\sum_{i=1}^{N(t)}h\left(\frac{it}{N(t)}\right)\left(\left|\int_{I_i}u|dz|-\int_{I_i}d\langle\log P\rangle\right|\right) \\ &\quad+\epsilon_*\int_0^t d\langle\log P\rangle \tag*{(4)} \end{aligned}

According to proposition 2, ∀ϵ>0,∃u0>0\forall\epsilon>0,\exists u_0>0 such that ∀u<u0\forall u<u_0 and t∈(0,T]t\in(0,T], ∣uTV(log⁡Pγ,[0,t])−⟨log⁡P⟩t∣<ϵ|uTV(\log P_\gamma,[0,t])-\langle\log P\rangle_t|<\epsilon. Therefore, ∫0tu∣dz∣≤J(t)+ϵ\int_0^t u|dz|\leq J(t)+\epsilon. Similarly, ∣uTV(log⁡Pγ,[a,b])−∫abd⟨log⁡P⟩∣<2ϵ\left|uTV(\log P_\gamma,[a,b])-\int_a^b d\langle\log P\rangle\right|<2\epsilon, leading to ∣∫Iiu∣dz∣−∫Iid⟨log⁡P⟩∣≤2N(t)ϵ\left|\int_{I_i}u|dz|-\int_{I_i}d\langle\log P\rangle\right|\leq2N(t)\epsilon. Plugging these results into inequality 4,

∣u∫0th(s)∣dz∣−∫0th(s)d⟨log⁡P⟩∣<(J(t)+ϵ)ϵ∗+2M(t)N(t)ϵ+J(t)ϵ∗(5)\left|u\int_{0}^{t}h(s)|dz|-\int_{0}^{t}h(s)d\langle\log P\rangle\right|<(J(t)+\epsilon)\epsilon_*+2M(t)N(t)\epsilon+J(t)\epsilon_* \tag*{(5)}

Note that g(ez)e2zg(e^z)e^{2z} is a bounded and uniformly continuous function of zz on a closed interval. Since we have ∥log⁡Pγ−log⁡P∥∞≤u2\|\log P_\gamma-\log P\|_\infty\le\frac{u}{2}, there exists u1>0u_1>0 such that as long as u<u1u<u_1, ∣g(Pγ(s))Pγ2(s)−h(s)∣<ϵ\left|g(P_\gamma(s))P_\gamma^2(s)-h(s)\right|<\epsilon holds for all s∈[0,t]s\in[0,t]. Let u<min⁡(u0,u1)u<\min(u_0,u_1), we have

∣u∫0tg(Pγ(s))Pγ2(s)∣dz∣−u∫0th(s)∣dz∣∣<ϵ(J(t)+ϵ)\left|u\int_{0}^{t}g(P_\gamma(s))P_\gamma^2(s)|dz|-u\int_{0}^{t}h(s)|dz|\right|<\epsilon(J(t)+\epsilon)

Combining with 5,

∣u∫0tg(Pγ(s))Pγ2(s)∣dz∣−∫0th(s)d⟨log⁡P⟩∣≤(J(t)+ϵ)(ϵ∗+ϵ)+2M(t)N(t)ϵ+J(t)ϵ∗\begin{aligned} \left|u\int_{0}^{t}g(P_\gamma(s))P_\gamma^2(s)|dz|-\int_{0}^{t}h(s)d\langle\log P\rangle\right|\\ \le(J(t)+\epsilon)(\epsilon_*+\epsilon)+2M(t)N(t)\epsilon+J(t)\epsilon_* \end{aligned}

JJ, MM, NN are non-decreasing function on (0,T](0,T] and attain their maximum at TT. Let ϵ∗→0\epsilon_*\to0, and then ϵ→0\epsilon\to0. We have

lim⁡u→0∣u∫0tg(Pγ(s))Pγ2(s)∣dz∣−∫0tg(P(s))P2(s)d⟨log⁡P⟩∣=0\lim_{u\to0}\left|u\int_{0}^{t}g(P_\gamma(s))P_\gamma^2(s)|dz|-\int_{0}^{t}g(P(s))P^2(s)d\langle\log P\rangle\right|=0

The convergence is uniform for ∀t∈[0,T]\forall t\in[0,T].

Recall that u=−2log⁡(1−γ)u=-2\log(1-\gamma), lim⁡γ→0γu(1−γ)=12\lim_{\gamma\to0}\frac{\gamma}{u(1-\gamma)}=\frac{1}{2}. Combining these results with equation (3), we have

lim⁡γ→0fee(t)=lim⁡γ→0γu(1−γ)u∫0tg(Pγ(s))Pγ2(s)∣dz∣=12∫0tg(P)P2d⟨log⁡P⟩=∫0tg(P)2d⟨P⟩\begin{aligned} \lim_{\gamma\to0}fee(t)&=\lim_{\gamma\to0}\frac{\gamma}{u(1-\gamma)}u\int_{0}^{t}g(P_\gamma(s))P_\gamma^2(s)|dz|\\ &=\frac{1}{2}\int_{0}^{t}g(P)P^2d\langle\log P\rangle\\ &=\int_{0}^{t}\frac{g(P)}{2}d\langle P\rangle \end{aligned}

Theorem 1 shows that when the fee rate approaches zero, the accumulated trading fee is only determined by the quadratic variation of the price process, which means that for a diffusion process dPt=μdt+σdWtdP_t=\mu dt+\sigma dW_t, the fee is only determined by volatility σ\sigma.

Take Uniswap as a concrete example of Theorem 1. Given range [Pa,Pb][P_a,P_b] and liquidity LL, the trading function is

(x+LPa)(y+LPb)=L2\left(x+L\sqrt{P_a}\right)\left(y+\frac{L}{\sqrt{P_b}}\right)=L^2

when the price PP is within this range. We can get

x(P)=L(P−Pa), y(P)=L(1/P−1/Pb)x(P)=L\left(\sqrt{P}-\sqrt{P_a}\right),\ y(P)=L\left(1/\sqrt{P}-1/\sqrt{P_b}\right)

and

g(P)=L2P−32g(P)=\frac{L}{2}P^{-\frac{3}{2}}

Applying Theorem 1 leads to the result

feet=∫0tL4Ps−321Ps∈[Pa,Pb] d⟨P⟩fee_t=\int_0^t\frac{L}{4}P_s^{-\frac{3}{2}}\mathbf{1}_{P_s\in[P_a,P_b]}\,d\langle P\rangle

Uniswap V2 is a special case of V3 when we choose Pa=0P_a=0 and Pb=+∞P_b=+\infty. Under the assumption that the price process follows a geometric Brownian motion dP=μP dt+σP dWdP=\mu P\,dt+\sigma P\,dW, we get

feet=∫0tL4σ2Ps dsfee_t=\int_0^t\frac{L}{4}\sigma^2\sqrt{P_s}\,ds

Since the pool value V=x+Py=2LPV=x+Py=2L\sqrt{P}, the instantaneous fee ratio gets to σ28\frac{\sigma^2}{8}, which is consistent with previous research [2] and [6].

Discussion

LP’s P&L

Following the definition in [7], LP’s PnL can be decomposed to accumulated fees plus the change in pool reserve value.

LP PnLt=feet⏟accumulated fees+Vt−V0⏟change in pool reserve value(6)\mathrm{LP\ PnL}_t=\underbrace{fee_t}_{\text{accumulated fees}}+\underbrace{V_t-V_0}_{\text{change in pool reserve value}} \tag*{(6)}

As the fee rate γ\gamma approaches zero, we have lim⁡γ↓0V=x+Py\lim_{\gamma\downarrow0}V=x+Py, and under the assumption of a continuous semi-martingale {Pt}\{P_t\}, we have

lim⁡γ↓0(Vt−V0)=∫0tV′(Ps) dPs+12∫0tV′′(Ps) d⟨P⟩(from Ito’s Lemma)=∫0ty(Ps) dPs−∫0tg(Ps)2 d⟨P⟩(from xref‘Section 2‘)(7)\begin{aligned} \lim_{\gamma\downarrow0}(V_t-V_0)=\int_0^t V'(P_s)\,dP_s+\frac{1}{2}\int_0^t V''(P_s)\,d\langle P\rangle\quad\text{(from Ito’s Lemma)} \\ &=\int_0^t y(P_s)\,dP_s-\int_0^t\frac{g(P_s)}{2}\,d\langle P\rangle\quad\text{(from {xref}`Section 2`)} \tag*{(7)} \end{aligned}

Combined with Theorem 1, we get

Proposition 3.

lim⁡γ↓0LP PnLt=∫0ty(Ps) dPs⏟market riska.s.(8)\lim_{\gamma\downarrow0}\mathrm{LP\ PnL}_t=\underbrace{\int_0^t y(P_s)\,dP_s}_{\text{market risk}}\quad a.s. \tag*{(8)}

This proposition implies that when the fee rate approaches zero and only arbitraging tradings happen, LP’s PnL is only affected by the market risk. If LPs perfectly hedge the market risk at CEXs, no matter which process the price is, they can certainly(not only by expectation) make profit from non-arbitraging trading activities.

Process with Jumps

In practice, AMMs are operated on blockchain networks characterized by fixed average block intervals, which impose discrete settlement intervals on AMM transactions. Consequently, even if CEX price changes continuously, AMMs price update step-wisely and exhibit ’jumpy’ behavior. The longer the block time, the more pronounced these price discontinuities become. Furthermore, exogenous shocks such as breaking news and massive liquidations introduce extreme volatility, causing CEX prices to deviate sharply. To model such cases more precisely, we need to incorporate jump components into the underlying price process.

For a general semimartingale price process {Pt}\{P_t\}, jumps are written as ΔP=Pt−Pt−\Delta P = P_t - P_{t-} where Pt−P_{t-} is the left limit of PtP_t. We have the following conclusion:

Proposition 4.

lim⁡γ→0LP PnLt=∫0ty(Ps) dPs⏟market risk+∑0≤s≤t[Vs−Vs−−y(Ps−)ΔPs]⏟arbitrage lossa.s.(9)\lim_{\gamma\to0} \mathrm{LP\ PnL}_t = \underbrace{\int_0^t y(P_s)\,dP_s}_{\text{market risk}} + \underbrace{\sum_{0 \le s \le t}\left[V_s - V_{s-} - y(P_{s-})\Delta P_s\right]}_{\text{arbitrage loss}}\quad\mathrm{a.s.} \tag*{(9)}

We then prove this conclusion formally. Recall equation (6), LP’s PnL can be decomposed to the sum of accumulated fees feetfee_t and value change of pool reserve Vt−V0V_t - V_0. We calculate these two parts separately.

To calculate feetfee_t, from [5] we have

lim⁡c↓0cTVc(X,[0,t])=[X]tconta.s.\lim_{c \downarrow0} cT V^c(X,[0,t]) = [X]_t^{\mathrm{cont}}\quad\mathrm{a.s.}

holds for all càdlàg semimartingales XX. Here [X]cont[X]^{\mathrm{cont}} denotes the continuous part of the quadratic variation of XX. Following the same proof in § 3, we get the following corollary for the price process with jumps:

Corollary 1. For a general càdlàg semi-martingale process of CEX price {Pt}\{P_t\},

lim⁡γ→0fee(t)=∫0tg(P)2 d[P]conta.s.\lim_{\gamma\to0} fee(t) = \int_0^t \frac{g(P)}{2}\,d[P]^{\mathrm{cont}}\quad\mathrm{a.s.}

The convergence is uniform for ∀t∈[0,T]\forall t \in[0,T].

To calculate Vt−V0V_t - V_0, recall 7 and apply Ito’s Lemma for jump-diffusion process, we have the following equation:

lim⁡γ↓0(Vt−V0)=∫0tV′(Ps) dPs+12∫0tV′′(Ps) d[Ps]cont+∑0≤s≤t[Vs−Vs−−V′(Ps−)ΔPs]=∫0ty(Ps) dPs+∑0≤s≤t[Vs−Vs−−y(Ps−)ΔPs]−∫0tg(Ps)2 d[Ps]cont(10)\begin{aligned} \lim_{\gamma\downarrow0}(V_t - V_0) &= \int_0^t V'(P_s)\,\mathrm{d}P_s + \frac{1}{2}\int_0^t V''(P_s)\,\mathrm{d}[P_s]^{\mathrm{cont}} \\ &\quad+ \sum_{0 \leq s \leq t} [V_s - V_{s-} - V'(P_{s-})\Delta P_s] \\ &= \int_0^t y(P_s)\,\mathrm{d}P_s + \sum_{0 \leq s \leq t} [V_s - V_{s-} - y(P_{s-})\Delta P_s] \\ &\quad- \int_0^t \frac{g(P_s)}{2}\,\mathrm{d}[P_s]^{\mathrm{cont}} \tag*{(10)} \end{aligned}

Combining the above two parts leads to 4.

We have a brief explanation why the second part [Vs−Vs−−y(Ps−)ΔPs][V_s - V_{s-} - y(P_{s-})\Delta P_s] is called arbitrage loss in 4. Intuitively, there is an instantaneous price gap between CEX price and the AMM pool price when jump happens. As the fee rate approaches zero, LP suffers from arbitrage loss without any fee for compensation. If we take a look at LP’s PnL at each jump, assuming the CEX price changes from PP to P+ΔPP + \Delta P, the arbitragers can make profit by pushing the pool price from PP to P+ΔPP + \Delta P. The amount is calculated as follows:

ArbLoss=x(P+ΔP)−x(P)−(y(P)−y(P+ΔP))∗(P+ΔP)=V(P+ΔP)−V(P)−y(P)ΔP≤0(Given V is concave, see Section 2)\begin{aligned} \mathrm{ArbLoss} &= x(P + \Delta P) - x(P) - (y(P) - y(P + \Delta P)) * (P + \Delta P) \\ &= V(P + \Delta P) - V(P) - y(P)\Delta P \\ &\leq0 \quad\text{(Given $V$ is concave, see Section 2)} \end{aligned}

This implies that when market risk is perfectly hedged, jumps are the main cause of LP’s loss. The calculation above shows that larger price jumps, which can be caused by large block time or large price volatility, lead to more LP loss. This result is consistent with [6].

Conclusion

In this work, we study AMM with the presence of trading fees. We derive a closed-form formula when the fee rate approaches zero. Our work relaxes the assumption that the price process is a general semimartingale. Our result shows that when the price changes continuously, the trading fees can offset the LVR loss. However, when the price jumps, LPs suffer from the loss from arbitrage trading. These results indicate that AMM designers should take blockchain latency and price jumps into consideration. Once these two issues are addressed, designers can shift their focus to other performance metrics, such as reducing the variance of LVR, without the concern that the mechanism’s design might inherently impose losses on LPs.

References

  1. [1]Evans, A.: Liquidity provider returns in geometric mean markets. arXiv preprint arXiv:2006.08806 (2020)arxiv.org/abs/2006.08806
  2. [2]Evans, A., Angeris, G., Chitra, T.: Optimal fees for geometric mean market makers. In: Financial Cryptography and Data Security. FC 2021 International Workshop: CoDecFin, DeFi, VOTING, and WTSC, Virtual Event, March 5, 2021, Revised Selected Papers 25. pp. 65–79. Springer (2021)arxiv.org/abs/2104.00446
  3. [3]Fukasawa, M., Maire, B., Wunsch, M.: Weighted variance swaps hedge against im-permanent loss. Quantitative Finance 23(6), 901–911 (2023)
  4. [4]Łochowski, R.M., Miłоś, P.: On truncated variation, upward truncated variation and downward truncated variation for diffusions. Stochastic Processes and their Applications 123(2), 446–474 (2013)DOI
  5. [5]Łochowski, R.M.: Quadratic variation of a càdlàg semimartingale as as limit of the normalized truncated variations. Stochastics 91(4), 629–642 (2019)DOI
  6. [6]Milionis, J., Moallemi, C., Roughgarden, T.: Automated market making and arbitrage profits in the presence of fees. Financial Cryptography (2024)arxiv.org/abs/2305.14604
  7. [7]Milionis, J., Moallemi, C.C., Roughgarden, T., Zhang, A.L.: Automated market making and loss-versus-rebalancing. arXiv preprint arXiv:2208.06046 (2022)arxiv.org/abs/2208.06046

Paper details

vlnc:W_m5edvbyx
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 1

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents