The Model

IL Shield’s pricing model, IL computation, and risk framework.

Impermanent loss computation

IL is computed using the exact Uniswap v3 concentrated liquidity math. This is a 1:1 port of the on-chain ILMath.sol library, fuzz-tested against a Python reference implementation across 10,000 random inputs.

Step 1: Position amounts at entry
(x₀, y₀) = positionAmounts(sqrtPrice_entry, tickLower, tickUpper, L)
Compute token0 and token1 amounts using the Uniswap getAmount0/getAmount1 formulas. Handles three cases: price below range (100% token0), above range (100% token1), or within range (both tokens).
Step 2: LP value at exit
LP_value = positionValue(sqrtPrice_exit, tickLower, tickUpper, L)
The AMM has auto-rebalanced the position as price moved. Compute new token amounts at exit price, value them in token1 terms.
Step 3: HODL value at exit
HODL_value = x₀ × P_exit + y₀
What the initial amounts would be worth if you had simply held them without LPing.
Step 4: Impermanent loss
IL = max(0, HODL_value − LP_value)
The difference between holding and LPing. Always non-negative — the AMM auto-rebalancing always costs the LP relative to holding.
Key math operations
amount0 = L × 2⁹⁶ × (√P_b − √P) / (√P_b × √P)
amount1 = L × (√P − √P_a) / 2⁹⁶
token0_value = amount0 × (sqrtPrice)² / 2¹⁹²
All computed using BigInt Q96 fixed-point arithmetic to match Solidity precision.

Premium pricing model

The premium is based on the Net IL framework: the expected cost of IL after subtracting the expected fee income. LPs only pay for the residual risk that fees don’t cover.

Expected gross IL per block
E[GrossIL] = (σ² / 8) × C(R) / blocks_per_year
σ = annualized volatility, C(R) = concentration factor from tick range width. Derived from the variance of geometric Brownian motion applied to the concentrated liquidity position.
Expected fee income per block
E[FeeIncome] = feeRate × expectedVolume / liquidity
The LP's share of trading fees based on pool volume and their liquidity contribution. Offsets IL risk.
Net IL premium
NetIL = max(0, GrossIL − FeeIncome)
If fee income exceeds expected IL, the premium is zero — the LP is already net positive. This is the key insight: LPs in high-volume pools with low volatility may not need protection.
Final premium rate
Rate = NetIL × RiskLoading × TierMultiplier × UtilizationCurve × C-Level
The net IL is then scaled by risk loading (1.4x base + volatility slope), coverage tier (50/75/100%), vault utilization (kinked curve), and the C-level repricing coefficient.

Risk loading

Risk loading formula
RL = 1.40 + max(0, (σ − 0.50) × 0.80)
Base loading of 1.4x on all premiums. Above 50% volatility, an additional 0.8x per unit of excess vol is added. At 70% vol: RL = 1.40 + (0.20 × 0.80) = 1.56x.
The risk loading accounts for model uncertainty, adverse selection risk, and tail events that the base variance formula doesn’t capture. It ensures the protocol remains solvent even when realized vol exceeds the model’s expectation.

Utilization curve

Premium pricing responds to vault utilization via a kinked curve, similar to Aave’s interest rate model. This ensures premiums rise steeply when vault capacity is constrained.

1.0x
0–40% utilization
Flat — no surcharge
1.0–2.0x
40–75% utilization
Linear increase
2.0–12.0x
75–100% utilization
Exponential surge
Exponential region (>75%)
Multiplier = 2.0 + 10 × ((util − 0.75) / 0.25)²
At 100% utilization, the multiplier reaches 12x, effectively halting new registrations by making premiums prohibitively expensive.

Concentration factor

Concentrated liquidity positions experience amplified IL compared to full-range positions. The concentration factor C(R) quantifies this amplification based on the tick range width.

Concentration factor
C(R) = f(tickUpper − tickLower)
Narrower tick ranges have higher concentration factors, resulting in higher premiums. A ±600 tick range (±6% price range) has ~25x more IL exposure than a full-range position at the same price move.
This is why concentrated LPs are the primary audience for IL Shield — their IL risk is dramatically higher than full-range LPs, and the protection is correspondingly more valuable.

Tranche waterfall

When an LP settles a claim, the payout flows through the tranche waterfall:

1
Junior tranche absorbs first. Up to the full Junior vault balance is drawn to pay claims. Junior depositors bear the first-loss risk.
2
Senior tranche is only drawn if Junior is depleted. Senior depositors are protected by the Junior buffer. In normal market conditions, Senior is never touched.
Premium distribution
Senior vault70%
Junior vault15%
Treasury10%
Referrer (or treasury)5%

Anti-adverse selection

Four mechanisms prevent LPs from gaming the system by buying protection only when they know IL is about to occur:

Warming period.Coverage doesn’t start until 10 blocks after registration (48 hours on mainnet). Same-block register-and-settle is impossible.
Coverage ramp. Payout scales linearly from 0% to 100% over 50 blocks (7 days on mainnet). Early settlement receives reduced coverage.
Streaming premium. Premium is deducted per-block, not paid upfront as a lump sum. LPs pay for each block of coverage they consume.
C-level repricing. The protocol can adjust the C-level coefficient to increase premiums if the combined ratio (claims/premiums) exceeds 100%.

Verification and testing

The IL computation is fuzz-tested against a Python reference implementation (il_math_reference.py) for 10,000 random inputs spanning the full sqrtPriceX96 domain. All runs match to within 1 wei.

The premium formula has 4 property tests verified across 40,000 fuzz runs: monotonicity in volatility, monotonicity in concentration, zero premium when fees exceed IL, and convergence to gross IL when fees are zero.

Vault solvency is verified via 1,000 invariant test runs with 50,000 random handler calls across deposits, withdrawals, premium distributions, and claim settlements.

Total tests: 252 (168 CI + 84 fork)
Fuzz runs: 50,000
Invariant calls: 50,000
Failures: 0
ILShieldCore branch coverage: 97.06%