LP Divergence-Loss Gate
lp_riskForward-looking liquidity-provision risk. Given a realized price ratio (for impermanent loss) and/or a volatility + horizon (for expected divergence / LVR), returns the closed-form IL, the expected −σ²T/8 divergence, and — with a fee APR — the net forecast and breakeven volatility (the vol above which fees no longer cover the bleed). Self-checked: the IL closed form is verified at the token level against explicit constant-product amounts. Call before providing liquidity to see whether the fee yield can plausibly beat the divergence loss.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feeAprPct | No | annualized fee yield estimate | |
| capitalUsd | No | position capital in USD — losses are also reported in USD | |
| priceRatio | No | realized P1/P0 for realized IL | |
| volatility | No | per-period vol (decimal) for expected divergence | |
| horizonPeriods | No | periods (default 1) | |
| periodsPerYear | No | default 365 | |
| concentrationFactor | No | V3 amplifier ≥1 (default 1) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | false when the engine rejected the input | |
| model | No | model assumptions used | |
| proof | No | Verifiability envelope: echoed inputs, engine codeHash, contentHash of this exact result, self-checks, EIP-712 signature (EAS-ready). Re-run the open engine on `inputs` to reproduce the result byte-for-byte. | |
| checks | No | Ground-truth self-checks; the result is untrustworthy if any fails. | |
| realizedIL | No | closed-form impermanent loss at the realized price ratio | |
| feeVsDivergence | No | net forecast and breakeven volatility vs the fee APR | |
| expectedDivergence | No | expected divergence loss / LVR over the horizon (−σ²T/8 law) | |
| concentrationFactor | No | V3 concentration amplifier applied |