yb-LP Share Value Derivation
Two distinct quantities describe what a yb-LP share is worth, both computed in
LT.vy. PPS (pricePerShare) values the share at oracle price via LEVAMM's internal invariant; this is the fundamental per-share accounting. Redemption value (preview_withdraw) values the share at the live Cryptoswap state, which is what a redeemer actually receives on withdraw. The gap between the two is TRD.
The two quantities
| Concept | Function | Reference price | What it computes |
|---|---|---|---|
| PPS (fundamental) | LT.pricePerShare() | Oracle price via 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 AMM state → Cryptoswap.calc_withdraw_fixed_out |
Both are read-only. Both account for pending admin fees via the same value-checkpoint routine.
PPS is an oracle-priced valuation, so it is resistant to flash-loan or sandwich manipulation of Cryptoswap's spot price; the oracle EMA does not move within one block.
Redemption value is a live-state valuation. It calls CRYPTOPOOL.calc_withdraw_fixed_out(withdrawn_lp, 0, withdrawn_debt), the actual Cryptoswap unwind with debt repayment pinned, so it reflects whatever slippage the pool's current balances would impose.
Where the gap comes from
PPS reads AMM.value_oracle, which evaluates using the stored LEVAMM state and the oracle price. This is the whitepaper's "" quantity, defined as the sandwich-resistant value at (whitepaper Eq. 21, RELEVERAGE ALGORITHM section). See Math Primer §3 for the derivation of .
preview_withdraw instead:
- Computes a proportional slice:
frac = total / (total + admin) × tokens / supply_tokens. - Scales AMM state:
withdrawn_lp = collateral × frac,withdrawn_debt = debt × frac. - Calls
CRYPTOPOOL.calc_withdraw_fixed_out(withdrawn_lp, 0, withdrawn_debt)to get what Cryptoswap would pay out in asset terms for that unwind.
Both functions value the same underlying position, but at different reference prices:
- PPS: oracle price (EMA, not manipulable in-block).
- Redemption: live Cryptoswap spot price embedded in the
calc_withdraw_fixed_outoutput.
When the two reference prices agree (arbitrage has aligned LEVAMM target with Cryptoswap state), the quantities coincide. When they drift (market moved recently, arb not yet through), a gap opens. That gap is TRD.
Setup
A yb-LP position comprises, inside LEVAMM:
- Curve LP tokens (collateral).
- crvUSD debt.
Redeeming one share entitles the holder to collateral and debt proportionally. The redemption unwinds through the Curve Cryptoswap pool:
- Remove liquidity from Cryptoswap (fixed debt output) → receive asset + crvUSD.
- Received crvUSD repays back to LEVAMM.
- Remaining asset returns to user.
This is exactly what LT.preview_withdraw simulates, using CRYPTOPOOL.calc_withdraw_fixed_out for step 1.
Per-share form
Two formulas value each share:
- PPS (oracle-priced fundamental). Computed by
LT.pricePerShare()using LEVAMM's stored state and the EMA-smoothed oracle price. Derives from the whitepaper's sandwich-resistant value (Eq. 21). - Redemption value (live Cryptoswap state). Computed by
LT.preview_withdraw(shares)viaCryptoswap.calc_withdraw_fixed_out, reflecting actual unwind slippage and fees at current pool balances.
The gap between the two is TRD.
For the full derivation including code-level grounding, see PPS and Redemption Value Derivation. For the underlying invariant, see Math Primer.
TRD as an observable
Resolves to 0 when Cryptoswap state aligns with LEVAMM's oracle target (closed by arbitrage; see Temporary Redemption Discount).
Staked condition
LT.liquidity exposes staked and ideal_staked. The contract caps staked at ideal_staked, so parity is the strict equality:
staked < ideal_staked defines Recovery Mode. While in Recovery Mode, even with TRD = 0, a staked redemption returns less than deposit until incoming admin fees route to the staked side first and restore parity. See Watermark and Recovery.
Related
- Math Primer — §3 is the authoritative derivation.
- Fundamental Value vs Redemption Value: concept-page counterpart focused on user-facing consequences of the gap.
- Temporary Redemption Discount — the TRD arbitrage-closure mechanism and its bounds.
- Watermark & Recovery — how ideal_staked restores parity via admin-fee routing.