Skip to main content

Watermark and Recovery

A staked yb-LP position is "underwater" when the price-per-share has fallen below its watermark. The protocol calls this Recovery Mode. Subsequent fee inflows route to the staked side first until parity is restored, so the loss is bounded and temporary; YB emissions continue to accrue throughout. This state is expected to be rare; what follows is the contract-level mechanism that protects stakers if it is triggered.

The two variables

  • staked: the actual value currently held in staked.
  • ideal_staked: the watermark. Equals price-per-share ATH.

Both update on every deposit, withdraw, transfer into or out of the staker address, and every fee distribution.

Watermark is the user-facing name for ideal_staked. The docs use watermark everywhere except in source-level discussion.

Three states

StateConditionWhat's happening
At paritystaked == ideal_stakedNormal operation. Fees split between staked and unstaked per admin-fee formula.
Recovery modestaked < ideal_stakedFees route to staked first until parity.
Above watermarkNot a permitted statestaked is capped at ideal_staked in the accounting itself.

Worked example: how recovery works when triggered

Recovery mode is rare. The scenario below illustrates how the mechanism behaves once triggered; the numbers are illustrative magnitudes for pedagogical clarity.

Day 0. You stake 100 yb-LP shares at PPS = 1.0. staked = 100, ideal_staked = 100.

Days 1–30. Market volatility pushes cumulative rebalance cost above fees by 2%. staked drops to 98; ideal_staked stays at 100. Recovery mode is active. Your YB emissions over the 30 days: about $50 in YB at current price.

Days 31–60. Fees outrun rebalance cost by 1.5%. All 1.5% routes to the staked side first, since admin fee does not apply during recovery. staked climbs to 99.47.

Days 61–100. Another 1.5% net fee gain routes entirely to staked, closing the gap. staked = 100.0. From this point, admin fee applies to subsequent inflows.

Day 100. You unstake. Redemption value (modulo TRD) is roughly 100oforiginalvalueplus100 of original value plus 50 of YB emissions: positive net.

If instead you unstake on day 30, mid-drawdown: your 100 shares redeem for 98ofsharevalueplus98 of share value plus 50 YB = 148,againstthe148, against the 150 you would have had by waiting. Realized loss: $2 of PPS-level value. No TRD assumed.

Entering Recovery Mode

When rebalance costs or LEVAMM revaluation reduce the vault's total value, LT distributes the loss across staked and unstaked. The net effect is staked dropping below ideal_staked.

In the value-distribution logic:

  • Positive value change: flows to staked first while staked < ideal_staked.
  • Negative value change: absorbed proportionally, with staked loss capped at the larger of its fair share and a safety bound (the v_st_loss * supply / staked term, which prevents unbounded dilution of stakers' shares).

Exiting Recovery Mode

Fees and favourable rebalances accrue. Each fee distribution:

  1. Increases staked toward ideal_staked.
  2. Once parity is reached, subsequent fees resume the normal staked/unstaked split.

Recovery time depends on fee flow. The parameter set keeps rebalance cost close to fee income, so a triggered recovery closes as forward fees outrun forward drag — the size of the gap determines how many fee cycles that takes.

What a staked LP sees

  • During drawdown: the dashboard shows PPS still climbing for unstaked LPs, but your staked position's redeemable value is below deposit.
  • YB emissions continue throughout. They are the compensation for waiting.
  • At watermark recovery: your staked position's redeemable value returns to at-or-above deposit, modulo TRD (which also resolves on its own).

How staked moves on deposits and transfers

  • Deposit from user address (unstaked): supply and total grow; staked and ideal_staked unchanged.
  • Transfer into staker address (stake): staked and ideal_staked both increase by proportional value. Watermark re-anchors.
  • Transfer out of staker address (unstake): staked decreases by proportional value; ideal_staked decreases by the same ratio of staked_tokens. The gap as a percentage of staked is preserved on unstake, not the absolute value of the gap.

Worked illustration. Suppose staked = 980, ideal_staked = 1000 (gap 2%) and you stake 100 of new value. Both variables scale: staked = 1080, ideal_staked ≈ 1102. Gap stays near 2%.