This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: 1Mathematical Institute, University of Oxford
2School of Mathematics, University of Edinburgh
3Simtopia.ai
4Vega Protocol

Inefficiency of CFMs: hedging perspective and agent-based simulations

Anonymous for submission Samuel Cohen1,3 Marc Sabaté Vidales2,3 David Siska2,4 and Łukasz Szpruch2,3
(August 7, 2025)
Abstract

We investigate whether the fee income from trades on the CFM is sufficient for the liquidity providers to hedge away the exposure to market risk. We first analyse this problem through the lens of continuous-time financial mathematics and derive an upper bound for not-arbitrage fee income that would make CFM efficient and liquidity provision fair. We then evaluate our findings by performing multi-agent simulations by varying CFM fees, market volatility, and rate of arrival of liquidity takers. We observe that, on average, fee income generated from liquidity provision is insufficient to compensate for market risk.

1 Introduction

It has been shown empirically [7] and experimentally [19] that liquidity providers (LPs) in constant function markets (CFMs) (in particular, Uniswap v3) lose money on average. Indeed, from e.g. [7, Table 2], the average LP transaction in the ETH/USDC pool (from May 2021–-August 2022) resulted in a position loss of 1.64%-1.64\%, and fee income of 0.155%0.155\% of the size of the initial trade, with an average hold time of 6.1 days.

An LP entering a position in CFM opens themselves to two risks: the impermanent loss due to price moves in the underlying asset and the risk of fee income not compensating the impermanent loss. A rational LP may choose to hedge the impermanent loss component, which is essentially a perpetual option [2]. If the fee income (from trades on the CFM) exceeds the cost of the hedge the LP is making a risk-free profit. However, if the fee income is below the cost of the hedge the LP is making a loss. We formalise this intuition using tools from continuous-time financial mathematics, to derive a theoretical, arbitrage-free upper bound on the fee income that would make the CFM efficient and LP positions fair. This is our Theorem 2.1. This is complementary perspective to that of loss versus rebalancing (LVR) introduced in [17].

The fee income of the LP depends on the CFM fee (denoted 1γ1-\gamma in Uniswap) and the trade flow. There is no canonical way to jointly model the underlying price process and the trade flow which realistically captures the interdependence of the two. For this reason we analyse the relationship between the LP fee income and the arbitrage-free upper bound using simulations involving a CFM, another liquid exchange, an arbitrageur agent and price sensitive noise traders (they choose between the exchanges based on which offers better execution price). We considered the CFM fee to be in the range 0%0\% to 4%4\% and in this range the simulations show that fee income due to the LP never exceeds the cost of hedging i.e. the LP is always losing money. As one would expect from Theorem 2.1 the loss is higher if the volatility of the underlying asset is higher. This is regardless of the rate of noise traders arriving in the market. One may hope that the solution is to increase the fee the CFM charges but this reduces the trade flow thus reducing the income. Similarly, reducing the slippage by depositing more into the pool would increase trade but would not lead to lower losses for LPs as this increases the hedging cost of the LP position.

Refer to caption
(a) avg difference between non-arbitrage fees and CFM fees
Refer to caption
(b) std of difference between non-arbitrage fees and CFM fees
Figure 1: Difference between premium fees and CFM fees for different values of γ,σ\gamma,\sigma, positive values indicate fee income is not covering cost of hedging impermanent loss.

1.1 Literature review

The CFM are gaining popularity in market design as they guarantee market liquidity (proportional to the amount of assets locked) and they have minimal storage and computational requirements, unlike e.g. limit-order-book-based markets. This makes them ideal for environments where computational power and storage are at a premium like Ethereum [20], or Cardano, Polkadot or Solana.

Running on blockchain gives advantages over centralised exchanges: transparency, pseudonymity, censorship resistance and security, see references in e.g. [16]. However blockchain-based CFMs suffer from a number of problems: namely questionable returns for LPs as has been already mentioned as well as traders (liquidity takers) being front-run by miners (known as miner-extractable-value) [8], [10].

Classical market clearing models suggest, see Glosten & Milgrom [11], Kyle [13, 14] and Grossman & Miller [12], that the volatility of the underlying asset plays an important role in how the market makers should set bid-ask spread (which is comparable to the pool fee as it imacts execution costs). As we show in Theorem 2.1 the fee income due to the CFM LPs is bounded above by a product of quadratic variation of the underlying asset (which is basically volatility) and convexity of the position being hedged.

1.2 Organisation of the paper

Section 2 includes all the theoretical findings of the paper. Some readers may wish to skim through Section 2.1 which reviews CFMs and how liquidity provision works and fixes some notation used further in the paper. Section 2.2 recalls what a perpetual option is, Section 2.3 proves the main theoretical result of the paper which is Theorem 2.1. Section 3 describes in detail the agent-based model used and discusses the findings. Finally, in Section 4, we discuss the main findings, their limitations and possible further work. A full implementation of the agent-based simulation is at111The link is deliberately broken to comply with the anonymous submission format. https://github.com/simtopia/cfm-sim.

2 Liquidity provision in constant function markets

In this section, we will draw a connection between a constant function market (CFM) and a perpetual (American) options contract. We will particularly seek to derive the impermanent loss (also known as LVR) of a CFM, or equivalently the arbitrage-free streaming premium of the perpetual option.

2.1 An overview of CFMs

A constant function market (CFM) is characterised by

  1. i)

    The reserves (x1,x2)+2(x^{1},x^{2})\in\mathbb{R}^{2}_{+} describing amounts of assets in the pool.

  2. ii)

    A trading function Ψ:+2\Psi:\mathbb{R}_{+}^{2}\rightarrow\mathbb{R} which determines the state of the pool after each trade according to the acceptable fund positions:

    {(x1,x2)+2:Ψ(x1,x2)=constant}.\left\{(x^{1},x^{2})\in\mathbb{R}^{2}_{+}\,:\,\Psi(x^{1},x^{2})=\text{constant}\right\}. (1)
  3. iii)

    A trading fee (1γ)(1-\gamma), for γ(0,1]\gamma\in(0,1].

For the purposes of this paper, we assume Ψ:+2\Psi:\mathbb{R}_{+}^{2}\rightarrow\mathbb{R} to be twice continuously differentiable and convex (see [6], [5]).

To acquire Δxt1\Delta x^{1}_{t} of asset x1x^{1} at time tt a trader needs to deposit a quantity Δx2=Δx2(Δx1)\Delta x^{2}=\Delta x^{2}(\Delta x^{1}) of asset x2x^{2} into the pool, and pay a fee (1γ)Δx2(1-\gamma)\Delta x^{2}.222The fee in Uniswap-V3 is not added to the pool reserves [1]. This is in contrast to Uniswap-V2. Δx2\Delta x^{2} and Δx\Delta x needs to satisfy the equation

Ψ(xt1Δx1,xt2+Δx2)=Ψ(xt1,xt2).\Psi(x^{1}_{t}-\Delta x^{1},x^{2}_{t}+\Delta x^{2})=\Psi(x^{1}_{t},x^{2}_{t})\,. (2)

Once the trade is accepted the reserves are updated according to

xt+11=xt1Δx1andxt+12=xt2+Δx2.x^{1}_{t+1}=x^{1}_{t}-\Delta x^{1}\quad\text{and}\quad x^{2}_{t+1}=x^{2}_{t}+\Delta x^{2}\,. (3)

The relative price of trading Δx1\Delta x^{1} for Δx2\Delta x^{2} is defined as

Pt1,CFM(Δx1)Pt2,CFM(Δx2):=Δx2Δx1subject to Ψ(xt1Δx1,xt2+Δx2)=Ψ(xt1,xt2).\frac{P_{t}^{1,CFM}(\Delta x^{1})}{P_{t}^{2,CFM}(\Delta x^{2})}:=\frac{\Delta x^{2}}{\Delta x^{1}}\,\quad\text{subject to }\quad\Psi(x^{1}_{t}-\Delta x^{1},x^{2}_{t}+\Delta x^{2})=\Psi(x^{1}_{t},x^{2}_{t})\,. (4)

Observe that

0=Ψ(xt1Δx1,xt2+Δx2)Ψ(xt1,xt2)=x1Ψ(xt1,xt2)Δx1+x2Ψ(xt1,xt2)Δx2+𝒪((Δx)2).\begin{split}0=&\Psi(x^{1}_{t}-\Delta x^{1},x^{2}_{t}+\Delta x^{2})-\Psi(x^{1}_{t},x^{2}_{t})\\ &\qquad=-\partial_{x^{1}}\Psi(x^{1}_{t},x^{2}_{t})\Delta x^{1}+\partial_{x^{2}}\Psi(x^{1}_{t},x^{2}_{t})\Delta x^{2}+\mathcal{O}((\Delta x)^{2})\,.\end{split} (5)

Hence the relative price of trading an infinitesimal amount of Δx1\Delta x^{1} for Δx2\Delta x^{2} is given by

Pt1,CFMPt2,CFM:=limΔx10Pt1,CFM(Δx1)Pt2,CFM(Δx2)=x1Ψ(xt1,xt2)x2Ψ(xt1,xt2).\frac{P_{t}^{1,CFM}}{P_{t}^{2,CFM}}:=\lim_{\Delta x^{1}\rightarrow 0}\frac{P_{t}^{1,CFM}(\Delta x^{1})}{P_{t}^{2,CFM}(\Delta x^{2})}=\frac{\partial_{x^{1}}\Psi(x^{1}_{t},x^{2}_{t})}{\partial_{x^{2}}\Psi(x^{1}_{t},x^{2}_{t})}\,. (6)

Assume that there is an external market where assets x1x^{1} and x2x^{2} can be traded (without frictions) at the prices St=(St1,St2)S_{t}=(S_{t}^{1},S_{t}^{2}). The no-arbitrage condition in the case of no fees (γ=1)\gamma=1) implies that

Pt1,CFMPt2,CFM=St1St2\frac{P_{t}^{1,CFM}}{P_{t}^{2,CFM}}=\frac{S_{t}^{1}}{S_{t}^{2}} (7)

Conversely, if 7 would not hold, then (in a market with no fees) there would be an arbitrage opportunity between CFM and the external market (assuming frictionless trading is possible), as it would be possible to purchase a combination of assets cheaply in one market, and then sell it in the other.

Example 1 (GMM)

Consider the trading function

Ψ(x1,x2)=(x1)θ(x2)1θ\Psi(x^{1},x^{2})=(x^{1})^{\theta}(x^{2})^{1-\theta} (8)

for θ(0,1)\theta\in(0,1). The no arbitrage relationship (7), in GMM is given by

Pt1,CFMPt2,CFM=St1St2.\frac{P_{t}^{1,CFM}}{P_{t}^{2,CFM}}=\frac{S_{t}^{1}}{S_{t}^{2}}\,. (9)

The value of the liquidity pool at any time t[0,)t\in[0,\infty), is given by

ψ(St;xt):=xt1St1+xt2St2,\psi(S_{t};x_{t}):=x^{1}_{t}\cdot S_{t}^{1}+x^{2}_{t}\cdot S_{t}^{2}\,, (10)

and using (21) we can show that

ψ(St;xt)=1θSt1xt1orψ(St)=11θSt2xt2.\psi(S_{t};x_{t})=\frac{1}{\theta}S_{t}^{1}x^{1}_{t}\,\quad\text{or}\quad\psi(S_{t})=\frac{1}{1-\theta}S_{t}^{2}x^{2}_{t}\,. (11)

In Appendix 0.A we derive an alternative representation for ψt\psi_{t}, that does not depend on (x1,xt2)(x^{1},x_{t}^{2}),

ψ(St)=ψ(S0)(St1S01)θ(St2S02)1θ.\psi(S_{t})=\psi(S_{0})\cdot\left(\frac{S_{t}^{1}}{S_{0}^{1}}\right)^{\theta}\cdot\left(\frac{S_{t}^{2}}{S_{0}^{2}}\right)^{1-\theta}\,. (12)

The above example, also studied in [9], demonstrates two key properties of CFMs:

  • A GMM automatically re-balances liquidity pools so that the value of the pools with asset x1x^{1} and x2x^{2} is θψ(St)\theta\cdot\psi(S_{t}) and (1θ)ψ(St)(1-\theta)\psi(S_{t}), respectively

  • Providing liquidity to a CFM Ψ\Psi is equivalent to entering a long position on a perpetual derivative on the underlying asset with the payoff dictated by the value (in terms of price) ψ\psi.

As observed in [3], [4], for any CFM ψ\psi for any non-negative, non-decreasing, concave, 1-homogenous333That is, λψ(S)=ψ(λS)\lambda\psi(S)=\psi(\lambda S) for all λ>0\lambda>0 and SS. Equivalently, we can assume that one of the assets in StS_{t} is the numeraire asset, in which case the 1-homogeneity assumption is not needed. payoff function ψ\psi, there exists a trading function Ψ\Psi, such that the value of the liquidity provision in CFM with with function Ψ\Psi matches this payoff function. In other words, a CFM with appropriately designed trading function Ψ\Psi dynamically adjusts portfolio held by liquidity providers so that the value of this portfolio, at any time, is described by the payoff function ψ\psi. This gives us two ways to understand a CFM:

  • Through the defining trading function Ψ\Psi, indicating valid combinations of the two assets.

  • Through the valuation function ψ\psi, indicating the value of the CFM pool in terms of the prices of the two assets.

Concentrated liquidity, introduced in Uniswap V3, gives individual LPs control over what price ranges their capital is allocated to. This gives a practical way of creating liquidity provision that replicates a given function ψ\psi, and has been observed and described in [15].

2.2 Connection with perpetual options

Given a payoff function ψ\psi, there is a simple connection between liquidity provision in a CFM and investment in a perpetual American option.

We begin with a precise definition of a perpetual American contract with streaming premium. As we shall see, liquidity provision in a CFM is equivalent to entering a long perpetual derivative with the payoff dictated by the function ψ\psi. This derivative is written on the underlying assets S=(St)t0S=(S_{t})_{t\geq 0} traded in the pools. We follow the definition from [2].

Definition 1

A perpetual contract with streaming premium, written on assets with price vector SS, with payoff function ψ:n\psi:\mathbb{R}^{n}\to\mathbb{R}, is a agreement between two parties, referred to as the long side and short side. The long side has the right to terminate the contract at any time t0t\geq 0, at which point it will receive a payment of ψ(St)\psi(S_{t}). In return, the long-side must pay to the short side ψ(S0)\psi(S_{0}) at the time t=0t=0 of inception as well as a continuous cash-flow of (gt)t0(g_{t})_{t\geq 0} per unit time, referred to as the streaming premium, up until the contract is terminated.

In order to highlight the connections between a CFM and a perpetual American option, we make the following observations. In a CFM, a liquidity provider (CFM-LP)

  • initially deposits assets with value ψ(S0)\psi(S_{0}),

  • receives fees at the rate ftf_{t} per unit time (which may vary). These fees may be withdrawn (under the Uniswap v3 protocol) at any time,

  • at some future time τ\tau (of the CFM-LPs choosing), may withdraw their assets, which will have value ψ(Sτ)\psi(S_{\tau}).

In a perpetual American option with streaming premium and payoff ψ\psi, an investor purchasing the option

  • initially purchases the option, for a cost ψ(S0)\psi(S_{0}),

  • receives the streaming premium at a rate gtg_{t} per unit time (which may vary). This streaming premium may be positive or negative, and is received immediately,

  • at some future time τ\tau (of the investor’s choosing), may exercise the option, which rewards them with value ψ(Sτ)\psi(S_{\tau}).

As we can see, assuming fees in the CFM are instantaneously predictable (i.e. the fee to be received from the CFM can be accurately estimated in advance), a no arbitrage argument suggests that we must have ft=gtf_{t}=g_{t}, as otherwise one asset is strictly better than the other in every state of the world (over some short time horizon), which implies that an efficient market will focus all its trading in the better of these alternatives.

2.3 Model and assumptions

We make the following assumptions about the market:

  • The agent can borrow and lend any amount of cash at the riskless rate.

  • The agent can buy and sell any amount of assets x1x^{1} and x2x^{2}.

  • The above transactions do not incur any transaction costs and the size of a trade does not impact the prices of the traded assets.

We denote the risk free rate (which may be stochastic) by (rt)t0(r_{t})_{t\geq 0} and model the money market as

dBt=rtBtdt,B00.dB_{t}=r_{t}B_{t}dt\,,\qquad B_{0}\geq 0\,. (13)

We assume rt0r_{t}\geq 0. We further denote the drift and diffusion coefficients (again, possibly stochastic) of the risky asset shadow prices by μ=(μt1,μt2)2\mu=(\mu_{t}^{1},\mu_{t}^{2})\in\mathbb{R}^{2} and

σ=(σt(1,1),σt(1,2),σt(2,1),σt(2,2))+4\sigma=(\sigma_{t}^{(1,1)},\sigma_{t}^{(1,2)},\sigma_{t}^{(2,1)},\sigma_{t}^{(2,2)})\in\mathbb{R}^{4}_{+}

respectively, and model the shadow price of the risky asset (Sti)t0(S^{i}_{t})_{t\geq 0} by

dSti=μtiStidt+j=1dσt(i,j)StidWt,Soi0,dS_{t}^{i}=\mu^{i}_{t}S_{t}^{i}dt+\sum_{j=1}^{d}\sigma^{(i,j)}_{t}S_{t}^{i}dW_{t},\quad S_{o}^{i}\geq 0\,, (14)

where W=(Wt1,Wt2)W=(W_{t}^{1},W_{t}^{2}) is a 22-dimensional Brownian motion. We assume that (μ,σ)(\mu,\sigma) are sufficiently regular that a (unique strong) solution to (14) exists.

Remark 1

By allowing the drift and diffusion coefficients to be arbitrary processes we are just saying that the prices are non-negative and continuous: our framework incorporates a rich family of common models such as Black–Scholes, Heston, SABR or local stochastic volatility models with possibly path dependent coefficients.

We will proceed to derive an arbitrage-free fee bound in a similar way to the construction of the predictable loss in [17], and to classical arguments for no-arbitrage pricing in financial markets.

Assumption 1

The value of the pool as a function of external price process, sψ(s)s\mapsto\psi(s) is twice continuously differentiable.

Assumption 1 holds in the case when the fee (1γ)=0(1-\gamma)=0 and arbitrageurs continuously close the gap between StS_{t} and the price of the CFM, as demonstrated in [17]. Hence we expect the the arbitrage-free fee derived below to be a good proxy for CFMs that charge small fee (e.g Uniswap). If the CFM charges a fee (1γ)(1-\gamma) which is significantly larger than 0 then the value of the pool is a function of the reserves and the price one would use for the conversion (external price StS_{t} or pool-implied price Pt2,CFMP^{2,CFM}_{t}), see Remark 2 for more details.

Consider the wealth process ZZ of an agent who

  • begins with zero capital444This is simply to avoid having to account for the interest they should earn on their initial capital.,

  • initially borrows a quantity ψ(S0)\psi(S_{0}) at the risk-free interest rate, which they use to establish a CFM position (which they can do by trading in the liquid market to obtain the desired risky assets for the pool),

  • until time tt, trades in the liquid market hold a quantity (Δsi)(\Delta_{s}^{i}) of each asset at time ss.

The dynamics of ZtZ_{t} are given by

Zt=ψ(St)ψ(S0)CFM gains+0ti=12ΔsidSsitrading gains+0t(Zsi=12ΔsiSsi)rs𝑑sinterest payments on uninvested wealth+0tfs𝑑sCFM fees.Z_{t}=\underbrace{\psi(S_{t})-\psi(S_{0})}_{\text{CFM gains}}+\underbrace{\int_{0}^{t}\sum_{i=1}^{2}\Delta^{i}_{s}dS^{i}_{s}}_{\text{trading gains}}+\underbrace{\int_{0}^{t}\Big{(}Z_{s}-\sum_{i=1}^{2}\Delta^{i}_{s}S^{i}_{s}\Big{)}r_{s}ds}_{\text{interest payments on uninvested wealth}}+\underbrace{\int_{0}^{t}f_{s}ds}_{\text{CFM fees}}.

We assumed ψ\psi is smooth, hence we can apply Itô’s lemma to obtain

Zt=i=120t[iψ(Ss)+Δsi]𝑑Ssi+12i,j=120tijψ(Ss)dSi,Sjs+0t[(Zsi=12ΔsiSsi)rs+fs]𝑑s.\begin{split}Z_{t}&=\sum_{i=1}^{2}\int_{0}^{t}\Big{[}\partial_{i}\psi(S_{s})+\Delta^{i}_{s}\Big{]}dS_{s}^{i}+\frac{1}{2}\sum_{i,j=1}^{2}\int_{0}^{t}\partial_{i}\partial_{j}\psi(S_{s})d\langle S^{i},S^{j}\rangle_{s}+\int_{0}^{t}\Big{[}\Big{(}Z_{s}-\sum_{i=1}^{2}\Delta^{i}_{s}S^{i}_{s}\Big{)}r_{s}+f_{s}\Big{]}ds.\end{split}

By setting Δsi=iψ(Ss)\Delta_{s}^{i}=-\partial_{i}\psi(S_{s}), we eliminate the first term, giving

Zt=12i,j=120tijψ(Ss)dSi,Sjs+0t[(Zs+i=12(iψ(Ss))Ssi)rs+fs]𝑑s.\begin{split}Z_{t}&=\frac{1}{2}\sum_{i,j=1}^{2}\int_{0}^{t}\partial_{i}\partial_{j}\psi(S_{s})d\langle S^{i},S^{j}\rangle_{s}+\int_{0}^{t}\Big{[}\Big{(}Z_{s}+\sum_{i=1}^{2}(\partial_{i}\psi(S_{s}))S^{i}_{s}\Big{)}r_{s}+f_{s}\Big{]}ds.\end{split}

As the quadratic variation is dSi,Sjs=(σsσs)(i,j)SsiSsjdsd\langle S^{i},S^{j}\rangle_{s}=(\sigma_{s}\sigma_{s}^{\top})^{(i,j)}S_{s}^{i}S_{s}^{j}ds, this simplifies to

dZsds=12i,j=12ijψ(Ss)(σsσs)(i,j)SsiSsj+(Zs+i=12(iψ(Ss))Ssi)rs+fs.\frac{dZ_{s}}{ds}=\frac{1}{2}\sum_{i,j=1}^{2}\partial_{i}\partial_{j}\psi(S_{s})(\sigma_{s}\sigma_{s}^{\top})^{(i,j)}S_{s}^{i}S_{s}^{j}+\Big{(}Z_{s}+\sum_{i=1}^{2}(\partial_{i}\psi(S_{s}))S^{i}_{s}\Big{)}r_{s}+f_{s}.

If this quantity is positive, then we have a strategy which earns money with probability one over a short time period, that is, an arbitrage. Therefore, after rearrangement, we know that

fs+Zsrs12i,j=12ijψ(Ss)(σsσs)(i,j)SsiSsj(i=12(iψ(Ss))Ssi)rs.f_{s}+Z_{s}r_{s}\leq-\frac{1}{2}\sum_{i,j=1}^{2}\partial_{i}\partial_{j}\psi(S_{s})(\sigma_{s}\sigma_{s}^{\top})^{(i,j)}S_{s}^{i}S_{s}^{j}-\Big{(}\sum_{i=1}^{2}(\partial_{i}\psi(S_{s}))S^{i}_{s}\Big{)}r_{s}.

As ZZ is increasing in ff (an agent who earns more fees will be wealthier) and we assume r0r\geq 0, there is a unique value of ff such that above equation is an equality. With this CFM trading fee income per unit of time, we have dZs/ds=0dZ_{s}/ds=0 and Z0=0Z_{0}=0, and hence Zs=0Z_{s}=0. We denote this critical value555[7] give a similar calculation, to obtain a closely related quantity, which they call the permanent loss of the CFM.

f^s=12i,j=12ijψ(Ss)(σsσs)(i,j)SsiSsj(i=12(iψ(Ss))Ssi)rs.\hat{f}_{s}=-\frac{1}{2}\sum_{i,j=1}^{2}\partial_{i}\partial_{j}\psi(S_{s})(\sigma_{s}\sigma_{s}^{\top})^{(i,j)}S_{s}^{i}S_{s}^{j}-\Big{(}\sum_{i=1}^{2}(\partial_{i}\psi(S_{s}))S^{i}_{s}\Big{)}r_{s}.

We have thus shown the following.

Theorem 2.1

Given the model of the market given by (13) and (14) and with the assumptions stated in Section 2.3 we know that CFM fee income rate ftf_{t} (which depends on the trade flow and the fee 1γ1-\gamma) must satisfy ftf^tf_{t}\leq\hat{f}_{t} where this theoretical upper bound on CFM fee income rate is

f^t=12i,j=12ijψ(St)dSi,Sjtdt(i=12iψ(Ss)Sti)dlogBtdt.\begin{split}\hat{f}_{t}=&-\frac{1}{2}\sum_{i,j=1}^{2}\partial_{i}\partial_{j}\psi(S_{t})\frac{d\langle S^{i},S^{j}\rangle_{t}}{dt}-\Big{(}\sum_{i=1}^{2}\partial_{i}\psi(S_{s})S_{t}^{i}\Big{)}\frac{d\log B_{t}}{dt}\,.\end{split} (15)

Notice that the critical CFM fee income rate depends on the trading function via ijψ(S)\partial_{i}\partial_{j}\psi(S) (which is negative, as ψ\psi is concave as long as the trading function Ψ\Psi is convex) and the quadratic variation of traded asset (which is implicitly related to the level of trading activity). On the other hand the actual CFM fee income rate depends on the trade flow in the CFM and the fee the pool sets i.e. 1γ1-\gamma. It is not clear that one could bring ftf_{t} in line with f^t\hat{f}_{t} as increasing 1γ1-\gamma, the fee charged by the CFM will likely lead to decreased trade flow.

Note that this argument only uses a long-position in the CFM, and only establishes666The presentation above assumes the agent starts at time 0, and derives the critical fee rate on this basis. To obtain the inequality bound ftf^tf_{t}\leq\hat{f}_{t} for all times, we formally have to consider starting with zero capital at a time where the inequality is not satisfied, and showing that this gives a short-term arbitrage opportunity. the inequality ftf^tf_{t}\leq\hat{f}_{t}. If it were possible to perfectly short-sell the CFM (or the corresponding perpetual option), then a similar argument would yield the converse inequality. This may explain why the fee rate in Uniswap v3, is systematically below the critical fee rate, which is related to liquidity provision in CFMs yielding persistently poor returns.

Example 2

For clarity of presentation we set the risk free interest rate r=0r=0, and assume that asset S2S^{2} is a numeraire (hence the agent only invests in asset S=S1S=S^{1}). This means that

ψ(St)=ψ(S0)(StS0)θ.\psi(S_{t})=\psi(S_{0})\left(\frac{S_{t}}{S_{0}}\right)^{\theta}\,. (16)

The second derivative of ψ\psi is given by S2ψ(St)=θ(θ1)ψ(S0)S02(StS0)θ2\partial^{2}_{S}\psi(S_{t})=\theta(\theta-1)\frac{\psi(S_{0})}{S_{0}^{2}}\left(\frac{S_{t}}{S_{0}}\right)^{\theta-2}, which is negative since θ(0,1)\theta\in(0,1). The critical fee rate is then given by

f^t=12θ(θ1)ψ(S0)S02(StS0)θ2σt2St2=θ(1θ)2σt2ψ(S0)(StS0)θ=θ(1θ)2σt2ψ(St)0.\begin{split}\hat{f}_{t}&=\frac{-1}{2}\theta(\theta-1)\frac{\psi(S_{0})}{S_{0}^{2}}\left(\frac{S_{t}}{S_{0}}\right)^{\theta-2}\sigma_{t}^{2}S_{t}^{2}\\ &=\frac{\theta(1-\theta)}{2}\sigma_{t}^{2}\psi(S_{0})\left(\frac{S_{t}}{S_{0}}\right)^{\theta}=\frac{\theta(1-\theta)}{2}\sigma_{t}^{2}\psi(S_{t})\geq 0\,.\end{split} (17)

As mentioned above, by analyzing the data in the Uniswap v3 pool (e.g. [7]) one can see that, in general, the fee rate is below critical fee rate. Nevertheless, since one cannot simply short position at the Uniswap (unless using an over-the-counter bespoke arrangement) it is not clear how one could realise a potential arbitrage opportunity when f<f^f<\hat{f}.

Remark 2 (Comments about the derivation of the arbitrage-free fee rate bound)

The derivation of the arbitrage-free fee rate bound is done under the Assumption 1 which, as we explained, holds in the case when (1γ)=0(1-\gamma)=0.

If for each trade the CFM charges a fee it can be easily shown that this optimal arbitrage trades will not lead to condition (7). We demonstrate this on Figure 2. Indeed the arbitrageur who trades (Δx1,Δx2)(\Delta x^{1},\Delta x^{2}) when reserves are (x1,x2)(x^{1},x^{2}) will incur cost f(γ,x1,x2,Δx1,Δx2)f(\gamma,x^{1},x^{2},\Delta x^{1},\Delta x^{2}) and solves the optimisation problem Δx2,:=max(ΔxCFM, CEX2,ΔxCEX, CFM2)\Delta x^{2,*}:=\max(\Delta x^{2}_{\text{CFM, CEX}},\Delta x^{2}_{\text{CEX, CFM}}), where

ΔxCFM, CEX2:=argmaxΔx2Δx1S1Δx2f(γ,,x1,x2,Δx1,Δx2)such that Ψ(x1Δx1,x2+Δx2)=Ψ(x1,x2),Δx20,Δx1S1Δx2f(γ,x1,x2,Δx1,Δx2)0\begin{split}\Delta x^{2}_{\text{CFM, CEX}}:=&\operatorname*{arg\,max}_{\Delta x^{2}}\Delta x^{1}\cdot S^{1}-\Delta x^{2}-f(\gamma,,x^{1},x^{2},\Delta x^{1},\Delta x^{2})\\ \text{such that }&\Psi(x_{1}-\Delta x^{1},x_{2}+\Delta x^{2})=\Psi(x_{1},x_{2}),\quad\Delta x^{2}\geq 0,\\ &\Delta x^{1}\cdot S^{1}-\Delta x^{2}-f(\gamma,x^{1},x^{2},\Delta x^{1},\Delta x^{2})\geq 0\end{split} (18)

and

ΔxCEX, CFM2:=argmaxΔx2Δx2Δx1S1f(γ,x1,x2,Δx1,Δx2)such that Ψ(x1+Δx1,x2Δx2)=Ψ(x1,x2),Δx20,Δx2Δx1S1f(γ,x1,x2,Δx1,Δx2)0\begin{split}\Delta x^{2}_{\text{CEX, CFM}}:=&\operatorname*{arg\,max}_{\Delta x^{2}}\Delta x^{2}-\Delta x^{1}S^{1}-f(\gamma,x^{1},x^{2},\Delta x^{1},\Delta x^{2})\\ \text{such that }&\Psi(x_{1}+\Delta x^{1},x_{2}-\Delta x^{2})=\Psi(x_{1},x_{2}),\quad\Delta x^{2}\geq 0,\\ &\Delta x^{2}-\Delta x^{1}S^{1}-f(\gamma,x^{1},x^{2},\Delta x^{1},\Delta x^{2})\geq 0\end{split} (19)

where the subindexes of Δx,2\Delta x^{2}_{\cdot,\cdot} denote the order of the markets where the arbitrageur goes short and long in asset x2x^{2}. If Δx2,=0\Delta x^{2,*}=0, then there is no possible trade for which an arbitrageur makes a profit. When condition (7) does not hold, the model to calculate the arbitrage fee rate bound f^t\hat{f}_{t} needs to be generalized. A first step in this direction is to re-rewrite the value function as a function of (x1,x2,St)(x^{1},x^{2},S_{t}). Furthermore, using Implicit Function Theorem for trading function Ψ(x1,x2)\Psi(x^{1},x^{2}), there is function gg such that x2=g(x1)x^{2}=g(x^{1}). Hence, assuming x1x^{1} is the numeraire so that St1=1S_{t}^{1}=1,

ψ(xt1,St)=xt1+g(xt1)St2.\psi(x^{1}_{t},S_{t})=x^{1}_{t}+g(x^{1}_{t})\cdot S^{2}_{t}\,.

Applying Itô formula to ψ\psi we get

dψ(xt1,St2)=xψ(xt1,St2)dxt1+Sψ(xt1,St2)dSt2+xSψ(xt1,St2)dx1,S2t+12x2ψ(xt1,St2)dx1,x1t+12S2ψ(xt1,St2)dS2,S2t.\begin{split}d\psi(x_{t}^{1},S^{2}_{t})=&\partial_{x}\psi(x_{t}^{1},S^{2}_{t})dx_{t}^{1}+\partial_{S}\psi(x_{t}^{1},S^{2}_{t})dS^{2}_{t}+\partial_{x}\partial_{S}\psi(x_{t}^{1},S^{2}_{t})d\langle x^{1},S^{2}\rangle_{t}\\ &+\frac{1}{2}\partial_{x}^{2}\psi(x_{t}^{1},S^{2}_{t})d\langle x^{1},x^{1}\rangle_{t}+\frac{1}{2}\partial_{S}^{2}\psi(x_{t}^{1},S^{2}_{t})d\langle S^{2},S^{2}\rangle_{t}\,.\end{split}

One can see that to analyse the evolution of the value of the pool one needs to model the evolution of reserves and its dependence on SS. Instead of performing analysis under various sets of assumptions we turn to simulations.

3 An Agent-based model

We design an Agent-Based-Model with the aim to compare the accumulated fees by a CFM defined as in Example 1 with θ=1/2\theta=1/2 in a period of time [0,T][0,T] against the accumulated non-arbitrage fee derived in Section 2.3.

3.1 Model description

We consider the CFM with x1x^{1} being the numeraire. Price discovery occurs in a second reference market, where StS_{t} denotes the price of asset x2x^{2} in terms of the numeraire x1x^{1} at time tt. We model the price StS_{t} by a Geometric Brownian Motion

dSt=σStdWt,S0>0.dS_{t}=\sigma S_{t}dW_{t},\quad S_{0}>0.

Whenever the price of asset x2x^{2} in terms of the numeraire x1x^{1} in the CFM is different than StS_{t}, there might be an arbitrage opportunity. An arbitrageur will automatically make the necessary trades to maximise their profit. Furthermore we model the arrival of liquidity takers by Poisson process (Nt)t(N_{t})_{t} with intensity λ\lambda. We run the simulation of discrete times Π:={0,t1,t2,,T}\Pi:=\{0,t_{1},t_{2},...,T\} and initialise the simulation with reserves (x01,x02)(x^{1}_{0},x^{2}_{0}) and fee (1γ)(1-\gamma); initial price S0S_{0} and volatility σ\sigma; liquidity takers arrival intensity λ\lambda. We run the following simulation.

For every tΠt\in\Pi:

  • The arbitrageur makes the necessary trades resulting from optimisations (18) (19) in the CFM and in the reference market to make a risk-free profit.

  • If NtNt=1N_{t}-N_{t-}=1 then a price-sensitive liquidity trader arrives and trades Δt\Delta_{t}\in\mathbb{R} sampled from 𝒩(0,1)\mathcal{N}(0,1) of asset x1x^{1}. The noise trader chooses the market with better execution price with some high probability pp, i.e. we allow for the noise trader to be irrational with probability (1p)(1-p)777Perfectly rational liquidity trader would consider splitting the order to optimise the execution cost. We omit this extension in our simulations..

We take σ{0.2,0.4,0.6,0.8},λ{50,75,100}\sigma\in\{0.2,0.4,0.6,0.8\},\lambda\in\{50,75,100\} and fix S0=10,x01=100,x02=10S_{0}=10,x_{0}^{1}=100,x_{0}^{2}=10 and run the above simulation 100 times for different values of γ[0.96,1]\gamma\in[0.96,1].

3.2 High fee and low fee 1γ1-\gamma

Figures 2, 3, 4 and 5 consider two simulated scenarios: high fee value γ=0.96\gamma=0.96 ( i.e fee 4%4\%); low fee value γ=0.997\gamma=0.997 of ( i.e fee 0.3%0.3\%), λ=50\lambda=50 and σ=0.4\sigma=0.4. Figures 2 and 4 provide the evolution of the price process for the two simulated scenarios in the CFM for the same price process StS_{t} in the reference market. The smaller the fee (the higher the value of γ\gamma) the closer the CFM price process depicted in blue follows the reference market price StS_{t}. For these two scenarios, the CFM and arbitrage-free fee rates are shown in Figures 3 and 5, and the area under the fee rates corresponds to accumulated fees in that particular simulation. High values of fees (low values of γ\gamma) indicate less arbitrage opportunities, and therefore the number of trades will be lower than in the low fees scenarios. Hence increasing the fee rate does not necessarily lead to higher fee income. However, in higher fees regimes, the trade sizes will necessarily be higher (there will only be an arbitrage opportunity when the gap between the CFM price and the reference price is big enough to compensate for the fee).

Fixing λ=50\lambda=50, Figure 1 aggregates the generated results for all the considered γ[0.96,1],σ{0.2,0.4,0.6,08}\gamma\in[0.96,1],\sigma\in\{0.2,0.4,0.6,08\}. Figure 1(a) indicates that higher trades will bring higher fees on average, yet they will not be able to cover the cost of hedging the impermanent loss, which increases with the volatility σ\sigma.

Refer to caption
Figure 2: Price processes for a simulation with γ=0.96,σ=0.4\gamma=0.96,\sigma=0.4
Refer to caption
Figure 3: CFM fees (left) and non-arbitrage fees (right) for a simulation with γ=0.96,σ=0.4\gamma=0.96,\sigma=0.4
Refer to caption
Figure 4: Price processes for a simulation with γ=0.997,σ=0.4\gamma=0.997,\sigma=0.4
Refer to caption
Figure 5: CFM fees (left) and non-arbitrage fees (right) for a simulation with γ=0.997,σ=0.4\gamma=0.997,\sigma=0.4

3.3 Impact of noise trader arrival rate λ\lambda

Figure 6 aggregates all the simulations for three considered intensity regimes for the noise trader. Again, in average the CFM fee does not cover the cost of hedging impermanent loss and, furthermore, this is not impacted by the arrival intensity of noise traders.

Refer to caption
Figure 6: Difference between non-arbitrage fees and CFM fees for different values of γ,σ,λ\gamma,\sigma,\lambda

4 Conclusion and future work

In Theorem 2.1 we have derived an upper bound on the fee income for an LP placing liquidity in a CFM which does not lead to arbitrage when compared to the cost of hedging the risk of the underlying price moves (referred to as impermanent loss). These findings are augmented by agent based simulations which indicate that at least in some market regimes LP providers in CFMs are not being adequately compensated for the impermanent loss risk they take on.

The theoretical model used to derive Theorem 2.1 makes a number of simplifying assumptions that are common in financial mathematics but on top of that it only applies in the low fee regime of CFMs, as discussed in Remark 2. To better study the higher fee regimes one would need to jointly model the trade flow and its impact on the underlying price or to model the joint evolution of the reserves and the underlying asset price. This, mathematically more challenging problem, is left for future work.

The agent-based simulation could be exctended in a number of ways. More realistic agent order flow could be based directly on empirical data e.g. from [18]. The liquidity takers could not only choose the venue which provides better execution price but could split their orders for lowest overall execution cost. Furthermore, most arbitrageurs do not to realise the arbitrage in one “step”; instead they should consider multi-step optimisation with penalty for inventory leading to dynamic-programming problems (or, if we assume that the model of underlying price is unknown, to a reinforcement learning problem). Again, this more involved investigation is left for future work.

Appendix 0.A Derivation of ψ\psi for the Geometric Mean Market

Consider the trading function

Ψ(x1,x2)=(x1)θ(x2)1θ\Psi(x^{1},x^{2})=(x^{1})^{\theta}(x^{2})^{1-\theta} (20)

for θ(0,1)\theta\in(0,1). In the setting with no fees, γ=1\gamma=1, we have (xt1)θ(xt2)1θ=(x01)θ(x02)1θ(x^{1}_{t})^{\theta}(x^{2}_{t})^{1-\theta}=(x^{1}_{0})^{\theta}(x^{2}_{0})^{1-\theta}. The no arbitrage relationship (7), in GMM is given by

Pt1,CFMPt2,CFM=θxt2(1θ)xt1=St1St2.\frac{P_{t}^{1,CFM}}{P_{t}^{2,CFM}}=\frac{\theta x^{2}_{t}}{(1-\theta)x^{1}_{t}}=\frac{S_{t}^{1}}{S_{t}^{2}}\,. (21)

The value of the liquidity pool at any time t[0,)t\in[0,\infty), is given by

ψ(St):=xt1St1+xt2St2.\psi(S_{t}):=x^{1}_{t}\cdot S_{t}^{1}+x^{2}_{t}\cdot S_{t}^{2}\,. (22)

Note that, under no arbitrage and no fee assumptions, it makes no difference whether the accounting is being done in SS or PP.

Using (21) we can show that

ψ(St)=(1θθ+1)St1xt1=1θSt1xt1\psi(S_{t})=\left(\frac{1-\theta}{\theta}+1\right)S_{t}^{1}x^{1}_{t}=\frac{1}{\theta}S_{t}^{1}x^{1}_{t}\, (23)

or equivalently

ψ(St)=(θ1θ+1)St2xt2=11θSt2xt2.\psi(S_{t})=\left(\frac{\theta}{1-\theta}+1\right)S_{t}^{2}x^{2}_{t}=\frac{1}{1-\theta}S_{t}^{2}x^{2}_{t}\,. (24)

From here we see that the value of the sub-pools with assets x1x^{1} and x2x^{2} are θψ(St)\theta\cdot\psi(S_{t}) and (1θ)ψ(St)(1-\theta)\psi(S_{t}), respectively.

Next, we derive an alternative representation for VtV_{t} that does not depend on (x1,xt2)(x^{1},x_{t}^{2}). To do that, note that

1=ψ(St)ψ(St)=St2xt21θθSt1xt1.1=\frac{\psi(S_{t})}{\psi(S_{t})}=\frac{S_{t}^{2}x^{2}_{t}}{1-\theta}\frac{\theta}{S_{t}^{1}x^{1}_{t}}. (25)

Hence

ψ(St)=(St1xt1θ)θ(St1xt1θ)1θ=(St1xt1θ)θ(St1xt1θ)1θ(St2xt21θθSt1xt1)1θ=(xt1)θ(xt2)1θ(St1θ)θ(St21θ)1θ.\begin{split}\psi(S_{t})&=\left(\frac{S_{t}^{1}x^{1}_{t}}{\theta}\right)^{\theta}\cdot\left(\frac{S_{t}^{1}x^{1}_{t}}{\theta}\right)^{1-\theta}\\ &=\left(\frac{S_{t}^{1}x^{1}_{t}}{\theta}\right)^{\theta}\cdot\left(\frac{S_{t}^{1}x^{1}_{t}}{\theta}\right)^{1-\theta}\cdot\left(\frac{S_{t}^{2}x^{2}_{t}}{1-\theta}\frac{\theta}{S_{t}^{1}x^{1}_{t}}\right)^{1-\theta}\\ &=(x^{1}_{t})^{\theta}(x^{2}_{t})^{1-\theta}\left(\frac{S_{t}^{1}}{\theta}\right)^{\theta}\cdot\left(\frac{S_{t}^{2}}{1-\theta}\right)^{1-\theta}.\end{split} (26)

Since

(xt1)θ(xt2)1θ=(x01)θ(x02)1θ,andψ(S0)=(x01)θ(x02)1θ(S01θ)θ(S021θ)1θ,(x^{1}_{t})^{\theta}(x^{2}_{t})^{1-\theta}=(x^{1}_{0})^{\theta}(x^{2}_{0})^{1-\theta}\,,\quad\text{and}\quad\psi(S_{0})=(x^{1}_{0})^{\theta}(x^{2}_{0})^{1-\theta}\left(\frac{S_{0}^{1}}{\theta}\right)^{\theta}\cdot\left(\frac{S_{0}^{2}}{1-\theta}\right)^{1-\theta}\,, (27)

we have

ψ(St)=ψ(S0)(St1S01)θ(St2S02)1θ.\psi(S_{t})=\psi(S_{0})\cdot\left(\frac{S_{t}^{1}}{S_{0}^{1}}\right)^{\theta}\cdot\left(\frac{S_{t}^{2}}{S_{0}^{2}}\right)^{1-\theta}\,. (28)

References

  • [1] H. Adams, N. Zinsmeister, M. Salem, R. Keefer, and D. Robinson. Uniswap v3 core. Tech. rep., Uniswap, Tech. Rep., 2021.
  • [2] G. Angeris, T. Chitra, A. Evans, and M. Lorig. A primer on perpetuals. arXiv preprint arXiv:2209.03307, 2022.
  • [3] G. Angeris, A. Evans, and T. Chitra. Replicating market makers. arXiv preprint arXiv:2103.14769, 2021.
  • [4] G. Angeris, A. Evans, and T. Chitra. Replicating monotonic payoffs without oracles. arXiv preprint arXiv:2111.13740, 2021.
  • [5] G. Angeris, H.-T. Kao, R. Chiang, C. Noyes, and T. Chitra. An analysis of uniswap markets. arXiv preprint arXiv:1911.03380, 2019.
  • [6] A. Capponi and R. Jia. The adoption of blockchain-based decentralized exchanges. arXiv preprint arXiv:2103.08842, 2021.
  • [7] A. Cartea, F. Drissi, and M. Monga. Decentralised finance and automated market making: Permanent loss and optimal liquidity provision. https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4273989, 2022.
  • [8] P. Daian, S. Goldfeder, T. Kell, Y. Li, X. Zhao, I. Bentov, L. Breidenbach, and A. Juels. Flash boys 2.0: Frontrunning, transaction reordering, and consensus instability in decentralized exchanges. arXiv:1904.05234, 2019.
  • [9] A. Evans. Liquidity provider returns in geometric mean markets. 2021.
  • [10] Flashbots. Mev-explore v0. https://explore.flashbots.net.
  • [11] L. R. Glosten and P. R. Milgrom. Bid, ask and transaction prices in a specialist market with heterogeneously informed traders. Journal of Financial Economics, 14:71–100, 1985.
  • [12] S. J. Grossman and M. H. Miller. Liquidity and market structure. The Journal of Finance, 43:617–633, 1988.
  • [13] A. S. Kyle. Continuous auctions and insider trading. Econometrica, 53:1315–1335, 1985.
  • [14] A. S. Kyle. Informed speculation with imperfect competition. The Review of Economic Studies, 56:317–455, 1989.
  • [15] G. Lambert and J. Kristensen. Panoptic: a perpetual, oracle-free options protocol. arXiv preprint arXiv:2204.14232, 2022.
  • [16] S. Loesch, N. Hindman, M. B. Richardson, and N. Welch. Impermanent loss in uniswap v3. arXiv:2111.09192, 2021.
  • [17] J. Milionis, C. C. Moallemi, T. Roughgarden, and A. L. Zhang. Automated market making and loss-versus-rebalancing. arXiv preprint arXiv:2208.06046, 2022.
  • [18] D. Miori and M. Cucuringu. Defi: Data-driven characterisation of Uniswap v3 ecosystem & an ideal crypto law for liquidity pools. arXiv:2301.13009, 2022.
  • [19] M. Sabate-Vidales and D. Šiška. The case for variable fees in constant product markets: An agent based simulation. In Financial Cryptography and Data Security, 2022.
  • [20] G. Wood. Ethereum: A secure, decentralised generalised transaction ledger. Ethereum project yellow paper, 2014.