Overview

The Stableclaim Peg Instability Detector combines three independent signal lanes into a single composite score per stablecoin (USDC, USDT, DAI, USDe). Each lane captures a different dimension of peg risk, and together they provide a defensible, reproducible assessment.

Composite Score Formula:

composite_score = 0.45 × Lane1 + 0.35 × Lane2 + 0.20 × Lane3
LaneComponentWeightRefresh Rate
1Price Deviation & Persistence45%Every 6 minutes
2Bayesian Online Changepoint Detection35%Every 6 minutes
3DIRA-Inspired Composite Score20%Every 6 hours

Lane 1 — Price Deviation & Persistence

Data source: Pyth Network 1-min OHLCV price feeds

Method:

off_peg_bps = |price - 1.00| × 10,000

Thresholds:
- 25 bps (0.25%) → Attention
- 50 bps (0.50%) → Warning
- 100 bps (1.00%) → Alert

Alert classification combines price deviation with TVL data:

ConditionClassification
Price drop + TVL decliningTrue depeg — structural outflow
Price drop + TVL stableArb opportunity — temporary dislocation

Persistence gating requires a threshold breach to last N consecutive minutes before generating an alert, separating short volatility events from sustained confidence problems.

Reference: StablecoinInsider (Dec 2025) — “Off-peg bps + depeg duration = fastest indicators of sustained market stress”

Lane 2 — Bayesian Online Changepoint Detection (BOCD)

Data source: Pyth Network 1-min OHLCV log returns

Method:

BOCD (Adams & MacKay 2007) maintains a probability distribution over the current “run length” — the number of observations since the last regime change. Every 6 minutes, when a new observation arrives, the algorithm updates this distribution in constant time.

log_returns = ln(price_t / price_{t-1})
run_length_posterior = BOCD_update(log_returns, hazard_prior=1/1440)
changepoint_prob = 1 - run_length_posterior[0]

When the market regime changes, the probability distribution collapses — mass shifts from “the current regime has been running for hours” to “a new regime just started.” A changepoint probability > 0.65 triggers a detection.

Performance baseline: The “Detecting Depegs” paper (arXiv:2306.10612, 2023) applied BOCD to the March 2023 USDC depeg and detected regime change ~5 hours before the price broke $0.99, with no false positives in the preceding 7 days.

References:

  • Adams & MacKay (2007), “Bayesian Online Changepoint Detection,” arXiv:0710.3742
  • C. et al. (2023), “Detecting Depegs: Towards Safer Passive Liquidity Provision,” arXiv:2306.10612

Lane 3 — DIRA-Inspired Composite Score

Data sources: OHLCV data (Pyth), Curve 3Pool balances (DeFiLlama), DEX depth (subgraphs), supply data (CoinGecko)

Components:

MiPD — Market-informed Probability of Depegging (from OHLCV):

  • Rolling 24h volatility (standard deviation of log returns)
  • BTC/ETH correlation (decorrelation = warning)
  • TWAP deviation (10-min TWAP vs spot)
  • Bid-ask spread proxy (High-Low candle range)

LPD — Liquidity-informed Probability of Depegging (from on-chain):

  • Curve 3Pool imbalance (>60% any single coin = warning)
  • Top 3 DEX pool TVL (day-over-day change)
  • Supply change rate (7-day % change)
  • Chain distribution concentration

Scoring:

composite_score_lane3 = 0.55 × MiPD + 0.35 × LPD + 0.10 × ReserveObservability

Reference: Moody’s DIRA methodology (public) and Halborn Stablecoin Risk Framework v1.03 (13-category Total Risk Rating)

Composite Score Interpretation

Composite ScoreRisk LevelAction
0.00 – 0.25LowNormal monitoring
0.25 – 0.50ModerateIncreased sampling frequency
0.50 – 0.75HighAlert — review available exit routes
0.75 – 1.00CriticalImmediate attention — depeg likely in progress

Decision Matrix

When multiple lanes agree, confidence increases:

Lane 1Lane 2Lane 3Verdict
HighHighHighCRITICAL — True depeg
HighHighModerateHIGH — Depeg probable
HighLowLowWARNING — Possible arb opportunity
LowHighLowWARNING — Structural shift forming
LowLowHighINFO — Structural weakness
ModerateModerateModerateYELLOW — Elevated risk

Data Freshness

All detector runs record data freshness as a first-class metric. Stale inputs generate warning flags and prevent alert escalation. The pipeline runs every 6 hours by default (cron: 06:00 UTC, 18:00 UTC) with an intra-run sampling loop every 6 minutes for Lane 1 and 2.

Limitations

  1. Not a prediction engine. The detector measures current conditions and persistence — it cannot predict black swan events.
  2. Reserve data remains partially off-chain. Collateral composition, custodial arrangements, and legal structure are not fully observable from on-chain data.
  3. False positives are possible. A whale trade or market-wide crypto crash can trigger Lane 1/2 momentarily. The persistence gate and Lane 3 structural check mitigate this.
  4. BOCD requires warm-up. The algorithm needs ~6 hours of price history before changepoint probabilities stabilize.

Dashboard Visualizations

The Peg Detector dashboard on stableclaim.com renders five interactive Chart.js visualizations alongside the KPI cards and score tables:

Peg Deviation Timeline

A multi-line chart showing off-peg basis points for each tracked stablecoin over time. Threshold bands at 25 bps (Moderate), 50 bps (High), and 100 bps (Critical) are rendered as dashed reference lines. Data is sourced from the cumulative peg-detector-history.json file, which appends each pipeline run’s snapshot.

Risk Heatmap

A color-coded table showing risk level (Low/Moderate/High/Critical) per stablecoin per day. Green cells indicate Low risk, purple indicates Moderate, orange indicates High, and red indicates Critical. The heatmap provides a quick visual scan of risk trends across the tracked universe.

Curve 3Pool Imbalance Gauge

A horizontal bar chart showing each stablecoin’s share of Curve 3Pool liquidity. The 3Pool (USDT/USDC/DAI) is the deepest stablecoin liquidity pool in DeFi. When any single coin exceeds 60% of the pool, it signals potential imbalance — a warning flag for peg stability. Data sourced from DeFiLlama via the Lane 3 LPD component.

Prediction Markets — Polymarket Longitudinal Chart

A multi-series line chart showing real-time depegging probability data from Polymarket prediction markets for five stablecoins (USDC, USDT, DAI, USDe, GHO). Each coin is displayed as a separate colored trace, with probability (0–100%) on the y-axis and time on the x-axis. Data is sourced from the Polymarket CLOB midpoint API via hourly polling and appended to per-coin time series at data/polymarket/. The combined chart data lives at data/charts/peg-detector-polymarket-latest.json.

Monitored markets (all from event "Stablecoins depeg before 2027?"):

  • USDC depeg by December 31? (YES token)
  • USDT depeg by December 31? (YES token)
  • DAI depeg by December 31? (YES token)
  • USDe depeg by December 31? (YES token)
  • GHO depeg by December 31? (YES token)

Alert History Log

A scrollable table showing all triggered alerts with timestamp, level, coin, composite score, primary driver, and message. Alerts are persisted in data/history/peg_detector_alerts.json and survive across pipeline runs. The log provides an audit trail for post-event analysis.

Data Pipeline

All visualizations are data-driven — no manual content maintenance required. The pipeline generates:

FilePurposeUpdate Cadence
peg-detector-latest.jsonCurrent snapshot (all coins, lanes, alerts)Every run
peg-detector-scores-latest.jsonComposite scores + risk levelsEvery run
peg-detector-breakdown-latest.jsonPer-coin lane breakdownEvery run
peg-detector-polymarket-latest.jsonPolymarket depeg probability time seriesHourly (cron)
peg-detector-history.jsonCumulative time series for timeline/heatmapEvery run (append)
peg_detector_alerts.jsonPersistent alert history logEvery run (append)

Change Log

DateChange
2026-06-14Initial methodology published
2026-06-14Added Dashboard Visualizations section (timeline, heatmap, curve gauge, alert log)
2026-06-15Added Prediction Markets — Polymarket Longitudinal Chart as 5th visualization