Strategic Liquidity Provision in Uniswap v3
Transcript of Strategic Liquidity Provision in Uniswap v3
Strategic Liquidity Provision in Uniswap v3Michael NeuderHarvard University
Rithvik RaoHarvard University
Daniel J. MorozHarvard University
David C. ParkesHarvard University
ABSTRACTUniswap is the largest decentralized exchange for digital currencies.The newest version, called Uniswap v3, allows liquidity providers toallocate liquidity to one or more closed intervals of the price of anasset, instead of over the total range of prices. While the price of theasset remains in that interval, the liquidity provider earns rewardsproportionally to the amount of liquidity allocated. This inducesthe problem of strategic liquidity provision: smaller intervals resultin higher concentration of liquidity and correspondingly largerrewards when the price remains in the interval, but with higherrisk. We formalize this problem and study three classes of strategiesfor liquidity providers: uniform, proportional, and optimal (via aconstrained optimization problem).We present experimental resultsbased on the historical price data of Ethereum, which show thatsimple liquidity provision strategies can yield near-optimal utilityand earn over 200x more than Uniswap v2 liquidity provision.
CCS CONCEPTSโข Applied computing โ Electronic commerce; Digital cash;E-commerce infrastructure; Secure online transactions;Elec-tronic funds transfer.
KEYWORDSblockchain, decentralized finance, Uniswap v3, liquidity provision
1 INTRODUCTIONDecentralized finance (DeFi) is a large and rapidly growing collec-tion of projects in the cryptocurrency and blockchain ecosystem.From May 2020 to May 2021, the TVL (total value locked, meaningthe sum of all liquidity provided to the protocol) into DeFi protocolsballooned by 100x from 800 million USD to 80 billion USD [15],beginning with a period of rapid growth in the โDeFi Summerโof 2020. DeFi aims to replicate traditional financial intermediariesand instruments using smart contracts executed on blockchains(typically Ethereum).
Decentralized exchanges (DEXes) allow users to swap tokensof different types without a trusted intermediary. Most DEXes,including Uniswap, fall into the category of constant functionmarketmakers (CFMMs). Instead of using an order book as is done intraditional exchanges, CFMMs use an automated market maker(AMM) to determine the price of an asset. In Uniswap v2, tokenpairs can be swapped for each other using liquidity pools, which
Submitted, June 2021, arXiv version
contain both tokens. Permitted trades are determined by the reservecurve, ๐ฅ๐ฆ = ๐ , where ๐ฅ and ๐ฆ denote the the number of tokens ofeach type in the liquidity pool, and ๐ remains constant across trades.Liquidity providers add tokens to liquidity pools for the traders toswap against, and are rewarded through the fees traders pay. Anillustrative reserve curve is shown in Figure 1 (blue). In order totrade some quantity of token ๐ฆ for some quantity of token ๐ฅ , thetrader must keep the product of reserves constant, i.e., buy ฮ๐ฅ of ๐ฅfor ฮ๐ฆ of ๐ฆ such that (๐ฅ โ ฮ๐ฅ) (๐ฆ + ฮ๐ฆ) = ๐ .
This reserve curve also defines an effective price for token ๐ฅ inunits of token ๐ฆ, i.e., ๐๐ฅ (๐ฅ,๐ฆ) = โ๐๐ฆ/๐๐ฅ [12]. In the context of the๐ฅ๐ฆ = ๐ curve of Uniswap v2, we have๐ฆ = ๐/๐ฅ =โ ๐๐ฅ (๐ฅ,๐ฆ) = ๐/๐ฅ2.By convention, we take the โprice" corresponding to the AMM andliquidity pool to be the price of ๐ฅ , i.e., ๐๐ฅ (๐ฅ,๐ฆ), and we let the ๐ฅtoken be volatile relative to the ๐ฆ token. In Uniswap v2, liquidityproviders earn rewards when traders use the liquidity to executeswaps, which each incur a constant fee of 0.3% [2]. Each liquid-ity provider provides liquidity on the entire interval of possibleprices (0,โ), and earns rewards based on their fraction of the totalliquidity in the pool.1
On May 3, 2021, Uniswapโs new protocol, dubbed Uniswap v3[3], was launched on the Ethereum mainnet. The primary updateof Uniswap v3 over Uniswap v2 was the addition of concentratedliquidity [3]. Within three weeks, the new protocol accumulateda TVL of over 1.2 billion USD and averaged a daily volume of 1.6billion USD [17]. In Uniswap v3, liquidity providers can provideliquidity to each of any number of price intervals, called positions.Liquidity allocated to position [๐๐, ๐๐ ] earns rewards from feeswhen the price remains in that interval. If multiple providers haveallocated liquidity over an interval containing the correct price,each is rewarded proportionally to the fraction of the liquidity theyown on that price. Figure 1 (red) demonstrates how the constantproduct curve of Uniswap v2 is shifted to intercept the axes at ๐and ๐, which are determined by the upper and lower bound of theprice interval of the position. This shifted curve [3] is given by(
๐ฅ +โ๏ธ๐/๐๐
) (๐ฆ +
โ๏ธ๐๐๐
)= ๐, (1)
and the intercepts, ๐ and ๐ can be calculated by letting ๐ฅ or ๐ฆ equalzero respectively.
In this way, Uniswap v3 supports a diversity of strategies inregard to the allocation of liquidity. Each liquidity provider is pre-sented with a trade off between choosing large positions that cover
1The end behavior of this derivative demonstrates the support for the range of pricesbeing the interval (0,โ) , with lim๐ฅโโ ๐/๐ฅ2 = 0, and lim๐ฅโ0+ ๐/๐ฅ2 = โ.
arX
iv:2
106.
1203
3v1
[cs
.CR
] 2
2 Ju
n 20
21
Submitted, June 2021, arXiv version Michael Neuder, Rithvik Rao, Daniel J. Moroz, and David C. Parkes
Figure 1: The reserve curves of Uniswap v2 and v3. Providingconcentrated liquidity in v3 on price interval [๐๐, ๐๐ ] resultsin shifting the Uniswap v2 curve ๐ฅ๐ฆ = ๐ to intercept the axesat ๐ and ๐ respectively. The intercepts are calculated by set-ting ๐ฅ and๐ฆ equal to zero in the v3 reserve curve (Equation 1).
many possible prices, but earn less fees than smaller, more con-centrated positions that are also more risky. Additionally, thereis a cost of reallocating liquidity, because liquidity allocations aretransactions that must be included in a block and thus incur gasfees. This cost must be factored into a liquidity providerโs strategy.
The contributions of this paper are as follows:(1) formalizing the strategic liquidity provision problem and a
family of liquidity provision strategies which we call โresetliquidity provision strategiesโ (reset-LP strategies),
(2) presenting three classes of reset-LP strategies for liquidityproviders, which we call uniform, proportional, and optimal,
(3) analytically calculating the expected utility of a reset-LPstrategy,
(4) solving for the optimal reset-LP strategy based on price-change statistics created from historical Ethereum price data,
(5) demonstrating that proportional allocations are optimal forrisk-seeking providers and uniform allocations are optimalfor risk-averse providers, and
(6) back-testing an optimal reset-LP strategy to demonstratethat under suitable conditions, a strategic provider will earn200x more return on investment than through following av2 strategy.
1.1 Related workThe Uniswap v1 protocol was defined by Adams [1], followed upwith v2 by Adams et al. [2], and most recently amended in v3 byAdams et al. [3].
There is a growing body of work studying liquidity provisionincentives in Uniswap v2. Angeris et al. [6] present an analysisof Uniswap, and more broadly of constant-product AMMs, anddemonstrate conditions for which the markets closely track theprice on an external referencemarket. Angeris and Chitra [4] extendthis line of research by demonstrating that the more general class ofCFMMs incentivize participants to report the true price of an asseton an external market, demonstrating their value as price oracles.
Evans [10] demonstrates that for geometric mean market makers(G3Ms), passive liquidity provision can be used to replicate payoffsof financial derivatives and more active trading strategies. Tassy
and White [16] and White et al. [18] analyze the growth in wealthof a liquidity provider in CFMM for a geometric Brownian motionprice process. Evans et al. [11] extend this to more general liquidityprovider objectives and diffusion processes.
Aoyagi [7] study the equilibrium liquidity provision of constantproduct markets, and show that strategic liquidity providers in theUniswap v2 environment may have a non-monotonic best responsewhen parameterized with the opponentsโ liquidity provision. An-geris et al. [5] extend this line of work to arbitrary CFMMs andcalculate bounds on the liquidity provider rewards based on thecurve that defines the CFMM.
The above work applies to Uniswap v2 and the general class ofCFMMs but not to Uniswap v3. A blog post by Max [13] describesa โpassive rebalancingโ strategy for v3, which aims at maintaininga 50-50 ratio of value for the assets of the liquidity provider. Ourwork presents a more general class of liquidity provision strategiesfor Uniswap v3, and introduces a Markov model to evaluate theexpected utility of different strategies. To our knowledge, this isthe first formal study of liquidity provision strategies in Uniswapv3.
1.2 OutlineSection 2 introduces the Uniswap v3 protocol and introduces theconcept of a liquidity provision strategy. We primarily focus on aclass of strategies which we refer to as โ๐-resetโ strategies. Section 3presents the Markov model used to analyze the expected utility of astrategy in this class of strategies. Section 4 presents three specificliquidity provision strategies including the optimal ๐-reset strategy.Section 5 presents empirical results based on historical Ethereumprice data. Section 6 suggests open problems for future researchand concludes.
2 UNISWAP V3Uniswap v3 introduces to AMMs the concept of concentrated liq-uidity. Instead of providing liquidity on the entire price range of(0,โ), providers can now specify one or more intervals of price forone of the assets over which to provide liquidity. A provider earnstransaction fees when the price of the specified asset is within oneof these intervals (and only then). Additionally, if multiple providersallocate liquidity to the same price, they are each rewarded propor-tionally to the fraction of the total liquidity of that price that theyown.
By choosingmore concentrated intervals, a provider can increasetheir return when the price remains in the interval, but this will alsoincrease the variance in their return. To formalize this, we model adiscrete set of price bins, and a provider who chooses how muchliquidity to place in each bin and when to reallocate, and who seeksto maximize its expected utility from the stream of fees implied bythe adopted strategy.
Definition 2.1 (Bins). Wedefine a set of bins๐ต = {๐1, ๐2, . . . , ๐๐ , . . .},with each bin ๐๐ corresponding to price interval [๐๐ , ๐๐ ), and theseform a partition of [0,โ), with ๐1 = 0 and ๐๐ = ๐๐+1 for all ๐ โ{1, 2, . . . }. Bin ๐๐ corresponds to interval [๐๐ , ๐๐ ). Bin ๐๐ denotes thebin containing the current price of the asset.
For the remainder of this work we refer to the price of one assetin a token pair as measured in units of the other. For example, the
Strategic Liquidity Provision in Uniswap v3 Submitted, June 2021, arXiv version
USDC/ETH pool, where we measure the volatile price of ETH in thestable units of USDC. Consider time ๐ก = ๐ and let ๐๐ denote thebin that contains the current price of the volatile asset. A liquidityprovision strategy at time ๐ก = ๐ provides a method of determiningwhat proportion of the providerโs liquidity is allocated to each bin.We make the following assumptions:
(1) Stable price distributionโWe assume the next-price distri-bution, describing the percent change in price relative tothe current price, is constant across time and invariant tothe current price. We validated this empirically using theEthereum 10-minute historical price data, where we founda correlation coefficient of ๐2 = 0.98 between the follow-ing pairs of probability distributions (i) ETH prices above300 USD against ETH prices below 300 USD (ii) ETH pricesfrom April 2018-April 2019 against ETH prices from April2019-April 2020.
(2) Fixed cost to reallocate liquidityโWe assume that the costto reallocate the liquidity, which comes from the gas feeof including the associated transaction in a block, is fixed(fixed to 1), with other values normalized relative to thiscost. For example if the liquidity provider allocates โ = 100units of liquidity, this is interpreted as 100 times the cost ofreallocating liquidity.
(3) Periodic updatesโWe assume that a providerโs liquidity allo-cation is updated periodically, and with an immediate effectof any reallocation. Further, we take the period length to belong enough (at least 10 minutes) that network transmissiondelay is not a factor, and this is not the focus of this work.
(4) Single strategic providerโWe assume a single, strategic liquid-ity provider, and implicitly model the rest of the providers asallocating liquidity over the entire price range, i.e., followingthe Uniswap v2 liquidity provision method.
2.1 Liquidity provision strategiesIn describing the strategic liquidity provision problem, we first definethe stochastic process {๐๐ : ๐ โ N} on the price ๐๐ at time index ๐.We model a stable next-price distribution, such that the distributionon next price, describing the change in price relative to the currentprice, is constant across time and also invariant to the current price.For this, we re-index the price bins relative to the current price. Let๐๐ denote the current price bin, and index this in relative terms as๐ (0) . Let ๐ (โ๐) and ๐ (๐) denote the ๐๐กโ bin to the left and right ๐๐ ,respectively. The support of the next-price distribution is withinset ๐ต๐ = {โ๐max,โ๐max + 1, . . . , 0, . . . , ๐max}, where ๐max is themaximum possible next-price movement. Following Assumption 1,we can write
Pr(๐๐+1 = ๐ (๐) | ๐๐ = ๐ (0)
)= โ(๐), for ๐ โ ๐ต๐ , (2)
where โ(๐) is the probability of moving left or right by ๐ bins,depending on the sign of ๐ .
Given this, we can now define a simple class of liquidity provisionstrategies.
Definition 2.2. A reset liquidity provision strategy (reset-LP strat-egy) is composed of:
(1) The bin containing the price at the time of reset, ๐๐ = ๐ (0) .
Figure 2: The uniform ๐-reset strategy, defined here on threecontiguous bins centered on the current price. Each circlerepresents a price bin, and the darker circle delineates thecurrent price at each time step. Once the price leaves thesethree contiguous bins, the strategy โresets" and re-centersthe allocation to the price at the time of the reset.
(2) An allocation, ๐ด(๐) โ [0, 1] that specifies the fraction ofliquidity allocated to each bin ๐ (๐) in ๐ต๐ .
(3) A reset condition, which specifies a subset of the bins in ๐ต
that cause the strategy to reset. Upon a reset, the allocationrule ๐ด is used to reallocate liquidity, centered on the newprice ๐๐ .
Of particular interest is the family of ๐-reset strategies.
Definition 2.3. A ๐-reset strategy is a reset-LP strategy in whichthe reset condition is defined so that there is a reset only when theprice is outside the set ๐ต๐ = {๐ (โ๐๐ ) , ยท ยท ยท , ๐ (0) , ยท ยท ยท๐ (๐๐ ) } of 2๐๐ + 1of contiguous bins, centered on ๐๐ .
Sometimes we also use ๐ to denote the probability mass of thenext-price distribution that is covered by๐ต๐ . For example, if ๐ = 0.50then ๐๐ is selected to be the smallest number such that set ๐ต๐includes at least 50% of the next-price probability mass.
We also sometimes write ๐ต๐ to denote the set of relative indicescorresponding to this set of bins, i.e., ๐ต๐ = {โ๐๐ , ยท ยท ยท , 0, ยท ยท ยท๐๐ }. Theusage will be clear from the context.
For illustration, consider the following strategies.
Example 1 (Fixed strategy) โ โAlways provide liquidity in theprice interval [$30, $50].โ
Example 2 (Uniform ๐-reset strategy) โ โAllocate liquidityuniformly on a range of bins centered on the current price ๐๐ .Reset when the price moves outside this range."
Example 3 (Proportional ๐-reset strategy #1) โ โLet ๐ = 0.5,so ๐ต๐ contains the middle 50% of the probability mass of thenext-price distribution. Allocate liquidity proportionally to theprobability of each bin in ๐ต๐ . Reset according to ๐ต๐ ."
Example 4 (Proportional ๐-reset strategy #2) โ โLet ๐ = 0.5,so ๐ต๐ contains the middle 50% of the probability mass of thenext-price distribution. Allocate liquidity proportionally to theprobability of each bin in the middle 90% of the probabilitymass of the next-price distribution. Reset according to ๐ต๐ ."
The uniform ๐-reset strategy is illustrated in Figure 2.
Submitted, June 2021, arXiv version Michael Neuder, Rithvik Rao, Daniel J. Moroz, and David C. Parkes
3 MARKOV ANALYSISIn this section, We develop an analytical framework with whichto determine the expected utility from the fees that flow from aparticular reset-LP strategy.
Definition 3.1. Using relative indices, let ๐ (๐, ๐) : ๐ต๐ร๐ต๐ โ [0, 1]denote the probability of the price moving from the ๐๐กโ bin in ๐ต๐to the ๐๐กโ bin in ๐ต๐ ,
๐ (๐, ๐) = Pr(๐๐+1 = ๐ ( ๐) | ๐๐ = ๐ (๐)
), for ๐, ๐ โ ๐ต๐ . (3)
Note that ๐ (๐, ๐) = โ( ๐ โ ๐), because โ defines the probability thatthe price moves ๐ โ ๐ bins.
Given ๐๐ = ๐ (๐) , there is also a non-zero probability that thenext price ๐๐+1 lands in a bin ๐ ( ๐) โ ๐ต๐ . This is the complement ofthe probability of landing in any of the bins ๐ ( ๐) โ ๐ต๐ .
Definition 3.2. Let ๐(๐) : ๐ต๐ โ [0, 1] denote the probability ofresetting, given the price is in the ๐๐กโ bin of ๐ต๐ ,
๐(๐) = 1 โโ๏ธ๐ โ๐ต๐
๐ (๐, ๐), for ๐ โ ๐ต๐ . (4)
Landing in a bin outside of ๐ต๐ causes a reallocation of liquiditythat is centered on ๐๐ (by the definition of the ๐-reset strategy), sowe can also view a reset as transitioning the price to the ๐ (0) bin.
3.1 Reset Markov chainDefinition 3.3. The reset Markov chain, ๐ โ R(2๐๐+1)ร(2๐๐+1) ,
where ๐ (๐, ๐) denotes the probability from transitioning to state๐ given the current state is ๐ , describes the stochastic process ofthe price movement over the set of bins, ๐ต๐ , induced by a ๐-resetstrategy. We have:
๐ =
๐ (โ๐๐ ,โ๐๐ ) ยท ยท ยท ๐ (โ๐๐ , 0) + ๐(โ๐๐ ) ยท ยท ยท ๐ (โ๐๐ , ๐๐ )...
.
.
....
๐ (0,โ๐๐ ) ยท ยท ยท ๐ (0, 0) + ๐(0) ยท ยท ยท ๐ (0, ๐๐ )...
.
.
....
๐ (๐๐ ,โ๐๐ ) ยท ยท ยท ๐ (๐๐ , 0) + ๐(๐๐ ) ยท ยท ยท ๐ (๐๐ , ๐๐ )
.
Definition 3.4. Given ๐ต๐ , let ๐๐ โ R1ร(2๐๐+1) denote the station-ary distribution of the reset Markov chain, where
๐๐๐ = ๐๐ . (5)
At any time, the probability that the price is contained withinthe ๐๐กโ bin of ๐ต๐ , given a ๐-reset strategy, is ๐๐ (๐).
3.2 Liquidity allocationWhile playing a ๐-reset liquidity provision strategy, agents maywant to allocate liquidity to a larger set of bins than ๐ต๐ .
Definition 3.5. Let the ๐ผ bins, ๐ต๐ผ โ ๐ต, denote a set of bins 2๐๐ผ +1,centered at ๐ (0) , over which liquidity is allocated.
Note that,
๐ต๐ผ = {๐ (โ๐๐ผ ) , ยท ยท ยท , ๐ (0) , ยท ยท ยท , ๐ (๐๐ผ ) }. (6)
Similarly to ๐ต๐ we also overload ๐ต๐ผ to denote the set of relativeindices corresponding to this set of bins,
๐ต๐ผ = {โ๐๐ผ , ยท ยท ยท , 0, ยท ยท ยท , ๐๐ผ }, (7)
and the usage will be clear from context.
Definition 3.6. A liquidity allocation, ๐ด : ๐ต๐ผ โ [0, 1], defines thefraction of a providerโs liquidity allocated to each bin in ๐ต๐ผ , andsatisfies
โ๐โ๐ต๐ผ
๐ด(๐) โค 1.
In order to evaluate this allocation, for each ๐ โ ๐ต๐ผ , we need (i)the probability of being in bin ๐ ( ๐) at any given time, and (ii) theutility of being in bin ๐ ( ๐) .
Definition 3.7. The outcome matrix, ๐ โ R(2๐๐+1)ร(2๐๐ผ+1) is,
๐ =
๐ (โ๐๐ ,โ๐๐ผ ) ยท ยท ยท ๐ (โ๐๐ , 0) ยท ยท ยท ๐ (โ๐๐ , ๐๐ผ )...
.
.
....
๐ (0,โ๐๐ผ ) ยท ยท ยท ๐ (0, 0) ยท ยท ยท ๐ (0, ๐๐ผ )...
.
.
....
๐ (๐๐ ,โ๐๐ผ ) ยท ยท ยท ๐ (๐๐ , 0) ยท ยท ยท ๐ (๐๐ , ๐๐ผ )
, (8)
which represents the probability of moving from any bin in ๐ต๐ toany bin in ๐ต๐ผ .
The probability of landing in the ๐๐กโ bin of ๐ต๐ผ is calculated bymarginalizing out the current location (taking the dot product ofthe stationary distribution of the Markov chain with each columnof the outcome matrix),
Pr(๐๐+1 = ๐ ( ๐)
)=
โ๏ธ๐โ๐ต๐
๐๐ (๐) ยท ๐ (๐, ๐), for ๐ โ ๐ต๐ผ . (9)
To define the utility of each bin in ๐ต๐ผ , we use the exponential(constant absolute risk aversion) utility function [8, 14].
Definition 3.8. Let ๐ข (๐) denote the exponential utility function,
๐ข (๐) ={(1 โ ๐โ๐๐ ) /๐ ๐ โ 0๐ ๐ = 0,
(10)
where ๐ โ R denotes the ArrowโPratt measure of absolute riskaversion, a proxy for the providerโs degree of risk preference. Risk-seeking, risk-averse, and risk-neutral preferences correspond to๐ < 0, ๐ > 0, and ๐ = 0 respectively.
Definition 3.9. The reward, ๐ ๐ด ( ๐), of landing in the ๐๐กโ bin of ๐ต๐ผis proportional to the amount of liquidity allocated to that bin. Let^ โ R+ denote the proportionality constant, which is the fractionof the amount of liquidity provided that is earned as a reward in thenext time step. From Assumption 4, we assume that ^ is constantfor each central bin ๐๐ โ ๐ต and at each time ๐ก = ๐.
Additionally, the reward incurs a reset fee of 1 if the bin is notin ๐ต๐ , and we have reward function:
๐ ๐ด ( ๐) ={^ ยท โ ยท ๐ด( ๐) for ๐ โ ๐ต๐ , ๐ โ ๐ต๐ผ
^ ยท โ ยท ๐ด( ๐) โ 1 for ๐ โ ๐ต๐ , ๐ โ ๐ต๐ผ .(11)
The utility will depend on the risk preference of the provider.Here, we increment each reward by one unit, making the exponen-tial utility function (Equation 10) well defined (it requires positiveinputs). This constant shift does not affect the comparison of ex-pected utility across different strategies.
Definition 3.10. The utility, ๐๐ด ( ๐), of landing in the ๐๐กโ bin of๐ต๐ผ is
๐๐ด ( ๐) = ๐ข (๐ ๐ด ( ๐) + 1) , for ๐ โ ๐ต๐ผ . (12)
Strategic Liquidity Provision in Uniswap v3 Submitted, June 2021, arXiv version
Figure 3: The price dynamics in the illustrative example. Ateach time step, there is a one-third probability of movingleft one, moving right one, and staying in the same bin.
Figure 4: The reset Markov chain in the illustrative example.The center node will move left, right, or stay in the samelocation with probability one-third, which means it cannotcause a reset, and thus will always earn a reward of +^โ/3.The outer nodeswill cause a resetwith probability one-third,which will incur a reward of โ1.
Definition 3.11. The expected utility, ๐ธ๐ข , of an allocation, ๐ด, is
๐ธ๐ข (๐ด) =โ๏ธ๐ โ๐ต๐ผ
Pr(๐๐+1 = ๐ ( ๐)
)ยท๐๐ด ( ๐) . (13)
3.3 Illustrative exampleConsider the simple next-price distribution,
Pr(๐๐+1 = ๐ (โ1) | ๐๐ = ๐ (0) ) = 1/3Pr(๐๐+1 = ๐ (0) | ๐๐ = ๐ (0) ) = 1/3Pr(๐๐+1 = ๐ (1) | ๐๐ = ๐ (0) ) = 1/3.
That is, the price will move down one bin, up one bin, and stay inthe same bin, each with probability one-third. This price model isrepresented in the Markov chain depicted in Figure 3. We use thefollowing ๐ผ and ๐ bins,
๐ต๐ = ๐ต๐ผ = {๐ (โ1) , ๐ (0) , ๐ (1) },
which also implies that ๐๐ผ = ๐๐ = 1. We now can calculate the resetMarkov chain for the example,
๐ =
1/3 2/3 01/3 1/3 1/30 2/3 1/3
.
Figure 4 shows this Markov chain visually, where the blue arrowsare non-reset transitions, and the red arrows are reset transitions.The stationary distribution of this Markov chain is given by the lefteigenvector with eigenvalue 1,
๐๐ =[1/4 1/2 1/4
].
This means that at any time step, there is a one-half probabilitythat the current price is in the middle bin of the strategy, and thereis a one-fourth probability that the current price is in one of theedge bins of the strategy. Let the example allocation be,
๐ด( ๐) = 1/3, for ๐ โ ๐ต๐ผ ,
so each bin in ๐ต๐ผ is allocated one-third of the providerโs liquidity.We have the outcome matrix, ๐ ,
๐ =
1/3 1/3 01/3 1/3 1/30 1/3 1/3
.Let โ = ^ = 1. By taking the dot product of the stationary distribu-tion, ๐๐ with each column of the outcome matrix, we calculate theexpected utility. If we let ๐ = 0 (risk-neutral), then,
๐ธ๐ข (๐ด) = 1/3 ยท 5/6 + 0 ยท 1/6= 5/18 = 0.27.
At each time step, we can expect to earn 5/18 reward for each unitof liquidity that we provide.
4 LIQUIDITY PROVISION STRATEGIESWe now present three ๐-reset strategies.
4.1 Proportional strategyIn this strategy, the provider allocates liquidity proportionally tothe probability of landing in a certain ๐ผ bin.
Definition 4.1. The proportional strategy is a ๐-reset strategywith:
(1) The bin, ๐๐ , of the price when re-setting the strategy.(2) The smallest set of consecutive bins,๐ต๐ , centered at๐๐ , which
account for at least ๐ of the probability mass of the next-pricedistribution.
(3) The smallest set of consecutive bins, ๐ต๐ผ , centered at ๐๐ ,which account for at least ๐ผ of the probability mass of thenext-price distribution.
(4) The allocation function
๐ด( ๐) โ โ( ๐), for ๐ โ ๐ต๐ผ , (14)
which allocates all of the liquidity proportionally to the prob-ability of landing in each bin.
Figure 5 shows an example of the proportional strategy, for thecase of ๐ผ > ๐ . If ๐ผ < ๐ , the set of ๐ bins would be larger than theset of ๐ผ bins.
4.2 Uniform allocation strategyIn this strategy, the provider allocates liquidity uniformly over theset of ๐ผ bins.
Definition 4.2. The uniform allocation strategy is a ๐-reset strat-egy with:
Submitted, June 2021, arXiv version Michael Neuder, Rithvik Rao, Daniel J. Moroz, and David C. Parkes
Figure 5: An example of the proportional ๐-reset strategy,where ๐ผ > ๐ . The height of the bars indicates the amount ofliquidity in each bin. When the strategy last reset, the pricewas ๐๐ . The next-price probability distribution is shown inblue. The โalpha" and the โtau" bins are illustrated. In thiscase, the middle five bins are part of both ๐ต๐ผ and ๐ต๐ .
(1) The bin ๐๐ of the price when resetting the strategy.(2) A set of consecutive bins, ๐ต๐ โ ๐ต.(3) A set of consecutive bins, ๐ต๐ผ โ ๐ต.(4) The allocation function
๐ด( ๐) = 1/(2๐๐ผ + 1), for ๐ โ ๐ต๐ผ , (15)
where ๐๐ผ is the number of bins in ๐ต๐ผ .
4.3 Optimal liquidity strategyIn this strategy, the provider allocates liquidity optimally (among๐-reset strategies) over the set of ๐ผ bins for a specified set of con-secutive bins, ๐ต๐
Definition 4.3. The optimal liquidity strategy is defined by:(1) The bin ๐๐ of the price when resetting the strategy.(2) A set of consecutive bins, ๐ต๐ โ ๐ต.(3) A set of consecutive bins, ๐ต๐ผ โ ๐ต, defined to contain every
bin that could be transitioned to from a bin in ๐ต๐ .(4) An allocation function,๐ด, that is the solution to the liquidity
optimization problem, defined as
max๐ดโR๐ต๐ผ
๐ธ๐ข (๐ด) =โ๏ธ๐ โ๐ต๐ผ
Pr(๐๐+1 = ๐ ( ๐)
)ยท๐๐ด ( ๐)
s.t.โ๏ธ๐ โ๐ต๐ผ
๐ด( ๐) = 1
๐ด( ๐) โฅ 0 for ๐ โ ๐ต๐ผ .
(16)
The constraints specify that (i) all of the liquidity is allocated,and (ii) the liquidity allocated to each bin is non-negative.
If an interior solution exists, this optimization problem admits astandard solution by way of Lagrange multipliers. Then the solutionis characterized by the system
๐ โฒ๐ด ( ๐) ยท Pr
(๐๐+1 = ๐ ( ๐)
)= ๐ โฒ
๐ด (๐) ยท Pr(๐๐+1 = ๐ (๐)
)for all ๐, ๐ โ ๐ต๐ผ , and the constraintsโ๏ธ
๐ โ๐ต๐ผ
๐ด( ๐) = 1
and๐ด( ๐) โฅ 0 for ๐ โ ๐ต๐ผ .
Figure 6: The percent-change next-price distribution with129 bins based on historical Ethereum price data.
In practice, we solve this constrained optimization problem usingthe sequential least squares programming (SLSQP) method [9].
5 EXPERIMENTS ON HISTORICALETHEREUM PRICE DATA
5.1 Ethereum price dataTo study the liquidity provision strategies described in the previ-ous sections, we create a next-price distribution from historicalEthereum price data. We use the 10-minute ETH price from March2018 to April 2020 (100,000 observations). We calculate the percentchange in price at every time step, where
percent change = 100 ยท (๐๐+1 โ ๐๐)/๐๐ . (17)
Figure 6 shows the probability distribution of this percent-changenext-price ETH distribution, for 129 bins on the interval [โ3%, 3%]with each bin containing about 0.046%. We use this distribution togovern the stochastic process of the price changes for simulatingthe return on different liquidity allocation strategies.
5.2 Proportional strategy (Risk neutralprovider)
Wefirst study the expected utility of a risk-neutral liquidity provider(๐ = 0) with a proportional allocation strategy for different choicesof ๐ผ and ๐ , where utility is a function of the expected rewards ateach time step given a providers risk preference.
Figure 7 (left) shows a density plot of expected utility. Figure 7(right) shows slices of the surface, first fixing different choices of๐๐ผ and then fixing different choices of ๐๐ . We include two differentkinds of calculations. The solid lines are based on the analyticalresults (plugging in the Ethereum next-price distribution to Equa-tion 13). Theร symbols represent the sample-average utility comingfrom a direct simulation of the strategy for 50,000 time steps ofsimulated data. This confirms the validity of the analytical, Markov-chain based model.
For a risk-neutral liquidity provider, the highest expected utilityoccurs when there is just a single ๐ผ and ๐ bin, i.e., the current bin,๐๐ . In this strategy, the provider allocates all of their liquidity tothe single, highest probability bin (which has a probability mass of
Strategic Liquidity Provision in Uniswap v3 Submitted, June 2021, arXiv version
Figure 7: The expected utility of different proportional strategies for a risk-neutral provider (๐ = 0). Left: a density plot of theanalytic expected utilities, varying number of ๐ bins and ๐ผ bins. Right: Varying ๐ holding number of ๐ผ bins fixed and varying๐ผ holding number of ๐ bins fixed. The solid lines denote the results of the analytical, Markov analysis (plugging in the ETHnext-price distribution). The ร symbols denote the result of simulating the strategies directly on 50,000 time steps.
Figure 8: Optimal distribution for the liquidity allocation ofa ๐-reset strategy with parameter ๐๐ set to the smallest valuesuch that ๐ต๐ contains at least 50% of the probability mass ofthe next-price distribution. The figure displays the densityfunction of the optimal liquidity allocation. A risk-seeking(๐ = โ1) or risk-neutral (๐ = 0) provider puts all liquidityinto the current-price bin. As the provider becomes morerisk averse (e.g., ๐ = 0.1, 1, 10), it prefers to use more binsto reduce variance. An extremely risk-averse provider (e.g.,๐ = 15) makes a uniform allocation over the ๐ต๐ผ bins.
about 0.15). Since the provider is allocating 100 units of liquidity,this corresponds to a utility of 15 per time step.
5.3 Optimal liquidity allocationsFigure 8 demonstrates the optimal liquidity allocation for a providerwith different levels of risk aversion. This is for a ๐-reset strategy
with parameter ๐๐ set to the smallest value such that ๐ต๐ contains atleast 50% of the probability mass of the next-price distribution. Fora risk seeking (๐ = โ1) or risk neutral (๐ = 0) provider, the optimalallocation uses the single, current-price bin. This allocation resultsin a high expected reward, but a correspondingly high variance. Asthe provider becomes more risk averse (e.g., ๐ = 0.1, 1), the optimalallocation makes use of more bins, while still putting a higherproportion of the liquidity into the higher probability, central bins.As the provider becomes very risk averse (e.g., ๐ = 10), the optimalallocation spreads to cover all bins in ๐ต๐ผ , and for ๐ = 15 the optimalallocation is uniform over these bins.
5.4 Comparing different strategiesFigure 9 compares performance of the optimal, proportional, anduniform ๐-reset strategies for different risk preferences. In eachcase, we define ๐๐ as the smallest value such that ๐ต๐ contains atleast 50% of the probability mass of the next-price distribution.
At risk-neutrality (๐ = 0) and very low risk-aversion (e.g.,๐ = 0.1)the proportional strategy is almost optimal with ๐ผ = 0.14 and ๐ผ =
0.74 respectively. At high levels of risk aversion (e.g., ๐ = 10), theuniform allocation is near-optimal and for an extremely risk averseprovider (e.g., ๐ = 15), the optimal allocation is exactly uniform.This aligns with the optimal allocations presented in Figure 8.
Figure 10 demonstrates the optimal expected utility for variousvalues of ๐ , where ๐ defines the proportion of the probability massof the next-price distribution that the set ๐ต๐ contains. For the risk-neutral agent (๐ = 0), they prefer small values of ๐ , because theyare willing to update their allocation more frequently given theallocation is all the liquidity in a single bin. For a more risk-averseproviders (e.g., ๐ = 3), they prefer a larger ๐ and the resultinglylarger number of bins to spread their liquidity over to reduce thevariance in the rewards they receive.
Submitted, June 2021, arXiv version Michael Neuder, Rithvik Rao, Daniel J. Moroz, and David C. Parkes
Figure 9: Expected utility of the optimal, the best propor-tional, and the uniform allocation for different risk prefer-ences (values of ๐). For each level of ๐, utility is normalizedby the optimal expected utility for that ๐. At lower levelsof risk aversion (e.g., ๐ = 0, 0.1, 1), the proportional strategystrongly outperforms the uniform allocation. At higher lev-els of risk aversion (e.g., ๐ = 10, 15) the uniform strategy isoptimal.
Figure 10: Expected utility from the optimal ๐-reset strategyas a function of ๐ . Here, we report ๐ as the amount of prob-ability mass that is contained in the ๐ต๐ bins. A risk-neutralprovider (๐ = 0) prefers a small ๐ and is willing to updateits allocation quickly. For a more risk-averse provider (e.g.,๐ = 3), the opposite is true. Since they are spreading theirliquidity over more bins, the optimal ๐ is as high as possibleto cover more bins and further reduce the variance of theirrewards.
5.5 Comparison with Uniswap v2Given the historical price data of Ethereum, we can backtest theperformance of strategic liquidity provision versus the Uniswap v2liquidity provision. Recall that in Uniswap v2, liquidity providersarenโt able to specify the price intervals over which they want toprovide liquidity.
Figure 11 shows the historical ETH price for the time periodthat we use. As denoted in the inset, the black line represents theprice of Ethereum at that time period, while the red and blue linesrepresent the bounds of the ๐ผ and ๐ bins respectively for the optimal๐-reset strategy where ๐ = 0.5 of the next-price distribution and๐ = 0.1 (top right allocation of Figure 8). This demonstrates howthe strategy adjusts the liquidity provision regularly to recenter onthe current price.
To simulate a Uniswap v2 liquidity provision strategy, we allocateuniformly over the entire price range of the data. In this example, theprice ranges from 81 USD to 830 USD, and we discretize this rangeof prices into about 5500 bins, based on the spacing defined fromthe empirical calculation of the next-price distribution (Figure 6).
We allocate liquidity evenly among these 5500 bins, providing aguaranteed utility of ๐ข (1/5500, ๐) at each time step. We comparethis to v3 by finding the optimal ๐-reset strategy and dividing theliquidity accordingly to calculate the utility of each price in the dataset. The optimal ๐โreset liquidity provision strategy has 230๐ฅ moreutility than the v2 strategy for the slightly risk averse provider(๐ = 0.1).
6 CONCLUSIONThis work explores the strategic liquidity provision problem thatresults from the Uniswap v3 protocol. We present the broad ๐-reset class of strategies, and outline a technique for analyticallycalculating the expected utility of them. We describe three differentimplementations of the strategy, and compare their performanceon the next-price distribution created from the historical Ethereumprice data. We are able to find the optimal ๐-reset strategy, givena choice of ๐ bins, and a next-price distribution. By backtestingour strategy on the historical price data, we find that the optimal๐-reset strategy can have an expected utility that is over 200x theutility a v2 strategy.
We hope that this work serves as a first step in formalizing andcomparing the performance of these strategies. This present frame-work only represents a subset of the full strategy space, consideringstrategies that use the same approach to allocation across time, withthe strategy centered on the current price and a reallocation trig-gered by a large enough price movement. A richer class of strategieswould also modify the allocation of liquidity, and reset strategy,based on recent trends in price movement.
It will be interesting to investigate the question of liquidity pro-vision in a multi-provider context. Whereas in this paper we studythe investment problem facing a single v3 player vs a set of v2players, we see an opportunity in future work to study emergent,equilibrium properties of this Uniswap v3 liquidity provision set-ting. An empirical study of strategies pursued on Uniswap v3 is alsoof interest. Additionally, there are intriguing macro-level connec-tions between Uniswap v3 and gas prices. If gas fees are low, thenliquidity providers are motivated to update their positions more
Strategic Liquidity Provision in Uniswap v3 Submitted, June 2021, arXiv version
Figure 11: The optimal ๐-reset strategy for ๐ = 0.5 backtested with the historical Ethereum price data. The red lines show thewidth of the ๐ผ bins at each time step and the blue lines show the width of the ๐ bins. With this strategy, the provider earns onaverage 230x more utility compared with providing liquidity uniformly across the range of price bins (Uniswap v2 allocation).
frequently, which may cause cause gas prices to rise. Understandingthe resulting dynamics and relationship between Uniswap and gasprices is another promising direction.
ACKNOWLEDGMENTSThis work is supported in part by two generous gifts to the Centerfor Research on Computation and Society at Harvard University,both to support research on applied cryptography and society.
REFERENCES[1] Hayden Adams. 2018. Uniswap Whitepaper. https://hackmd.io/@HaydenAdams/
HJ9jLsfTz[2] Hayden Adams, Noah Zinsmeister, and Dan Robinson. 2020. Uniswap v2 core.
URl: https://uniswap.org/whitepaper. pdf (2020).[3] Hayden Adams, Noah Zinsmeister, Moody Salem, River Keefer, and Dan Robinson.
2021. Uniswap v3 Core. (2021).[4] Guillermo Angeris and Tarun Chitra. 2020. Improved price oracles: Constant
function market makers. In Proceedings of the 2nd ACM Conference on Advancesin Financial Technologies. 80โ91.
[5] Guillermo Angeris, Alex Evans, and Tarun Chitra. 2020. When does the tail wagthe dog? Curvature and market making. arXiv preprint arXiv:2012.08040 (2020).
[6] Guillermo Angeris, Hsien-Tang Kao, Rei Chiang, Charlie Noyes, and Tarun Chitra.2019. An analysis of Uniswap markets. arXiv preprint arXiv:1911.03380 (2019).
[7] Jun Aoyagi. 2020. Lazy liquidity in automated market making. Available at SSRN3674178 (2020).
[8] Kenneth Joseph Arrow. 1965. Aspects of the theory of risk-bearing. Helsinki.[9] Paul T Boggs and Jon W Tolle. 1995. Sequential quadratic programming. Acta
numerica 4 (1995), 1โ51.[10] Alex Evans. 2020. Liquidity provider returns in geometric mean markets. arXiv
preprint arXiv:2006.08806 (2020).[11] Alex Evans, Guillermo Angeris, and Tarun Chitra. 2021. Optimal Fees for Geo-
metric Mean Market Makers. (2021).[12] Bhaskar Krishnamachari, Qi Feng, and Eugenio Grippo. 2021. Dynamic Curves
for Decentralized Autonomous Cryptocurrency Exchanges. arXiv preprintarXiv:2101.02778 (2021).
[13] Max. 2021. Introducing Alpha Vaults โ an LP strategy for UniswapV3. https://medium.com/charmfinance/introducing-alpha-vaults-an-lp-strategy-for-uniswap-v3-ebf500b67796
[14] John W Pratt. 1978. Risk aversion in the small and in the large. In Uncertainty ineconomics. Elsevier, 59โ79.
[15] DeFi Pulse. 2021. Defi Pulse. https://defipulse.com/[16] Martin Tassy and David White. 2020. Growth rate of a liquidity providerโs wealth
in xy= c automated market makers.[17] Uniswap team. 2021. Uniswap v3 Analytics. https://info.uniswap.org/#/
[18] Dave White, Martin Tassy, Charlie Noyes, and Dan Robinson. 2020. UniswapโsFinancial Alchemy. https://research.paradigm.xyz/uniswaps-alchemy