Skip to main content

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

ConceptFunctionReference priceWhat it computes
PPS (fundamental)LT.pricePerShare()Oracle price pop_o via AMM.value_oracleTotal position value divided by share supply, after a checkpoint that accounts for pending admin fees
Redemption valueLT.preview_withdraw(tokens)Live Cryptoswap statePro-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 V=x0(po)/(2L1)V = x_0(p_o) / (2L - 1) using the stored LEVAMM state and the oracle price. This is the whitepaper's "VV" quantity, defined as the sandwich-resistant value at p=pop = p_o (whitepaper Eq. 21, RELEVERAGE ALGORITHM section). See Math Primer §3 for the derivation of x0(po)x_0(p_o).

preview_withdraw instead:

  1. Computes a proportional slice: frac = total / (total + admin) × tokens / supply_tokens.
  2. Scales AMM state: withdrawn_lp = collateral × frac, withdrawn_debt = debt × frac.
  3. 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 pop_o (EMA, not manipulable in-block).
  • Redemption: live Cryptoswap spot price embedded in the calc_withdraw_fixed_out output.

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:

  • yy Curve LP tokens (collateral).
  • dd crvUSD debt.

Redeeming one share entitles the holder to y~\tilde{y} collateral and d~\tilde{d} debt proportionally. The redemption unwinds through the Curve Cryptoswap pool:

  1. Remove liquidity from Cryptoswap (fixed debt output) → receive asset + crvUSD.
  2. Received crvUSD repays d~\tilde{d} back to LEVAMM.
  3. 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 V=x0(po)/(2L1)V = x_0(p_o)/(2L-1) (Eq. 21).
  • Redemption value (live Cryptoswap state). Computed by LT.preview_withdraw(shares) via Cryptoswap.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

TRD  =  1VshareliveVshareoracle  =  1preview_withdraw(shares)pricePerShare()shares/1018\text{TRD} \;=\; 1 - \frac{V_{\text{share}}^{\text{live}}}{V_{\text{share}}^{\text{oracle}}} \;=\; 1 - \frac{\mathtt{preview\_withdraw}(\mathtt{shares})}{\mathtt{pricePerShare}() \cdot \mathtt{shares}/10^{18}}

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\mathrm{staked} = \mathrm{ideal\_staked}

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.