Depegs

Download Markdown

A depeg is when a token that should be worth a fixed amount, usually 1 US dollar, trades below that amount on the market. Depegs are common and usually short. A stablecoin can trade at 0.995 for a few hours and then return to 1.00. Sometimes a depeg is a sign of a real problem.

The figures on this page were measured in automated tests on copies of each protocol's real mainnet programs and accounts, and are rounded. Prices are in US dollars per token, so 0.995 means the token trades at 99.5 cents. Limits are given in basis points (bps): one basis point is 0.01%, so 50 bps is 0.5%.

Three kinds of depeg

KindExampleDoes the leg's value change?
A stablecoin on the leg's sale route trades off parA Hastra leg is sold through PYUSD, a Solstice leg through USXNo. The leg is valued from the protocol's own price. Only sales get more expensive.
A receipt token trades below its fair valuesyrupUSDC trades below Maple's published rateNo for the book value. Yes for the cautious low value, through MARKET_STRESS.
A stablecoin held as a token leg loses its pegThe vault holds USDG directlySame as a receipt token: the low value follows the market.

Table: in every case the book value stays put; what changes is the sale cost or the price paid to leavers.

A sale route is the path a token takes on a market back to USDC. For example, PRIME is sold for PYUSD, then PYUSD for USDC. A receipt token is the token a protocol gives you for your deposit, like syrupUSDC for a Maple deposit.

When a small depeg stops sales

What. Every sale of a token is the executor's trade, which the program values before and after. The leg's slippage limit, a per-leg setting chosen by the curator in add_leg or later through a queued UpdateLeg change, is the most a sale may lose against the value it removes from the leg. A sale that returns less is refused (WithdrawSlippageExceeded). The program caps the limit at 1,000 bps, which is 10%. In the tests the Hastra and Solstice legs use 50 bps (0.5%); a real vault's curator may choose other values.

Why. A vault that sells into a depeg turns a temporary price dip into a permanent loss for its holders. The limit makes the executor wait for the price to recover instead.

Example. The executor, the service that moves the vault's cash into and out of legs, sells part of a 3,000 USDC Hastra or Solstice leg while the route's stablecoin trades below 1.00. At 0.99 the sale would lose about 1% and is refused by the 0.5% limit; at 0.998 it goes through. During all of this, the leg's value does not move, and the vault keeps running. Withdrawals are paid from idle cash, and a Hastra leg can still leave through Hastra's queue, which pays one USDC per wYLDS whatever PYUSD trades at. Only the executor cannot raise cash from a sale until the peg recovers.

When a large depeg flags the leg

What. A Solstice leg's cooldown exit pays in USX, so the adapter reads USX's price on its market. It treats USX as on its peg while its price stays within 0.98 to 1.02, that is, within 2% of 1 dollar either way. Outside that range, the adapter raises PRICE_UNCERTAIN. A Hastra leg is valued at Hastra's price and its queue pays in USDC, so a PYUSD depeg only blocks sales through PYUSD; it does not flag the leg.

How. PRICE_UNCERTAIN is a blocking flag, so refreshing the leg fails with AdapterFlagged. About a minute later the leg is stale and the vault stops, as in A protocol stops working. The guardian then suspends the leg, which keeps its last value and lets the rest of the vault run, or marks it if the depeg looks permanent.

Example. USX trades at 0.95, outside the range, so refreshing a Solstice leg fails with AdapterFlagged. Once the leg is stale, a new 100 USDC Junior deposit fails with StaleValuation. After the guardian suspends the leg, the vault runs again.

When a receipt token trades below its fair value

What. syrupUSDC trades on the market at 0.96 of the rate Maple publishes through Chainlink. The syrupUSDC token leg raises MARKET_STRESS (as does Maple's own adapter in vaults that still hold it).

How. MARKET_STRESS is not a blocking flag. The vault keeps running at the book value (Maple's rate), but:

  • the band's low value drops to the market price, so leavers are paid at it, Junior first;
  • the leg cannot be bought or sold (LegStressed), so the vault never trades at the depressed price.

Example. Suppose Junior holds 2,000 USDC, Senior 4,000, and the leg 3,000, with each share worth 1 USDC. At 0.96 the leg's low value is 3,000 × 0.96 = 2,880, which is 3,000 − 2,880 = 120 below book. Junior absorbs the whole gap, so Senior still leaves at 1.00. Junior leaves at (2,000 − 120) ÷ 2,000 = 0.94, so 100 Junior shares pay 100 × 0.94 = 94 USDC.

When a stablecoin token leg loses its peg

Suppose the vault holds 3,000 USDG directly as a token leg, priced at par (1 USDG = 1 USDC), and Junior holds 2,000 USDC. USDG falls to 0.90 on both Pyth (a price oracle) and the market pool.

  • While its price guard is clean, the leg raises MARKET_STRESS. The book stays at 1.00, leavers are priced at 0.90 and trading stops. The leg's low value is 3,000 × 0.90 = 2,700, which is 300 below book. Junior absorbs it, so Junior leaves at (2,000 − 300) ÷ 2,000 = 0.85.
  • When the guard goes stale, the leg raises PRICE_UNCERTAIN. Refreshing fails with AdapterFlagged and the vault stops until the guardian acts.

When the market is too thin for the whole leg

A token leg's pricing can also check that its market holds enough USDC to buy the whole leg back. When it does not, even at a clean price, the leg raises THIN_MARKET.

  • The book value stays put, and the low value becomes what the market can pay, so leavers are paid at it, Junior first.
  • The leg is not bought, but it is still sold: each sale is at most what the market can pay and within the leg's slippage limit, so the executor can take the leg out over several sales.

Example. A 5,000,000 USDC syrupUSDC leg sits next to a market holding 3,000,000 USDC. The low value is 3,000,000, and a sale of 100,000 goes through. A price break on top of it (MARKET_STRESS) stops sales as well.

When the asset really loses value

If the protocol's own price falls, it is not a market depeg but a real loss. The tests lower Maple's rate, OnRe's net asset value (NAV), Hastra's stake price and the token legs' oracle or NAV by 5%. The loss is booked through the real price path, Junior first. See An honest loss.

Summary

flowchart TD
    D[A token trades off its price] --> Q1{Where is the token?}
    Q1 -->|On the sale route| E1[Leg value unchanged]
    E1 --> Q2{Solstice's USX outside 0.98 to 1.02?}
    Q2 -->|No| E2[Vault runs. Sales may be refused by the slippage limit]
    Q2 -->|Yes| E3[PRICE_UNCERTAIN. Vault stops until the guardian suspends or marks]
    Q1 -->|Held in the leg| M1{Guard reading fresh?}
    M1 -->|Yes| M2[MARKET_STRESS. Leavers priced at market, Junior first, no trading]
    M1 -->|No| E3

Figure: the path from a depeg to what the vault does, depending on where the token sits and how far it moves.

The takeaway: the vault never books a market dip as a permanent loss and never sells into one. It either waits, prices leavers cautiously, or stops and asks the guardian.

Advanced details

  • The markets on these routes (PRIME/PYUSD, PYUSD/USDC, eUSX/USX, USX/USDC) each charged a 0.01% fee in the tests, so almost all of a sale's cost comes from the depeg itself.
  • Token-leg guards: the USDG token leg checks Pyth's USDG/USD price and its market, and flags a reading more than 50 bps (0.5%) away from par; the syrupUSDC token leg flags a market price more than 100 bps (1%) away from Maple's rate; the ONyc token leg flags a market price more than 200 bps (2%) away from OnRe's NAV.

On this page