Impermanent Loss from a Quantitative Perspective: Static Replication and Hedging via Options
A mathematical breakdown of impermanent loss in AMMs and a static replication strategy using European options.
Introduction
Automated Market Makers (AMMs) have revolutionized decentralized finance (DeFi), enabling permissionless, on-chain token swaps without relying on traditional order books. Among the most widely adopted designs is the Constant Product Market Maker (CPMM)—the engine behind protocols like Uniswap v2 and Balancer.
While CPMMs offer simplicity and robustness, they expose liquidity providers (LPs) to a risk known as impermanent loss (IL)—the hidden cost of rebalancing assets within a liquidity pool as prices fluctuate. IL arises not from protocol failures, but from the very mechanics that make AMMs work.
Despite its growing relevance, IL is often misunderstood or under-quantified. In this post, we take a mathematical lens to the problem, offering a static replication formula that mirrors the value of a liquidity pool using European options and bonds. By bridging DeFi with traditional quantitative finance, we derive a hedging strategy that uses a long strangle to mitigate IL across a defined price range.
This article is a condensed, blog-ready version of a formal academic paper I co-authored during my quantitative finance studies at the University of Buenos Aires. At the end, you’ll find links to the full paper, open-source code, and a Google Colab notebook so you can replicate and adapt the simulations yourself.
Mathematical Modeling of the Constant Product Pool
A Constant Product Market Maker (CPMM) allows token swaps while maintaining the invariant:
where x and y represent the reserves of two tokens, and k is a constant. This mechanism ensures that any trade moves the reserves along the curve defined by this equation, preserving balance without relying on an order book.
To understand the value of a liquidity provider’s position, we express the total portfolio value in terms of the spot market price:
Let
denote the relative price of the two assets at time ttt. Under arbitrage efficiency and assuming no fees, the value of the pool can be written as:
This elegant expression shows that the pool’s value grows with the square root of the price, a nonlinear relationship that hints at the complexity of replicating or hedging this exposure.
More importantly, this nonlinearity means that traditional linear hedging instruments, such as simple futures, may be insufficient to protect LPs from price movements. Instead, we explore option-based replication strategies that better match the curvature of the payoff.
In the next section, we show how to construct a portfolio of options and bonds that statically replicates this value function, drawing from established results in financial mathematics.
Static Replication of the Pool’s Value with Options and Bonds
In traditional finance, static replication refers to constructing a portfolio of instruments—typically bonds and European options—that mimics the payoff of a target asset or strategy. This technique is especially useful when dynamic hedging is impractical or too costly.
Applying results from Breeden & Litzenberger and later extended by Carr & Madan, we express any sufficiently smooth payoff function f(P_T), where P_T is the final price, as:
This decomposition shows that any payoff can be statically replicated using:
A bond: paying a fixed amount at maturity,
A linear position in the underlying asset (via call-put parity),
A continuum of European options across all strikes.
We use the previous result to statically replicate the value of a constant product market
at a final price m^T.
Considering
in the previous decomposition, we obtain:
This construction allows us to reproduce the final value of the pool at time T without needing to rebalance continuously. It forms the quantitative foundation for later hedging strategies against impermanent loss.
In the next section, we’ll define impermanent loss analytically, and explore its nonlinearity—one of the main challenges in managing LP risk.
Characterizing Impermanent Loss
Liquidity providers in constant product AMMs are exposed to impermanent loss (IL)—a hidden cost resulting from the rebalancing dynamics of the pool. This loss becomes real once the provider exits the pool and compares the outcome with simply holding the tokens.
We define IL as the difference between the value of the LP’s position in the pool and the value of holding the assets outside:
Assuming a pool initialized with tokens x_0 and y_0, and price P_0P, and later evaluated at price P, we derive the expressions for both strategies:
Value of the pool at time t:
\(V_{\text{pool}}(P) = 2 \sqrt{k P} = V_{\text{pool}}(P_0) \cdot \sqrt{\frac{P}{P_0}}\)Value of holding the tokens outside the pool:
Given that the value of the pool and the value of the pool at P_0 are equal, impermanent loss is defined as:
This expression highlights the nonlinear, asymmetric behavior of IL. While small deviations around P_0 may appear benign, larger swings—especially to the downside—can result in significant losses for LPs.
We can also compute the first derivative of IL to analyze its slope and sensitivity to price:
This slope is negative for P > P_0 and positive for P < P_0, reinforcing the asymmetric nature of the risk.
In the next section, we’ll build on this formulation to present a hedging strategy using European options—a method that can partially or fully mitigate IL within a price range of interest.
Hedging Impermanent Loss with a Long Strangle Strategy
Given the nonlinear and asymmetric nature of impermanent loss, classical linear hedging tools are insufficient to protect liquidity providers across a meaningful range of price movements. Instead, we propose a static hedging approach using European options—specifically, a long strangle strategy.
📌 Setup
Suppose a liquidity provider deposits an initial amount c = x_0 + y_0 P_0 into a CPMM at price P_0, and plans to exit the pool at future time T. The impermanent loss at time T, for any future price P_T, is:
To hedge this exposure, we construct a long strangle by:
Buying q_c call options with strike K_c and premium d_c
Buying q_p put options with strike K_p and premium d_p
The total cost of the strategy is:
The payoff of the option strategy at time T is:
The net value of the combined position—pool returns + hedge payoff—is:
where r_p is the pool’s cumulative return (e.g., from swap fees) over the period.
Conditions for a Hedged Position
We aim for no loss across a target interval [P_i, P_s] around the initial price P_0. This leads to three key inequalities that must hold:
These ensure that the payoff is non-negative throughout [P_i, P_s]. This framework can be adapted for real options data—as we illustrate in our simulations using Deribit’s ETH options.
Code and Simulation: Replicating the Strategy
To illustrate the behavior of impermanent loss and the effectiveness of the long strangle hedge, we developed a simulation notebook using Python. The code:
Simulates a constant product pool (Uniswap v2-like),
Computes impermanent loss across a range of final prices,
Builds a simple long strangle strategy,
Evaluates the net result of the pool position + hedge.
You can run, explore, and modify the simulation directly on Google Colab:
🔗 Open the Google Colab Notebook
For implementation details, extensions, or integration into your own research, you can also access the code on GitHub (colabs/Hedging_against_IL_in_a_CPMM.ipynb):
🔗 Open the Github Repo
(Note: load the dataset colabs/ETHUSDC-1d-data.csv manually for the practical example).
This simulation offers a starting point for exploring more advanced hedging techniques, sensitivity analysis, and adapting the strategy for different pools or market conditions.
Feel free to fork it, iterate on it, or use it as inspiration for your own LP risk management tools