Blockchain Applications

Lecture 5: Stablecoins I – Measuring Depeg Risk and On-Chain Early Warning

Lecture 5: Stablecoins I – Measuring Depeg Risk and On-Chain Early Warning

Daniel Traian PELE

Bucharest University of Economic Studies
IDA Institute Digital Assets
Blockchain Research Center
Master Blockchain for Business (MBB), FABIZ
25 November 2026

Lecture Question and Outline

Slide 2 in the PDF

A stablecoin promises one dollar, and the lecture asks how far and how often it misses that promise, and whether a miss can be seen coming. The question matters because stablecoins are the settlement asset of most crypto trades and the main collateral in decentralised finance (DeFi). A lending protocol that values a stablecoin at its market price will liquidate positions when that price falls, so a deviation of a few basis points (bp) can force sales that cannot be reversed.

The route has three parts. The first measures the peg: deviations in basis points, the tails of their distribution, episodes of stress, and the Silicon Valley Bank (SVB) weekend of March 2023 as a case. The second looks at the place where stablecoin prices are formed on chain, the automated market maker (AMM), and compares two of its pricing rules, the constant product and StableSwap. The third evaluates early-warning systems: how to judge an alarm, what the paper's alarm achieves, and what a simple price-only alarm achieves on the aggregated USDC/USDT rate.

The data are daily (2021–2026) and hourly (2022–2026) prices of USDT, USDC and DAI from the data vendor EOD Historical Data (EODHD), and the stablecoin supply from DefiLlama on 21 October 2026.

In brief

  • Question: a stablecoin promises one dollar. How far and how often does it miss, and can we see a miss coming?
    • stablecoins settle most crypto trades and serve as collateral in decentralised finance (DeFi): a deviation of a few basis points can trigger liquidations
  • Outline
    • measuring the peg: deviations in basis points, tails, episodes; the Silicon Valley Bank (SVB) weekend of March 2023
    • where the price is formed: automated market maker (AMM) invariants: constant product and StableSwap
    • early warning: event-level evaluation, utility, results of a recent working paper (Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026))
  • Data: EODHD daily (2021–2026) and hourly (2022–2026) prices of USDT, USDC, DAI; DefiLlama supply (21 October 2026)

From Lecture 4: Measuring a Depeg Episode

Slide 3 in the PDF

Lecture 4 summarised risk by one daily quantile. The value-at-risk at level 1%, VaR 1%, is minus the 1% quantile of daily changes, \(\mathrm{VaR}\,1\% = -q_{0.01}\), written as a positive loss. For USDC, measured in deviations from one dollar on daily closes from 2021 to 2026, the 1% quantile is \(q_{0.01} = -7.6\) bp, so VaR 1% is 7.6 bp: on 1% of days the closing price was at least 7.6 bp below one dollar.

The SVB weekend shows what this number misses. Measured on hourly USDC prices, the event has three separate dimensions. Its magnitude was a lowest hourly close of −1,036 bp at 07:00 Coordinated Universal Time (UTC) on 11 March 2023, while the lowest daily close was only −285 bp. Its duration was 62 hours from the first hour at or below −15 bp to the return above −15 bp, of which 44 hours were at or below −100 bp. The third dimension is the event probability: how often such episodes start, and whether the next 24 hours will contain one.

A daily VaR answers none of the three. It is one quantile of daily closes, so it says nothing about the depth of losses beyond it, the length of a depeg, or the time of the next one. The lecture measures all three: deviations and their tails, episodes, and an early-warning alarm.

In brief

  • Lecture 4 summarised risk by one daily quantile: VaR 1% \(= -q_{0.01}\), a positive loss
    • USDC, daily closes 2021–2026: \(q_{0.01} = -7.6\) basis points (bp), so VaR 1% \(= 7.6\) bp
  • The SVB weekend (March 2023), measured three ways on hourly USDC prices
    • magnitude: lowest hourly close \(-1\,036\) bp (11 March, 07:00 UTC); lowest daily close \(-285\) bp
    • duration: 62 hours from the first hour at or below \(-15\) bp to the return above \(-15\) bp; 44 hours at or below \(-100\) bp
    • event probability: how often such episodes start, and whether the next 24 hours will contain one
  • A daily VaR answers none of the three
    • it is one quantile of daily closes: silent on the depth beyond it, on how long a depeg lasts and on when the next one starts
    • this lecture measures all three: deviations and tails, episodes, and an early-warning alarm

Learning Outcomes

Slide 4 in the PDF
  • Measure a peg deviation in basis points and describe its distribution, tails and episodes
  • Explain price impact under constant-product and StableSwap AMMs
  • Explain why pool composition reveals liquidity stress before the price
  • Evaluate an early-warning system with event-level recall, lead time, false alerts and utility

Abbreviations (1/2)

Slide 5 in the PDF
AMM automated market maker
AR autoregressive (model); AR(1): first order
ARIMA autoregressive integrated moving average
AUC area under the receiver operating characteristic curve
AUPRC area under the precision–recall curve
bn billion
bp basis point (0.01%)
BTC Bitcoin
CDF cumulative distribution function
CI confidence interval
CRPS continuous ranked probability score
DAI Maker/Sky stablecoin (crypto-backed)
DeFi decentralised finance
EODHD EOD Historical Data (data vendor)
ES expected shortfall
ETH Ether (Ethereum)
FABIZ Faculty of Business Administration in Foreign Languages, ASE
FDIC Federal Deposit Insurance Corporation
Fed Federal Reserve
FPCA functional principal component analysis
FRM Financial Risk Meter
GARCH generalised autoregressive conditional heteroskedasticity
GARCH-t GARCH with Student-t errors
GPD generalised Pareto distribution
HC heteroskedasticity-consistent
HHI Herfindahl–Hirschman index

Abbreviations (2/2)

Slide 6 in the PDF
JIT just-in-time (liquidity)
KS Kolmogorov–Smirnov (test)
KYC know your customer
m million
OLS ordinary least squares
PIT probability integral transform
PYUSD PayPal USD
QL quantile (pinball) loss
sd standard deviation
SE standard error
SHAP SHapley Additive exPlanations
SSR sum of squared residuals
SVB Silicon Valley Bank
TAR threshold autoregression
TiDE Time-series Dense Encoder
twCRPS threshold-weighted CRPS
USD US dollar
USD1 World Liberty Financial USD
USDC USD Coin (Circle)
USDe Ethena USDe
USDG Global Dollar (Paxos)
USDS Sky Dollar
USDT Tether
UTC Coordinated Universal Time
V3 version 3 (Uniswap V3)
VaR value-at-risk

Reading and Tools

Slide 7 in the PDF

The main paper is the working paper Onchain Monitoring of Stablecoin Depeg Risk by Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026) and the slides that quote its results name it in their source line. Its hourly on-chain data set is published by Chaffard (2026), Stablecoin DeFi Hourly Dataset, Zenodo on Zenodo. The pricing rules of the two automated market makers come from Egorov (2019) (StableSwap, used by Curve) and Adams et al. (2021) (Uniswap V3).

Three methodological references support the Appendix: the threshold model and its test of Hansen (1996), the scoring rules for probabilistic forecasts of Gneiting & Raftery (2007) and Gneiting & Ranjan (2011), and the attribution method of Lundberg & Lee (2017). The market data are EODHD stablecoin prices and DefiLlama stablecoin supply; the tools are Python with the libraries `numpy`, `scipy` and `scikit-learn`. Lecture 6 (Stablecoins II) moves from one pool to many stablecoins with the De-pegging Pressure Index and the Financial Risk Meter (FRM).

In brief

Our central thesis is that decentralization of issuance and access to arbitrage trades with the issuing treasury are key factors determining the efficiency of the peg.

— Lyons & Viswanath-Natraj (2023)

A stablecoin is a token on a blockchain that promises a fixed price, almost always one US dollar (USD). Stablecoins settle most crypto trades and serve as collateral in decentralised finance (DeFi), the lending and trading applications that run through smart contracts. Their supply reached 303 billion USD in October 2026. A price that is meant to be constant still moves: it can drift a few hundredths of a percent away from one dollar, and on rare days it falls by several percent. In a lending protocol, a fall of a few basis points (bp, one bp is 0.01%) can be enough to trigger liquidations, which cannot be undone.

The lecture asks two questions. How far and how often does a stablecoin miss its dollar? And can a miss be seen before it happens? Lecture 4 summarised risk with one daily quantile, the value-at-risk (VaR). That number says nothing about how deep a depeg goes beyond the quantile, how long it lasts, or when the next one starts, and these are the three quantities measured here.

The data are daily prices of the three largest dollar stablecoins, Tether (USDT), USD Coin (USDC) and DAI, from 2021 to October 2026, and hourly prices from 2022 to October 2026, all from the data vendor EOD Historical Data (EODHD); the stablecoin supply comes from DefiLlama. The lecture first explains how a stablecoin holds its peg and how the peg is measured, then shows where stablecoin prices are formed on chain, in automated market makers (AMMs). It ends with an early-warning system for depegs from a recent working paper by Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026) and with a simpler alarm that uses prices only.

The Silicon Valley Bank (SVB) weekend, 8–18 March 2023, hourly prices in basis points (bp) away from one US dollar. USD Coin (USDC) fell to −1,036 bp on Saturday 11 March, 07:00 Coordinated Universal Time (UTC), after its issuer disclosed 3.3 billion USD of reserves at the failed bank; DAI followed it, and Tether (USDT) rose above one dollar. The second dotted line marks the backstop announced by the US authorities.
The Silicon Valley Bank (SVB) weekend, 8–18 March 2023, hourly prices in basis points (bp) away from one US dollar. USD Coin (USDC) fell to −1,036 bp on Saturday 11 March, 07:00 Coordinated Universal Time (UTC), after its issuer disclosed 3.3 billion USD of reserves at the failed bank; DAI followed it, and Tether (USDT) rose above one dollar. The second dotted line marks the backstop announced by the US authorities.

What you will be able to do

  • Measure a peg deviation in basis points and describe its distribution, tails and episodes.
  • Explain price impact under constant-product and StableSwap automated market makers.
  • Explain why pool composition reveals liquidity stress before the price.
  • Evaluate an early-warning system with event-level recall, lead time, false alerts and utility.

The Appendix holds optional material on threshold models, liquidity curves and distributional forecasts.

Lecture plan

  1. What a Stablecoin PromisesThe three designs, the arbitrage that holds the peg, who issues the dollars on chain, and three distinctions between kinds of depeg risk.
  2. Measuring the PegDeviations in basis points, their tails and episodes, and the SVB weekend hour by hour.
  3. Automated Market Makers and Price FormationConstant-product and StableSwap pools, and why the price stays flat until a pool is nearly one-sided.
  4. Early WarningLabels and episodes, an evaluation built for alarms, the results of the paper and a price-only alarm.
  5. Recent Data: August to October 2026The last twelve weeks of the three dollars.
  6. SummaryThe main numbers of the lecture and four interpretation exercises.
  7. Appendix: Further MaterialThreshold autoregression, Uniswap V3 liquidity, pool entropy, Gegenbauer scores, SHAP attribution and distributional forecasts.

What a Stablecoin Promises

Before measuring deviations from the peg, the analyst needs to know what holds the peg and what can break it. The section describes the three designs of stablecoins, the arbitrage that keeps the price near one dollar and what happens to the peg when banks are closed, the issuers that dominate the market, and three distinctions that decide which kind of depeg risk can be monitored at all.

A stablecoin is a token that targets a fixed price \(P^\ast\) in a reference asset; in this lecture \(P^\ast = 1\) USD. Three designs exist. A fiat-backed stablecoin, such as USDT or USDC, is backed by reserves in cash and Treasury bills held by the issuer, which creates (mints) new tokens and buys them back (redeems them) at par, one dollar per token, for eligible clients. A crypto-backed stablecoin, such as DAI and its successor USDS, is created through over-collateralised loans in a smart contract: a user locks crypto assets worth more than the tokens borrowed, and the contract liquidates the collateral if its value falls too far, which protects the peg. An algorithmic stablecoin has no external collateral; TerraUSD, which collapsed in May 2022, relied on a swap that minted and burned it against a volatile token.

In all three designs the market price is held near the peg by arbitrage. If the price \(P_t\) is below one dollar, a trader buys the token on the market and redeems it with the issuer at one dollar; if it is above one dollar, the trader mints at one dollar and sells on the market. Both trades push the price back towards the peg.

Arbitrage needs three conditions. It needs access, because redemption is open only to clients who have passed the issuer's know-your-customer (KYC) checks and often only above a minimum size. It needs time, because redemptions are paid through banks, which work only during banking hours. And it needs trust that the reserves are there. When one of the three fails, nothing pulls the market price back, and it can leave the peg.

In brief

  • A stablecoin is a token that targets a fixed price \(P^\ast\) in a reference asset, here \(P^\ast = 1\) USD
  • Fiat-backed (USDT, USDC): reserves in cash and Treasury bills; the issuer mints and redeems at par for eligible clients
  • Crypto-backed (DAI/USDS): over-collateralised loans in a smart contract; liquidations protect the peg
  • Algorithmic (TerraUSD, May 2022): a mint/burn swap against a volatile token; no external collateral
  • The peg is held by arbitrage: if \(P_t < 1\), buy on the market and redeem at 1; if \(P_t > 1\), mint at 1 and sell
    • arbitrage needs access (know-your-customer (KYC) rules, minimum size), time (bank hours) and trust in the reserves
    • when one of the three fails, the market price can leave the peg

Peg Deviations on Weekends and Weekdays

Slide 9 in the PDF

Redemption at par is paid through the issuer's banks, and banks are closed at weekends. If arbitrage through the issuer is what holds the peg, the peg should be weaker when that channel pauses. The chart tests this on the hourly price of USDC in USDT from January 2022 to 23 October 2026. The left panel gives the mean absolute deviation \(|d_t|\) by day of the week, the right panel the share of hours with \(|d_t| \geq 15\) bp, the breach threshold used later in the lecture; blue bars use all hours, orange bars leave out 10–14 March 2023, the days of the Silicon Valley Bank (SVB) failure, and the shaded days are the weekend.

With all hours included, the weekend looks clearly worse: the mean \(|d_t|\) is 6.6 bp at weekends and 4.6 bp on weekdays. Almost all of that difference comes from one weekend. Without the SVB days the mean is 4.5 bp on both, so on a typical weekend the price stays as close to parity as on a weekday.

Breaches are another matter. Leaving out the SVB days, 2.8% of weekend hours and 2.1% of weekday hours are beyond 15 bp, so large deviations are somewhat more frequent when banks are closed. Consecutive hours are strongly correlated, so these shares are not independent observations and the comparison is descriptive, not a statistical test. The reading is consistent with the arbitrage argument: the weekend does not move the typical price, but it removes one of the forces that close a large gap quickly.

In brief

Peg Deviations on Weekends and Weekdays
  • USDC priced in USDT, hourly, January 2022 – 23 October 2026: mean \(|d_t|\) 6.6 bp on weekend hours, 4.6 bp on weekday hours
  • Without 10–14 March 2023 (SVB): 4.5 bp on both; one weekend makes the whole difference in the mean
  • Breach hours (\(|d_t| \geq 15\) bp), SVB days left out: 2.8% of weekend hours, 2.1% of weekday hours
  • Redemption through the issuer pauses at weekends: the typical deviation is unchanged, breaches are a little more frequent; hours are autocorrelated, so this is a comparison of shares, not a test
  • Source: own computation on EODHD hourly prices of USDC and USDT, January 2022 – 23 October 2026
BA_L5_weekday

Issuers of On-Chain Dollars

Slide 10 in the PDF
    Question for the room On 8 May 2022, the day before the TerraUSD collapse, the supply of USD stablecoins was 185.4 USD bn. What share of it was algorithmic?
    Answer

    About 11%: 11.5%, or 21.3 USD bn. Three weeks later, on 31 May 2022, the algorithmic share was 0.9%, and in October 2026 it is 0.0%; fiat-backed tokens hold 90.9% and crypto-backed tokens 8.1%. TerraUSD was large, but never the largest: on 8 May 2022 Tether held 45.0% and USD Coin 26.1% of the supply.

    The left panel of the chart stacks the supply of USD stablecoins by design, in billions of USD, from 2019 to October 2026, using data from DefiLlama. Total supply was 4.2 billion USD in January 2020, 187.1 billion in May 2022, 129.8 billion in January 2024 and 303.4 billion on 21 October 2026. The red band of algorithmic designs, visible until May 2022, disappears after the collapse of TerraUSD. On 21 October 2026, fiat-backed stablecoins made up 90.9% of the supply and crypto-backed ones 8.1%.

    The right panel gives the share of each issuer in all USD stablecoins on 21 October 2026. Two issuers hold 84%: Tether (USDT) with 60.2% and Circle's USD Coin (USDC) with 23.8%. The next ones, Sky Dollar (USDS), DAI, Ethena USDe, World Liberty Financial USD (USD1), Global Dollar (USDG) and PayPal USD (PYUSD), hold between 0.9% and 2.2% each. With this concentration, a dislocation between USDC and USDT is an event for the whole system, which is why the lecture studies the price of USDC in USDT.

    In brief

    • Supply of USD stablecoins: 4.2 bn USD (Jan 2020), 187.1 bn (May 2022), 129.8 bn (Jan 2024), 303.4 bn (21 Oct 2026)
    • Fiat-backed: 90.9%, crypto-backed 8.1%; algorithmic designs vanished after TerraUSD
    • Two issuers hold 84% (USDT 60.2%, USDC 23.8%): a USDC/USDT dislocation is a system-level event
    BA_L5_supply

    Three Distinctions in Depeg Analysis

    Slide 11 in the PDF

    Three distinctions decide what kind of depeg risk is being measured. The first is between a fundamental and a market-defined peg. The fundamental value is the redemption value, what the issuer pays per token; the market-defined value is the price on a given trading venue. A token has no single market price: on 10 October 2025 USDe traded at 0.65 USD on one exchange while other venues stayed near one dollar.

    The second distinction is between exogenous and endogenous causes. Exogenous causes, such as losses on the reserves, regulation or sanctions, arrive as news and are hard to predict from market data. Endogenous causes, such as a shortage of liquidity or one-sided order flow, arise inside the market and are visible on the blockchain before the price moves.

    The third distinction is between transient and persistent depegs. A transient depeg lasts hours and is closed by arbitrage; a persistent one reflects a loss of confidence, as with TerraUSD. A transient depeg is not harmless, because liquidations executed at a bad price are irreversible. The lecture concentrates on market-defined, mostly endogenous and often transient risk, the kind for which monitoring is feasible.

    In brief

    • Fundamental vs market-defined peg
      • fundamental: the redemption value; market-defined: the price on a given venue
      • a token has no single price: on 10 October 2025 USDe traded at 0.65 USD on one exchange while other venues stayed near 1
    • Exogenous vs endogenous
      • exogenous: reserve losses, regulation, sanctions; arrive as news, hard to predict
      • endogenous: liquidity and order flow inside the market; visible on chain before the price moves
    • Transient vs persistent
      • transient: hours, closed by arbitrage; persistent: a loss of confidence (TerraUSD)
      • a transient depeg is not harmless: liquidations at a bad price are irreversible
    • This lecture: market-defined, mostly endogenous, often transient risk, where monitoring is feasible

    Section summary

    A stablecoin holds its peg through arbitrage that needs access, time and trust in the reserves. The supply is dominated by two fiat-backed issuers, and the risk that can be monitored from market and on-chain data is the market-defined, endogenous and often transient depeg.

    Measuring the Peg

    The section turns the peg into numbers. It defines the deviation in basis points, the share of time beyond a threshold and the episode, with an episode found by hand, then describes the daily distribution of the three dollars, how long its deviations last, its tails and how they change over time, and the SVB weekend hour by hour, with a worked example on how large the SVB discount should have been.

    The basic measure is the deviation of the price from the peg, expressed in basis points (1 bp = 0.01%). For a token with price \(P_t\) in USD, and for the price of USDC in USDT,

    \[d_t = 10^4\,(P_t - 1), \qquad d_t^{\,\mathrm{USDC/USDT}} = 10^4\left(\frac{P_t^{\mathrm{USDC}}}{P_t^{\mathrm{USDT}}} - 1\right)\]
    (5.1)

    A price of 0.9985 USD gives \(d_t = -15\) bp. Two prices can be used for each interval: the closing price, and the intraday low, which is the lowest price reported during the interval, aggregated over the venues covered by the data vendor. Whether a given amount could actually have traded at the low depends on the venue, its depth and the size of the trade, so the low is an upper bound on stress, not a price an investor could count on.

    The frequency of large deviations is measured by the exceedance probability, the share of observations with an absolute deviation of at least \(x\), and the breach indicator for a threshold \(\delta\), here 15 bp:

    \[\hat P(|d| \geq x) = \frac1T \sum_{t=1}^T \mathbb{1}\{|d_t| \geq x\}, \qquad b_t = \mathbb{1}\{|d_t| \geq \delta\}\]
    (5.2)

    where \(T\) is the number of observations and \(\mathbb{1}\{\cdot\}\) equals 1 when the condition holds and 0 otherwise.

    Breach hours come in clusters, so they are not independent observations. The lecture therefore counts episodes: an episode starts at a breach hour that is preceded by 24 observed hours without a breach. A missing hour is never counted as quiet. A breach that follows a gap in the data is ambiguous, because a breach could have occurred in the missing hours, and it is set aside rather than counted as a new episode.

    In brief

    • Deviation in basis points (1 bp = 0.01%):
      \[ d_t = 10^4\,(P_t - 1), \qquad d_t^{\,\mathrm{USDC/USDT}} = 10^4\left(\frac{P_t^{\mathrm{USDC}}}{P_t^{\mathrm{USDT}}} - 1\right) \]
      • closing price vs intraday low: the low is the lowest price reported in the interval, aggregated over venues
      • whether a given amount could trade at that price depends on the venue, its depth and the trade size
    • Exceedance probability and breach indicator, threshold \(\delta\) (here 15 bp):
      \[ \hat P(|d| \geq x) = \frac1T \sum_{t=1}^T \mathbb 1\{|d_t| \geq x\}, \qquad b_t = \mathbb 1\{|d_t| \geq \delta\} \]
    • An episode starts at a breach hour preceded by 24 observed hours without a breach
      • hours inside an episode are not independent observations: count episodes, not hours
      • a missing hour is never counted as quiet: a breach after a gap is ambiguous and is set aside

    Worked Example: Finding an Episode Start

    Slide 13 in the PDF

    The episode rule can be applied by hand. On 29 June 2026 the hourly EODHD closes were 0.999554 USD for USDC and 0.998109 USD for USDT at 14:00 Coordinated Universal Time (UTC), and 0.999712 and 0.998199 at 15:00. The deviation of USDC priced in USDT, from (5.1), is

    \[d_{14:00} = 10^4\left(\frac{0.999554}{0.998109} - 1\right) = 14.5 \text{ bp}, \qquad d_{15:00} = 10^4\left(\frac{0.999712}{0.998199} - 1\right) = 15.2 \text{ bp}\]

    With the threshold \(\delta = 15\) bp, the breach indicator is \(b_{14:00} = 0\) and \(b_{15:00} = 1\). USDC was above USDT here, not below: the breach comes from a discount of USDT, which is why the rule uses the absolute deviation.

    The second step checks the quiet spell. The 24 hours before 15:00, from 28 June at 15:00 to 29 June at 14:00, are all observed, and the largest \(|d_t|\) among them is 14.7 bp, just below the threshold. The breach at 15:00 therefore starts an episode. At 16:00 the deviation is back at 13.8 bp, so this episode lasts one hour.

    The contrast case is 4 February 2026 at 17:00, when \(d_t = 15.9\) bp. No breach is observed in the 24 hours before, but one of those hours is missing. The missing hour could have been a breach, in which case 17:00 would be the continuation of an episode rather than its start. The rule treats such a case as an ambiguous onset and does not count it, so the episode counts that follow are lower bounds.

    In brief

    • Hourly EODHD closes on 29 June 2026, UTC: USDC 0.999554 and USDT 0.998109 at 14:00; USDC 0.999712 and USDT 0.998199 at 15:00
      \[ d_{14:00} = 10^4\left(\frac{0.999554}{0.998109} - 1\right) = 14.5 \text{ bp}, \qquad d_{15:00} = 10^4\left(\frac{0.999712}{0.998199} - 1\right) = 15.2 \text{ bp} \]
    • Breach indicator with \(\delta = 15\) bp: \(b_{14:00} = 0\), \(b_{15:00} = 1\)
    • Quiet spell: the 24 hours from 28 June, 15:00 to 29 June, 14:00 are all observed; the largest \(|d_t|\) among them is 14.7 bp
      • so 15:00 starts an episode; at 16:00 \(d_t = 13.8\) bp, and the episode lasts one hour
    • Contrast: 4 February 2026, 17:00, \(d_t = 15.9\) bp; the previous 24 hours show no breach, but one of them is missing
      • an ambiguous onset: the missing hour could have been a breach, so this hour is not counted as an episode

    Peg Deviations, Daily, 2021–2026

    Slide 14 in the PDF

    The table describes the daily deviations (5.1) of USDT, USDC and DAI from one dollar, on 2,122 daily closes from 2021 to October 2026, from aggregated EODHD prices; earlier years are excluded because the aggregate then included illiquid venues. The columns give, in bp, the mean, the standard deviation (sd), the 1% and 99% quantiles, the lowest close with its date, the percentage of days with \(|d| \geq 15\) and \(|d| \geq 50\), and the lowest intraday low. The last two columns give the excess kurtosis, which is 0 for the Normal distribution and grows with the weight of the tails, and \(\hat\rho_1\), the correlation of a day's deviation with the previous day's (lag-1 autocorrelation).

    The means lie within ±0.5 bp for all three coins: the peg holds on average, and the risk is in the tails. USDC has an excess kurtosis of 1,045: its distribution is dominated by one weekend, SVB, with a lowest close of −285 bp on 11 March 2023. At the same time its 1% quantile, −7.6 bp, is the closest to zero of the three coins. A quantile and a kurtosis describe different parts of the distribution, and a coin can look safe on one and risky on the other.

    USDT has the smallest extreme, a lowest close of −41 bp on 11 May 2022, during the collapse of TerraUSD, but the most persistent deviations: \(\hat\rho_1 = 0.73\), so a deviation today is largely still there tomorrow. It is beyond 15 bp on 3.6% of days. DAI is beyond 15 bp on 5.2% of days, the most of the three.

    The lowest intraday prices are about 4 to 12 times deeper than the worst closes: −515 bp against −41 bp for USDT, −1,226 against −285 for USDC, −1,030 against −261 for DAI. Whether a liquidation used such a price depends on the price feed (oracle) of the lending protocol, which may read a close, an average or a single venue.

    In brief

    bpmeansd\(q_{0.01}\)\(q_{0.99}\)min (date)% \(|d| \geq 15\)% \(|d| \geq 50\)min lowex. kurt\(\hat\rho_1\)
    USDT\(0.5\)\(7.3\)\(-15.5\)\(21.3\)\(-41\) (11 May 22)\(3.6\)\(0.14\)\(-515\)\(40\)\(0.73\)
    USDC\(-0.2\)\(7.4\)\(-7.6\)\(9.7\)\(-285\) (11 Mar 23)\(0.7\)\(0.14\)\(-1226\)\(1045\)\(0.29\)
    DAI\(0.4\)\(10.8\)\(-17.2\)\(36.6\)\(-261\) (11 Mar 23)\(5.2\)\(0.57\)\(-1030\)\(185\)\(0.34\)
    • 2 122 daily closes, EODHD aggregated prices; earlier years are excluded because the aggregate includes illiquid venues
    • Means lie within \(\pm 0.5\) bp: the peg holds on average; the risk is in the tails
    • USDC: excess kurtosis 1 045 (0 for the Normal distribution); one weekend dominates; its 1% quantile (\(-7.6\) bp) is the closest to zero of the three
    • USDT: smallest extreme, but most persistent (lag-1 autocorrelation \(\hat\rho_1 = 0.73\)) and most often beyond 15 bp after 2022
    • The lowest reported intraday prices are about 4 to 12 times deeper than the worst closes; whether a liquidation used them depends on the protocol's price oracle
    • Source: own computation on EODHD daily closes and intraday lows of USDT, USDC and DAI, 2021 – 23 October 2026

    Duration of Peg Deviations

    Slide 15 in the PDF

    The table gave the lag-1 autocorrelation \(\hat\rho_1\); the chart extends it to lags of 1 to 30 days. The autocorrelation \(\hat\rho_k\) is the correlation between the deviation on one day and the deviation \(k\) days later. The shaded band, \(\pm 1.96/\sqrt{T} = \pm 0.043\) with \(T = 2{,}122\) days, marks the values that do not differ from zero at the 5% level.

    The three coins behave very differently. For USDC, \(\hat\rho_1 = 0.29\) and \(\hat\rho_2 = 0.09\): a deviation is mostly gone after a day or two, which is what fast arbitrage produces. For DAI, \(\hat\rho_1 = 0.34\), followed by a long plateau near 0.2 up to 30 days. For USDT, \(\hat\rho_1 = 0.73\), \(\hat\rho_7 = 0.45\) and \(\hat\rho_{30} = 0.25\): a discount of USDT is still visible weeks later.

    The shape of the USDT curve says more than its first value. If the deviation followed a first-order autoregression, AR(1), with \(\rho = 0.73\), it would halve in \(\ln 0.5 / \ln 0.73 = 2.2\) days, and its autocorrelation at 30 days would be \(0.73^{30} \approx 0.0001\). The observed 0.25 is far above that. The slow decay points to shifts in the level around which USDT trades, lasting weeks or months, rather than to one fast-reverting process; the last section of the lecture shows such a period, with USDT a few basis points below the dollar from August to October 2026.

    In brief

    Duration of Peg Deviations
    • Autocorrelation \(\hat\rho_k\) of the daily close deviation at lags of 1 to 30 days; the band \(\pm 1.96/\sqrt{T} = \pm 0.043\) (\(T = 2\,122\) days) marks no autocorrelation at the 5% level
    • USDT: \(\hat\rho_1 = 0.73\), \(\hat\rho_7 = 0.45\), \(\hat\rho_{30} = 0.25\): a discount lasts for weeks
    • USDC: \(\hat\rho_1 = 0.29\), \(\hat\rho_2 = 0.09\): a deviation closes within a day or two
    • DAI: \(\hat\rho_1 = 0.34\), then a plateau near 0.2 up to 30 days
    • An AR(1) with \(\rho = 0.73\) has a half-life of \(\ln 0.5/\ln 0.73 = 2.2\) days and \(\rho^{30} \approx 0.0001\); the observed 0.25 at 30 days points to slow shifts in the level of USDT
    • Source: own computation on EODHD daily closes of USDT, USDC and DAI, 2021 – 23 October 2026
    BA_L5_acf

    Daily Peg Deviations of Three Stablecoins

    Slide 16 in the PDF
      Question for the room With δ = 15 bp, DAI closes beyond ±δ on 5.2% of days, USDT on 3.6% and USDC on 0.7%. The ▶ button raises δ to 100 bp. At δ = 50 bp, which coin has the largest share of closes beyond ±δ?
      Answer

      DAI, with 0.57% of days (12 of 2,122). USDT and USDC are beyond 50 bp on 0.14% of days each (3 days). USDT is the coin most often beyond 15 bp, but its deviations are small and persistent; USDC has the deepest close (−285 bp on 11 March 2023), but only on a few days. How often a coin breaches a threshold depends on the threshold: the ranking at 15 bp does not carry over to 50 bp.

      The chart has one panel per coin, with the daily close in colour and the intraday low in red, both in bp, from 2021 to October 2026; the dotted lines mark ±15 bp, and the lows are cut at −150 bp so that the panels stay readable. Most of the time the closes stay inside ±15 bp.

      The lows reveal the stress days that the closes hide. Two dates stand out across coins: May 2022, when TerraUSD collapsed, and March 2023, the SVB weekend, when the USDC and DAI closes themselves fall far below the band. The DAI panel also shows a long period of frequent deviations in 2021 and of deep lows until early 2024, followed by a much calmer series.

      In brief

      • Closes stay inside \(\pm 15\) bp most of the time; the lows (red) reveal the stress days: May 2022 (Terra), March 2023 (SVB)
      BA_L5_dev_daily

      Tails and Their Frequency

      Slide 17 in the PDF
        Question for the room With x = 15 bp, DAI was beyond on 26.6% of days in 2021 and on 0.3% in 2026; USDT on 8.2% and 3.0%. The ▶ button raises x. With x = 25 bp, how many of the three coins have at least one close beyond x in 2026?
        Answer

        None. In 2026 (to 23 October) no close of USDT, USDC or DAI is 25 bp or more from 1 USD; at 20 bp only USDT has any (0.34% of days). The tails are heavy over 2021–2026 as a whole, because of 2021, May 2022 and March 2023; in 2026 the deviations are small. A heavy tail of the full sample does not mean that large deviations occur every year.

        The left panel plots the exceedance probability (5.2) against the threshold \(x\), for closes (solid lines) and intraday lows (dashed lines), with both axes on log scales. On such a chart, a distribution whose tail decays like a power, \(P(|d| \geq x) \propto x^{-a}\), appears as a straight line. The curves decay slowly beyond 15 bp, the dotted red line: the tails are heavy, as found for returns in Lecture 2. Calling them a power law would need an explicit estimate of the tail index and a test, which the chart does not provide.

        The right panel shows, for each year, the percentage of days on which the close was at least 15 bp away from one dollar. The pattern changes over time. DAI was beyond 15 bp on 26.6% of days in 2021 and on 0.3% of days in 2026; USDC has had no such day since 2023. USDT is the only coin that still breaches regularly, on 3.0% of days in 2026.

        In brief

        • Left: on a log-log scale the exceedance curves decay slowly beyond 15 bp: heavy tails (Lecture 2); a power law would need an explicit tail-index estimate and test
        • Right: DAI was beyond 15 bp on 26.6% of days in 2021, 0.3% in 2026; USDT is the only one still breaching regularly (3.0% in 2026)
        BA_L5_exceed

        Rolling 1% VaR of Peg Deviations

        Slide 18 in the PDF
          Question for the room With a window of 365 days the VaR 1% of USDC stays at 12.0 bp for a year after the SVB weekend. The ▶ button changes the window length W. With W = 90 days, what is the highest VaR 1% of USDC after the SVB weekend?
          Answer

          About 102 bp, on 12 March 2023, and it stays at 50 bp or more for 89 days. With 90 days the 1% quantile lies at position (90 − 1) × 0.01 = 0.89 between the lowest close (−285 bp) and the second lowest (−79.3 bp): −285 + 0.89 × 205.7 = −101.9 bp. With 365 days it lies between the 4th and 5th lowest, which is why one extreme day hardly moves it. A short window reacts strongly to a single day and forgets it after W days; a long window barely sees it.

          A single VaR for the whole sample hides how the tail changes over time. The chart recomputes the value-at-risk of Lecture 4, VaR 1% \(= -q_{0.01}\), the negative of the 1% quantile of the daily close deviation, written as a positive loss in basis points, over the previous 365 days for each day from January 2022. On the full sample 2021–2026 the values are 15.5 bp for USDT, 7.6 bp for USDC and 17.2 bp for DAI.

          The rolling values move a lot, and in different directions. USDT is the only coin whose tail widened: its VaR 1% rose from 5.6 bp in April 2022 to 18.6 bp on 1 January 2025 and stands at 16.2 bp on 23 October 2026. USDC stayed at 12.0 bp for a year after the SVB weekend and is at 4.2 bp now. DAI went the other way: 36.2 bp at the start of 2022, 3.5 bp in January 2025, and 10.0 bp now.

          The steps in the lines come from the estimator. With 365 observations, the 1% quantile lies between the 4th and 5th lowest close, so the estimate changes only when one of the few lowest days enters or leaves the window. A rolling VaR is a summary of a handful of days, which is one more reason to look at episodes and their frequency rather than at one quantile.

          In brief

          • VaR 1% \(= -q_{0.01}\) of the daily close deviation over the previous 365 days, a positive loss in bp (Lecture 4); full sample 2021–2026: USDT 15.5, USDC 7.6, DAI 17.2 bp
          • USDT: from 5.6 bp (April 2022) to 18.6 bp (1 January 2025); 16.2 bp on 23 October 2026: the only coin whose tail widened
          • USDC: 12.0 bp for a year after SVB, 4.2 bp now; DAI: 36.2 bp at the start of 2022, 3.5 bp in January 2025, 10.0 bp now
          • With 365 days, the 1% quantile lies between the 4th and 5th lowest close: the line moves in steps when single days enter or leave the window
          • Source: own computation on EODHD daily closes of USDT, USDC and DAI, 2021 – 23 October 2026
          BA_L5_rollvar

          The SVB Weekend, Hour by Hour

          Slide 19 in the PDF
            Question for the room USDC reached −1,036 bp at 07:00 UTC on Saturday 11 March 2023, 211 bp below its zero-recovery value of −825 bp. For how many hours of the weekend was the hourly close of USDC below the zero-recovery value?
            Answer

            For 8 hours, all on Saturday 11 March between 06:00 and 14:00 UTC (at 08:00 it was −771 bp). From 15:00 UTC on Saturday the price stayed above the value that a total loss of the SVB deposit implies, although it returned above −100 bp only at 22:00 UTC on Sunday 12 March and above −15 bp at 14:00 UTC on Monday 13 March. With a recovery rate R = 0.5 the value is −412 bp, and USDC was below it for 22 hours.

            In March 2023 Silicon Valley Bank (SVB) failed, and Circle, the issuer of USDC, disclosed that 3.3 billion USD of its reserves were deposited there. The chart follows the hourly deviations of USDC, DAI and USDT from one dollar, and the price of USDC in USDT (dashed red line), from 8 to 18 March.

            USDC reached its lowest hourly value, −1,036 bp, at 07:00 UTC on Saturday 11 March; DAI reached −955 bp in the same hour. USDT moved the other way and traded above one dollar: holders who left USDC moved to the other dollar token. USDC returned above −100 bp at 22:00 UTC on Sunday 12 March, just before the US Federal Reserve (Fed), the Federal Deposit Insurance Corporation (FDIC) and the Treasury announced a backstop for SVB's depositors, and above −15 bp only at 14:00 UTC on Monday 13 March.

            DAI followed USDC almost one for one because a large part of its collateral was USDC. A loss on one stablecoin's reserves therefore passed to a second stablecoin through its balance sheet, a form of contagion.

            In brief

            • Hourly minimum: USDC \(-1\,036\) bp and DAI \(-955\) bp, both at 07:00 Coordinated Universal Time (UTC) on Saturday 11 March 2023; USDT rose above 1 (flight to the other dollar)
            • USDC back above \(-100\) bp at 22:00 UTC on 12 March, just before the backstop; above \(-15\) bp only on 13 March, 14:00 UTC
            • DAI followed USDC because a large part of its collateral was USDC: contagion through the balance sheet
            • Source: own computation on EODHD hourly prices of USDC, USDT and DAI, March 2023
            BA_L5_svb

            Worked Example: the SVB Discount and Reserve Losses

            Slide 20 in the PDF

            A simple calculation asks whether the reserve loss alone explains the fall of USDC. Circle disclosed 3.3 billion USD of about 40 billion USD of reserves at SVB, a share \(s = 3.3/40 = 8.25\%\). If a fraction \(R\) of the SVB deposit is recovered (the recovery rate), the reserves behind each token are worth, in USD,

            \[V(R) = 1 - s\,(1 - R)\]
            (5.3)

            Even with zero recovery, \(V(0) = 1 - 0.0825 = 0.9175\), a deviation of −825 bp. The market reached −1,036 bp, 211 bp below the value under zero recovery, the worst possible outcome for the SVB deposit.

            These 211 bp are the part of the discount that this reserve-loss scenario does not explain; they are not an estimate of a liquidity premium. Several components are possible, and the calculation does not separate them. Time: banks were closed over the weekend, so nobody could redeem at par. Uncertainty: about the size of the loss and about the issuer's other reserve holdings. Frictions: limited arbitrage capital, the restriction of redemption to approved clients, and trading spread over many venues. A peg can therefore fail even when the reserves cover 92% or more of the tokens: access to redemption matters as much as the backing.

            In brief

            • Circle disclosed 3.3 bn USD of about 40 bn USD reserves at SVB: share \(s = 3.3/40 = 8.25\%\)
            • With recovery rate \(R\) on the SVB deposit, the redemption value per token is
              \[ V(R) = 1 - s\,(1 - R), \qquad V(0) = 0.9175 \;\Rightarrow\; d = -825 \text{ bp} \]
            • The market reached \(-1\,036\) bp, 211 bp below the value under zero recovery
            • The 211 bp are the discount unexplained by this reserve-loss scenario, not an estimate of a liquidity premium
            • Possible components, not separated by this calculation
              • time: banks were closed over the weekend, so redemption at par was impossible
              • uncertainty: about the size of the loss and about the other reserve holdings
              • frictions: arbitrage capital, client access to redemption, fragmented venues
            • A peg can fail with reserves that cover 92% or more: access matters as well as backing

            Section summary

            Peg deviations average within half a basis point but have heavy tails, and their intraday lows are several times deeper than their closes. The SVB weekend shows the three dimensions of a depeg, depth, duration and timing, and a discount larger than the reserve loss alone can explain.

            Automated Market Makers and Price Formation

            On a blockchain, stablecoins are traded mostly in automated market makers (AMMs): smart contracts that hold two or more tokens and quote a price from a fixed formula, the invariant, instead of an order book. The section compares the constant-product rule with the StableSwap rule used for stablecoins, and shows why the price in such a pool can stay flat while the pool is running out of one token.

            Constant-Product AMM

            Slide 21 in the PDF

            A constant-product pool holds an amount \(x\) of token X and \(y\) of token Y, and every trade must keep the product of the two balances fixed, \(x\,y = k\). The marginal price of X in units of Y is \(p = y/x\). A trader who sells \(\Delta x\) of X to the pool raises the balance of X to \(x + \Delta x\), and the pool pays out enough Y to keep the product at \(k\):

            \[\Delta y = y - \frac{k}{x + \Delta x} = \frac{y\,\Delta x}{x + \Delta x}, \qquad \text{slippage} = 1 - \frac{\Delta y}{\Delta x} = \frac{\Delta x}{x + \Delta x} \quad (p = 1)\]
            (5.4)

            The slippage is the percentage by which the trader receives less than the marginal price before the trade; the second formula holds for a pool that starts at price 1.

            In the worked example the pool holds 10 million X and 10 million Y, and a trader sells 1 million X. The pool pays \(\Delta y = 10 \times 1/11 = 0.909\) million Y, a slippage of 9.1%. For two tokens that should both be worth one dollar, a loss of 9.1% on a trade of one tenth of the pool is very large. The constant-product rule spreads liquidity over all prices from 0 to infinity, so it never runs out of either token, but most of that liquidity sits at prices that a stable pair should never reach.

            In brief

            • A pool holds \(x\) of token X and \(y\) of token Y; trades keep the invariant \(x\,y = k\)
            • Marginal price of X in Y: \(p = y/x\). Selling \(\Delta x\) returns
              \[ \Delta y = y - \frac{k}{x + \Delta x} = \frac{y\,\Delta x}{x + \Delta x}, \qquad \text{slippage} = 1 - \frac{\Delta y}{\Delta x} = \frac{\Delta x}{x + \Delta x}\;\; (p = 1) \]
            • Worked example: pool 10 m X + 10 m Y, sell 1 m X
              \[ \Delta y = \frac{10 \cdot 1}{11} = 0.909 \text{ m}, \qquad \text{slippage } 9.1\% \]
            • Liquidity is spread over all prices from 0 to \(\infty\): robust but very expensive for stable pairs

            StableSwap (Curve): the Invariant near Parity

            Slide 22 in the PDF

            The StableSwap invariant of Egorov (2019), used by the exchange Curve, combines a constant sum with a constant product. For \(n\) coins with balances \(x_i\) and an amplification parameter \(A\),

            \[A\,n^n \sum_i x_i + D = A\,D\,n^n + \frac{D^{n+1}}{n^n \prod_i x_i}\]
            (5.5)

            where \(D\) is the total balance of the pool when it is balanced at price 1, that is when every \(x_i = D/n\). The parameter \(A\) moves the curve between two extremes. As \(A \to 0\) the invariant becomes the constant product; as \(A \to \infty\) it becomes the constant sum \(x + y = D\), where the price is exactly 1 whatever the balances.

            The table gives the average slippage of a sale of X into a pool of 10 million X and 10 million Y, for the constant product and for StableSwap with \(A = 10\), 100 and 2,000, computed from the two invariants. For a sale of 1 million X the slippage is 9.09% under the constant product, 0.48% with \(A = 10\), 0.05% with \(A = 100\) and 0.003% with \(A = 2{,}000\): near balance StableSwap is thousands of times cheaper. The advantage shrinks as the sale grows. For a sale of 9.5 million, which almost empties the pool of Y, the slippage with \(A = 100\) is 2.94%, nearly sixty times its value for a sale of 1 million.

            In brief

            • Invariant for \(n\) coins, amplification \(A\) (Egorov (2019)):
              \[ A\,n^n \sum_i x_i + D = A\,D\,n^n + \frac{D^{n+1}}{n^n \prod_i x_i} \]
              • \(x_i\): balance of coin \(i\); \(D\): total balance when the pool is balanced at price 1 (\(x_i = D/n\))
              • \(A \to 0\): constant product; \(A \to \infty\): constant sum (\(x + y = D\), price exactly 1)
            Sale of X (pool 10 m + 10 m)constant product\(A = 10\)\(A = 100\)\(A = 2000\)
            0.1 m0.99%0.048%0.005%0.000%
            1 m9.09%0.48%0.05%0.003%
            5 m33.3%2.95%0.33%0.017%
            8 m44.4%7.22%1.04%0.055%
            9.5 m48.7%11.6%2.94%0.232%
            • Average slippage: StableSwap is thousands of times cheaper near balance, but slippage rises steeply when the pool empties of one coin
            • Source: own computation from the constant-product and StableSwap invariants; no market data

            Price Response of an AMM Pool to Imbalance

            Slide 23 in the PDF
              Question for the room In a StableSwap pool with A = 2000 the price of X is 0.997 when X is 90% of the pool. As the share of X grows, where does the price of X first fall below 0.99?
              Answer

              Between 90% and 95% of the pool: the price is 0.9914 at 94.0% and 0.9898 at 94.5%. With A = 100 it falls below 0.99 already at about 76%, with A = 10 at about 55%; in a constant-product pool any imbalance moves the price (0.99 at a share of 50.3%). A high amplification keeps the price near 1 until the pool is almost one-sided: the price says little about the stress, the composition says much more.

              The left panel plots the marginal price of X against the share of X in the pool, for the constant product (red) and for StableSwap with three values of \(A\). Under the constant product the price falls steadily as X accumulates. Under StableSwap the curve is almost flat over a wide middle range and turns down only near the right edge, when the pool holds almost nothing but X. The right panel shows the average slippage of a sale of X, on a log scale, against its size.

              With \(A = 100\) the price of X is 0.986 when X makes up 80% of the pool, 0.943 at 90% and 0.807 at 95%. With \(A = 2{,}000\) it is 0.999, 0.997 and 0.988 at the same shares. A pool with high amplification absorbs a large one-sided flow with almost no change in price.

              This has a direct consequence for monitoring. When holders sell one stablecoin into the pool, its price hardly moves until the pool is nearly one-sided, and then it falls quickly. The price hides the stress until late; the composition of the pool, the share of each token, shows it much earlier. This is the idea behind the on-chain early-warning features of the next section.

              In brief

              • With \(A = 100\) the price of X is 0.986 when X is 80% of the pool, 0.943 at 90%, 0.807 at 95%; with \(A = 2000\): 0.999, 0.997, 0.988
              • The pool absorbs one-sided flow with almost no price change, so the price hides the stress; the composition shows it
              BA_L5_amm

              Section summary

              Automated market makers quote prices from an invariant. The StableSwap invariant keeps the price of a stable pair flat over a wide range of pool balances, which makes trading cheap but also hides one-sided flows: the pool composition shows stress before the price does.

              Early Warning

              An early-warning system turns data into an alarm that should ring before a depeg, not during it. The section sets up the prediction problem, shows how the choice of the threshold changes the number of events, what the episodes look like, how often they come and what the price shows before them, explains why the usual classification metrics are the wrong yardstick for an alarm, compares the results of the paper with a price-only alarm, and asks what five test events can tell.

              Early-Warning Set-up Based on Pool State

              Slide 24 in the PDF

              Each hour \(t\), a vector of features \(\mathbf x_t\) is computed from data available up to hour \(t\) only. Three examples show the idea. The balance of the Curve 3pool, a StableSwap pool of DAI, USDC and USDT, is summarised by the entropy of the three shares, which equals \(\ln 3 = 1.0986\) when the pool is balanced and falls as it becomes one-sided (Appendix). The depth of the Uniswap V3 pool is measured by the liquidity available within a few price steps (ticks) of the current price. The recent deviation enters as \(|d_t|\) and as its maximum over the last 24 hours.

              The event to predict is a breach, \(|d_{t+h}| \geq 15\) bp at some hour \(h\) within the next 24 hours, which defines the label \(y_t \in \{0, 1\}\). The data are split in time order: the models are fitted on the early years, the alert threshold is chosen on a later validation year, and the results are reported once, on a final test period that was not used for any choice.

              Two metrics appear in the results. Precision is the share of alerted hours that are followed by a breach; recall is the share of positive hours, those followed by a breach, that are alerted. Lowering the alert threshold raises recall and usually lowers precision. The area under the precision–recall curve (AUPRC) summarises this trade-off over all thresholds: a random score obtains the base rate, the share of positive hours (5.9% in the paper), and a perfect score obtains 1. The paper uses further features (Gegenbauer scores of the liquidity curve, ownership of liquidity positions, data from the lending protocol Aave) that summarise the same pools; they are defined in the Appendix.

              In brief

              • Each hour \(t\), features \(\mathbf x_t\) are computed from data up to \(t\) only; three examples
                • Curve 3pool balance: entropy of the DAI/USDC/USDT shares (\(\ln 3 = 1.0986\) when balanced)
                • Uniswap V3 depth: liquidity within a few ticks of the current price
                • recent deviation: \(|d_t|\) and its maximum over the last 24 hours
              • Event: a breach \(|d_{t+h}| \geq 15\) bp within the next 24 hours gives the label \(y_t \in \{0, 1\}\)
              • Time order: fit on the early years, choose the alert threshold on a later validation year, report once on the final test period
              • Metrics, before the results
                • precision: share of alerted hours that are followed by a breach; recall: share of positive hours that are alerted
                • AUPRC: area under the precision–recall curve over all thresholds; a random score gets the base rate (5.9% in the paper), a perfect one 1
              • The other features (Gegenbauer scores, ownership, Aave) summarise the same pools; definitions in the appendix

              Data and Target in the Paper

              Slide 25 in the PDF

              Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026) study the Uniswap V3 pool of USDC and USDT with a fee of 0.01%, hourly from January 2022 to May 2026, 38,045 observations. Their features come in blocks: the pool price and flows; the shares and entropy of the Curve 3pool; curves of the price impact of swaps; Gegenbauer scores of the liquidity curve; the ownership of liquidity, including the share of just-in-time (JIT) liquidity, the Herfindahl–Hirschman index (HHI) of providers, and the width and age of positions; utilisation, interest rates and liquidations on Aave; the volatility of Bitcoin (BTC) and Ether (ETH); a USD index from the price-feed network Chainlink; and the crypto fear and greed index.

              The target is a breach of \(\delta = 15\) bp within the next 24 hours:

              \[y_t = \mathbb{1}\Big\{\max_{1 \leq h \leq 24} |d_{t+h}| \geq \delta\Big\}\]
              (5.6)

              Labels and events must be kept apart. In the paper's pool data, 2,227 hours (5.9%) are positive, but they belong to only 107 events, because every hour in the 24 hours before a breach, and inside a long breach, carries a label of 1. In the EODHD cross rate of USDC in USDT from January 2022 to October 2026, 2,291 hours (7.1%) are positive, and they belong to 30 episodes. The number of events also depends on where the price is read: a single pool breaches the threshold more often than a price aggregated over many venues, 107 events against 30, although the periods differ as well.

              In brief

              • Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026): Uniswap V3 USDC/USDT pool (0.01% fee), hourly, January 2022 – May 2026, 38 045 observations
              • Feature blocks: pool price and flows; Curve 3pool shares and entropy; swap-impact curves; Gegenbauer scores; ownership (JIT share, Herfindahl–Hirschman index (HHI), width, age of positions); Aave utilisation, rates, liquidations; BTC/ETH volatility; a USD index from Chainlink; fear and greed index
              • Target: a breach of \(\delta = 15\) bp within the next 24 hours
                \[ y_t = \mathbb 1\Big\{\max_{1 \leq h \leq 24} |d_{t+h}| \geq \delta\Big\} \]
              • Labels are not events: every hour in the 24 hours before a breach, and inside it, is labelled 1
                • Uniswap V3 pool in the paper: 2 227 positive hours (5.9%) but only 107 events
                • EODHD cross rate USDC/USDT, Jan 2022 – Oct 2026: 2 291 positive hours (7.1%), 30 episodes
              • The event count depends on where the price is read: one pool breaches more often than a price aggregated over venues (107 vs 30 events; the periods also differ)

              Episodes by Threshold

              Slide 26 in the PDF

              The table counts episodes of the USDC price in USDT, from hourly EODHD prices between January 2022 and 23 October 2026, for four thresholds \(\delta\). In these data 2.8% of hours are missing. For each threshold it gives the number of episodes (a breach hour after 24 observed quiet hours), the number of ambiguous breaches (no breach observed in the previous 24 hours, but some of those hours missing, so not counted as episodes), the total number of breach hours, and the episodes per year.

              At 10 bp there are 98 episodes and 4,282 breach hours; at 15 bp there are 30 episodes, about 70% fewer; at 25 bp there are 5 and at 50 bp only 2. Most episodes at 15 bp fall in 2022 (13) and 2024 (9).

              The threshold is a policy choice, not a statistical one. A low \(\delta\) gives many events, most of them harmless; a high \(\delta\) gives so few events that a model can neither learn from them nor be tested on them. With 5 episodes beyond 25 bp in almost five years, any evaluation at that threshold would rest on a handful of cases.

              In brief

              \(\delta\) (bp)episodesambiguousbreach hours20222023202420252026
              1098214 282307311119
              1530201 044133914
              255335831100
              502110511000
              • Episode: breach hour after 24 observed quiet hours; ambiguous: no breach observed in the previous 24 hours, but some of them missing (not counted)
              • From 10 to 15 bp the number of episodes falls by about 70% (98 to 30); at 25 bp or more there are only 5
              • The threshold is a policy choice: low \(\delta\) gives many, mostly harmless events; high \(\delta\) leaves too few events to learn or to test
              • Source: own computation on EODHD hourly prices of USDC and USDT, January 2022 – 23 October 2026; 2.8% of hours missing

              Duration and Depth of Episodes

              Slide 27 in the PDF
                Question for the room At δ = 15 bp there are 30 episodes; 15 last one hour and the median duration is 1.5 hours. The ▶ button raises δ. At δ = 25 bp, how many episodes are there, and what is their median duration?
                Answer

                5 episodes, with a median duration of 7 hours; 2 of them last more than a day. A higher threshold keeps fewer, longer and deeper events: the median peak is 33.6 bp, against 16.6 bp at 15 bp. At 50 bp only 2 episodes remain, the FTX collapse (November 2022) and the SVB weekend (March 2023). An episode beyond 25 bp has also crossed 15 bp, but at 15 bp it is counted inside a longer episode that started earlier.

                Counting episodes says how often the peg breaks; the chart describes what each break looks like. For each of the 30 episodes at 15 bp it measures the duration, the hours from the first breach hour to the last breach hour before 24 hours without a breach, and the peak, the largest \(|d_t|\) in between. The left panel plots peak against duration on logarithmic scales, coloured by the year in which the episode starts; the right panel counts episodes by duration.

                Most episodes are brief and shallow. Fifteen of the 30 last a single hour and 18 last at most 6 hours, for a median duration of 1.5 hours. The median peak is 16.6 bp, barely above the threshold, and 27 of the 30 episodes peak below 25 bp.

                Two episodes are of another kind. After the collapse of the FTX crypto exchange in November 2022 the cross rate stayed beyond 15 bp, on and off, for 135 hours, with a peak of 182 bp; during the SVB weekend of March 2023 the episode lasted 335 hours, with a peak of 1,091 bp. Across all episodes, longer ones go deeper: the Spearman rank correlation between duration and peak is 0.57. The distribution of episodes is therefore as heavy-tailed as the distribution of deviations: many harmless blips and a few events that matter.

                In brief

                • The 30 episodes at 15 bp; duration: hours from the first to the last breach hour before 24 hours without a breach
                • 15 of 30 episodes last one hour, 18 at most 6 hours; median duration 1.5 hours; median peak \(|d_t|\) 16.6 bp; 27 of 30 peak below 25 bp
                • Two exceptions: the collapse of the FTX exchange, November 2022 (135 hours, peak 182 bp), and SVB, March 2023 (335 hours, peak 1 091 bp)
                • Longer episodes go deeper: Spearman rank correlation of duration and peak 0.57
                • Source: own computation on EODHD hourly prices of USDC and USDT, January 2022 – 23 October 2026
                BA_L5_episodes

                Worked Example: Waiting Times from Episode Frequencies

                Slide 28 in the PDF

                Frequencies become more useful when they are turned into waiting times. On daily closes from 2021 to 2026, USDT was beyond 15 bp on 3.6% of days, which corresponds to \(0.036 \times 365 = 13\) days a year. It was beyond 50 bp on 0.14% of days, 3 of 2,122, which corresponds to once every \(1/(0.00141 \times 365) = 1.9\) years.

                For the hourly cross rate the natural unit is the episode. There were 30 episodes in 4.81 years, a rate of \(\lambda = 30/4.81 = 6.2\) a year, or one every \(365/6.2 = 59\) days on average. If episodes arrived independently at a constant rate (a Poisson process), the number in a month would be Poisson with mean \(6.2/12 = 0.52\), and the probability of at least one episode in a month would be \(1 - e^{-0.52} = 0.41\).

                The data do not support a constant rate. The median gap between consecutive episodes is 25 days, well below the 59 days of the average, and 7 of the 29 gaps are shorter than a week; at the same time only 5 of the 30 episodes fall in 2025 and 2026. Episodes cluster in stress years, as volatility clusters in Lecture 4. A constant rate therefore overstates risk in calm years and understates it in stress years, and a monitoring system should let the expected rate depend on current conditions.

                In brief

                • Daily closes, 2021–2026: USDT beyond 15 bp on 3.6% of days, so \(0.036 \times 365 = 13\) days a year
                  • beyond 50 bp on 0.14% of days (3 of 2 122): once every \(1/(0.00141 \times 365) = 1.9\) years
                • Hourly USDC/USDT: 30 episodes in 4.81 years, a rate \(\lambda = 30/4.81 = 6.2\) a year, one every \(365/6.2 = 59\) days
                • If episodes arrived independently at this rate (a Poisson process),
                  \[ P(\text{at least one episode in a month}) = 1 - e^{-6.2/12} = 1 - e^{-0.52} = 0.41 \]
                • The data disagree with a constant rate
                  • median gap between episodes 25 days; 7 of the 29 gaps are shorter than a week
                  • only 5 of the 30 episodes fall in 2025–2026: episodes cluster in stress years
                • A constant rate overstates risk in calm years and understates it in stress years

                Price Behaviour before an Episode

                Slide 29 in the PDF

                Before building an alarm it is worth asking what the price itself shows before a breach. The chart aligns the 30 episodes on their first breach hour, hour 0, and shows \(|d_t|\) of USDC priced in USDT for the 48 hours before: the line is the median across episodes, the band the interquartile range, the dashed line the median over all hours (3.2 bp), and the shaded area the warning window from 24 hours to 1 hour before the breach, in which an alert counts as a warning.

                The price is not quiet before a breach. Twenty-four hours ahead, the median deviation is 7.9 bp, more than twice its usual level; in the last hours it rises, to 11.1 bp one hour before the breach. In 25 of the 30 episodes, \(|d_t|\) reached 10 bp or more somewhere in the warning window.

                This suggests that a simple price rule could see many episodes coming, and the next frames test it. The difficulty is the other side of the ledger: deviations of 10 to 14 bp are also common when no breach follows. In October 2026, for example, the cross rate was above 10 bp in 206 hours and never reached 15 bp. Every such hour is a potential false alert, which is why the false-alert budget, not the detection of events, turns out to be the binding constraint for price-only alarms.

                In brief

                Price Behaviour before an Episode
                • \(|d_t|\) of USDC priced in USDT in the 48 hours before the first breach hour of each of the 30 episodes; median over all hours: 3.2 bp
                • Median 24 hours before the breach: 7.9 bp, more than twice the typical level; 1 hour before: 11.1 bp
                • In 25 of 30 episodes \(|d_t|\) reached 10 bp or more somewhere in the warning window \([-24\,\text{h}, -1\,\text{h}]\)
                • A price rule can see many episodes coming, but 10–14 bp is also common without any breach (October 2026: 206 hours above 10 bp, none above 15): hence the false alerts below
                • Source: own computation on EODHD hourly prices of USDC and USDT, January 2022 – 23 October 2026
                BA_L5_preevent

                Event-Level Evaluation of an Early-Warning Rule

                Slide 30 in the PDF

                The usual metrics of classification are computed row by row, hour by hour. The area under the receiver operating characteristic curve (AUC) is the probability that a randomly chosen positive hour gets a higher score than a randomly chosen negative hour; the AUPRC was defined above. Both reward a model for labelling hours correctly during an episode, when the deviation is already large and easy to see. An alert raised after the breach has begun is no warning, but it raises the AUC.

                The paper therefore evaluates the alarm at the level of events. An alert is an hour whose score is above a threshold; alerts closer than 24 hours (a refractory period) are merged into one alert episode. An event \(e\) that starts at time \(\tau_e\) is detected if an alert falls in the window from 24 hours to 1 hour before it, \([\tau_e - 24\text{h}, \tau_e - 1\text{h}]\), and its lead time \(\ell_e\) is the number of hours between the first valid alert and \(\tau_e\). All other alert episodes are false alerts, and \(F_m\) is their number per month.

                The two sides are combined in a utility:

                \[U = \frac{1}{|E|}\sum_{e \in E} v(\ell_e) - 0.05\,F_m, \qquad v(\ell) = 0.10 + 0.90\,\frac{\ell - 1}{23} \;\text{ for } 1 \leq \ell \leq 24, \text{ else } 0\]
                (5.7)

                where \(E\) is the set of events and \(|E|\) their number. A detected event earns between 0.10, for a lead of 1 hour, and 1, for a lead of 24 hours; a missed event earns 0; each false alert per month costs 0.05. The alert threshold is chosen on the preceding validation fold, to maximise \(U\) subject to at most 2 false alerts per month on validation. It is never re-tuned on the test fold, where \(F_m\) can therefore exceed 2.

                In brief

                • Row-level area under the receiver operating characteristic curve (AUC) and under the precision–recall curve (AUPRC) reward correct labels during an episode; an alert after the breach is no warning
                • Event-level protocol
                  • alerts: hours with score above a threshold; a 24-hour refractory period merges them into alert episodes
                  • event \(e\) at time \(\tau_e\) is detected if an alert falls in \([\tau_e - 24\text{h}, \tau_e - 1\text{h}]\); lead \(\ell_e\) = hours before \(\tau_e\)
                  • all other alert episodes are false; \(F_m\) = false alerts per month
                • Utility
                  \[ U = \frac{1}{|E|}\sum_{e \in E} v(\ell_e) - 0.05\,F_m, \qquad v(\ell) = 0.10 + 0.90\,\frac{\ell - 1}{23} \;\text{ for } 1 \leq \ell \leq 24, \text{ else } 0 \]
                • Alert threshold chosen on the preceding validation fold, maximising \(U\) subject to \(F_m \leq 2\) per month on validation; never re-tuned on the test fold, where \(F_m\) can exceed 2

                Worked Example: Computing the Utility

                Slide 31 in the PDF
                  Question for the room In the example U = 0.398 − 0.05 × 2.5 = 0.273. The ▶ button raises the false-alert rate Fm from 0 to 10 a month. At what rate of false alerts does U fall to zero?
                  Answer

                  At 7.96 false alerts a month: the mean credit of the four events, 0.398, divided by the cost of 0.05 per false alert a month. 0.273 / 0.05 = 5.46 is the number of false alerts a month that can be added to the 2.5 already counted. The budget of 2 false alerts a month is a constraint on the choice of the alert threshold, not the point where U changes sign.

                  The chart draws the credit \(v(\ell)\) of formula (5.7) against the lead time: zero for a lead below 1 hour, a jump to 0.10 at 1 hour, a straight rise to 1 at 24 hours, and zero again for alerts more than 24 hours ahead, which are too early to count as a warning of this event.

                  Consider four events. The first valid alerts come 14 hours, 2 hours, never, and 20 hours before the breach, and the alarm produces 2.5 false alerts per month. The credits are \(v(14) = 0.10 + 0.90 \times 13/23 = 0.609\), \(v(2) = 0.139\), 0 for the missed event and \(v(20) = 0.843\). Their mean is \(\bar v = 0.398\), and the utility is \(U = 0.398 - 0.05 \times 2.5 = 0.273\).

                  The weights have a simple reading. One more false alert per month costs 0.05 of utility, about the value of detecting one extra event out of four with a 2-hour lead. A user who finds false alerts more or less costly than this would choose a different penalty, and the ranking of alarms could change.

                  In brief

                  • Four events; first valid alerts 14 h, 2 h, none, 20 h before the breach; 2.5 false alerts per month
                    \[ v = (0.609,\; 0.139,\; 0,\; 0.843), \qquad \bar v = 0.398, \qquad U = 0.398 - 0.05 \cdot 2.5 = 0.273 \]
                  • One more false alert per month costs 0.05, about the value of detecting one extra event (out of four) with a 2-hour lead
                  BA_L5_utility

                  Results: Four Classifier Families

                  Slide 32 in the PDF
                    Question for the room CatBoost with α = 0.3 has the highest utility of the table, 0.303. For how many of the six values of α does CatBoost have a higher U than the other three families?
                    Answer

                    For 5 of the 6. At α = 0.5 the random forest is higher (0.233 against 0.149). XGBoost and LightGBM never have the highest U; LightGBM has a negative U for five of the six values. Overlapping 95% intervals of CatBoost and the random forest do not change the ranking of the point estimates; they show that the ranking is uncertain.

                    The chart reports the utility \(U\) with its 95% confidence interval (CI) on the test fold, for four families of classifiers built from decision trees, CatBoost, random forest, XGBoost and LightGBM, and for six values of \(\alpha\), the parameter of the Gegenbauer basis that summarises the liquidity curve (Appendix). Points above the horizontal line at zero are alarms whose credit for detected events exceeds the cost of their false alerts. CatBoost has the highest utility at five of the six values of \(\alpha\); XGBoost and LightGBM stay near or below zero at most values.

                    The table compares two models. CatBoost with \(\alpha = 0.3\) has \(U = 0.303\) (95% CI 0.229 to 0.381): it detects 72.3% of the test events, with a median lead of 14.4 hours and 2.50 false alerts per month; the budget of 2 per month was imposed on validation and is exceeded on the test fold. The random forest with \(\alpha = 0.1\) has the highest AUC, 0.901 against 0.862, and almost the same AUPRC, 0.239 against 0.241, but it detects only 41% of events and reaches \(U = 0.180\).

                    The comparison is the main lesson of the evaluation. Ranked by AUC, the random forest would be chosen; ranked by what an alarm is for, timely detection of events at an acceptable false-alert rate, CatBoost is clearly better. AUC is not the right criterion for choosing an alarm.

                    In brief

                    \(U\) [95% CI]recall\(F_m\)median lead (h)AUCAUPRC
                    CatBoost, \(\alpha = 0.3\)\(0.303\) [0.229, 0.381]\(0.723\)\(2.50\)\(14.4\)\(0.862\)\(0.241\)
                    Random forest, \(\alpha = 0.1\)\(0.180\) [0.118, 0.243]\(0.410\)\(0.97\)\(12.0\)\(0.901\)\(0.239\)
                    • Test fold: CatBoost detects 72% of events, 14 hours ahead, with 2.5 false alerts a month (the budget of 2 was imposed on validation); the random forest with the best AUC detects only 41%: AUC is not the right criterion
                    • Source: Chaffard et al. (2026), working paper, Table 1
                    BA_L5_paper_t1

                    A Price-Only Baseline

                    Slide 33 in the PDF

                    Can the price alone warn of a breach? To answer, the same alarm protocol is applied to the EODHD cross rate of USDC in USDT, with features built from prices only. The models are trained on 2022–2023; the alert threshold is chosen on 2024 subject to \(F_m \leq 2\); the test period runs from 2 January 2025 to 23 October 2026, with 24-hour gaps (embargoes) between the periods so that no label overlaps two of them. The features use prices only: \(d_t\) and \(|d_t|\), the 24-hour maximum and volatility of \(d\), the deviation from its weekly mean, the deviations of DAI and USDT from the dollar, and the 24-hour return and volatility of Bitcoin.

                    The table gives the results on the 5 test events. A logistic regression, a gradient-boosting model and a simple rule that alerts when \(|d_t| \geq k\), with \(k = 20\) bp chosen in 2024, detect none of the five. Their utilities are slightly negative, between −0.009 and −0.002, because they raise a few false alerts and no valid ones.

                    Their row-level scores look good nonetheless: AUC between 0.88 and 0.93 and AUPRC between 0.24 and 0.35, against a base rate of 1.5% positive hours. The high AUC comes from labelling hours inside episodes, where the deviation is already large. The threshold explains the zero recall: in 2024, every rule that detected events produced at least 2.6 false alerts a month, so the budget of 2 forced the threshold above the 15 bp that defines an event, and the alarm could fire only after the breach. The comparison with the paper is indirect, because the venue, the period and the number of events differ.

                    In brief

                    • Question: can the price alone warn of a breach? The same alarm protocol, on the EODHD cross rate USDC/USDT
                    • Time order: train 2022–2023, choose the threshold in 2024 (\(F_m \leq 2\)), test 2 Jan 2025 – 23 Oct 2026; 24-hour gaps (embargoes) so that no label spans two periods
                    • Features: \(d_t\), \(|d_t|\), 24 h max and volatility of \(d\), deviation from the weekly mean, DAI and USDT vs USD, BTC 24 h return and volatility
                    Test, 5 eventsdetectedrecalllead (h)\(F_m\)\(U\)AUCAUPRC
                    Logistic regression0\(0\)–\(0.09\)\(-0.005\)\(0.929\)\(0.238\)
                    Gradient boosting0\(0\)–\(0.05\)\(-0.002\)\(0.880\)\(0.267\)
                    Rule \(|d_t| \geq k\), \(k = 20\) chosen in 20240\(0\)–\(0.18\)\(-0.009\)\(0.915\)\(0.345\)
                    • AUC 0.88–0.93, yet no timely warning: high AUC comes from labelling hours inside episodes (base rate 1.5%)
                    • In 2024 every rule that detected events produced at least 2.6 false alerts a month, so the budget forced the threshold above 15 bp
                    • Comparison with the paper is indirect: venue, period and number of events differ
                    • Source: own computation on EODHD hourly prices of USDC, USDT, DAI and BTC, January 2022 – 23 October 2026

                    The Recall–False-Alert Trade-off

                    Slide 34 in the PDF
                      Question for the room On the test period the rule |dt| ≥ 11 bp detects 4 of the 5 events with 3.18 false alerts a month. The ▶ button raises k from 4 to 25 bp. At the smallest k that meets the budget of 2 false alerts a month on the test period, how many events does the rule detect?
                      Answer

                      3 of the 5, at k = 13 bp, with 1.29 false alerts a month and U = 0.340 (Clopper–Pearson 95% interval for the recall [0.15, 0.95]). At k = 12 bp the rule has 2.26 false alerts a month. This k is chosen with hindsight on the test data; the rule chosen on 2024 under the same budget is k = 20 bp, which detects none of the test events. At k = 15 bp, the event threshold itself, the rule detects nothing in time: it fires only once the breach has started.

                      The chart shows the trade-off that the budget cuts through. Each curve plots the share of test events detected in time (timely event recall) against the number of false-alert episodes per month on the test period, as the alert threshold varies: green for the rule \(|d_t| \geq k\) with \(k\) from 4 to 14 bp, blue for the logistic regression and orange for gradient boosting, all on price-only features. The dotted line marks the budget of 2 false alerts per month, and the red star the paper's CatBoost result, obtained on other data.

                      Choosing the threshold on the test data is look-ahead, which an alarm in real use cannot do. With \(k\) chosen this way, the rule \(|d_t| \geq 11\) bp would have reached a recall of 0.8, a median lead of 20.5 hours and \(U = 0.42\), higher than the paper's model, but with 3.2 false alerts a month, above the budget.

                      The number of events limits every conclusion. Four detected events out of five give a recall of 0.8, with a Clopper–Pearson 95% confidence interval of 0.28 to 0.99 (an exact interval for a proportion based on the binomial distribution). With so few events, the ranking of alarms on one test period is fragile.

                      In brief

                      • Choosing \(k\) on the test data is look-ahead: the rule \(|d_t| \geq 11\) bp would have reached recall 0.8, median lead 20.5 h, \(U = 0.42\), but with 3.2 false alerts a month
                      • 4 of 5 events: Clopper–Pearson 95% interval for recall \([0.28, 0.99]\). With so few events, the ranking of alarms is fragile
                      • Source: own computation on EODHD hourly prices, test period 2 January 2025 – 23 October 2026
                      BA_L5_ew_tradeoff

                      Worked Example: Uncertainty of a Recall Estimated from Five Events

                      Slide 35 in the PDF

                      The rule \(|d_t| \geq 11\) bp detected 4 of the 5 test events, a recall of 0.8. How much does this tell us about its true recall? Suppose the true recall is \(p\) and the five events are detected independently. The number detected, \(X\), is then binomial with 5 trials and success probability \(p\), and the probability of detecting at least four is

                      \[P(X \geq 4) = 5\,p^4 (1 - p) + p^5\]

                      For \(p = 0.5\) this is \(5/32 + 1/32 = 6/32 = 0.19\); for \(p = 0.3\) it is \(0.028 + 0.002 = 0.03\); for \(p = 0.723\), the recall of the paper's CatBoost, it is 0.58.

                      An alarm that misses half of all events would therefore score 4 of 5 in about one test period out of five, and the paper's alarm would score that well in a little more than half. Five events cannot tell the two apart. The Clopper–Pearson interval of the previous frame, 0.28 to 0.99, expresses the same uncertainty in one line.

                      The practical conclusion is about evaluation design. To compare alarms, pool events across periods or venues, as the paper does with its 107 pool events, or report a confidence interval next to every recall; a single test period with a handful of events is a demonstration, not a ranking.

                      In brief

                      • Rule \(|d_t| \geq 11\) bp on the test period: 4 of 5 events detected, recall 0.8
                      • Suppose the true recall is \(p\); the number detected is \(X \sim \text{Binomial}(5, p)\):
                        \[ P(X \geq 4) = 5\,p^4 (1 - p) + p^5 \]
                        • \(p = 0.5\): \(5/32 + 1/32 = 6/32 = 0.19\)
                        • \(p = 0.3\): \(0.028 + 0.002 = 0.03\)
                        • \(p = 0.723\) (the paper's CatBoost): \(0.58\)
                      • An alarm with recall 0.5 scores 4 of 5 in about one test period out of five: five events cannot separate it from the paper's alarm
                      • The Clopper–Pearson 95% interval for 4 of 5, \([0.28, 0.99]\), says the same in one line
                      • To compare alarms, pool events across periods or venues, or report intervals next to every recall

                      Section summary

                      An alarm must be judged on events, lead times and false alerts, not on hour-by-hour classification scores. The paper's alarm, built on pool composition and liquidity, detects most test events hours ahead; price-only alarms on the aggregated rate reach high AUC but give no timely warning within the false-alert budget, and with five test events any ranking is uncertain.

                      Recent Data: August to October 2026

                      The section applies the measurements of the lecture to the most recent data, August to October 2026.

                      The Last Twelve Weeks

                      Slide 36 in the PDF
                        Question for the room In October 2026 USDC priced in USDT was at or above 10 bp in 206 of 552 hours, never at 15 bp. With an alert at |dt| ≥ 10 bp and a 24-hour refractory period, how many alert episodes would the rule have issued from 1 August to 23 October?
                        Answer

                        24, about two a week, none of them followed by a breach of 15 bp. The refractory period merges consecutive hours above 10 bp into one episode, so the count is far below the number of hours. With k = 12 bp there are 10 episodes, with k = 14 bp 2. A level rule cannot tell a persistent small discount of USDT from stress; the alarm of the paper also looks at the pool composition and the liquidity curve.

                        The chart shows the hourly deviations of USDT, USDC and DAI from one dollar and the price of USDC in USDT (dashed red line), from 1 August to 23 October 2026, with the dotted lines at ±15 bp. USDT traded below one dollar on average, by 6.6 bp in August, 3.2 bp in September and 8.7 bp in October. Because USDT was the cheaper coin, USDC priced in USDT was above parity: its October mean was 7.5 bp and its maximum 14.7 bp, at 02:00 UTC on 15 October.

                        In October, 206 of 552 hours were above 10 bp and none above 15 bp, so by the definition of the lecture there was no breach. A rule that alerts at 10 bp would have fired again and again over these weeks. The paper's alarm would look at the composition of the pools and at the liquidity curve before reporting stress; a persistent small deviation with balanced pools is a different situation from the same deviation with a pool that is emptying of one coin.

                        In brief

                        • USDT below USD: \(-6.6\) bp on average in August, \(-3.2\) in September, \(-8.7\) in October 2026
                        • USDC priced in USDT: October mean 7.5 bp, maximum 14.7 bp (15 October, 02:00 UTC); 206 of 552 hours above 10 bp, none above 15 bp
                        • A rule at 10 bp would have fired repeatedly; the paper's alarm would look at the pool composition and the liquidity curve before calling it stress
                        • Source: own computation on EODHD hourly prices of USDC and USDT, 1 August – 23 October 2026
                        BA_L5_recent

                        Summary

                        Daily peg deviations of the three large dollar stablecoins average within ±0.5 bp and have heavy tails, so the risk lies in rare episodes. For USDC priced in USDT since 2022, there were 30 episodes beyond 15 bp and 2 beyond 50 bp. During the SVB weekend USDC fell to −1,036 bp, 211 bp below its value under zero recovery of the SVB deposit (−825 bp), formula (5.3): reserve losses alone do not explain the discount.

                        Automated market makers with the StableSwap invariant (5.5) keep prices flat until a pool is nearly one-sided, so the composition of the pool reveals stress before the price does. Evaluated on events with the utility (5.7), the paper's alarm detects 72% of test events about 14 hours ahead, with 2.5 false alerts a month. Price-only alarms on the aggregated USDC/USDT rate reach an AUC of up to 0.93 but meet the false-alert budget only by detecting none of the 5 test events.

                        In brief

                        • Daily peg deviations average within \(\pm 0.5\) bp and have heavy tails; the risk is in rare episodes
                          • USDC/USDT since 2022: 30 episodes beyond 15 bp, 2 beyond 50 bp
                        • SVB: USDC fell to \(-1\,036\) bp, 211 bp below its zero-recovery value (\(-825\) bp): reserve losses alone do not explain the discount
                        • AMMs keep prices flat until a pool is nearly one-sided: pool composition reveals stress before the price
                        • The paper's alarm detects 72% of test events 14 hours ahead, with 2.5 false alerts a month
                        • Price-only alarms on the aggregated USDC/USDT rate reach AUC up to 0.93 but meet the false-alert budget only by detecting none of the 5 test events

                        Interpretation Exercises

                        Slide 38 in the PDF

                        The four exercises use the numbers of the lecture. Each asks for a judgement in a few sentences: what a number shows about risk, what an analyst should monitor, which model to deploy, and why a good result on one test set may not carry over.

                        In brief

                        1. USDC has the 1% quantile closest to zero of the three coins (\(-7.6\) bp) but the largest excess kurtosis (1 045). What do the two numbers say together about its risk?
                        2. A Curve pool with \(A = 2000\) shows a price of 0.997 while 90% of it is USDC. Is USDC safe? What would you monitor instead of the price?
                        3. The random forest has AUC 0.901 and recall 0.41; CatBoost has AUC 0.862 and recall 0.72. Which would you deploy, and why does the ranking differ?
                        4. A rule \(|d_t| \geq 11\) bp reaches \(U = 0.42\) on the 2025–2026 test period. Give two reasons why this does not show that the rule is as good as the paper's model.
                        • Next: Lecture 6, the De-pegging Pressure Index across stablecoins

                        Appendix: Further Material

                        The Appendix holds optional material for self-study. It covers a threshold model for the speed at which deviations close, the liquidity data of Uniswap V3 and the Curve 3pool, the Gegenbauer scores and the SHAP attribution of the paper's alarm, and the paper's forecasts of the whole distribution of future deviations with their scoring rules.

                        Appendix: Further Material

                        Slide 39 in the PDF
                        Optional material for self-study.
                        • A Threshold Autoregression
                        • Estimates: Hourly USDC/USDT, 2022–2026
                        • The Fitted Band
                        • Worked Example: Speed of Reversion of a Deviation
                        • Uniswap V3: Concentrated Liquidity
                        • Curve 3pool: Entropy as an Imbalance Index
                        • Gegenbauer Polynomial Expansion of the Liquidity Curve
                        • Worked Example: Decomposing a Stylised Curve
                        • SHAP Attribution of the Warnings
                        • Distributional Forecasts of Peg Deviations
                        • A Quantile Function with Pareto Tails
                        • Role of the Tail Parameters
                        • Scoring a Distribution: CRPS and twCRPS
                        • Worked Example: Scoring Three Forecast Distributions
                        • Results: Distributional Accuracy
                        • Calibration and Ablation

                        A Threshold Autoregression

                        Slide 40 in the PDF

                        If arbitrage costs \(c\) per dollar, deviations smaller than \(c\) are not worth trading and may persist, while larger ones should close quickly. A threshold autoregressive (TAR) model captures this idea by letting the speed of reversion differ inside and outside a band \(\pm\gamma\):

                        \[\Delta d_t = \mu + \rho_{in}\, d_{t-1}\,\mathbb{1}\{|d_{t-1}| \leq \gamma\} + \rho_{out}\, d_{t-1}\,\mathbb{1}\{|d_{t-1}| > \gamma\} + \varepsilon_t\]
                        (5.8)

                        The band hypothesis is \(\rho_{in} \approx 0\) and \(\rho_{out} < 0\); a coefficient \(\rho\) gives a half-life of \(\ln 0.5/\ln(1+\rho)\) hours. For each \(\gamma\) on a grid the model is estimated by ordinary least squares (OLS), and \(\hat\gamma\) minimises the sum of squared residuals (SSR). The test of a threshold effect, \(H_0: \rho_{in} = \rho_{out}\), is non-standard because \(\gamma\) has no meaning under \(H_0\) (Hansen, 1996). The statistic is the largest Wald statistic over the grid, \(\sup W\), with a heteroskedasticity-consistent (HC) variance, and its p-value comes from a fixed-regressor bootstrap with \(B = 199\) replications.

                        In brief

                        • If arbitrage costs \(c\), small deviations are not worth trading; beyond \(c\) they are. A threshold autoregressive (AR) model captures this:
                          \[ \Delta d_t = \mu + \rho_{in}\, d_{t-1}\,\mathbb 1\{|d_{t-1}| \leq \gamma\} + \rho_{out}\, d_{t-1}\,\mathbb 1\{|d_{t-1}| > \gamma\} + \varepsilon_t \]
                          • band hypothesis: \(\rho_{in} \approx 0\), \(\rho_{out} < 0\); half-life \(h = \ln 0.5 / \ln(1 + \rho)\)
                        • Estimation: for each \(\gamma\) on a grid, ordinary least squares (OLS); \(\hat\gamma = \arg\min_\gamma \mathrm{SSR}(\gamma)\), the sum of squared residuals (SSR)
                        • Test of a threshold effect, \(H_0: \rho_{in} = \rho_{out}\); \(\gamma\) is not identified under \(H_0\), so the usual \(\chi^2\) fails; with a heteroskedasticity-consistent (HC) variance:
                          \[ \sup W = \sup_{\gamma \in \Gamma} W(\gamma), \qquad W(\gamma) = \frac{(\hat\rho_{in} - \hat\rho_{out})^2}{\widehat{\mathrm{Var}}_{\mathrm{HC}}(\hat\rho_{in} - \hat\rho_{out})} \]
                        • p-value by the fixed-regressor bootstrap (Hansen (1996)): \(y_t^\ast = \hat e_t z_t\), \(z_t \sim N(0,1)\), recompute \(\sup W\), \(B = 199\)

                        Estimates: Hourly USDC/USDT, 2022–2026

                        Slide 41 in the PDF

                        The model (5.8) is estimated on 40,545 pairs of consecutive hourly deviations of USDC in USDT. The estimated band is \(\hat\gamma = 22.5\) bp, with 99.0% of hours inside it. Inside the band \(\hat\rho_{in} = -0.0396\) (standard error, SE, 0.0020), a half-life of 17.2 hours; outside, \(\hat\rho_{out} = -0.0233\) (SE 0.0297), a half-life of 29.4 hours. The test gives \(\sup W = 0.5\) against a bootstrap 95% critical value of 4.7, p = 0.653: the hypothesis \(\rho_{in} = \rho_{out}\) is not rejected, and deviations decay in about a day either way. The band story fails here because the large deviations are the SVB and Terra hours, when redemption was closed or trust was gone and arbitrage was not available: a band model describes normal times, and stress is a change of regime rather than a larger deviation of the same process.

                        In brief

                        coefficientSE (HC)half-life (hours)
                        \(\hat\gamma\) (bp)\(22.5\)99.0% of hours inside
                        \(\hat\rho_{in}\)\(-0.0396\)\(0.0020\)\(17.2\)
                        \(\hat\rho_{out}\)\(-0.0233\)\(0.0297\)\(29.4\)
                        linear AR(1): \(\hat\rho\)\(-0.0245\)\(28.0\)
                        \(\sup W\) (bootstrap 95% critical value)\(0.5\)   (\(4.7\)),   p \(= 0.653\)
                        • \(n = 40\,545\) pairs of consecutive hours; SE: standard error
                        • No threshold effect: \(\rho_{in} = \rho_{out}\) is not rejected; deviations decay in about a day either way
                        • The band story fails in this sample because the large deviations are SVB and Terra hours, when redemption was closed or trust was gone: arbitrage was not available, so reversion was not faster
                        • Lesson: a band model describes normal times; stress is a change of regime, not a larger deviation of the same process
                        • Source: own computation on EODHD hourly prices of USDC and USDT, January 2022 – 23 October 2026

                        The Fitted Band

                        Slide 42 in the PDF

                        The left panel plots the hourly change \(\Delta d_t\) against the previous hour's deviation \(d_{t-1}\), for hours with \(|d_{t-1}| < 80\) bp, with the fitted TAR (red), the linear first-order autoregression, AR(1) (green dashed), and the estimated band (dotted). The fitted slopes are close to −0.04 and the two lines almost coincide: reversion is slow at the hourly scale. The right panel plots the Wald statistic \(W(\gamma)\) for each candidate threshold; it stays below 0.5 everywhere, far from the bootstrap critical value of 4.7 (dashed red).

                        In brief

                        The Fitted Band
                        • Left: the hourly change against last hour's deviation; slopes are small (\(\approx -0.04\)): reversion is slow at the hourly scale
                        • Right: the Wald profile \(W(\gamma)\) never comes close to the bootstrap critical value
                        BA_L5_tar

                        Worked Example: Speed of Reversion of a Deviation

                        Slide 43 in the PDF

                        Inside the band, with \(\hat\rho_{in} = -0.0396\) and \(\hat\mu \approx 0\), the expected deviation after \(h\) hours is \(E[d_{t+h} \mid d_t] \approx (1 + \hat\rho_{in})^h d_t\). Start from \(d_t = +12\) bp, USDC priced above USDT, that is USDT the cheaper coin, as on 23 October 2026. After 24 hours the factor is \(0.9604^{24} = 0.379\), so the expected deviation is \(12 \times 0.379 = 4.55\) bp, and the half-life is \(\ln 0.5/\ln 0.9604 = 17.2\) hours. A deviation of this size is expected to shrink by about 60% in a day; if it does not, the process is not behaving as inside the band, and that persistence is itself a warning signal.

                        In brief

                        • Inside the band, \(\hat\rho_{in} = -0.0396\): the expected deviation after \(h\) hours is
                          \[ E[d_{t+h} \mid d_t] \approx (1 + \hat\rho_{in})^h\, d_t \quad (\hat\mu \approx 0) \]
                        • Start from \(d_t = +12\) bp: USDC priced above USDT, i.e. USDT is the cheap coin, as on 23 October 2026
                          \[ 24 \text{ hours: } 0.9604^{24} = 0.379, \qquad E[d_{t+24}] \approx 12 \times 0.379 = +4.55 \text{ bp} \]
                        • Half-life \(\ln 0.5 / \ln 0.9604 = 17.2\) hours
                        • Interpretation
                          • a deviation of this size is expected to shrink by about 60% in a day
                          • if it does not, the process is not “inside the band”: that persistence is itself a warning signal

                        Uniswap V3: Concentrated Liquidity

                        Slide 44 in the PDF

                        In Uniswap V3 (Adams et al., 2021) liquidity providers choose the price range in which their funds are used. Prices sit on a grid of ticks \(p_k = 1.0001^k\), so one tick is 1 bp. The active liquidity \(L_{t,j}\) at tick \(j\) is the sum of all positions whose range contains \(j\), and the curve \(j \mapsto L_{t,j}\) changes every hour. The paper sums it from the current tick \(k_t\) upwards, \(Q_t^+(k) = \sum_{j=k_t}^{k} L_{t,j}\), and downwards, \(Q_t^-(k) = \sum_{j=k}^{k_t} L_{t,j}\), a proxy for depth in liquidity units, not in tokens; crossing tick \(j\) upwards costs \(L_{t,j}(\sqrt{p_{j+1}} - \sqrt{p_j})\) of Y, and downwards \(L_{t,j}(1/\sqrt{p_j} - 1/\sqrt{p_{j+1}})\) of X. The area under each curve measures depth on one side, the slope at \(k_t\) the local depth, and a sudden flat part is a liquidity cliff, where a small trade moves the price a lot. The data come hourly from The Graph subgraphs, ±50 ticks around the peg; positions minted and burned in the same block are just-in-time (JIT) liquidity and may not be there under stress.

                        In brief

                        • Liquidity providers choose a price range; prices live on ticks \(p_k = 1.0001^k\), one tick = 1 bp
                        • Active liquidity at tick \(j\): \(L_{t,j}\) = sum of all positions whose range contains \(j\); the curve \(j \mapsto L_{t,j}\) changes every hour
                        • Cumulative liquidity proxy from the current tick \(k_t\) (Chaffard, Găman, Staures, Ginavar, Jheng, Härdle & Pele (2026)), in liquidity units, not in tokens:
                          \[ Q_t^+(k) = \sum_{j = k_t}^{k} L_{t,j}\;\; (k > k_t), \qquad Q_t^-(k) = \sum_{j = k}^{k_t} L_{t,j}\;\; (k < k_t) \]
                          • token amounts to cross tick \(j\) (price \(p = y/x\)): up, pay \(\Delta y_j = L_{t,j}(\sqrt{p_{j+1}} - \sqrt{p_j})\) of Y; down, pay \(\Delta x_j = L_{t,j}(1/\sqrt{p_j} - 1/\sqrt{p_{j+1}})\) of X
                          • area under the curves: global depth on each side; slope at \(k_t\): local depth
                          • a sudden flat part: a liquidity cliff, where a small trade moves the price a lot
                        • Data: The Graph subgraphs, hourly, \(\pm 50\) ticks around the peg; positions minted and burned in the same block are just-in-time (JIT) liquidity and may not be there under stress

                        Curve 3pool: Entropy as an Imbalance Index

                        Slide 45 in the PDF

                        With normalised balances \(w_{\mathrm{DAI}} + w_{\mathrm{USDC}} + w_{\mathrm{USDT}} = 1\), the imbalance of the Curve 3pool is measured by the entropy \(S_{3pool} = -\sum_i w_i \ln w_i\), which lies between 0 and \(\ln 3 = 1.0986\). The balanced pool \((1/3, 1/3, 1/3)\) has \(S = 1.0986\); shares of \((0.20, 0.40, 0.40)\) give 1.0549 and \((0.05, 0.10, 0.85)\) give 0.5182. The chart plots \(S\) when one token has share \(w\) and the other two split the rest equally (solid), and for a two-token pool (dashed). The curve is flat near balance and steep near a corner, so small changes of \(S\) at high levels are noise, while a fall below about 1 signals stress.

                        In brief

                        • Normalised balances \(w_{\mathrm{DAI}} + w_{\mathrm{USDC}} + w_{\mathrm{USDT}} = 1\):
                          \[ S_{3pool} = -\sum_i w_i \ln w_i, \qquad 0 \leq S \leq \ln 3 = 1.0986 \]
                        Curve 3pool: Entropy as an Imbalance Index
                        • Worked example: balanced \((\frac13, \frac13, \frac13)\): \(S = 1.0986\); \((0.20, 0.40, 0.40)\): \(1.0549\); \((0.05, 0.10, 0.85)\): \(0.5182\)
                        • Flat near balance, steep near a corner: small changes in \(S\) at high levels are noise, a fall below about 1 is stress
                        BA_L5_entropy

                        Gegenbauer Polynomial Expansion of the Liquidity Curve

                        Slide 46 in the PDF

                        To turn the liquidity curve into a few numbers, the paper maps prices to a peg-centred coordinate \(x \in [-1, 1]\), with the peg at \(x = 0\), takes the log-liquidity \(\ell_t(x) = \log\{L_t(x) + 1\}\), and expands it in Gegenbauer polynomials \(\phi_k^{(\alpha)}\), which are orthonormal under the weight \(w_\alpha(x) = (1 - x^2)^{\alpha - 1/2}\): \(\ell_t(x) \approx \sum_{k=0}^{K} \beta_{t,k}\,\phi_k^{(\alpha)}(x)\). The coefficient \(\beta_{t,0}\) measures the level of liquidity, \(\beta_{t,1}\) the asymmetry between the two sides, \(\beta_{t,2}\) the concentration at the peg, and higher orders local notches and cliffs; odd orders are asymmetric and even orders symmetric. Their sums of squares, \(E_t^{odd}\) over odd \(k\) and \(E_t^{even}\) over even \(k \geq 2\), are the energies. The parameter \(\alpha\) moves weight between the centre and the edges and is tuned as a hyperparameter. A fixed basis keeps the scores comparable over time, unlike a rolling functional principal component analysis (FPCA), whose components change with the window.

                        In brief

                        • Peg-centred coordinate \(x \in [-1, 1]\) (peg at \(x = 0\)), log-liquidity \(\ell_t(x) = \log\{L_t(x) + 1\}\)
                        • Expansion in Gegenbauer polynomials, orthonormal under the weight \(w_\alpha\):
                          \[ \ell_t(x) \approx \sum_{k=0}^{K} \beta_{t,k}\, \phi_k^{(\alpha)}(x), \qquad w_\alpha(x) = (1 - x^2)^{\alpha - 1/2}, \qquad \beta_{t,k} = \int_{-1}^{1} \ell_t(x)\,\phi_k^{(\alpha)}(x)\,w_\alpha(x)\,dx \]
                        • Reading the coefficients
                          • \(k = 0\): level of liquidity; \(k = 1\): left-right asymmetry; \(k = 2\): concentration at the peg
                          • higher \(k\): local notches and cliffs; odd \(k\) asymmetric, even \(k\) symmetric
                        • Energies: \(E_t^{odd} = \sum_{k \text{ odd}} \beta_{t,k}^2\), \(\;E_t^{even} = \sum_{k \geq 2 \text{ even}} \beta_{t,k}^2\)
                        • \(\alpha\) moves the weight between centre and edges; it is tuned as a hyperparameter. A fixed basis keeps the scores comparable over time, unlike rolling functional principal component analysis (FPCA)

                        Worked Example: Decomposing a Stylised Curve

                        Slide 47 in the PDF

                        The left panel shows the first five basis functions for \(\alpha = 0.3\). The middle panel shows a stylised log-liquidity curve with a deep band at the peg, extra depth below parity and a cliff above \(x = 0.5\), and its reconstruction with \(K = 7\) (dashed red). The right panel gives the coefficients \(\hat\beta = (18.78, -2.52, -2.50, 0.32, 1.45, 0.08, -0.43, 0.07)\), with energies \(E^{odd} = 6.48\) and \(E^{even} = 8.55\), next to those of the mirror-image curve. The mirror image has the same even coefficients and odd coefficients of opposite sign: the odd scores carry the direction of fragility, whether the thin side is above or below the peg.

                        In brief

                        Worked Example: Decomposing a Stylised Curve
                        • Stylised curve: a deep band at the peg, extra depth below parity, a cliff above \(x = 0.5\); \(\alpha = 0.3\), \(K = 7\)
                        • \(\hat\beta = (18.78, -2.52, -2.50, 0.32, 1.45, 0.08, -0.43, 0.07)\); \(E^{odd} = 6.48\), \(E^{even} = 8.55\)
                        • The mirror image has the same even coefficients and odd coefficients with the opposite sign: the odd scores carry the direction of fragility
                        • Source: own computation on a stylised liquidity curve; no market data
                        BA_L5_gegenbauer

                        SHAP Attribution of the Warnings

                        Slide 48 in the PDF

                        SHapley Additive exPlanations (SHAP) of Lundberg & Lee (2017) split a model's prediction into a baseline and one contribution per feature, \(f(\mathbf x) = \phi_0 + \sum_j \phi_j(\mathbf x)\). The chart groups the mean absolute contributions \(|\phi_j|\) of the paper's CatBoost alarm on the test set by economic block, as shares of the total. The shape of the Uniswap V3 liquidity curve accounts for 34.4% and the imbalance of the Curve 3pool for 32.7%; the broader market (BTC, ETH, the dollar index, sentiment) for 15.0%; past peg deviations for only 7.5%. The model warns mainly from the state of the pools, not from the price itself. This is an attribution, not a causal statement: correlated on-chain features share credit between them.

                        In brief

                        SHAP Attribution of the Warnings
                        • SHapley Additive exPlanations (SHAP; Lundberg & Lee (2017)): \(f(\mathbf x) = \phi_0 + \sum_j \phi_j(\mathbf x)\), shares of mean \(|\phi_j|\) grouped by economic block (interventional, main effects)
                        • Past peg deviations explain only 7.5%: the model warns from liquidity shape (34.4%) and 3pool imbalance (32.7%), not from the price itself
                        • Attribution, not causality: correlated on-chain features share credit
                        • Source: Chaffard et al. (2026), working paper, SHAP shares of its CatBoost model on the test set
                        BA_L5_paper_shap

                        Distributional Forecasts of Peg Deviations

                        Slide 49 in the PDF

                        An alarm says whether a breach is likely; a risk manager also needs how far the price may go, for example the probability of crossing a liquidation level or the expected shortfall (ES) of a depeg, the mean loss beyond a quantile. The paper therefore forecasts the whole conditional distribution of \(d_{t+h}\) for \(h = 1, \dots, 24\) hours. Its neural network has one branch for the history of the target and one for the covariates; it selects a few covariates and returns a quantile function for each horizon. It is compared with five benchmarks: a naive forecast, an autoregressive integrated moving average (ARIMA) model, a generalised autoregressive conditional heteroskedasticity model with Student-t errors (GARCH-t), and two neural models, the Time-series Dense Encoder (TiDE) and TimeXer, which receive the same distributional output and loss. The test period runs from January 2025 to May 2026.

                        In brief

                        • An alarm says whether; a risk manager also needs how far: the probability of crossing a liquidation level, the expected shortfall (ES) of a depeg
                        • The paper forecasts the full conditional distribution of \(d_{t+h}\), \(h = 1, \dots, 24\)
                        • Architecture, in brief
                          • two branches: the target history (dilated causal convolutions) and the covariates (one token per variable)
                          • reversible instance normalisation; a gated residual network scores covariates, sparsemax sets most weights to exactly zero
                          • cross-attention from forecast horizons to the selected covariates; an output head returns a quantile function
                        • Benchmarks: naive, autoregressive integrated moving average (ARIMA), generalised autoregressive conditional heteroskedasticity with Student-t errors (GARCH-t), Time-series Dense Encoder (TiDE) and TimeXer; the two neural benchmarks get the same distributional head and loss
                        • Test period: January 2025 – May 2026

                        A Quantile Function with Pareto Tails

                        Slide 50 in the PDF

                        The forecast distribution is written as a quantile function \(Q_t(u)\), the value below which the deviation falls with probability \(u\). Its body, between the levels \(\tau_L\) and \(\tau_U\), is a monotone spline centred at the median and scaled. Below \(\tau_L\) and above \(\tau_U\) it is replaced by the tails of a generalised Pareto distribution (GPD), joined smoothly to the body. Each tail has a shape parameter, \(\xi_L\) and \(\xi_U\); a larger \(\xi\) means a heavier tail, and for \(\xi \geq 1/2\) the tail has infinite variance (Lecture 2: the tail index is \(1/\xi\)). Separate parameters allow depegs of USDC below USDT and of USDT below USDC to differ.

                        In brief

                        • Body: monotone I-spline, centred at the median and scaled
                          \[ Q_t^0(u) = \sum_{k=1}^{K} a_{t,k} I_k(u),\; a_{t,k} > 0; \qquad Q_t^B(u) = \ell_t + \frac{s_t}{\sqrt{V_t}}\,\{Q_t^0(u) - Q_t^0(0.5)\} \]
                        • Tails: generalised Pareto distribution (GPD), joined smoothly at \(\tau_L\) and \(\tau_U\)
                          \[ Q_t(u) = \begin{cases} z_L - \dfrac{\beta_L}{\xi_L}\Big[\big(\tfrac{u}{\tau_L}\big)^{-\xi_L} - 1\Big], & u < \tau_L \\[2mm] Q_t^B(u), & \tau_L \leq u \leq \tau_U \\[1mm] z_U + \dfrac{\beta_U}{\xi_U}\Big[\big(\tfrac{1-u}{1-\tau_U}\big)^{-\xi_U} - 1\Big], & u > \tau_U \end{cases} \]
                        • \(z_L = Q^B_t(\tau_L)\), \(\beta_L = \tau_L\,Q_t^{B\prime}(\tau_L)\) and symmetrically for the upper tail; separate \(\xi_L\), \(\xi_U\) allow USDC and USDT depegs to differ
                        • For \(\xi \geq 1/2\) the tail has infinite variance (Lecture 2: tail index \(1/\xi\))

                        Role of the Tail Parameters

                        Slide 51 in the PDF

                        The chart draws three quantile functions with the same Gaussian body, a standard deviation of 3 bp, spliced at the 5% and 95% levels, on a horizontal axis in normal-quantile scale, where the Gaussian is a straight line. At the 99.9% level the Gaussian gives 9.3 bp, GPD tails with \(\xi = 0.2\) give 13.6 bp, and an upper tail with \(\xi_U = 0.5\) gives 22.6 bp, while its lower tail with \(\xi_L = 0.1\) stays at −11.9 bp at the 0.1% level. The tail parameters change the extreme quantiles a lot while leaving the body untouched.

                        In brief

                        Role of the Tail Parameters
                        • Same Gaussian body (sd 3 bp), splice at 5% and 95%; on the normal-quantile scale the Gaussian is a straight line
                        • 99.9% quantile: Gaussian 9.3 bp; GPD with \(\xi = 0.2\): 13.6 bp; with \(\xi_U = 0.5\): 22.6 bp, while the lower tail (\(\xi_L = 0.1\)) stays at \(-11.9\) bp
                        • Source: own illustration with assumed tail parameters; no market data
                        BA_L5_gpd

                        Scoring a Distribution: CRPS and twCRPS

                        Slide 52 in the PDF

                        A forecast distribution \(F\) is scored against the outcome \(y\) by the continuous ranked probability score (Gneiting & Raftery, 2007),

                        \[\mathrm{CRPS}(F, y) = \int_{-\infty}^{\infty} \big(F(x) - \mathbb{1}\{y \leq x\}\big)^2 dx = 2\int_0^1 \rho_u\big(y - Q(u)\big)\,du\]
                        (5.9)

                        the squared gap between the forecast cumulative distribution function (CDF) and the step function of the outcome, shaded in the left panel; lower is better. It equals twice the average of the pinball loss \(\rho_u(e) = e\,(u - \mathbb{1}\{e < 0\})\) over all quantile levels. The threshold-weighted CRPS (twCRPS) of Gneiting & Ranjan (2011) applies a weight \(w(r)\) that is close to 0 near the peg and close to 1 beyond \(\pm\delta\) (right panel, \(\delta = 15\) bp, smoothing \(h = 2\)), so the score concentrates on the depeg region. The paper trains its model on twCRPS and evaluates it on both scores.

                        In brief

                        • Continuous ranked probability score (Gneiting & Raftery (2007)), a proper scoring rule:
                          \[ \mathrm{CRPS}(F, y) = \int_{-\infty}^{\infty} \big(F(x) - \mathbb 1\{y \leq x\}\big)^2 dx = 2\int_0^1 \rho_u\big(y - Q(u)\big)\,du \]
                          • \(\rho_u(e) = e\,(u - \mathbb 1\{e < 0\})\): the pinball loss; CRPS averages it over all quantiles
                          • Normal: \(\mathrm{CRPS}(N(\mu, \sigma^2), y) = \sigma\big[z(2\Phi(z) - 1) + 2\varphi(z) - 1/\sqrt\pi\big]\), \(z = (y - \mu)/\sigma\)
                        • Threshold-weighted CRPS (Gneiting & Ranjan (2011)): put the weight where depegs are
                          \[ \mathrm{twCRPS} = 2\int_0^1 \rho_u\big(v(y) - v(Q(u))\big)\,du, \quad v(r) = \int_0^r w(s)\,ds, \quad w(r) = \sigma\Big(\frac{r - \delta}{h}\Big) + \sigma\Big(\frac{-r - \delta}{h}\Big) \]
                          • \(\sigma(z) = 1/(1 + e^{-z})\), the logistic function; \(h\) sets how sharply the weight rises around \(\pm\delta\)
                        • The paper uses twCRPS as training loss and both scores for evaluation

                        Worked Example: Scoring Three Forecast Distributions

                        Slide 53 in the PDF

                        The table scores three forecasts, Normal distributions with standard deviations 5 and 10 bp and a Student-t distribution with 3 degrees of freedom and scale 3, against three outcomes, \(y = 1\), 12 and 25 bp. In a calm hour (\(y = 1\)) the sharp forecasts win: CRPS 1.25 for \(N(0, 5^2)\) and 0.95 for the \(t_3\), against 2.38 for the wide \(N(0, 10^2)\). In a depeg hour (\(y = 25\)) the wide forecast wins, 19.40 against 22.18 and 22.57. The twCRPS nearly ignores the calm hour, 0.003 instead of a CRPS of 1.25 for \(N(0, 5^2)\), and puts its weight on the depeg region.

                        In brief

                        Worked Example: Scoring Three Forecast Distributions
                        CRPStwCRPS (\(\delta = 15\), \(h = 2\), illustrative)
                        forecast\(y = 1\)\(y = 12\)\(y = 25\)\(y = 1\)\(y = 12\)\(y = 25\)
                        \(N(0, 5^2)\)\(1.25\)\(9.21\)\(22.18\)\(0.003\)\(0.378\)\(9.98\)
                        \(N(0, 10^2)\)\(2.38\)\(7.48\)\(19.40\)\(0.054\)\(0.324\)\(9.34\)
                        \(t_3\), scale 3\(0.95\)\(9.71\)\(22.57\)\(0.003\)\(0.381\)\(9.91\)
                        • Calm hour (\(y = 1\)): the sharp forecasts win; depeg hour (\(y = 25\)): the wide one wins. twCRPS downweights calm hours (0.003 vs CRPS 1.25) and concentrates the score on the depeg region
                        • Source: own computation for three illustrative forecasts; no market data
                        BA_L5_crps

                        Results: Distributional Accuracy

                        Slide 54 in the PDF

                        The chart gives the mean CRPS and the mean twCRPS (log scale) over 24-hour horizons on the test period, January 2025 to May 2026, for the paper's model (red) and the five benchmarks. The proposed model has the lowest loss on every metric: against the best benchmark, CRPS is 6.6% lower than TimeXer's and twCRPS 14.2% lower than TiDE's. Against GARCH-t, CRPS is 0.82 against 2.21 (−63%) and twCRPS 0.067 against 0.106 (−37%). One-sided Diebold–Mariano tests, which compare the average losses of two forecasts, with block-bootstrap intervals give p-values below 0.05 against all five benchmarks.

                        In brief

                        Results: Distributional Accuracy
                        • Lowest loss on every metric; against the best benchmark: CRPS \(-6.6\%\) (TimeXer), twCRPS \(-14.2\%\) (TiDE)
                        • Against GARCH-t: CRPS \(0.82\) vs \(2.21\) (\(-63\%\)), twCRPS \(0.067\) vs \(0.106\) (\(-37\%\))
                        • One-sided Diebold–Mariano tests with block-bootstrap intervals: all p-values below 0.05 against all five benchmarks
                        • Source: Chaffard et al. (2026), working paper, Tables 2–3
                        BA_L5_paper_t2

                        Calibration and Ablation

                        Slide 55 in the PDF

                        A forecast is calibrated if the outcomes look like draws from it. The probability integral transform (PIT) \(u_t = \hat F_t(y_t)\) should then be uniform on \([0, 1]\), with mean 0.5 and variance \(1/12 = 0.0833\); the paper finds 0.5022 and 0.0878, and a Kolmogorov–Smirnov (KS) distance of 0.0288 with a 48-hour block-bootstrap p-value of 0.079, so we do not reject uniformity at 5%. VaR exceedances are too frequent at the 2–5% levels in both tails and close to nominal at 0.5–1%, and the forecast ES is more extreme than the realised one, a conservative error. The chart reports an ablation, the loss in the 1% and 99% quantile (pinball) losses (QL) when one part of the model is removed: a Gaussian output instead of the spline with Pareto tails costs 44% at the 1% quantile, and dropping the liquidity features costs 25% at the 99% quantile, more than dropping all covariates (14%).

                        In brief

                        • Probability integral transform (PIT) \(u_t = \hat F_t(y_t)\): mean 0.5022 (target 0.5), variance 0.0878 (target \(1/12 = 0.0833\)); Kolmogorov–Smirnov (KS) \(D = 0.0288\), 48-hour block bootstrap p \(= 0.079\)
                        • Value-at-risk (VaR) exceedances: too many at the 2–5% levels in both tails, close to nominal at 0.5–1%; forecast ES more extreme than realised: conservative
                        Calibration and Ablation
                        • A Gaussian head loses 44% at the 1% quantile; dropping the liquidity features costs 25% at the 99% quantile, more than dropping all covariates
                        • Source: Chaffard et al. (2026), working paper; ablation from its Table 4
                        BA_L5_paper_ablation

                        References