---
# System prepended metadata

title: AMM_slides
tags: [slides]

---

# Automated Market Makers: A Mathematical Finance Perspective
Shen-Ning Tung, National Tsing-Hua University



## Introduction: The Rise of AMMs

### Overview of AMMs
* **Automated market makers (AMMs)** are algorithmic protocols that facilitate the exchange of digital assets within liquidity pools, using predefined pricing mechanisms.
* They play a crucial role in the *decentralized finance (DeFi)* ecosystem, offering an alternative to traditional *centralized limit order books (CLOBs)*.


### The Need for AMMs
* *CLOBs*, while effective in traditional finance, face limitations in the decentralized world, including liquidity dependence, complexity in implementation, and potential transparency concerns.
* AMMs address these challenges by leveraging algorithms, liquidity pools, and *predefined pricing functions*, ensuring efficient and transparent trading in a decentralized environment.


### Participants in the AMM Ecosystem
* **Liquidity Providers (LPs):** Deposit assets into liquidity pools, enabling trading and earning fees in return, while facing risks like impermanent loss.
* **Traders:** Engage in buying and selling assets through the AMM, paying fees for the convenience and guaranteed liquidity.
* **Arbitrageurs:** Monitor price discrepancies between the AMM and external markets, exploiting these differences for profit and ensuring price efficiency.

![image](https://hackmd.io/_uploads/BJcOfBIq1x.png)


### AMM vs. CLOB: Key Differences
| Feature | CLOB | AMM |
|---------|------|-----|
| **Liquidity** | Depends on active traders | Guaranteed by liquidity pools |
| **Pricing** | Determined by order matching | Set by algorithm based on pool composition |
| **Fees** | Typically charged by exchange | Usually paid to liquidity providers |
| **Transparency** | May vary depending on exchange | High, due to open-source code and on-chain transactions |
| **Accessibility** | May require KYC/AML checks | Open to anyone with a crypto wallet |


### Reference
* Mohan, V. (2022). Automated market makers and decentralized exchanges: A DeFi primer. Financial Innovation, 8(20). https://doi.org/10.1186/s40854-021-00314-5
* Milionis, J., Moallemi, C. C., & Roughgarden, T. (2024). Complexity-approximation trade-offs in exchange mechanisms: AMMs vs. LOBs. In F. Baldimtsi & C. Cachin (Eds.), Financial Cryptography and Data Security: FC 2023 (pp. 351-370). Springer. https://doi.org/10.1007/978-3-031-47754-6_19



## Mathematical Foundations of AMMs


### Constant Function Market Makers (CFMMs)
* *CFMMs* are a fundamental type of AMM that employs a mathematical function known as a bonding curve to determine the price of assets within a liquidity pool.
    * Mathematical Representation: $\phi(x, y) = \ell$, where $\ell$ is a constant representing liquidity depth, and $x$ and $y$ are the reserves of two assets. 
    * ![Screenshot 2025-01-20 at 1.59.33 PM](https://hackmd.io/_uploads/Sy7LDSnPJl.png)
* The pricing mechanism in CFMMs relies on the **slope of the bonding curve** at the current reserve levels, representing the **marginal rate of exchange** between the assets.
    * Formula: $P = - \frac{dy}{dx} = - \frac{\partial \phi / \partial x}{\partial \phi / \partial y}$. 
    * ![image](https://hackmd.io/_uploads/r1V_dNL9kl.png)
* For a trading mechanism to be viable in a CFMM, the bonding curve must satisfy specific conditions, such as the implicit function for reserves being *decreasing* and *concave*.
* The total value of a CFMM pool depends on the market prices of the assets it holds and the shape of the bonding curve. Ito's formula can be used to analyze the dynamics of the pool value as asset prices fluctuate.
    * Pool Value Function: $V(P) = x(P) * P + y(P)$, where $x(P)$ and $y(P)$ are the reserves of the two assets at price $P$.
    * $dV_t = V'(P_t) dP_t + \frac{1}{2} V''(P_t) d\langle P_t \rangle = x(P_t) dP_t + \frac{1}{2} \frac{dx}{dP}(P_t) d\langle P_t \rangle_t$ since $V'(P) = x$.


### Impermanent Loss (IL)
* *Impermanent loss (IL)* is a potential risk that LPs face in CFMMs due to price fluctuations of the assets within the pool.
* It arises when the ratio of assets in the pool diverges from the initial deposit ratio, leading to a loss in value compared to simply holding the assets.
* Mathematically, IL is represented as the difference between the value of holding the initial assets and the current value of the pool.
    * $\text{IL}(P) := H(P) - V(P) = (x_0 - x(P)) * P + (y_0 - y(P))$
        * $H(P)$ represents the value of holding the initial assets and $V(P)$ is the pool value.
        * $x_0$ and $y_0$ are the initial reserves when the price was $P_0$.
* It's important to note that IL is always **non-negative** due to the concavity of the bonding curve.
    * ![image](https://hackmd.io/_uploads/S1crjNIqyg.png)
* To compensate for the risk of IL, traders pay **fees** to LPs, incentivizing them to provide liquidity despite potential losses.
    * $\phi(x + \gamma (\Delta x)_+ - (\Delta x)_- , y + \gamma (\Delta y)_+ - (\Delta y)_-) = \phi(x, y)$, $0 \leq \gamma \leq 1$.


### Key Considerations for CFMM Design
* The choice of bonding curve significantly impacts the CFMM's behavior, affecting price sensitivity, liquidity provider returns, and impermanent loss.
* The trading fee tier incentivizes liquidity provision but can influence trading volume and arbitrage activity.
* *Optimal market making* involves designing CFMMs that efficiently provide liquidity while minimizing risks for liquidity providers, which is an ongoing area of research.


### References
* Angeris, G., & Chitra, T. (2020). Improved price oracles: Constant function market makers. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies (pp. 80-91). Association for Computing Machinery. https://doi.org/10.1145/3419614.3423251
* Angeris, G., Chitra, T., & Evans, A. (2022). When does the tail wag the dog? Curvature and market making. Cryptoeconomic Systems Journal. https://cryptoeconomicsystems.pubpub.org/pub/angeris-curvature-market-making/release/2
* Angeris, G., Chitra, T., Diamandis, T., Evans, A., & Kulkarni, K. (2023). The geometry of constant function market makers. arXiv preprint arXiv:2308.08066.



## Arbitrage in AMMs

### Myopic Arbitrage Assumptions
* **Myopic arbitrage** refers to a scenario where arbitrageurs, driven solely by immediate profit opportunities, exploit price discrepancies between an AMM and a reference market.
* This framework operates under key assumptions: 
    1. The existence of a frictionless reference market with infinite liquidity, 
    2. Fixed porpotional trading fees $(1 - \gamma)$ within the AMM.
    3. The presence of active arbitrageurs constantly monitoring for price discrepancies.
* These assumptions lead to a **"no-arbitrage interval" $\gamma s < p < \gamma^{-1} s$,** a price range within which arbitrage opportunities are absent. Arbitrage actions push the AMM's price towards the boundaries of this interval, ensuring price consistency with the reference market, albeit within the constraints of trading fees.
    * ![blue](https://hackmd.io/_uploads/HkZrYEhDyx.png)


### Continuous Mispricing Dynamics
* **Mispricing** quantifies the deviation between the reference market price and the AMM's price. Mathematical theorems can be employed to analyze the dynamics of this mispricing.
    * $Z_t := \ln S_t - \ln P_t$
* **Theorems (Najnudel-T.-Yamazaki-Yen, Lee-T.-Wang)**
    * The mispricing process $Z_t$ takes value within the range $[\ln \gamma, − \ln \gamma]$ for all $t \geq 0$.
    * The mispricing process, $Z_t$, can be decomposed into:
        * $Z_t = \ln S_t - \ln P_0 + L_t - U_t$
        * $L_t$ and $U_t$ are non-decreasing and continuous, with initial values at 0.
        * $L_t$ and $U_t$ increase only when $Z_t = - \ln \gamma$ and $Z_t = \ln \gamma$, respectively.


### Loss-Versus-Rebalance (LVR)
* **Loss-versus-rebalance (LVR)** measures the adverse selection cost incurred by LPs in CFMMs. It captures the losses LPs face due to arbitrageurs exploiting stale prices.
* LVR is mathematically defined as the difference between the returns of a self-financing strategy replicating the AMM's portfolio and the actual value of the AMM's portfolio.
    * $d \text{LVR}_t = d R_t - d V_t = - \frac{1}{2} V''(P_t) d\langle P \rangle_t \geq 0$
    * $R_t$ is the self-financing strategy that holds $x(P_t)$ in risky asset at time $t$ with $R_0 = x_0 * P_0 + y_0$.
    * $V_t$ is the value of the pool at time $t$.
* Relationship between IL and LVR:
    * $\text{IL}_t = \int^t_0 \left(x(P_t) - x(P_0) \right) dP_s + \text{LVR}_t$
* This concept has important implications for LPs, as it highlights the inherent costs associated with providing liquidity and underscores the trade-off between potential returns and the risk of adverse selection.


### Limitations of the Myopic Arbitrage Model
* While providing valuable insights, the myopic arbitrage model relies on simplifying assumptions that may not always hold in real-world markets.
* Arbitrageurs may not always act myopically, and factors like transaction costs and market volatility can influence their behavior.
* More sophisticated models, such as those incorporating control theory or considering non-myopic arbitrageurs, are needed to capture the complexities of arbitrage in AMMs fully.

![pool_CEX_timeseries](https://hackmd.io/_uploads/rk4-9Nhvye.png)


### Reference
* Milionis, J., Moallemi, C. C., Roughgarden, T., & Zhang, A. L. (2022). Automated market making and loss-versus-rebalancing. arXiv preprint arXiv:2208.06046.
* Milionis, J., Moallemi, C. C., & Roughgarden, T. (2023). Automated market making and arbitrage profits in the presence of fees. arXiv preprint arXiv:2305.14604.
* Najnudel, J., Tung, S. N., Yamazaki, K., & Yen, J. Y. (2024). An arbitrage driven price dynamics of automated market makers in the presence of fees. Frontiers of Mathematical Finance, 3(4), 560-571. https://doi.org/10.3934/fmf.2024018
* Lee, C. Y., Tung, S. N., & Wang, T. H. (2024). Growth rate of liquidity provider's wealth in G3Ms. arXiv preprint arXiv:2403.18177.



## Types of AMMs


### Constant Product Market Makers (CPMMs): The Uniswap Model
* **CPMMs**, popularized by **Uniswap**, are characterized by their use of a *constant product bonding curve*, where the product of the reserves of the two assets in the pool remains constant.
* Uniswap v2 introduced key improvements such as ERC-20 to ERC-20 trading, price oracles, and flash swaps, solidifying its position as a leading decentralized exchange (DEX).
* Liquidity provision in CPMMs involves depositing assets and receiving LP tokens that represent ownership of a share of the pool. These tokens entitle holders to trading fees and a portion of the pool's assets.
    * ![image](https://hackmd.io/_uploads/HkSG7BIqJx.png)
    * ![image](https://hackmd.io/_uploads/SyS-7S85Jg.png)

#### Key Properties of CPMMs
* $\sqrt{xy} = \ell$
    * $x$ is the reserve of the first asset.
    * $y$ is the reserve of the second asset.
    * $\ell$ is a constant value representing the liquidity depth.
    * ![CPMM_bonding](https://hackmd.io/_uploads/SJSIVLaPJg.png)
* Pool reserves $x$ and $y$ are proportional to liquidity depth $\ell$.
* There is a **correspondence between the pool reserve pair $(x, y)$ and the liquidity-price pair $(\ell, P)$:**
    * From $(x, y)$ to $(\ell, P)$: $\ell = \sqrt{xy}$, $P = \frac{y}{x}$.
    * From $(\ell, P)$ to $(x, y)$: $x = \frac{\ell}{\sqrt{P}}$, $y = \ell \sqrt{P}$.
* Pool value function: $V(P) = Px + y = 2y = 2 \ell \sqrt{P}$.
* Impermanent loss function: $\text{IL}(P) = \frac{\ell}{P_0} (P + P_0 - 2 \sqrt{P P_0}) \geq 0$.
* Loss-versus-rebalance dynamic: $d\text{LVR}_t = \ell \frac{d\langle P \rangle_t}{4P^{\frac32}}$.

#### LP Growth Rate in CPMMs
* **LP wealth process:** $W_t = x_t S_t + y_t$, where $S_t$ is the reference market price.
    * The **log ratio** $\ln \frac{W_t}{V_t}$ is **bounded** by a constant depending on $\gamma$.
    * The LP wealth and LP value have the **same growth rate**.
* **Theorem (Tassy-White)** If $S_t$ follows a Geometric Brownian Motion (GBM) dynamic, i.e., $d\ln S_t = \mu dt + \sigma dB_t$, then under myopic arbitrage assumptions, there is an explicit formula for the growth rate $\lim_{T \to \infty} \frac{\ln W_T}{T}$. Moreover, the optimal fees and optimal growth rate depend on the relationship between the drift $\mu$ and volatility $\sigma$ of the asset price.
* **Optimal Fees and Optimal Growth Rate:**
    * (Case $\mu=0$): $\gamma$ should be as close as possible to 1 without being 1 and the optimal wealth growth is given by $\sigma^2 / 8$.
    * (Case $\mu>0$):
        * If $\frac{4 \mu}{\sigma^2} < 1$, $\gamma$ should be as large as possible and the best possible growth rate is $\frac{\mu}{2} + \frac{\sigma^2}8$.
        * If $\frac{4\mu}{\sigma^2} > 1$, $\gamma$ should be set to 0 (no trade) and the best possible growth rate is $\mu$.
        * If $\frac{4\mu}{\sigma^2} = 1$, the growth rate is constantly equal to $\mu$ independently of $\gamma$.
    * (Case $\mu<0$): The optimal fee is $\gamma$ as close as possible to 1, the optimal growth rate is $\frac{\mu}{2} + \frac{\sigma^2}{8}$.
* **Takeaway:** A CPMM LP position is an arbitrage-driven, constantly rebalanced portfolio (of weight 1/2). The growth rate of the LP's wealth is closely tied to the dynamics of the underlying asset prices and the fee structure of the CPMM.

#### Reference
* Uniswap v2 core, [White paper](https://app.uniswap.org/whitepaper.pdf).
* Angeris, G., & Chitra, T. (2020). An analysis of Uniswap markets. Cryptoeconomic Systems Journal. https://arxiv.org/abs/1911.03380
* Tassy, M., & White, D. (2020). Growth rate of a liquidity provider's wealth in xy=c automated market makers [Manuscript](https://drive.google.com/file/d/1UA-V9j77dhqscZQqxSSB1uMDeyGP2mtI/view?usp=sharing).


### Geometric Mean Market Makers (G3Ms): A Decentralized Index Fund
* **G3Ms**, exemplified by **Balancer**, generalize the constant product formula to accommodate pools with multiple assets and configurable weights, functioning as decentralized index funds.
* Balancer's key features include multi-asset pools, configurable weights for portfolio customization, and dynamic weights that adjust based on predetermined rules or market conditions.

#### Key Properties of G3Ms
* For a pool with $n$ assets, the bonding curve is represented by:
    * $\prod_{i=1}^{n} R_i^{w_i} = \ell$
        * $R_i$ is the reserve of the $i$-th asset.
        * $w_i$ is the weight assigned to the $i$-th asset, with $\sum_i w_i = 1$.
        * $\ell$ is a constant.
    * ![image](https://hackmd.io/_uploads/rkLm0PaPJl.png)
* The **marginal exchange rate** between the $i$-th asset and the $j$-th asset is:
    * $P_{ij} = \frac{R_j/w_j}{R_i/w_i}$.
* The **weight** of the $i$-th asset in the pool's total value remains constant at $w_i$.
* The **pool value function**, expressed in terms of asset $j$, is:
    * $V_j = \sum_{i=1}^n P_{ij} R_i = \frac{P_{ij}R_i}{w_i} = \ell \prod_{i=1}^n \left(\frac{P_{ij}}{w_i}\right)^{w_i}$.
* When $n=2$, the loss-versus-rebalance dynamic is:
    * $d\text{LVR}_t = \frac{w^{1-w}(1-w)^w}{2} \ell P^{w-2} d\langle P \rangle_t$.

#### LP Growth Rate in G3Ms (Two-Asset Case)
* Under myopic arbitrage assumptions, the liquidity process $\ell_t$ is **non-decreasing** and **predictable**.
    * $d \ln \ell_t= \frac{(1-\gamma)w(1-w)}{1-w+\gamma w} dL_t + \frac{(1 - \gamma)w(1-w)}{\gamma(1-w) + w} dU_t$.
    * This result can be used to generalize the Tassy-White theorem for CPMMs to the G3M setting.
* **Theorem (Lee-T.-Wang)** Assume the price of asset 1 with respect to asset 2, denoted by $S_t$, follows a GBM dynamic: $$d\ln S_t = \mu dt + \sigma dB_t.$$ Under myopic arbitrage assumptions, the long-term logarithmic growth rate of an LP's wealth is:
    * $\lim_{T \to \infty} \frac{\ln W_T}{T} = w \mu + \frac{(1-\gamma)w(1-w)}{(1-w) + \gamma w} \alpha + \frac{(1-\gamma)w(1-w)}{\gamma(1-w)+ w} \beta$
        * $\theta = \frac{2\mu}{\sigma^2}$ and $\alpha$ and $\beta$ are constants that depend on $\theta$ and the fee tier $\gamma$.
        * $\alpha = \beta = -\frac{\sigma^2}{4 \ln \gamma}$ if $\theta = 0$.
        * $\alpha = \frac{\theta \sigma^2}{2(\gamma^{-2\theta} - 1)}$ and $\beta = \frac{\theta \sigma^2}{2(1-\gamma^{2\theta})}$ if $\theta \neq 0$.
    * The steady-state distribution of the mispricing process $Z_t$ can be characterized as either a **uniform distribution** ($\theta=0$) or a **truncated exponential distribution** ($\theta \neq 0$).

#### Connection to Stochastic Portfolio Theory (SPT) and Optimal Fees
* The growth rate of an LP's wealth in G3Ms is connected to *Stochastic Portfolio Theory (SPT)*, particularly in frictionless markets, highlighting the link between AMMs and portfolio management principles.
* The growth rate formula corresponds to the growth rate of a constant rebalanced portfolio with the same weight as the fee tier $\gamma$ approaches 1.
* **Numerical analysis** suggests that the optimal fee tier $\gamma^*$ that maximizes LP wealth growth may lie within the interior of the interval $(0,1)$, a behavior not observed in the simpler CPMM model.
    * ![growth_ratio_weight](https://hackmd.io/_uploads/ry5fovpPyg.png)
    * ![growth_heatmap_weight](https://hackmd.io/_uploads/SJAWsDaPyl.png)

#### Reference
* Balancer: A non-custodial portfolio manager, liquidity provider, and price sensor, [White paper](https://www.securities.io/balancer-whitepaper/).
* Evans, A. (2023). Liquidity provider returns in geometric mean markets. Cryptoeconomic Systems Journal. https://cryptoeconomicsystems.pubpub.org/pub/evans-g3m-returns/release/4
* Lee, C. Y., Tung, S. N., & Wang, T. H. (2024). Growth rate of liquidity provider's wealth in G3Ms. arXiv preprint arXiv:2403.18177.


### Concentrated Liquidity Market Makers (CLMMs): A Step Towards Decentralized Limit Order Books
* **CLMMs**, introduced by **Uniswap v3**, allow liquidity providers to concentrate their capital within specific price ranges, enhancing capital efficiency and enabling more nuanced liquidity provision strategies.
* Uniswap v3's key features include *concentrated liquidity*, which enables LPs to provide liquidity only within a specified price range, and improved capital efficiency.
* Bonding curves in CLMMs emerge from the collective actions of all LPs, with each LP contributing a segment to the overall curve defined by their chosen price range.
    * ![Screenshot 2025-01-22 at 12.07.54 PM](https://hackmd.io/_uploads/SJ8Xe0RPke.png)

#### LP Reserves in CLMMs
* An LP position in a CLMM is defined by a pair $(\ell, [p_l, p_u])$, where:
    * $\ell$ represents the amount of liquidity provided.
    * $[p_l, p_u]$ defines the price range where the liquidity is active.
* The required reserves for an LP depend on the current pool price $p$ and the LP's chosen price range:
    * If $p \in [p_l, p_u]$, the LP provides both assets to the pool:
        * $x = \ell \left(\frac1{\sqrt p} - \frac1{\sqrt p_u} \right), \quad y = \ell \left(\sqrt p - \sqrt p_l \right)$
    * If $p > p_u$, the LP provides only the asset that will be bought as the price moves back into the range:
        * $x = \ell \left(\sqrt{p_u} - \sqrt{p_l}\right), \quad y = 0.$
    * If $p < p_l$, the LP provides only the asset that will be bought as the price moves back into the range:
        * $x = 0, y = \ell \left(\frac1{\sqrt{p_l}} - \frac1{\sqrt{p_u}}\right)$
    * These can be summarized as:
        * $x(p) = \ell \left(\frac1{\sqrt p} - \frac1{\sqrt p_u} \right)^+ - \ell \left(\frac1{\sqrt p} - \frac1{\sqrt p_l} \right)^+$,
        * $y(p) = \ell \left(\sqrt p - \sqrt p_l \right)^+ - \ell \left(\sqrt p - \sqrt p_u \right)^+$.

#### Properties of CLMMs
* The bonding curve for $p \in [p_l, p_u]$ is:
    * $\left( x + \frac{\ell}{\sqrt{p_u}} \right)^{1/2} \left(y + \ell\sqrt{p_l} \right)^{1/2} = \ell$
* This shows that **Uniswap v3 uses the same underlying bonding curve as Uniswap v2**, but with the added flexibility of concentrated liquidity.

![CLMM_bonding](https://hackmd.io/_uploads/BJfZWcTvyg.png)

#### LP Value as Options Payoff
* $V(P) = x(P)P + y(P)$
    * $= \ell P \left[ \left(\frac1{\sqrt P} - \frac1{\sqrt{p_u}} \right)^+ - \left(\frac1{\sqrt P} - \frac1{\sqrt{p_l}} \right)^+ + \left(\frac1{\sqrt P} - \frac{\sqrt{p_l}}{P} \right)^+ - \left(\frac1{\sqrt P} - \frac{\sqrt{p_u}}{P} \right)^+ \right]$
        * where $(z)^+ = \max(z,0)$ denotes the positive part of $z$.
    * $= \begin{cases} \ell P \left( \frac1{\sqrt{p_l}} - \frac1{\sqrt{p_u}} \right) &\text{ if } P < p_l, \\ \ell P \left( \frac2{\sqrt{P}} - \frac{1}{\sqrt{p_u}} - \frac{\sqrt{p_l}}{P} \right) &\text{ if } p_l \leq P \leq p_u, \\ \ell \left( \sqrt{p_u} - \sqrt{p_l} \right) &\text{ if } P > p_u, \end{cases}$
* The value of an LP position in a CLMM can be interpreted as the payoff of a covered call option with strike price $p_l$ and a short call option with strike price $p_m = \sqrt{p_l p_r}$.
![CLMM_value](https://hackmd.io/_uploads/BkuMM5Tvke.png)

#### Liquidity Profile
* The liquidity profile in CLMMs can be interpreted as a *distribution* $\ell = \ell(P)$, describing the concentration of liquidity across different price levels.
* From a measure-theoretic perspective, $d\ell(p)$ can be interpreted as a $\sigma$-finite signed measure on the interval $[0, \infty)$, with $\ell(p)$ serving as its cumulative distribution function (CDF).
* Pool reserves can be expressed in terms of the instantaneous price, $P$, and the liquidity profile, $\ell(P)$:
    * $x(P) = \frac12 \int_P^\infty \ell(p) p^{-\frac32} dp$, 
    * $y(P) = \frac12 \int_0^P \ell(p) p^{-\frac12} dp$.
* The reserve/bonding curve is decreasing and convex:
    * $\frac{d y}{dx}(P) = -P < 0$,
    * $\frac{d^2 y}{dx^2}(P) = \frac{2P^{\frac32}}{\ell(P)}> 0$.
* Using integration by parts, and under the boundary conditions $\lim_{p \to \infty} \ell(p) p^{-\frac12} = 0$ and $\lim_{p \to 0} \ell(p) p^{\frac12} = 0$, we can express the reserves as:
    * $x(P) = \frac{\ell(P)}{\sqrt P} + \int_P^\infty \frac1{\sqrt p} d\ell(p)$,
    * $y(P) = \ell(P) \sqrt P - \int_0^P \sqrt p d\ell(p)$.

#### Examples of Liquidity Profiles
* **Uniform Liquidity Profile:** Liquidity is evenly distributed across all prices.
![LP_v2](https://hackmd.io/_uploads/Hk4LZCTDJe.png)
* **Disjoint Positions Liquidity Profile:** Liquidity is concentrated in distinct, non-overlapping price ranges.
![LP_sum_of_two](https://hackmd.io/_uploads/rk5w-Aawyx.png)
* **Continuous Liquidity Profile:** Liquidity varies smoothly across the price range.
![LP_chi2](https://hackmd.io/_uploads/SJi_ZApwJe.png)
* **Empirical Liquidity Profile:** Observed liquidity distribution in a real-world CLMM.
![LP3D](https://hackmd.io/_uploads/SylqGRTDyl.png)
![LP1](https://hackmd.io/_uploads/SJASQCTPke.png)
![LP2](https://hackmd.io/_uploads/HJm8m0pD1x.png)
![LP3](https://hackmd.io/_uploads/rywLQR6Dkg.png)
![LP4](https://hackmd.io/_uploads/rysLmCpPyg.png)

#### IL and LVR in CLMMs
* IL and LVR in CLMMs can be analyzed using Ito's formula, considering both static and time-dependent liquidity profiles.
* Assuming a static liquidity profile ($\frac{d\ell}{dt}=0$).
    * The evolution of the pool value $V_t = P_t x_t + y_t$:
        * $dV_t = x_t dP_t - \frac14 \ell(P_t) P_t^{-\frac32} d\langle P \rangle_t$.
    * The *LVR* is:
        * $d{\rm LVR}_t = x_t dP_t - dV_t = \frac14 \ell(P_t) P_t^{-\frac32} d\langle P \rangle_t$.
    * The *IL* is:
        * $d{\rm IL}_t = (x_t - x_0)dP_t + d {\rm LVR}_t$.
* The analysis can be extended to time-dependent liquidity profiles.
    * Non-self-financing as LPs may need to add or remove assets from the pool to maintain their desired liquidity positions.
    * $d\langle \ell, P \rangle_t = 0$ as price changes $dP_t$ and liquidity adjustments $d\ell_t$ occur as distinct, ordered events on the blockchain.
    * Consequently, the core component of $d {\rm LVR}_t$ that is both unhedgeable and directly attributable to arbitrage remains the same.

#### Reference
* Uniswap v3 core, [White paper](https://app.uniswap.org/whitepaper-v3.pdf).
* Lipton, A., Lucic, V., & Sepp, A. (2024). Unified approach for hedging impermanent loss of liquidity provision. arXiv preprint arXiv:2407.05146.
* Tung, S. N., & Wang, T. H. (2024). A mathematical framework for modelling CLMM dynamics in continuous time. arXiv preprint arXiv:2412.18580.


### Uniswap v4: Expanding the Possibilities with Hooks
* Uniswap v4 introduces **"hooks,"** customizable plugins that empower developers to extend the functionality of AMMs, fostering innovation and flexibility.
* Hooks are smart contracts that can be integrated into the AMM's lifecycle at various points, enabling functionalities like *dynamic fees*, *limit orders*, and custom trading strategies.
* ![image](https://hackmd.io/_uploads/rJ2IH10vJx.png)

#### Reference
* Uniswap v4 core, [White paper](https://github.com/Uniswap/v4-core/blob/main/docs/whitepaper/whitepaper-v4.pdf).
* Yordanov, D. (2023, December 3). What is Uniswap V4: Customizable Hooks & Superior Efficiency. Three Sigma. Retrieved May 1, 2024, from [link](https://threesigma.xyz/blog/uniswap-v4-features-dynamic-fees-hooks-gas-saving)
* Uniswap Foundation. (2025, January 31). Uniswap v4: Supercharging DeFi across chains. Straith.eth. Retrieved from [link](https://uniswapfoundation.mirror.xyz/MHmGXC9KZOL1VkKERF2ZwrR6RuYzLLoBV3eM67cMjXY)
* Chitra, T., Kulkarni, K., & Srinivasan, K. (2025). Optimal Routing in the Presence of Hooks: Three Case Studies. arXiv preprint arXiv:2502.02059.



## Conclusion and Future Directions

### Conclusion
* *Automated Market Makers (AMMs)* have revolutionized *decentralized finance (DeFi)* by providing an innovative alternative to traditional exchanges, offering enhanced efficiency, transparency, and accessibility.
* The evolution of AMMs, from *Constant Product Market Makers (CPMMs)* to *Concentrated Liquidity Market Makers (CLMMs)* and the introduction of customizable hooks in Uniswap v4, demonstrates the continuous innovation within this space.
* The mathematical foundations of AMMs, including concepts like bonding curves, impermanent loss, and arbitrage dynamics, provide a framework for understanding their behavior and designing effective strategies.


### Open Research Questions
* How can non-arbitrage order flows be incorporated into AMM price models to enhance their accuracy and predictive power?
* How can Kyle-Back type models be developed for CFMMs to determine fair fee tiers?
* How can the growth rate formula for G3Ms be generalized to encompass pools with an arbitrary number of assets?
* How can a Merton-type control and SPT framework be established for dynamic weight G3Ms to optimize portfolio management strategies?
* How can a Black-Scholes-type model be developed for CLMMs to determine fair fee tiers and assess the risk-reward profile for liquidity providers?
* What are the optimal liquidity provision strategies in CLMMs, considering price dynamics, fee tiers, and competition among liquidity providers?
* How do liquidity profiles evolve, and how do liquidity providers adjust their positions over time in response to market conditions?
* How can auction-based designs be explored for AMMs to enhance price discovery and market efficiency?


### Reference
* Cartea, Á., Drissi, F., & Monga, M. (2024). Decentralized finance and automated market making: Predictable loss and optimal liquidity provision. SIAM Journal on Financial Mathematics, 15(3), 931-959. https://doi.org/10.1137/23M1602103
* Cartea, Á., Drissi, F., Sánchez-Betancourt, L., Siska, D., & Szpruch, L. (2024). Strategic bonding curves in automated market makers [Working paper]. Social Science Research Network. https://doi.org/10.2139/ssrn.5018420
* Bayraktar, E., Cohen, A., & Nellis, A. (2024). DEX Specs: A Mean Field Approach to DeFi Currency Exchanges. arXiv preprint arXiv:2404.09090.
* Contreras, D., & Rodriguez, A. (2024). LVR from theory to practice: A survey of next generation DEX designs [Working paper](https://github.com/ArrakisFinance/research/blob/main/LVR-from-Theory-to-Practice.pdf). Arrakis Finance.
* Adams, A., Moallemi, C. C., Reynolds, S., & Robinson, D. (2024). am-amm: An auction-managed automated market maker. arXiv preprint arXiv:2403.03367.
* Chitra, T., Kulkarni, K., Pai, M., & Diamandis, T. (2024). An Analysis of Intent-Based Markets. arXiv preprint arXiv:2403.02525.