yb-LP share value derivation
A yb-LP share has two values. Fundamental Value is the vault's accounting value at the oracle price. Redemption Value is what a withdrawal returns from the live Curve Cryptoswap pool. The signed gap between them is the Temporary Redemption Discount (TRD). Each value comes from a read-only getter on LT, the market's vault contract. The derivation below traces both getters to show where the gap comes from. For what TRD means when you withdraw, read Fundamental Value, Redemption Value, and TRD.
Position and redemption path
LEVAMM is the market's leveraged automated market maker (AMM). Inside LEVAMM, a yb-LP position holds two amounts:
- Curve liquidity provider (LP) tokens (collateral).
- crvUSD debt.
One share gives the holder a proportional claim on collateral and debt. On this page, a tilde marks the amount that one share claims. The Math primer uses a tilde for a different quantity: an ideal value at the oracle price.
A redemption unwinds the claim through the Curve Cryptoswap pool in three steps:
- Remove liquidity from Cryptoswap (fixed debt output) to receive the asset and crvUSD.
- Use the received crvUSD to repay to LEVAMM.
- Return the remaining asset to the holder.
How LT computes each value
LT computes Fundamental Value and Redemption Value with two different getters. The table compares them:
| Value | Getter | Reference price | What it computes |
|---|---|---|---|
| Fundamental Value | LT.pricePerShare() | Oracle price through AMM.value_oracle | Total position value divided by share supply, after a checkpoint that accounts for pending admin fees |
| Redemption Value | LT.preview_withdraw(tokens) | Live Cryptoswap state | Pro rata LEVAMM state → Cryptoswap.calc_withdraw_fixed_out |
Both getters account for pending admin fees with the same value-checkpoint routine.
pricePerShare() reads AMM.value_oracle, which evaluates from the stored LEVAMM state and the oracle price. This is the whitepaper's "" quantity: the sandwich-resistant value at (whitepaper Eq. 21, RELEVERAGE ALGORITHM section). Math primer derives in Eq (3.8) and this value in Eq (3.9).
pricePerShare() then converts that value to the asset with the pool's price_scale (its internal price) and the crvUSD aggregator price. On the deprecated markets 0 to 2, LT comes from an earlier blueprint, which reads the pool's price_oracle instead. The pool inputs change at most once per block, so one transaction cannot move them far. For why, read Oracle design.
preview_withdraw simulates the three redemption steps against the live pool. In its formula, total is the total position value, and admin is the pending admin fees, which can be negative. supply_tokens is the share supply, and tokens is the number of shares to redeem. The getter follows these steps:
- Compute a proportional slice:
frac = total / (total + max(admin, 0)) × tokens / supply_tokens. LT excludes a positive admin balance from the claim. - Scale the LEVAMM state:
withdrawn_lp = collateral × frac,withdrawn_debt = debt × frac. - Call
CRYPTOPOOL.calc_withdraw_fixed_out(withdrawn_lp, 0, withdrawn_debt)to get the asset amount that Cryptoswap pays for that unwind.
The call in the last getter step simulates redemption step 1: the actual Cryptoswap unwind with a fixed debt repayment. So the result includes the slippage and fees at the pool's current balances.
Where the gap comes from
The two values are equal when the oracle price and the live Cryptoswap spot price agree. That occurs after arbitrage has aligned the LEVAMM target with the Cryptoswap state. After a market move and before arbitrage completes, the prices drift apart. TRD opens in that window.
TRD is 0 when the Cryptoswap state matches LEVAMM's oracle target. The time to get there depends on volume and on how far price_scale must move.
LT.withdraw removes liquidity from Cryptoswap with remove_liquidity_fixed_out, an imbalanced removal. The pool charges half its fee rate on the imbalanced part. On a pool that runs the oracle-report policy (YBOraclizedPolicy), that rate is the policy's fallback fee, not the native fee curve. preview_withdraw includes this fee. For what the fallback fee is, read Pool policies.
TRD from the two values
TRD is the signed gap between Redemption Value (preview_withdraw) and Fundamental Value (pricePerShare()). A negative TRD means that a withdrawal now returns less. For the formula, the decimal scaling of the two getters, and when to act on TRD, read Fundamental Value, Redemption Value, and TRD.
Watermark condition for staked shares
After losses, a staked position can sit below its watermark. LT.liquidity exposes staked and ideal_staked. ideal_staked is the watermark: the staked value that the gauge must regain before LT charges an admin fee on new gains. The contract caps staked at ideal_staked, so the staked side is at its watermark only at strict equality:
When staked < ideal_staked, the staked side is below its watermark. Then a staked redemption returns less than the deposit, even with TRD = 0. For how losses open the gap and how later gains close it, with a worked example, read Watermark and recovery.
Related
- Math primer: the LEVAMM derivation behind
pricePerShare(). - Fundamental Value, Redemption Value, and TRD: the TRD formula, what the gap means for you, and what sets the time for it to close.
- Dev: Deposit and withdraw: TRD from the two LT getters, with unit scaling, for integration code.
- Watermark and recovery: how later gains return the staked side to
ideal_staked.