---
# System prepended metadata

title: The Thermodynamics of AMM - Uniswap V2

---

# The Thermodynamics of AMM - Uniswap V2

## Table of Contents
- [Abstract](#sec-abstract)
- [1 Introduction](#sec-1)
- [2 Constant-product AMM and the ideal-gas analogy](#sec-2)
  - [2.1 Curve geometry and spot price](#sec-21)
  - [2.2 Work-like integrals and trader cost](#sec-22)
  - [2.3 Path independence and reversibility (no fees)](#sec-23)
  - [2.4 Local response (slippage) and compressibility](#sec-24)
  - [2.5 Fees as friction; entropy-like growth of $\ln k$](#sec-25)
- [3 Numerical examples](#sec-3)
  - [3.1 Reversible round trip (no fees)](#sec-31)
  - [3.2 Irreversible round trip with fees](#sec-32)
  - [3.3 Local response (slippage) check](#sec-33)
  - [3.4 Accumulated entropy-like growth](#sec-34)
- [4 LP economics: fee revenue, impermanent loss, and a thermodynamic decomposition](#sec-4)
  - [4.1 Mark-to-market value of the pool under an external price](#sec-41)
  - [4.2 Impermanent loss (no fees): exact formula and derivation](#sec-42)
  - [4.3 Fees increase $$k$$: a clean “entropy → fee revenue” channel](#sec-43)
  - [4.4 LP PnL decomposition: price move vs. fees](#sec-44)
  - [4.5 Worked example: fee growth needed to offset impermanent loss](#sec-45)
- [5 Conclusion](#sec-5)

<a id="sec-abstract"></a>
## Abstract

We develop a rigorous connection between the mathematics of constant-product automated market makers (AMMs) and classical thermodynamics. The AMM invariant $AB = k$ (with $A$ the quote reserve and $B$ the base reserve) admits a structural analogy to the isothermal ideal-gas equation $PV = nRT$, enabling a unified language for spot price, slippage (as a response/elasticity), work-like line integrals along the curve, path independence in the fee-less limit, and irreversibility via fees (modeled as entropy production through the monotone increase of $\ln k$). We derive the core identities in parallel (AMM $\leftrightarrow$ ideal gas), clarify precisely why the trader’s total cost equals $\int (A/B)\,dB$ (not $\int A\,dB$), and show how fees shift the pool onto successively higher invariants. We then extend the framework to liquidity providers (LPs): we derive an exact impermanent loss formula for Uniswap v2 (no fees), show how fees increase $k$ and therefore pool value, and give a rigorous decomposition of LP PnL into a “price-move” component (impermanent loss) and a “throughput” component (fee-driven growth in $\ln k$).

<a id="sec-1"></a>
## 1 Introduction

Automated market makers replace order books with deterministic curves mapping reserves to executable prices. The simplest and most prevalent invariant is the constant product

$$
AB = k,\qquad A>0,\quad B>0, \tag{1}
$$

where $A$ and $B$ denote the on-chain reserves of the quote and base tokens, respectively, and $k$ is constant in the absence of fees. The instantaneous (spot) price of $B$ in units of $A$ at state $(A,B)$ is

$$
p_B = \frac{A}{B} = \frac{k}{B^2}. \tag{2}
$$

The central purpose of this document is to formalize a physics-inspired framework for Uniswap v2-style constant-product AMMs:

- **Invariants and path independence.** In the fee-less limit, trades move the state along a fixed hyperbola $AB = k$; closed cycles are reversible, returning both reserves and trader balances to their initial values.
- **Work, response, and conservation.** The isothermal ideal-gas work $W=\int P\,dV$ has a precise AMM analogue $\int A\,dB$ (a geometric area), and the trader’s cost equals $\int (A/B)\,dB$. Local price impact (slippage) is a response law.
- **Loss, friction, and entropy.** With fees, only a fraction of the input affects the invariant. The product $k$ strictly increases each trade; defining $S_{\mathrm{AMM}}=\ln k$ yields a monotone (entropy-like) variable. Round-trips become irreversible, providing a clean notion of dissipation.
- **LP economics.** Pool value under an external price is $V= A + P^*B$. In equilibrium $V = 2\sqrt{kP^*}$, making it transparent how price moves (via $P^*$) and fee accrual (via $k$) jointly determine LP returns.

**Notation.** We write differentials as $d(\cdot)$. When we say “no fees” we mean the invariant is enforced exactly. A fee rate on the input leg is denoted $\phi\in(0,1)$. We use $P^*$ for the external/reference price of $B$ in units of $A$.

<a id="sec-2"></a>
## 2 Constant-product AMM and the ideal-gas analogy

We place the constant-product AMM alongside the isothermal ideal gas. The structural mapping we adopt in this section is

$$
A \leftrightarrow P,\qquad B \leftrightarrow V,\qquad k \leftrightarrow nRT, \tag{3}
$$

so that $AB=k$ mirrors $PV=nRT$ at fixed temperature $T$.

<a id="sec-21"></a>
### 2.1 Curve geometry and spot price

From $AB=k$ we have $A(B)=k/B$. The spot price (marginal rate of exchange) of $B$ in units of $A$ is

$$
p_B = \left|\frac{dA}{dB}\right|_{AB=k} \approx \frac{A}{B}=\frac{k}{B^2}. \tag{4}
$$

(We use magnitude; along the hyperbola $A$ decreases as $B$ increases.) In the gas, $P(V)=k/V$ and the local elasticity obeys

$$
\frac{dP}{dV}=-\frac{P}{V},\qquad \text{so}\qquad \frac{P}{V}=-\frac{dP}{dV}. \tag{5}
$$

Thus the AMM spot price $A/B$ corresponds to the gas’s local pressure-to-volume ratio $P/V$ (a measure of stiffness/elasticity of the state curve).

<a id="sec-22"></a>
### 2.2 Work-like integrals and trader cost

There are two natural line integrals along $AB=k$:

1. **Isothermal work (gas) and work-like area (AMM):**

$$
W_{\mathrm{by}} \equiv \int_{V_0}^{V_1} P\,dV
\;\Longleftrightarrow\;
\int_{B_0}^{B_1} A\,dB
= \int_{B_0}^{B_1} \frac{k}{B}\,dB
= k\ln\frac{B_1}{B_0}. \tag{6}
$$

This is a geometric area under the hyperbola. It does not equal the trader’s total payment.

2. **Trader total cost (AMM):** When a trader buys $B$ (exact-output perspective: the pool’s $B$ decreases from $B_0$ to $B_1$), the total $A$ paid is the integral of the marginal price:

$$
A_{\mathrm{paid}}
= \int_{B_1}^{B_0} p_B(B)\,dB
= \int_{B_1}^{B_0} \frac{k}{B^2}\,dB
= k\left(\frac{1}{B_1}-\frac{1}{B_0}\right). \tag{7}
$$

The difference between (6) and (7) is the factor of $1/B$ in the integrand: $\int A\,dB$ is a state-area, whereas $\int (A/B)\,dB$ weights by depth. For small moves ($B_1\approx B_0$),

$$
A_{\mathrm{paid}} \approx \frac{1}{\bar B}\left(k\ln\frac{B_0}{B_1}\right),\qquad \bar B\in(B_1,B_0). \tag{8}
$$

**Exact-input form.** Equivalently, if the trader sends $\Delta A$ (exact input), the base output is

$$
B_{\mathrm{out}}
= \int_{A_0}^{A_1}\frac{B}{A}\,dA
= \int_{A_0}^{A_1}\frac{k}{A^2}\,dA
= k\left(\frac{1}{A_0}-\frac{1}{A_1}\right),\qquad A_1=A_0+\Delta A. \tag{9}
$$

Eqs. (7) and (9) are equivalent by $AB=k$.

<a id="sec-23"></a>
### 2.3 Path independence and reversibility (no fees)

In the fee-less case the invariant is exact. Any sequence of trades that moves $(A,B)$ from $(A_0,B_0)$ to $(A_1,B_1)$ satisfies $A_1=k/B_1$ and $A_0=k/B_0$, so the total paid $A_{\mathrm{paid}}$ depends only on the endpoints via (7). A round-trip with the exact reverse path returns $(A,B)$ and the trader’s wallet to their initial states; there is no net loss: reversible dynamics along a fixed curve.

<a id="sec-24"></a>
### 2.4 Local response (slippage) and compressibility

From $p_B=k/B^2$,

$$
\frac{dp_B}{p_B}=-2\frac{dB}{B}
\;\Rightarrow\;
\frac{\Delta p_B}{p_B}\approx -2\frac{\Delta B}{B}\qquad (\text{small trades}). \tag{10}
$$

This is the canonical dimensionless slippage law. In the gas, the isothermal compressibility is

$$
\kappa_T \equiv -\frac{1}{V}\left(\frac{\partial V}{\partial P}\right)_T=\frac{1}{P},
$$

and the bulk modulus is $K_T=P$. As $B$ falls (depth thins), $p_B$ rises and the system stiffens.

<a id="sec-25"></a>
### 2.5 Fees as friction; entropy-like growth of $\ln k$

Let $\phi\in(0,1)$ be the input fee rate on $A$. If the trader sends $\Delta A$, only $(1-\phi)\Delta A$ affects the invariant; the actual reserves become

$$
A' = A + \Delta A,\qquad
B' = \frac{k}{A + (1-\phi)\Delta A}. \tag{11}
$$

The new product

$$
k' \equiv A'B' = k\frac{A+\Delta A}{A + (1-\phi)\Delta A} > k, \tag{12}
$$

strictly increases on any fee-paying trade. For small relative input $\epsilon=\Delta A/A$,

$$
\Delta \ln k
= \ln\frac{k'}{k}
= \ln\frac{1+\epsilon}{1+(1-\phi)\epsilon}
= \phi\,\epsilon + \mathcal{O}(\epsilon^2). \tag{13}
$$

Thus the AMM entropy $S_{\mathrm{AMM}}\equiv \ln k$ is conserved without fees and increases monotonically with fees, providing a precise notion of dissipation/irreversibility.

**Heat/work bookkeeping (ideal gas).** For isothermal, reversible steps: $\Delta U=0$, $W_{\mathrm{by}}=\int P\,dV = k\ln(V_2/V_1)$, and $Q_{\mathrm{in}}=W_{\mathrm{by}}$. With friction, the environment’s entropy production $\Delta S_{\mathrm{tot}}>0$. Fees play the role of frictional losses in AMMs: they break reversibility and increase $S_{\mathrm{AMM}}$.

**Remark (alternative mapping).** If one maps pressure to the spot price $P\leftrightarrow A/B$, then the equation of state becomes $PV^2=k$ (a polytrope with index $n=2$), and the work $\int P\,dV$ equals the trader’s cost (7) identically. We keep the standard isothermal mapping in the main text and note this variant for cost-equality storytelling.

<a id="sec-3"></a>
## 3 Numerical examples

We now instantiate the theory with explicit numbers. Consider a pool with initial reserves

$$
A_0=100,\qquad B_0=10,\qquad k=A_0B_0=1000, \tag{14}
$$

so the initial spot price is $p_{B,0}=A_0/B_0=10$ (units of $A$ per $B$).

<a id="sec-31"></a>
### 3.1 Reversible round trip (no fees)

Buy $5\,B$ (exact output). The pool’s $B$ decreases to $B_1=5$, so by (7)

$$
A_{\mathrm{paid}} = k\left(\frac{1}{5}-\frac{1}{10}\right)=100. \tag{15}
$$

Reserves move to $(A_1,B_1)=(200,5)$; endpoint spot prices are $10\to 40$ and the average execution price is the geometric mean $\sqrt{10\cdot 40}=20$.

Sell back $5\,B$. The pool returns to $(A_2,B_2)=(100,10)$. The trader receives $100\,A$. Net wallet change: $0$. Reversibility holds.

**Work-like vs. cost.** Work-like area (isothermal mapping) along the forward leg is

$$
\int_{10}^{5}A\,dB
=\int_{10}^{5}\frac{1000}{B}\,dB
=-1000\ln 2\approx -693.1, \tag{16}
$$

whereas the trader’s cost is $100$. They differ by the path-averaged factor $\langle 1/B\rangle$ as discussed.

<a id="sec-32"></a>
### 3.2 Irreversible round trip with fees

Let the input fee be $\phi=0.005$ (50 bps) on each swap.

Buy with $100\,A$ (exact input). Only $(1-\phi)100=99.5$ moves the curve:

$$
B_1=\frac{k}{A_0+(1-\phi)100}=\frac{1000}{199.5}\approx 5.01253133,\qquad
\mathrm{out}_B=B_0-B_1\approx 4.98746867. \tag{17}
$$

The new product is $k_1=A_1B_1=200\cdot 5.01253133\approx 1002.50627$ (cf. (12)).

Sell back all received $B$. The effective input to the invariant is $(1-\phi)\,\mathrm{out}_B\approx 4.96253133$, so

$$
A_2=\frac{k_1}{B_1+(1-\phi)\,\mathrm{out}_B}
=\frac{1002.50627}{5.01253133+4.96253133}
\approx 100.251256, \tag{18}
$$

and $B_2=B_1+\mathrm{out}_B=10$. The trader receives $A_1-A_2\approx 99.748744\,A$ (a net loss of $\approx 0.251256\,A$ over the round trip), while

$$
k_2=A_2B_2\approx 1002.51256>k_1>k_0. \tag{19}
$$

Thus $S_{\mathrm{AMM}}=\ln k$ increases twice; the cycle is irreversible. The fee manifests as an effective spread: one fee when buying, one when selling.

<a id="sec-33"></a>
### 3.3 Local response (slippage) check

At $(A,B)=(100,10)$, a small buy $\Delta B$ obeys

$$
\frac{\Delta p_B}{p_B}\approx -2\frac{\Delta B}{B}. \tag{20}
$$

For $\Delta B=0.1$, $\Delta p_B/p_B\approx -0.02$, i.e., price rises by 2% relative to its starting value when $B$ falls by 1%.

<a id="sec-34"></a>
### 3.4 Accumulated entropy-like growth

For a sequence of small fee-bearing trades with relative inputs $\epsilon_i=\Delta A_i/A_i$,

$$
\ln k(T)-\ln k(0)
=\sum_i \ln\frac{1+\epsilon_i}{1+(1-\phi)\epsilon_i}
=\phi\sum_i \epsilon_i + \mathcal{O}\left(\sum_i \epsilon_i^2\right), \tag{21}
$$

i.e., $S_{\mathrm{AMM}}$ grows approximately linearly with cumulative relative throughput (to first order).

<a id="sec-4"></a>
## 4 LP economics: fee revenue, impermanent loss, and a thermodynamic decomposition

The thermodynamics lens becomes operational when we mark the pool to an external price $P^*$ and track how (i) price moves and (ii) fees (through $\Delta\ln k$) jointly determine LP returns.

Throughout, we value everything in units of token $A$ (the quote). The external/reference price of one unit of $B$ in units of $A$ is denoted $P^*$.

<a id="sec-41"></a>
### 4.1 Mark-to-market value of the pool under an external price

Define the pool’s mark-to-market value in $A$-units as

$$
V(A,B;P^*) \equiv A + P^* B. \tag{22}
$$

If arbitrage enforces that the pool’s marginal (spot) price equals the external price, then

$$
\frac{A}{B} = P^*. \tag{23}
$$

Together with $AB=k$, this pins down the reserves as functions of $(k,P^*)$:

$$
A = \sqrt{kP^*},\qquad B = \sqrt{\frac{k}{P^*}}. \tag{24}
$$

Substituting (24) into (22) yields a compact expression for pool value at equilibrium:

$$
V_{\mathrm{pool}}(k,P^*) = 2\sqrt{kP^*}. \tag{25}
$$

Equation (25) makes two facts transparent:

- For a fixed external price $P^*$, fee accrual increases $k$ and therefore increases $V_{\mathrm{pool}}$.
- For fixed $k$, the pool value scales like $\sqrt{P^*}$, reflecting the pool’s endogenous rebalancing as price moves.

Differentiating the logarithm of (25) gives a clean infinitesimal decomposition:

$$
d\ln V_{\mathrm{pool}}
= \frac{1}{2}\,d\ln k + \frac{1}{2}\,d\ln P^*. \tag{26}
$$

The term $(1/2)d\ln k$ is the “throughput / fee” channel; $(1/2)d\ln P^*$ is the “price move” channel for the pool itself.

<a id="sec-42"></a>
### 4.2 Impermanent loss (no fees): exact formula and derivation

Impermanent loss (IL) compares an LP position to a counterfactual where the LP simply holds their initial tokens.

Assume no fees, so $k$ remains constant, and consider an external price move from $P_0^*$ to $P_1^*$. Define the price ratio

$$
r \equiv \frac{P_1^*}{P_0^*}. \tag{27}
$$

**LP value after arbitrage (no fees).** With constant $k$, equilibrium pool value is (25):

$$
V_{\mathrm{LP}}(P_1^*) = 2\sqrt{kP_1^*}. \tag{28}
$$

**HODL value.** Suppose the LP initially provided reserves $(A_0,B_0)$ with $A_0B_0=k$ and $A_0/B_0=P_0^*$. The value of simply holding these tokens when the external price is $P_1^*$ is

$$
V_{\mathrm{HODL}}(P_1^*) = A_0 + P_1^*B_0. \tag{29}
$$

Using $A_0=\sqrt{kP_0^*}$ and $B_0=\sqrt{k/P_0^*}$ from (24), we obtain

$$
V_{\mathrm{HODL}}(P_1^*)
= \sqrt{kP_0^*} + P_1^*\sqrt{\frac{k}{P_0^*}}
= \sqrt{kP_0^*}\left(1 + \frac{P_1^*}{P_0^*}\right)
= \sqrt{kP_0^*}(1+r). \tag{30}
$$

Similarly, (28) becomes

$$
V_{\mathrm{LP}}(P_1^*)
= 2\sqrt{kP_1^*}
= 2\sqrt{kP_0^*}\sqrt{r}. \tag{31}
$$

Therefore the LP-to-HODL value ratio (no fees) is

$$
\frac{V_{\mathrm{LP}}}{V_{\mathrm{HODL}}}
= \frac{2\sqrt{kP_0^*}\sqrt{r}}{\sqrt{kP_0^*}(1+r)}
= \frac{2\sqrt{r}}{1+r}. \tag{32}
$$

Define impermanent loss as the fractional underperformance of LP relative to HODL:

$$
\mathrm{IL}(r)
\equiv \frac{V_{\mathrm{LP}}}{V_{\mathrm{HODL}}}-1
= \frac{2\sqrt{r}}{1+r}-1. \tag{33}
$$

Properties:
- $\mathrm{IL}(1)=0$.
- $\mathrm{IL}(r)\le 0$ for all $r>0$, with equality only at $r=1$.
- $\mathrm{IL}(r)$ is symmetric under $r\mapsto 1/r$, reflecting that up-moves and down-moves of equal magnitude produce the same IL.

This is the exact Uniswap v2 impermanent loss formula in the absence of fees.

<a id="sec-43"></a>
### 4.3 Fees increase $k$: a clean “entropy to fee revenue” channel

With input fees, $k$ increases according to (12), and $S_{\mathrm{AMM}}=\ln k$ increases according to (13). For LPs, the key observation is that equilibrium pool value scales with $\sqrt{k}$ (25), so fee-driven growth in $k$ directly increases LP value.

Let the pool be in equilibrium at external price $P^*$, and consider a sequence of trades that (possibly) occurs while price is approximately unchanged. After the sequence, $k$ becomes $k_T>k_0$, and

$$
\frac{V_{\mathrm{pool}}(k_T,P^*)}{V_{\mathrm{pool}}(k_0,P^*)}
= \frac{2\sqrt{k_TP^*}}{2\sqrt{k_0P^*}}
= \sqrt{\frac{k_T}{k_0}}
= \exp\left(\frac{1}{2}(\ln k_T - \ln k_0)\right). \tag{34}
$$

Equivalently, in terms of AMM entropy $S_{\mathrm{AMM}}=\ln k$,

$$
\ln\frac{V_{\mathrm{pool}}(T)}{V_{\mathrm{pool}}(0)}
= \frac{1}{2}\Delta S_{\mathrm{AMM}} \qquad (\text{at fixed }P^*). \tag{35}
$$

Thus $\Delta S_{\mathrm{AMM}}$ is not merely an analogy: it is a measurable state change whose half directly equals the log-growth of the pool’s mark-to-market value at a fixed price.

This channel is precisely what can offset impermanent loss: price moves tend to create IL (33), while trading volume tends to increase $\ln k$ (13), boosting the pool’s value (34).

<a id="sec-44"></a>
### 4.4 LP PnL decomposition: price move vs. fees

Combine the exact LP value (25) with the HODL benchmark (30) to decompose LP returns into a price-only component (impermanent loss) and a fee/throughput component (growth of $k$).

Let:
- Initial state: $(k_0,P_0^*)$.
- Final state: $(k_1,P_1^*)$, where $k_1\ge k_0$ (with equality if no fees).
- Price ratio: $r=P_1^*/P_0^*$.

**LP final value.**
From (25),

$$
V_{\mathrm{LP,final}} = 2\sqrt{k_1P_1^*}. \tag{36}
$$

**HODL final value.**
From (30),

$$
V_{\mathrm{HODL,final}} = \sqrt{k_0P_0^*}(1+r). \tag{37}
$$

Therefore the LP-to-HODL ratio is

$$
\frac{V_{\mathrm{LP,final}}}{V_{\mathrm{HODL,final}}}
= \frac{2\sqrt{k_1P_1^*}}{\sqrt{k_0P_0^*}(1+r)}
= \frac{2\sqrt{r}}{1+r}\sqrt{\frac{k_1}{k_0}}. \tag{38}
$$

Equation (38) is the clean decomposition:

- The factor
  $$
  \frac{2\sqrt{r}}{1+r}
  $$
  is the **price-move component**, i.e., the no-fee impermanent loss ratio (32).
- The factor
  $$
  \sqrt{\frac{k_1}{k_0}} = \exp\left(\frac{1}{2}\Delta S_{\mathrm{AMM}}\right)
  $$
  is the **fee/throughput component**, driven by the cumulative growth in $\ln k$ (35).

Taking logs makes the additive structure explicit:

$$
\ln\!\left(\frac{V_{\text{LP,final}}}{V_{\text{HODL,final}}}\right) = 
\ln\!\left(\frac{2\sqrt{r}}{1+r}\right)+ \frac{1}{2}\ln\!\left(\frac{k_1}{k_0}\right) \tag{39}
$$

Interpretation:
- When price moves a lot (large $r$ or small $r$), the first term becomes negative (IL).
- When trading volume is large (large $\Delta\ln k$), the second term becomes positive (fees).
- LP outperformance relative to HODL occurs when fee-driven $\Delta\ln k$ is large enough to overcome the IL term.

This is the Uniswap v2 LP story in one equation: **LP returns = (impermanent loss from price moves) + (entropy-driven growth from trading fees)**.

<a id="sec-45"></a>
### 4.5 Worked example: fee growth needed to offset impermanent loss

Equation (38) yields an explicit “break-even” condition: the LP matches HODL when

$$
\frac{V_{\mathrm{LP,final}}}{V_{\mathrm{HODL,final}}}=1
\quad\Longleftrightarrow\quad
\sqrt{\frac{k_1}{k_0}}=\frac{1+r}{2\sqrt{r}}
\quad\Longleftrightarrow\quad
\frac{k_1}{k_0}=\left(\frac{1+r}{2\sqrt{r}}\right)^2. \tag{40}
$$

Equivalently, in terms of AMM entropy,

$$
\Delta\ln k
= \ln\frac{k_1}{k_0}
= 2\ln\left(\frac{1+r}{2\sqrt{r}}\right). \tag{41}
$$

**Example (price doubles):** Let $r=2$ (external price increases by $2\times$). Then the no-fee LP/HODL ratio is

$$
\frac{2\sqrt{r}}{1+r}=\frac{2\sqrt{2}}{3}\approx 0.942809, \tag{42}
$$

so the no-fee impermanent loss is approximately $-5.72\%$. To break even, the required growth in $k$ is

$$
\frac{k_1}{k_0}=\left(\frac{1+2}{2\sqrt{2}}\right)^2
=\left(\frac{3}{2\sqrt{2}}\right)^2
=\frac{9}{8}
=1.125, \tag{43}
$$

i.e., $k$ must increase by $12.5\%$. In entropy terms,

$$
\Delta\ln k = \ln(1.125)\approx 0.1173. \tag{44}
$$

If one uses the small-trade approximation $\Delta\ln k \approx \phi\sum_i \epsilon_i$ from (13), where $\epsilon_i=\Delta A_i/A_i$ denotes relative input size at each trade, then the cumulative relative throughput needed to offset the $r=2$ impermanent loss is approximately

$$
\sum_i \epsilon_i \approx \frac{0.1173}{\phi}. \tag{45}
$$

For example, if $\phi=0.003$ (30 bps), then $\sum_i \epsilon_i \approx 39.1$. This expresses the requirement in a dimensionless, pool-normalized form: fee revenue must be large enough (i.e., sufficient throughput relative to pool depth) to overcome the loss from endogenous rebalancing caused by the price move.

<a id="sec-5"></a>
## 5 Conclusion

By treating the Uniswap v2 invariant $AB=k$ as an isothermal equation of state, we obtain a unified, rigorous language spanning DeFi and physics: spot price as local elasticity, slippage as response, work-like areas as geometric state functionals, path independence and reversibility in the fee-less limit, and entropy-like monotone growth via fees. Extending the framework to LPs yields a practical decomposition: impermanent loss is an exact, price-only effect captured by $\frac{2\sqrt{r}}{1+r}-1$, while fee revenue enters through the monotone increase of $\ln k$, which directly scales pool value as $\sqrt{k}$. The physics lens therefore does more than decorate AMM math: it clarifies why round-trips are reversible without fees, why fees create irreversibility, and how LP returns arise from the competition between price-driven rebalancing (IL) and throughput-driven growth of the invariant (fee accrual).