AbstractScoring the quality of a sideways market
Concentrated-liquidity AMMs like PancakeSwap v3 let a provider confine capital to a price range, multiplying capital efficiency 200–300× over a v2 pool. The catch: when price leaves the range, the position stops earning fees, sits fully in the weaker asset, and bleeds impermanent loss (IL) and loss-versus-rebalancing (LVR). Providers had no objective answer to a simple question — how stable is this range, and is it worth deploying liquidity here?
IVL answers it. Over a window of candles it integrates three inseparable signals — internal dispersion (volume-weighted variance around VWAP), temporal persistence, and fractal consistency across 15m/1h/4h/1d — into one 0–100 score, and emits a deterministic, backtestable LP spec. On a 365-day walk-forward of AAVE/WBNB, an IVL-guided set-and-hold provider cut impermanent-loss exposure −62% versus a naive fixed-band strategy, with ~5× fewer rebalances. Everything below runs on real market data and is reproducible from the open-source engine.
01 · The problemA range is not just its width
A concentrated-liquidity position is a bet that price stays inside [S, R]. Inside the range you collect trading fees; outside it you collect nothing and hold the depreciating asset. So the entire economics of LPing hinge on one thing: how the price actually moves inside the range — not how wide the range is.
Traditional indicators miss this. RSI measures momentum, ATR measures volatility, Bollinger bands measure expansion — none of them describe the internal structure of a consolidation. That structure is exactly what decides whether your liquidity earns or evaporates.
02 · The hypothesisSame width, opposite risk
Take two ranges of identical width. In the first, price oscillates freely between support and resistance. In the second, price is compressed against one edge, coiling. To the naked eye — and to a width-based tool — they look the same. For a liquidity provider they are opposites.
| Property | Range A — healthy | Range B — coiled |
|---|---|---|
| Internal distribution | broad, rebounds edge-to-edge | compressed against one border |
| Crossing volume | high → fees | low → little yield |
| What happens next | keeps ranging | high breakout probability |
| For an LP | deploy | avoid / withdraw |
03 · PolarityHigh IVL is good
This is the counter-intuitive heart of the metric, and we fix the convention up front. For a channel [S, R], the raw measure is bounded in [0, 0.25]:
- Price travelling the whole channel, extreme-to-extreme →
IVL_raw → 0.25→ a healthy, fee-generating lateralization. - Price compressed or pressed asymmetrically against one edge →
IVL_raw → 0.01→ imminent breakout risk.
04 · Measuring IVLThree inseparable components
A single IVL score is the geometric integration of three measurements. They are intentionally multiplicative: a weak reading on any one of them drags the whole score down, because a good LP zone has to satisfy all three at once.
05 · The methodFrom candles to a score
Over a window of candles (closes Pi, volumes vi), support and resistance are S = min(low), R = max(high), and the window counts as a stable lateral block while its normalized width W/S ≤ δ. The center of equilibrium is the volume-weighted average price, and dispersion is the volume-weighted variance about it:
σ²lateral = Σ vi(Pi − μvwap)² / Σ(vi) # volume-weighted variance
IVL_raw = σ²lateral / (R − S)² # ∈ [0, 0.25]
The integrated score is a weighted geometric mean of dispersion D, persistence Pt and fractality F — geometric, so any single weak leg pulls the result down and the metric demands confirmation:
IVL Score = round( clamp(combined, 0, 1) · 100 ) # 0–100
A timeframe-aware LVR estimate, ATR-based widening, and deployable v3 ticks (tickLower/tickUpper) are derived from the same window — see the full mathematical formulation ↗.
06 · The decisionConcentrate, hold, or withdraw
The score maps to one of three actions, cross-checked against a CoinMarketCap signal layer (funding, open-interest change, RSI, Fear & Greed). If derivatives flag expansion, the decision is downgraded even on a moderately high IVL.
| Condition | Action | Range |
|---|---|---|
IVL_raw ≥ 0.18 & LVR low | CONCENTRATE | tight band μ ± 2σ |
0.10 ≤ IVL_raw < 0.18 | HOLD | keep current range |
IVL_raw < 0.10 or LVR high | WIDEN / WITHDRAW | 2.5 × ATR14 or exit to stable |
High IVL → concentrated provision
Decision: provide at optimal, low-dispersion levels — capital stacked at the VWAP.
Low IVL → liquidity withdrawal
Decision: pull liquidity to stable reserves — dispersion is breaking down.
07 · ResultsWhat the numbers say
Three checks, all reproducible from the open-source engine. First, that the metric is internally correct; second, that it behaves on a live pair; third — the one that matters — that it makes money behave better than the alternatives.
7.1 · Correctness — synthetic self-test
Six assertions verify polarity (high = good) and intrinsic fractality on hand-built scenarios. All pass. A healthy oscillation scores high; an asymmetric compression refuses to recommend concentrate; a range that disagrees across scales is penalized by the fractal term.
selftest.mjs · 6/6 assertions pass. Healthy 81 (excellent), compression 47, fractal-discrepancy 53 — note how disagreement across scales caps the score even when a single scale looks fine.7.2 · A live reading — BNB/USDT
Run against current Binance klines, BNB/USDT scored 56 / 100 (neutral): a real but unremarkable range. Persistence and fractality were strong (price stayed in-channel and all scales agreed), but dispersion was middling — price wasn't filling the channel enough to justify tight concentration.
Integrated components (0–1).
IVL_raw per scale (× relative to 0.18 threshold).
ivl.mjs --pair BNB-USDT · snapshot 2026-06-19. Range 570.82–592.80 (width 3.85%), LP band 567.3–591.5 around VWAP 579.4, LVR low, scales confirming 4h/1h/15m. Live values move with the market.7.3 · With vs without IVL — the proof
This is the result that matters. We model realistic set-and-hold liquidity provision (fees − impermanent loss − rebalance cost) over a 365-day walk-forward of the variable/variable pair AAVE/WBNB, where the pool prices the ratio of the two assets. IVL patiently holds and places forward ranges; the naive strategy uses a fixed band and chases price on every exit; random picks arbitrary ranges.
vs naive
(units)
7 vs 35
| Strategy | Net | Fees | IL | Rebalances | Deployed |
|---|---|---|---|---|---|
| IVL-guided | −7.62 | 85.3 | 82.4 | 7 | 91% |
| Naive fixed-band | −57.36 | 213.1 | 218.0 | 35 | 100% |
| Random | −57.70 | 194.6 | 201.7 | 34 | 100% |
compare.mjs --pair AAVE-WBNB --scale 1d --history 365. In a trending 365-day regime all three book a loss, but IVL converts a −57 bleed into a near-flat −7.6 by not chasing price — collecting fewer fees yet avoiding the impermanent loss that fee-chasing creates. The discipline, not the yield, is the edge.08 · DifferentiationWhat IVL measures that others don't
| Indicator | Measures |
|---|---|
| RSI | momentum |
| MACD | trend |
| ATR | volatility |
| Bollinger | expansion / contraction |
| IVL | lateralization quality · internal stability · LP suitability (multiscale) |
No existing indicator scores the internal quality of a consolidation. IVL is the layer between "is it ranging?" and "should I deploy capital here?".
09 · How it worksThe stack
- Candles — Binance public klines (BNB ecosystem, no key) supply OHLCV with volume.
- Signal — CoinMarketCap MCP adds the context layer: funding, open-interest change, RSI, Fear & Greed.
- Venue — PancakeSwap v3 concentrated-liquidity ranges (
tickLower/tickUpper). - Execution (conceptual) — the spec names the concentrate / hold / withdraw actions a Trust Wallet agent would call; IVL does not sign or send transactions.
The deliverable is a deterministic, backtestable spec — data sources, entry/exit rules, range-break stop, fee-target take-profit, IVL-proportional sizing, and risk limits — reproducible, not a black-box live agent.
10 · Open standardRun it yourself
IVL ships as a CoinMarketCap-compatible skill, MIT-clean and Apache-2.0 licensed. The math lives in pure, dependency-free modules so an agent — or you — can call it programmatically.
node scripts/ivl.mjs --pair BNB-USDT --lookback 120 --json
# prove the uplift (with vs without IVL)
node scripts/compare.mjs --pair AAVE-WBNB --scale 1d --history 365
# verify polarity + fractality (6/6)
node scripts/selftest.mjs