Depegs
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
| Kind | Example | Does the leg's value change? |
|---|---|---|
| A stablecoin on the leg's exit route trades off par | Hastra exits through PYUSD, Solstice through USX, OnRe through USDG | No. The leg is valued from the protocol's own price. Only exits get more expensive. |
| A receipt token trades below its fair value | syrupUSDC trades below Maple's published rate | No for the book value. Yes for the cautious low value, through MARKET_STRESS. |
| A stablecoin held as a token leg loses its peg | The vault holds USDG directly | Same as a receipt token: the low value follows the market. |
Table: in every case the book value stays put; what changes is the exit cost or the price paid to leavers.
An exit route is the chain of swaps an adapter uses to turn a position back into USDC. For example, a Hastra leg sells PRIME 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 exits
What. Two limits protect an exit from selling at a bad price.
- The leg's slippage limit. A per-leg setting, chosen by the curator in
add_legor later through a queuedUpdateLegchange. The vault refuses an exit that returns less USDC than the value it removes from the leg minus this limit (WithdrawSlippageExceeded). The program caps it at 1,000 bps, which is 10%. In the tests the Hastra and Solstice legs use 50 bps (0.5%), and the OnRe leg uses 200 bps (2%); a real vault's curator may choose other values. - The adapter's per-swap limit. Each swap in the Hastra and Solstice adapters may lose at most 1% against the fair price. Otherwise the swap's minimum-output check refuses it.
Why. A vault that sells into a depeg turns a temporary price dip into a permanent loss for its holders. The limits make 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, takes 500 USDC out of a 3,000 USDC leg while the exit stablecoin trades below 1.00. The cost is the value the leg gives up minus the USDC that arrives, as a share of the value given up:
| Exit stablecoin price | Hastra (PYUSD) | Solstice (USX) | OnRe (USDG) |
|---|---|---|---|
| 0.999 | Exits, costs 0.13% | Exits, 0.12% | Exits, 0.40% |
| 0.996 | Exits, 0.43% | Exits, 0.42% | Exits, 0.70% |
| 0.995 | Refused by the 0.5% leg limit | Refused | Exits, 0.80% |
| 0.990 | Refused by the 1% per-swap limit | Refused | Exits, 1.30% |
| 0.985 | Refused | Refused | Exits, 1.80% |
| 0.980 | Refused | Refused | Refused: the swap no longer returns enough |
Table: measured in tests and rounded; with a 0.5% leg limit, a price of 0.995 already stops Hastra and Solstice exits, while OnRe's 2% limit keeps working down to about 0.985.
During all of this, the leg's value does not move, and the vault keeps running. Withdrawals are paid from idle cash. Only the executor cannot raise more cash from that leg until the peg recovers. In the tests, once the price is back at 0.998, both Hastra and Solstice exit again.
When a large depeg flags the leg
What. Each adapter that exits through a stablecoin reads that stablecoin's price on the market pool bound to the leg. The adapter treats the stablecoin 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.
| Adapter | Stablecoin read | Pool |
|---|---|---|
| Solstice | USX | USX/USDC |
| Hastra | PYUSD | PYUSD/USDC |
| OnRe | USDG | USDG/USDC |
Table: the stablecoin each adapter watches; outside the 2% band each one flags the leg the same way.
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. PYUSD trades at 0.95, outside the range, so refreshing a Hastra 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. Both the Maple leg and the syrupUSDC token leg raise MARKET_STRESS.
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 withAdapterFlaggedand the vault stops until the guardian acts.
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 exit route| E1[Leg value unchanged]
E1 --> Q2{Price outside 0.98 to 1.02?}
Q2 -->|No| E2[Vault runs. Exits may be refused by slippage limits]
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 pools on these routes (PRIME/PYUSD, PYUSD/USDC, eUSX/USX, USX/USDC, USDG/USDC) each charged a 0.01% fee in the tests, so almost all of an exit's cost comes from the depeg itself.
- OnRe's exit asks OnRe for a little more USDG than the target to cover the second swap, so its cost in the table above is measured against the value the leg gave up.
- Token-leg guards: the USDG token leg checks Pyth's USDG/USD price and the USDG/USDC pool, and flags a reading more than 50 bps (0.5%) away from par; the syrupUSDC token leg flags a syrupUSDC/USDC pool price more than 100 bps (1%) away from Maple's rate; the ONyc token leg compares OnRe's NAV with its market price.