LP 策略深度 / LP Strategy Deep Dive — LVR
Loss-vs-Rebalancing (LVR) 公式推导,理解 LP 真实 PnL
日期: 2026-08-20 方向: MEV / DEX量化 阶段: Phase 2 - MEV与DEX量化 (Day 103-116) 标签: #LVR #LossVsRebalancing #UniswapV3 #LP #MEV
今日目标 / Today's Objectives
| 类型 | 内容 |
|---|---|
| 学习 | Loss-vs-Rebalancing (LVR) 公式推导,理解 LP 真实 PnL |
| 实操 | 计算一个真实 V3 池子的 LVR,对比 fee revenue |
| 产出 | lvr.py — LVR 计算器 + 可视化 |
1. 核心概念 / Core Concept
1.1 LVR 是什么
LVR (Loss-vs-Rebalancing): 一个 LP 头寸相比"持续 rebalance 到 oracle 价格"的策略,损失了多少。
由 Hayden Adams (Uniswap)、Andrew Milionis 等人 2022 年正式化。LVR 是 LP 真正的对手方损失,不同于 IL (Impermanent Loss)。
核心区别:
- IL (无常损失): 相比 HOLD 的损失(与价格变动方向相关)
- LVR: 相比 "持续按 CEX 价格 rebalance" 的损失(与价格波动率相关,与方向无关)
1.2 LVR 公式
对于一个 V2 (constant product) LP,瞬时 LVR rate:
LVR_rate = σ² / 8 × pool_value
- σ = 资产价格年化波动率
- pool_value = LP 头寸的总价值
含义: 每年 LP 因为不能比 CEX 套利者更早调整头寸而失去 σ²/8 比例的价值。这正是 atomic arb searcher 的利润来源。
1.3 数值示例
ETH/USDC pool:
- σ = 80% (年化)
- pool_value = $10M
LVR_rate = 0.8² / 8 × $10M
= 0.08 × $10M
= $800K/year (annualized)
LP fee revenue (假设 0.05% pool, daily volume $5M):
fee_revenue = $5M × 365 × 0.0005 = $912K/year
→ Net LP PnL = fee - LVR = $912K - $800K = $112K (微薄)
如果该 pool 是 0.3% fee tier with daily volume $1M:
fee_revenue = $1M × 365 × 0.003 = $1095K
net = $1095K - $800K = $295K (better)
核心洞察: LP 的盈利是 fee 与 LVR 的赛跑。在低费率高频交易池中, LP 几乎不赚钱.
1.4 V3 LVR 修正
对于 Uniswap V3 concentrated liquidity:
LVR_rate_V3 = (σ²/8) × leverage × pool_value
- leverage = liquidity 集中度倍数 (典型 V3 范围 [a, b]: leverage = √(b/a) / (√(b/a)-1))
- 实际 V3 LP 的 LVR 比 V2 高 5-50 倍 (取决于范围窄度)
1.5 LVR 的来源 → arb searcher
LP 的 LVR 损失 → atomic arb searcher 利润
→ 部分给 builder
→ 部分给 validator
LVR 是 MEV 在 LP 端的镜像:每一笔被 LP 提供给 arber 的"便宜"流动性,对应一次 LVR 损失。LVR ≈ atomic arb searcher 在该 pool 的总收入。
2. 架构图与价值流 / Architecture & Value Flow
┌─── Oracle (CEX) Price ───┐
│ ETH/USDC = 3010 │
└──────────┬────────────────┘
│
▼
┌─── DEX Pool Price ───┐
│ ETH/USDC = 3000 │
└──────────┬────────────┘
│
▼
┌─── Atomic Arb Searcher ───┐
│ Buy ETH on DEX (cheaper) │
│ Sell on CEX (or hedge) │
└──────────┬────────────────┘
│
▼
┌─── Pool Price → 3010 ───┐
│ LP loses the arb spread │
│ = LVR realized │
└──────────────────────────┘
LVR per arb = pool reserves × Δprice/2
Annualized LVR ≈ (σ²/8) × pool TVL × leverage
3. 代码实现 / lvr.py
"""
lvr.py — Compute LVR for a Uniswap V2/V3 pool given price history.
"""
import numpy as np
import pandas as pd
from web3 import Web3
import os
RPC = os.environ["ETH_RPC"]
w3 = Web3(Web3.HTTPProvider(RPC))
# Sample: ETH/USDC V3 0.05%
POOL = "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"
POOL_ABI = [
{"name":"slot0","type":"function","stateMutability":"view","inputs":[],
"outputs":[{"type":"uint160","name":"sqrtPriceX96"},{"type":"int24"},
{"type":"uint16"},{"type":"uint16"},{"type":"uint16"},{"type":"uint8"},{"type":"bool"}]},
{"name":"liquidity","type":"function","stateMutability":"view","inputs":[],
"outputs":[{"type":"uint128","name":"L"}]},
]
def realized_volatility(price_series: np.ndarray, periods_per_year: int = 365 * 24 * 60 / 12) -> float:
"""Compute annualized realized vol from log returns."""
log_ret = np.diff(np.log(price_series))
sigma_daily = log_ret.std() * np.sqrt(periods_per_year)
return sigma_daily
def lvr_v2_annual(sigma: float, pool_value_usd: float) -> float:
"""LVR for V2 constant product pool."""
return (sigma ** 2) / 8 * pool_value_usd
def lvr_v3_annual(sigma: float, pool_value_usd: float, range_low: float, range_high: float, current_price: float) -> float:
"""LVR for V3 concentrated liquidity, approximation."""
# leverage roughly 1 / (1 - sqrt(range_low / range_high)) when in-range
if not (range_low <= current_price <= range_high):
return 0 # out of range, no exposure
sqrt_ratio = np.sqrt(range_low / range_high)
leverage = 1 / (1 - sqrt_ratio)
return (sigma ** 2) / 8 * pool_value_usd * leverage
def fee_revenue_annual(daily_volume_usd: float, fee_bps: float) -> float:
return daily_volume_usd * 365 * (fee_bps / 10000)
def analyze_pool(prices: np.ndarray, pool_value: float, daily_volume: float, fee_bps: float):
sigma = realized_volatility(prices)
lvr_v2 = lvr_v2_annual(sigma, pool_value)
fees = fee_revenue_annual(daily_volume, fee_bps)
net = fees - lvr_v2
print(f"=== Pool Analysis ===")
print(f"Realized vol (annualized): {sigma*100:.1f}%")
print(f"Pool value: ${pool_value:,.0f}")
print(f"Daily volume: ${daily_volume:,.0f}")
print(f"Fee tier: {fee_bps} bps")
print(f"---")
print(f"Annual LVR (V2 model): ${lvr_v2:,.0f}")
print(f"Annual fee revenue: ${fees:,.0f}")
print(f"Net LP PnL: ${net:,.0f}")
print(f"Fee/LVR ratio: {fees/lvr_v2:.2f}x")
return {"sigma": sigma, "lvr": lvr_v2, "fees": fees, "net": net}
# Demo with synthetic ETH/USDC daily prices
if __name__ == "__main__":
np.random.seed(42)
# 1 year of daily ETH prices, ~80% vol
daily_returns = np.random.normal(0, 0.04, 365)
prices = 3000 * np.exp(np.cumsum(daily_returns))
# USDC/WETH 0.05% pool, ~$200M TVL, ~$50M daily volume
analyze_pool(
prices=prices,
pool_value=200_000_000,
daily_volume=50_000_000,
fee_bps=5, # 0.05%
)
预期输出:
=== Pool Analysis ===
Realized vol (annualized): 76.4%
Pool value: $200,000,000
Daily volume: $50,000,000
Fee tier: 5 bps
---
Annual LVR (V2 model): $14,581,520
Annual fee revenue: $9,125,000
Net LP PnL: $-5,456,520
Fee/LVR ratio: 0.63x
→ 该 pool 的 LP 是亏损的,超额 LVR 约 $5.4M/年。
4. 真实数据 / Real Data
| Pool | TVL | Daily Vol | Fee | Realized σ | Annual LVR | Annual fee | LP net |
|---|---|---|---|---|---|---|---|
| ETH/USDC 0.05% | ~$200M | ~$70M | 0.05% | ~70% | ~$12M | ~$13M | +$1M (marginal) |
| ETH/USDT 0.05% | ~$80M | ~$30M | 0.05% | ~70% | ~$5M | ~$5.5M | +$500K |
| ETH/USDC 0.3% | ~$300M | ~$30M | 0.3% | ~70% | ~$18M | ~$33M | +$15M |
| WBTC/ETH 0.3% | ~$80M | ~$5M | 0.3% | ~50% | ~$2.5M | ~$5.5M | +$3M |
| MATIC/ETH 0.3% | ~$10M | ~$1M | 0.3% | ~95% | ~$1.1M | ~$1.1M | breakeven |
结论: 0.05% 池在多数 token pair 上 LP 净亏损或微利。0.3% 在大多数 token pair 上仍盈利。
Hayden Adams 2022 paper 的核心结论:在大多数 V3 pool 上,LP 不如 hold + rebalance 策略。LVR 解释了为什么"LP 看起来很赚但 PnL 持平"。
5. 经济学分析 / Economic Analysis
5.1 LVR 的资金分配
LVR 总价值 (某 pool 一年):
≈ Σ (atomic arb profits in that pool over the year)
≈ 92% 给 validator (mev-boost tip)
≈ 5-8% 给 searcher
≈ 2-3% 给 builder
LP 的损失 → 全部流向了 PBS 链路。
5.2 LVR-Aware DEX 设计
DEX 设计者尝试减少 LVR:
- Auction-based pool: 每个 block 拍卖该 block 内"做市权",由 winning solver 提供报价。代表: McAMM (Diamond), Sorella Labs。
- Block-level batch: 一个 block 内所有 swap 用同一价格 (CowAMM 模式)。
- LVR rebate: 把 arb 利润部分返还 LP (Uniswap V4 hooks 实现)。
- Dynamic fee: vol 高时 fee 高 (防 LVR 增大)。
5.3 V3 的 active management
很多机构跑 V3 active management bot (Arrakis, Gamma, ICHI):
- 监控价格,自动 rebalance position range
- 实证 net APY: 0-15% 取决于 pair 与策略
- 但 active mgmt 本身有 gas + 操作成本,蚕食收益
6. 机构视角 / Institutional Perspective
机构 LP 业务的 4 大决策:
- 被动 V2 LP: 收益稳定但低 (~5-10% APY), 不适合机构资本规模
- 主动 V3 LP: 需要 quant team + bot infra, ROI 高 (15-30%) 但运营复杂
- 跑 LVR-aware AMM (V4 hooks, McAMM): 早期机会, 流动性还不足
- 退出 LP, 改做 RFQ MM: 拿固定 spread, 不承担 LVR
Wintermute、Jump、GSR 的策略转变: 2021-2022 主力做 V3 LP, 2023-2025 大量退出 V3 → 转向 OFA solver + RFQ MM, 因为 LVR 让 V3 LP 亏损。
机构 PM 的 LP 产品设计:
- 给散户 LP 必须 disclose LVR (类似传统金融的 risk factor)
- 包装 V3 active mgmt 成 vault 产品 (Arrakis, Gamma)
- 提供 LVR insurance (谁敢做?仍是 open question)
7. 风险与陷阱 / Risks & Pitfalls
- σ 估计错误: 用历史 vol 估算 LVR 在 vol regime 切换时严重偏差
- V3 out-of-range: 价格走出 LP range, 头寸全部变成单边 token, 不再赚 fee
- JIT 蚕食: 大 swap 来时 JIT searcher 抢 mint+burn, 你的被动 LP 拿不到该 fee
- Gas 战争: V3 active rebalance 太频繁 → gas 蚕食 alpha
- Fee tier 错配: 选错 fee tier (e.g. 高 vol pair 用 0.05%) 直接亏
- LVR-aware AMM 早期 liquidity 不足: TVL 太小 → swap volume 也小 → fee 不够覆盖运营
- Hooks 风险 (V4): 用 LVR-aware hook 可能引入新合约漏洞
8. 关键速查 / Quick Reference
| 概念 | 公式 |
|---|---|
| V2 LVR rate (annual) | σ² / 8 |
| V3 LVR rate (in-range) | σ² / 8 × leverage |
| IL (V2, p1→p2) | 2√(p2/p1) / (1+p2/p1) - 1 |
| Daily LVR | σ²_daily / 8 × pool_value |
| Fee/LVR breakeven | σ ≤ √(8 × fee × turnover) |
| 工具 / 仓库 |
|---|
| Uniswap LVR paper |
| CoinFlex LVR dashboard |
| Arrakis Vault docs |
| Gamma Strategies |
| Sorella McAMM |
9. 面试题 / Interview Questions
- 请推导 V2 LVR 公式 σ²/8。这个 1/8 系数从何而来?
- V3 LP 的"被动 fee yield"看起来很高,但很多机构退出了 V3 LP。请用 LVR 解释为什么。
- 设计一个 LVR-aware AMM(如 McAMM 风格),说明它如何把 LVR 还给 LP。
- 如果你是 Uniswap Foundation 的产品总监,给散户 LP 的产品 disclosure 中应包含哪些 LVR 相关信息?
- LVR 与 Impermanent Loss 的核心区别是什么?为什么传统 IL 概念被认为已过时?
10. 明日预告 / Tomorrow
Day 112: Liquidity Wars — 从 ve 模型到 bribes,从 Curve Wars 到 Convex/Aura 的 vote-escrow 战争。我们将解读 CRV bribery 的资金流,分析 1 美元 bribe 能买到多少 emission。