An arbitrage driven price dynamics of Automated Market Makers in the presence of fees
Abstract.
We present a model for price dynamics in the Automated Market Makers (AMM) setting. Within this framework, we propose a reference market price following a geometric Brownian motion. The AMM price is constrained by upper and lower bounds, determined by constant multiplications of the reference price. Through the utilization of local times and excursion-theoretic approaches, we derive several analytical results, including its time-changed representation and limiting behavior.
1. Introduction
Automated Market Makers (AMMs) [2, 3] are innovative algorithms that utilize blockchain technology to automate the process of pricing and order matching on decentralized exchanges. Their foundation on blockchain and the employment of smart contracts enable users to buy and sell crypto assets securely, peer-to-peer, without the dependency on intermediaries or custodians.
A critical distinction between AMMs and traditional centralized limit order book models is their mechanism for price determination. While an order book model derives prices through the intentions of individual buyers and sellers, an AMM determines prices based on the available liquidity in its pool. This pool, called the “liquidity pool”, consists of funds deposited by users, known as liquidity providers (LPs). These providers “lock in” varying amounts of two or more tokens into a smart contract, making them available as liquidity for other users’ trades. The barrier to entry for becoming an LP is low; one merely needs a self-custody wallet and a stock of compatible tokens.
A critical cost encountered by LPs in AMMs is adverse selection. This challenge primarily stems from arbitrageurs capitalizing on disparities between the lagging prices within AMMs and the real-time market prices often observed on centralized exchanges. Prominent studies, including [5, 4], delve into this concern by quantifying the losses experienced by LPs due to arbitrage. They employ a metric known as ‘loss-versus-rebalancing’ (LVR) to measure the impact.
This paper presents a model of AMM pricing dynamics based on the following assumptions:
-
a)
A reference market with infinite liquidity and no trading costs exists, where the reference market price follows a geometric Brownian motion.
-
b)
The AMM applies a fixed trading fee tier of , proportional to the trading volume. This fee can range from 1 basis point (bp) to 100 basis points (bps). Notably, Uniswap v3 offers options such as 1 bp, 5 bps, 30 bps, and 100 bps. Our focus is on the worst-case scenario, assuming that all trades within the pool are motivated by arbitrage.
-
c)
Arbitrageurs actively monitor the market, initiating trades whenever they identify arbitrage opportunities.
These assumptions integrate elements from two sources: [5], which focuses on continuous arbitrage without fees, and [4], which considers discrete arbitrage with fees. In our model, we address continuous arbitrage while incorporating the impact of fees.
From assumptions a)–c), we deduce the following relationships between the reference market price and AMM price :
-
•
Under Assumptions a) and b), an arbitrage opportunity exists when or (see [1, §2.4]).
-
•
According to Assumption b), the AMM price remains stable within the range of , termed the no-arbitrage interval. This follows immediately from the first assertion.
-
•
Assumption c) implies that arbitrage actions occur only when or , hence changes only at these times.

In Figure 1, a sample path of the logarithm of is provided, along with the logarithm of and the lower and upper bounds and , respectively. It is pushed upward (resp., downward) at times when it coincides with the lower (resp., upper) bound, and it stays constant at all other times.
Our work is inspired by the unpublished paper by Tassy and White [7]. While the context in the cited work specifically addresses Constant Product Market Makers, our model can be directly applied to all AMMs. The key contribution of this paper is the detailed probabilistic description of the considered AMM price process, underpinned by the local time of the Brownian motion. The logarithm of can be seen as a concatenation of the running infimum and supremum processes of the market price, with appropriate shifting. By leveraging the classical results on the Skorokhod equation of a reflected Brownian motion, expressed in terms of Brownian local times, several analytical results concerning can be derived. Of particular interest is the well-posedness of such a process, its time-changed representation, and its asymptotic behavior. To the best of our knowledge, this paper represents the first study of this stochastic process, motivated by its applications in AMM.
The remainder of the paper is structured as follows: First, we present a precise mathematical construction of our AMM price process. Subsequently, we explore two distinct approaches to analyze the process under consideration in this study.
2. AMM price process
We assume the market price (normalized in such a way that it is equal to at time , and with the appropriate unit of time) is given by a geometric Brownian motion for a standard Brownian motion , and the AMM price is constrained by the inequalities
where the parameter is related to the fees of the AMM. These inequalities are equivalent to
(2.1) |
where, for , is at time , is at time , and ; see Figure 1.
The process is chosen in such a way that , and remains constant at any time where this is compatible with the inequalities (2.1). More precisely, it is constant except when it is pushed up by the process or pushed down by in order to preserve the inequalities (2.1).
The precise description is described as follows, using a sequence of stopping times. If reaches before (we call this event ), then we define, by induction:
-
•
as the infimum of such that .
-
•
For all , is the first time such that .
-
•
For all , is the first time such that .
By the well-known property of the reflected Brownian motion, is finite, and so is almost surely (a.s.) for each . Then, we define as follows:
-
•
for .
-
•
For all and , .
-
•
For all and , .
Informally, is pushed up by in the intervals of time and pushed down by in the intervals of time . Similarly, if reaches before (event ), then we define:
-
•
as the infimum of such that .
-
•
For all , is the first time such that .
-
•
For all , is the first time such that .
Then,
-
•
for .
-
•
For all and , .
-
•
For all and , .
Proposition 1.
The process is the only continuous process with finite variation satisfying the following properties
-
(a)
,
-
(b)
for all ,
-
(c)
is nondecreasing in all intervals where it remains strictly smaller than ,
-
(d)
is nonincreasing in all intervals where it remains strictly larger than .
Notice that the last two properties imply that is constant on intervals where .
Proof.
The process is clearly continuous on . A careful look at the definition above shows that has no discontinuity at times . Indeed, on ,
(2.2) |
where the second equalities hold because the supremum and infimum are attained at the hitting times and of reflected Brownian motion. The continuity holds in the same way on as well.
Since is monotone on each interval of the form for , it has finite variation.
We now show properties (a)-(d) focusing on the case . The proof for the other case is similar. We have
-
(i)
is equal to zero on .
-
(ii)
For all , is nondecreasing in and nonincreasing in .
-
(iii)
For all , is equal to at time and to at time .
Indeed, (i) holds by the definition of and (iii) is clear from the definitions of the stopping times (see also (2.2)). (ii) holds by the definition of in terms of a piecewise supremum and infimum process, which is piecewise monotone. Now (a) holds by (i) and (b) holds by (ii) and (iii).
It remains to show (c) and (d); we only provide proof for (d) as that for (c) is similar. Let . By (iii), , which is the union of and . We know from (i) that is constant on , and from (ii), that is nonincreasing in . It is then enough to consider intervals
a sub-interval of at which . For , for some , and , thus, the supremum of on is not reached at . This implies that remains constant for , and thus is constant, and then nonincreasing, in , completing the proof of (d).
It remains to prove that the properties stated in Proposition 1 uniquely determine .
Let and be two distinct processes satisfying the conditions (a)-(d), and let
(2.3) |
We assume and derive contradiction.
Necessarily, by (a), (c) and (d), until the first time where reaches which is strictly positive, and thus . By the definition of as in (2.3), for all , and by the continuity of and , we also have .
Suppose
(2.4) |
By this, continuity of and and (b), we have for on the interval for sufficiently small . For , let us define the following processes on :
By (b), and , and is continuous and vanishes at the starting time .
Moreover, the variation of is carried by the set of times where . Indeed, changes only when changes, or equivalently, only when is equal to or , and then only when since we know that on the interval . From this last property and (d), is nonincreasing in , which implies that is nondecreasing in this interval. By Skorokhod’s lemma (see Lemma 2.1, Chapter VI of [6]; Lemma 3.1.2, Chapter 3 of [8]), is uniquely determined by on the interval , and thus , which implies that on the interval . This contradicts the fact that is the infimum of times where as in (2.3). This contradiction shows that , i.e. one cannot have two distinct processes satisfying the assumptions of Proposition 1. Similar argument holds for the complement case of (2.4).
∎
Now, let be another standard Brownian motion, and let be the triangle wave function with period such that
The derivative of is in the interval and in the interval , for all . The second derivative of in the sense of the distribution is
where denotes the Dirac measure at . By Itô-Tanaka formula,
where is a standard Brownian motion,
with denoting the local time of at time and level .
Remark 1.
The processes and are continuous and enjoy the following properties:
-
(a)
.
-
(b)
has paths of finite variation, since it is the difference of two nondecreasing processes, given by sums of local times at different levels.
-
(c)
For all , , so .
-
(d)
In an interval , does not reach levels congruent to modulo (these levels corresponding to values of such that ). Local times at levels for are constant on , which implies, from the definition of , that is nondecreasing on .
-
(e)
In an interval , does not reach levels congruent to modulo . Local times at these levels are constant on , which implies that is nonincreasing on .
From Proposition 1, and the corresponding uniqueness property, the process can be recovered from in the same way as has been constructed from . Since and are both Brownian motions, has the same joint distribution as .
We provide two descriptions of the processes discussed here using different time changes, the inverse local times and the hitting times.
Time change with inverse local times
We define the following linear combination of local times:
and its inverse process given by
Note that as , thus for all a.s.
Since is an additive functional of the Brownian motion (see [6], Chapter X), by the strong Markov property, the time-changed Brownian motion is a continuous-time Markov chain. Moreover, since the variation of is supported on the set of times where is in , we have that the Markov chain takes its value only in . This process can only jump between consecutive values in . Indeed, if jumps between non-consecutive values and in at some , then the path starts at , ends at , without accumulating local time at levels in strictly between and : this event occurs with probability zero. Similarly, the starting point can only be or . Thus, the following results are immediate.
Proposition 2.
The process satisfies the following properties:
-
(a)
It starts at with probability , and at with probability .
-
(b)
It jumps by or , the rate of all possible jumps being the same, again by symmetry.
Now, let us compute the rate of jumps. By translation invariance and the strong Markov property, the probability of having no jump during an interval of length is equal, for a Brownian motion , its local time at level zero and its inverse local time , :
where denotes a squared Bessel process of dimension . Hence, for a standard exponential variable ,
Hence, the sum of the rates of jump by and is equal to , and then each of the two possible jumps has a rate by symmetry.
We have
and
In an interval of values of where remains constant and equal to for a given , the variations of are opposite to the variations of , since the only local time which varies in the corresponding sums is the local time at level . Similarly, in an interval of values of where remains constant and equal to for a given , the variations of are equal to the variations of . Hence, is the difference of time spent by the Markov process at levels congruent to modulo , minus the time spent at levels congruent to modulo . If we reduce modulo and divide it by , we get a Markov chain, , on the two-state space , with its starting point uniform in this space, and rate of jumps equal to . Then, is the difference of time spent at state by this Markov process, minus the time spent at state , i.e. the integral of the Markov chain: .
Time change with hitting times
Let us define the sequence of stopping times , as follows:
-
•
If hits before (we call this event ), is the first hitting time of , and for ,
-
•
If hits before (or ), is the first hitting time of , and for ,
Between and , varies as the opposite of the local time of at ; for , between and , varies as the local time of at ; for , between and , it varies as the opposite of the local time of at . We deduce, for all ,
where we recall denoting the local time of at time and level . Notice that the term vanishes on , since in this case.
All these increments of local time, except the first one if in the event , are independent and have the distribution of the local time of at level zero, where is a Brownian motion and
Now, we show that using this approach, one can compute this distribution via Ray-Knight Theorem: for , if and only if no excursion of before the inverse local time reaches or , which implies
Hence, has the same distribution as . We deduce the equality in distribution, for ,
where is a sequence of i.i.d. standard exponential variables, and is an independent, Bernoulli random variable with parameter : if and only if hits before (i.e. ).
For , is a sum of and of i.i.d. variables with the same distribution as . These variables are centered, with variance equal to , since and are independent with variance . We get the following central limit theorem:
Proposition 3.
When tends to infinity,
in distribution.
The increment is itself the sum of i.i.d. random variables with the same distribution as . By the law of large numbers, we have a.s.
Stopping the martingale at time , we deduce for all , by optional sampling, that
For , almost surely converges to , and converges to from below. Applying dominated convergence to the left-hand side and monotone convergence to the right-hand side, we deduce
and then almost surely
(2.5) |
We get
where the first factor converges to a standard normal distribution by Proposition 3 and the second factor converges almost surely to by (2.5). By Slutsky’s thorem, we get the following:
Proposition 4.
When tends to infinity,
in distribution.
This result can be compared to the central limit theorem
which is a direct consequence of the inequality
where is a Brownian motion.
References
- [1] G. Angeris and T. Chitra. Improved price oracles: Constant function market makers. AFT ’20, page 80–91, New York, NY, USA, 2020. Association for Computing Machinery.
- [2] A. Capponi and R. Jia. The Adoption of Blockchain-based Decentralized Exchanges. arXiv e-prints, page arXiv:2103.08842, Mar. 2021.
- [3] E. Gobet and A. Melachrinos. Decentralized Finance & Blockchain Technology. In SIAM Financial Mathematics and Engineering 2023, Philadelphia, United States, June 2023.
- [4] J. Milionis, C. C. Moallemi, and T. Roughgarden. Automated Market Making and Arbitrage Profits in the Presence of Fees. arXiv e-prints, page arXiv:2305.14604, May 2023.
- [5] J. Milionis, C. C. Moallemi, T. Roughgarden, and A. L. Zhang. Automated Market Making and Loss-Versus-Rebalancing. arXiv e-prints, page arXiv:2208.06046, Aug. 2022.
- [6] D. Revuz and M. Yor. Continuous martingales and Brownian motion, volume 293 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. Springer-Verlag, Berlin, third edition, 1999.
- [7] M. Tassy and D. White. Growth rate of a liquidity provider’s wealth in automated market makers, 2020.
- [8] J.-Y. Yen and M. Yor. Local times and excursion theory for Brownian motion, volume 2088 of Lecture Notes in Mathematics. Springer, Cham, 2013. A tale of Wiener and Itô measures.