1. Constant Product AMMs ($x \cdot y = k$)
[FACT] In traditional finance, electronic market makers continuously quote bids and asks on a Central Limit Order Book (CLOB). Because Ethereum L1 block times (~12 seconds) and gas costs make high-frequency order cancellation prohibitively expensive, early DeFi adopted the Constant Product Automated Market Maker model introduced by Uniswap v2:
where $x$ is the reserve balance of token A, $y$ is the reserve balance of token B, and $k$ is a fixed invariant. The marginal spot price ($P$) of token A in terms of token B is the derivative of the bonding curve:
When a trader buys $\Delta x$ tokens from the pool, they must deposit $\Delta y$ tokens such that the product remains constant:
This formula mathematically guarantees that liquidity can never be fully depleted: as $x$ approaches zero, the price of token A approaches infinity. External arbitrageurs continuously rebalance the pool by trading against centralized exchange prices, ensuring the on-chain pool tracks global market fair value.
2. Concentrated Liquidity (Uniswap v3 Virtual Reserves)
[VERIFIED] While $x \cdot y = k$ is elegant, it suffers from severe capital inefficiency: capital is spread across all price intervals from $0$ to $\infty$, meaning $>99\%$ of deposited liquidity sits idle.
Uniswap v3 introduced Concentrated Liquidity, allowing liquidity providers (LPs) to allocate capital strictly within custom price bounds $[p_a, p_b]$:
where $L = \sqrt{k}$ represents the liquidity density. If the market price remains within $[p_a, p_b]$, capital efficiency is amplified by a factor of:
For stablecoin pairs (e.g. USDC/USDT) trading within $[0.999, 1.001]$, capital efficiency exceeds $4,000\times$ standard v2 pools, providing deep institutional liquidity with negligible price slippage.
3. Mathematical Derivation of Impermanent Loss
[ANALYSIS] Providing liquidity to an AMM exposes capital to Impermanent Loss (IL)—the opportunity cost of holding tokens inside an AMM pool versus simply holding them in a static wallet.
Let $k = P_{\text{new}} / P_{\text{initial}}$ denote the relative price change ratio of the volatile asset. The exact percentage value divergence of the LP position relative to the static hold portfolio is:
| Asset Price Change Ratio ($k$) | Price Movement | Impermanent Loss ($\%$) |
|---|---|---|
| $1.25$ | $+25\%$ Increase | $-0.6\%$ |
| $1.50$ | $+50\%$ Increase | $-2.0\%$ |
| $2.00$ | $+100\%$ ($2\times$ Gain) | $-5.7\%$ |
| $3.00$ | $+200\%$ ($3\times$ Gain) | $-13.4\%$ |
| $5.00$ | $+400\%$ ($5\times$ Gain) | $-25.5\%$ |
| $0.50$ | $-50\%$ Decline | $-5.7\%$ |
An LP generates positive net return if and only if accumulated trading fees exceed the impermanent loss over the holding period: $\sum \text{Fees} > |\text{IL}|$.
4. Decentralized Money Markets (Aave, Compound)
Decentralized lending protocols operate as non-custodial algorithmic money market funds:
- Health Factor ($HF$): The solvency metric governing borrower accounts. If $HF < 1.0$, the account is automatically subjected to liquidation: $$HF = \frac{\sum (\text{Collateral}_i \times \text{Liquidation Threshold}_i)}{\text{Total Borrow Balance in Base Currency}}$$
- Dynamic Utilization Interest Rate Model: Borrow rates dynamically adjust based on capital utilization ($U = \text{Borrows} / \text{Deposits}$): $$R_{\text{borrow}} = \begin{cases} R_0 + \frac{U}{U^*} R_{\text{slope1}} & \text{if } U \le U^* \\ R_0 + R_{\text{slope1}} + \frac{U - U^*}{1 - U^*} R_{\text{slope2}} & \text{if } U > U^* \end{cases}$$ When utilization exceeds the optimal kink $U^*$ (typically 80%–90%), borrowing rates spike steeply (up to 50%–100% APY), penalizing borrowers and compelling capital repayment to restore pool liquidity.
- Flash Loans: Uncollateralized loans that must be borrowed, utilized, and repaid within the exact same atomic blockchain transaction block. If the borrower fails to return the principal plus fee, the entire transaction reverts as if it never occurred, eliminating credit risk for the protocol.
5. Liquid Staking (LSTs) & Restaking Cascades (LRTs)
[RISK] Ethereum's transition to Proof-of-Stake catalyzed Liquid Staking Tokens (LSTs) like Lido's stETH:
- Users stake ETH to earn consensus rewards while receiving stETH, a liquid receipt token that can be deployed across DeFi money markets as collateral.
- EigenLayer & Restaking (LRTs): Protocols allow stETH holders to "restake" their staked capital to secure Actively Validated Services (AVSs), such as oracle networks, bridges, and data availability layers, earning incremental yield.
- Systemic Deleveraging Risk: Staking recursive leverage (looping: deposit stETH $\to$ borrow ETH $\to$ stake ETH $\to$ repeat) creates correlated systemic fragility. If an AVS slashes restaked collateral or an oracle failure depegs stETH/ETH on AMMs, mass automated liquidations cascade across Aave and Compound simultaneously.
6. MEV, Toxic Flow & Loss-Versus-Rebalancing (LVR)
Recent quantitative financial research (Milionis, Moallemi, Roughgarden, Adams) proves that AMM liquidity providers suffer from Loss-Versus-Rebalancing (LVR):
- Unlike traditional market makers who can cancel quotes before informed traders hit them, AMMs update prices only after an informed trade occurs.
- Arbitrageurs using Maximal Extractable Value (MEV) bots continuously pick off stale AMM quotes whenever external centralized exchange prices move, extracting guaranteed profits at the direct expense of passive liquidity providers.