Skip to main content

Math Primer

Single source of truth for YieldBasis math. Notation table in §0 is authoritative; downstream pages reference equation numbers here rather than restating derivations.

Before you read this​

This page is dense. The derivations use standard tools. For the basics in one place, see Concepts.

  • Algebra and basic calculus notation. Comfort with ⋅\sqrt{\cdot}, exponents, and single-variable derivatives. The integration step in §2 uses ∫dln⁡V=ln⁡V+C\int d\ln V = \ln V + C.
  • LP value-function derivations. The idea that an LP's dollar value can be written as a closed-form function of the external price. §1 does this from scratch for constant product.
  • The x⋅y=kx \cdot y = k invariant. The constant-product bonding curve used by Uniswap v2 and the starting point for §1.
  • Whitepaper pointer. The YB whitepaper has the full derivations with additional algebraic steps and edge-case discussion. This page is the on-site reference; the whitepaper is the long form.

0. Notation & symbols​

SymbolMeaning
ppBTC spot price in USD
pop_oOracle BTC/USD price used by the LEVAMM
VcV_cValue of collateral (Curve LP tokens)
V∗V_*Value of the leveraged position (after borrowing)
ddOutstanding crvUSD debt
LLCompounding leverage factor (fixed to 2 in YieldBasis)
yyLP token amount held by the LEVAMM
x0(po)x_0(p_o)Anchor term in the LEVAMM pricing formula
I(po)I(p_o)Invariant constant of the LEVAMM for a fixed oracle price
ϕ\phiFlash-loan size (crvUSD) solved via a quadratic
faf_aAdmin-fee fraction routed to veYB
fmin⁡f_{\min}Minimum admin fee when nobody stakes
s,Ts, TStaked vs total supply of LT tokens
vs,vs∗v_s, v_s^*Current and ideal (watermark) value of the staked bucket
rpoolr_{\text{pool}}Fee APR earned by the underlying Curve pool (unlevered)
rborrowr_{\text{borrow}}Borrow APR on the crvUSD CDP line
rreleverager_{\text{releverage}}Effective APR cost of maintaining leverage (releverage losses, gross of refuel)
rrefuelr_{\text{refuel}}Donation-funded offset to rreleverager_{\text{releverage}} (from recycled borrower interest)

1. The constant-product problem (why √p shows up)​

Classic AMMs (e.g. Uniswap v2) enforce

x⋅y=k(1.1)x \cdot y = k \tag{1.1}

where xx is the USD side and yy is the BTC side. Let the external BTC price be pp (USD per BTC).

1.1 Normalising the start​

Suppose equal USD value is deposited at p0=1p_0 = 1:

  • x0=1x_0 = 1 USD
  • y0=1y_0 = 1 BTC (worth $1 at p0p_0)

So

k=x0⋅y0=1.(1.2)k = x_0 \cdot y_0 = 1. \tag{1.2}

1.2 After a price move​

Arbitrage pushes the AMM price to pp. In a constant-product AMM,

p=xy.(1.3)p = \frac{x}{y}. \tag{1.3}

Combine (1.1) and (1.3):

x=kp,y=kp.(1.4)x = \sqrt{k p}, \qquad y = \sqrt{\frac{k}{p}}. \tag{1.4}

With k=1k = 1:

x=p,y=1p.(1.5)x = \sqrt{p}, \qquad y = \frac{1}{\sqrt{p}}. \tag{1.5}

1.3 LP value scales as √p​

Ignoring fees, LP USD value is

VLP(p)=x+p y=p+p⋅1p=2p.(1.6)V_{\text{LP}}(p) = x + p\,y = \sqrt{p} + p \cdot \frac{1}{\sqrt{p}} = 2\sqrt{p}. \tag{1.6}

The initial deposit totals $2, so the per-initial-dollar scaling is

VLP,norm(p)=p(1.7)\boxed{V_{\text{LP,norm}}(p) = \sqrt{p}} \tag{1.7}

1.4 Impermanent loss (IL)​

If the assets had been held without providing liquidity:

Vhold(p)=p+1.(1.8)V_{\text{hold}}(p) = p + 1. \tag{1.8}

Impermanent loss (relative underperformance) is

IL(p)=VLP(p)Vhold(p)−1=2p1+p−1.(1.9)\text{IL}(p) = \frac{V_{\text{LP}}(p)}{V_{\text{hold}}(p)} - 1 = \frac{2\sqrt{p}}{1+p} - 1. \tag{1.9}

Since 2p<1+p2\sqrt{p} < 1+p for any p≠1p \neq 1, IL(p)<0\text{IL}(p) < 0: the LP underperforms a simple hold whenever price drifts.

Takeaway. Constant-product LP value ∝p\propto \sqrt{p}. Other, more complicated, AMM formulae are not immune to the IL problem either, and the source thereof is the sublinearity of the value function, for which reason the only way of eliminating IL is to design an AMM with an at least linear value function. YieldBasis provides such a design by engineering exposure to scale linearly with pp, not as p\sqrt{p}.


2. Compounding leverage — turning √p into p​

YieldBasis borrows against the LP collateral to keep a constant compounding leverage of LL.

2.1 Defining "compounding leverage"​

By construction, the protocol keeps debt at a fixed fraction of collateral:

d=Vc(1−1L).(2.1)d = V_c \left(1 - \frac{1}{L}\right). \tag{2.1}

So the net position value is

V∗=Vc−d=VcL.(2.2)V_* = V_c - d = \frac{V_c}{L}. \tag{2.2}

Consider a small change in collateral value dVcdV_c. After re-leveraging to restore the ratio, the relative change of V∗V_* is amplified by LL:

δV∗V∗=L δVcVc.(2.3)\frac{\delta V_*}{V_*} = L \, \frac{\delta V_c}{V_c}. \tag{2.3}

Integrate both sides:

∫δV∗V∗=L∫δVcVc  ⟹  ln⁡V∗=Lln⁡Vc+const.(2.4)\int \frac{\delta V_*}{V_*} = L \int \frac{\delta V_c}{V_c} \;\Longrightarrow\; \ln V_* = L \ln V_c + \text{const}. \tag{2.4}

Exponentiate:

V∗∝Vc L(2.5)\boxed{V_* \propto V_c^{\,L}} \tag{2.5}
Why is the relative change amplified?

Growth of the price of collateral.

If the collateral grows in price, the value V∗V_* changes as (dd is kept constant at this step):

V∗+δV∗=Vc−d+δVc−δd=(Vc−d)+δVc=V∗+δVc=V∗+yδpV_* + \delta V_* = V_c - d + \delta V_c - \delta d = (V_c - d) + \delta V_c = V_* + \delta V_c = V_* + y\delta p

δV∗V∗=yδpypL=Lδpp=LδVcVc\frac{\delta V_*}{V_*} = \frac{y \delta p}{\frac{yp}{L}} = L\frac{\delta p}{p} = L\frac{\delta V_c}{V_c}

Adjustment of the debt value and of the collateral amount.

By definition:

d=Vc(1−1L)d = V_c\left(1-\frac{1}{L}\right)

Then:

V∗+δV∗=Vc−d+δVc−δd=(Vc+δVc)−d−(1−1L)δVc=V∗+1LδVc=V∗+1LpδyV_*+\delta V_* = V_c - d +\delta V_c - \delta d = (V_c + \delta V_c)-d-\left(1-\frac{1}{L}\right)\delta V_c = V_*+\frac{1}{L}\delta V_c = V_*+\frac{1}{L}p\delta y

Whence it follows that

δV∗V∗=pδyLpyL=δyy=δVcVc\frac{\delta V_*}{V_*} = \frac{\frac{p\delta y}{L}}{\frac{py}{L}} = \frac{\delta y}{y} = \frac{\delta V_c}{V_c}

In this step the value of the leveraged position tracks the collateral value linearly, so the total scaling factor equals the scaling factor from the previous step. See the General Idea section of the whitepaper for more.

2.2 Pick L = 2 to linearise BTC exposure​

Curve Cryptoswap LP value scales approximately as Vc∝pV_c \propto \sqrt{p}. Substituting into (2.5):

V∗∝(p) L=p L/2.(2.6)V_* \propto (\sqrt{p})^{\,L} = p^{\,L/2}. \tag{2.6}

Set L=2L = 2:

V∗∝p(2.7)\boxed{V_* \propto p} \tag{2.7}

Result. With L=2L = 2, the position tracks BTC one-to-one. The p\sqrt{p} curvature, and with it impermanent loss, is eliminated while trading fees continue to accrue.

2.3 What if L ≠ 2?​

  • L>2L > 2: V∗∝pL/2V_* \propto p^{L/2} — outperform on the way up, underperform on the way down (reintroduces divergence vs. just holding).
  • L<2L < 2: You under-hedge the p\sqrt{p} curve and still suffer residual IL.

Hence locking L=2L = 2 is the sweet spot: linear BTC exposure, zero IL, manageable debt always unwindable with the LP's USD side.


3. LEVAMM & Virtual Pool​

To keep leverage fixed at L=2L = 2 (debt = 50% of value), YieldBasis uses a second AMM ("LEVAMM"). It holds Curve LP tokens on one side and implicit crvUSD debt on the other, anchored to an oracle price pop_o (BTC/USD).

The derivation first states the target (ideal) state at p=pop = p_o, then derives the invariant and solves for the anchor variable x0(po)x_0(p_o).

3.1 Ideal debt at the oracle price​

If the live market price equals the oracle price pop_o, "perfect" leverage is:

d~  =  L−1L po y~(ideal debt when p=po),(3.1)\tilde{d} \;=\; \frac{L-1}{L}\,p_o\,\tilde{y} \qquad\text{(ideal debt when } p = p_o\text{)}, \tag{3.1}

where y~\tilde{y} is the LP amount in the AMM at that oracle touch point (tildes = "ideal" values).

For L=2L = 2: d~=12poy~\tilde{d} = \tfrac{1}{2} p_o \tilde{y}.

3.2 LEVAMM invariant & pricing​

Define x≡x0(po)−dx \equiv x_0(p_o) - d. The LEVAMM uses a constant-product-like invariant:

(x0(po)−d)  y  =  I(po),(3.2)\big(x_0(p_o) - d\big)\; y \;=\; I(p_o), \tag{3.2}

with I(po)I(p_o) constant as long as pop_o stays fixed.

At p=pop = p_o, the AMM's instantaneous price should equal the oracle:

x0(po)−d~y~=po.(3.3)\frac{x_0(p_o) - \tilde{d}}{\tilde{y}} = p_o. \tag{3.3}

Substitute d~\tilde{d} from (3.1):

x0(po)=2L−1L po y~.(3.4)x_0(p_o) = \frac{2L - 1}{L}\,p_o\,\tilde{y}. \tag{3.4}

3.3 Solving for x₀ with arbitrary y, d​

Away from the ideal point, y~\tilde{y} is not directly known. From (3.4):

y~  =  L2L−1 x0po.(3.5)\tilde{y} \;=\; \frac{L}{2L - 1}\,\frac{x_0}{p_o}. \tag{3.5}

Evaluate the invariant at the ideal point:

I(po)  =  (x0−d~) y~  =  (x0−L−1Lpoy~)y~.(3.6)I(p_o) \;=\; \big(x_0 - \tilde{d}\big)\,\tilde{y} \;=\; \left(x_0 - \frac{L-1}{L} p_o \tilde{y}\right)\tilde{y}. \tag{3.6}

Set that equal to the current-state invariant (x0−d) y(x_0 - d)\,y, substitute (3.5), and rearrange. The result is a quadratic in x0x_0:

x02(L2L−1)2−poy x0+poy d=0.(3.7)x_0^{2}\left(\frac{L}{2L-1}\right)^{2} - p_o y\,x_0 + p_o y\,d = 0. \tag{3.7}

Choose the larger root (matches the ideal-state intuition):

x0(po)=poy+(poy)2−4 po y d (L2L−1)22(L2L−1)2(3.8)\boxed{ x_0(p_o) = \frac{p_o y + \sqrt{(p_o y)^2 - 4\,p_o\,y\,d\,\left(\tfrac{L}{2L-1}\right)^{2}}} {2\left(\tfrac{L}{2L-1}\right)^{2}} } \tag{3.8}

For L=2L = 2, numerical simplification is applied in code; the general form is retained here for clarity.

3.4 Useful derived quantities​

Pool value at oracle price (sandwich-resistant valuation):

V  =  y~ po−d~  =  1L y~ po  =  x02L−1.(3.9)V \;=\; \tilde{y}\,p_o - \tilde{d} \;=\; \frac{1}{L}\,\tilde{y}\,p_o \;=\; \frac{x_0}{2L - 1}. \tag{3.9}

Invariant in closed form.

I(po)  =  (x0−d~) y~  =  x02po(L2L−1)2.(3.10)I(p_o) \;=\; \big(x_0 - \tilde{d}\big)\,\tilde{y} \;=\; \frac{x_0^{2}}{p_o}\left(\frac{L}{2L-1}\right)^{2}. \tag{3.10}

An alternative expression for VV follows from (3.10):

V  =  2 I(po) po−x0.(3.11)V \;=\; 2\,\sqrt{I(p_o)\,p_o} - x_0. \tag{3.11}

3.5 Flash-loan sizing (φ)​

When the arbitrageur comes with xx crvUSD (or needs extra), the Virtual Pool computes how much crvUSD to flash-borrow so that Curve liquidity is added/removed symmetrically (no spot price move) and the flash loan is repaid inside the same tx.

Let:

  • ff — LEVAMM fee
  • dd — current debt
  • yy — LP amount in the LEVAMM
  • x0x_0 — anchor term from Eq. (3.8)
  • xx — user-provided crvUSD for this swap
  • xc,yc,Scx_c, y_c, S_c — Curve pool's stablecoin reserves, crypto reserves, total LP supply

Define

r  =  xcSc (1−f).(3.12)r \;=\; \frac{x_c}{S_c}\,(1 - f). \tag{3.12}

The required flash amount ϕ\phi solves the quadratic (whitepaper Eq. 39):

ϕ2+ϕ(x0−d+x−r y)−y x r=0.(3.13)\phi^{2} + \phi\big(x_0 - d + x - r\,y\big) - y\,x\,r = 0. \tag{3.13}

Discriminant:

D  =  (x0−d+x−r y)2+4 y x r.(3.14)D \;=\; \big(x_0 - d + x - r\,y\big)^2 + 4\,y\,x\,r. \tag{3.14}

Choose the positive root:

ϕ=D−(x0−d+x−r y)2(3.15)\boxed{ \phi = \frac{\sqrt{D} - (x_0 - d + x - r\,y)}{2} } \tag{3.15}

This is evaluated inside the Virtual Pool before executing the swap, ensuring the flash loan is exactly covered by the LP redemption and AMM trade proceeds.

3.6 Directional intuition​

  • Debt too low (price up): d/V<0.5d/V < 0.5. Then x0−dx_0 - d is large → LP is "expensive" in crvUSD. Arb brings in crvUSD, mints LP, increases dd.
  • Debt too high (price down): d/V>0.5d/V > 0.5. Then x0−dx_0 - d is small → LP is "cheap". Arb buys LP, unwraps, repays debt.

All legs (flash loan, LP mint/burn, CDP mint/repay) run atomically in the Virtual Pool wrapper.

3.7 Safe debt bounds​

The protocol enforces safe operating bounds on the debt ratio to prevent edge cases:

  • MIN_SAFE_DEBT =14L2= \dfrac{1}{4L^2} of collateral value — at L=2L = 2: 116=6.25%\tfrac{1}{16} = 6.25\% (prevents under-leveraging edge cases).
  • MAX_SAFE_DEBT =(2L−1)24L2−18L2= \dfrac{(2L-1)^2}{4L^2} - \dfrac{1}{8L^2} of collateral value — at L=2L = 2: 916−132=1732=53.125%\tfrac{9}{16} - \tfrac{1}{32} = \tfrac{17}{32} = 53.125\%.

For L=2L = 2, the critical debt value corresponds to pAMM=916pop_{\text{AMM}} = \tfrac{9}{16} p_o; MAX_SAFE_DEBT sits a 132\tfrac{1}{32} buffer below that 916\tfrac{9}{16} mathematical limit. Deposits and withdrawals that would leave debt outside the band revert with "Unsafe min" / "Unsafe max".


4. Net APR & cost terms​

Explicit expression for the crypto-denominated return of an unstaked yb-LP position.

4.1 Components​

Let:

  • rpoolr_{\text{pool}} — APR the Curve BTC/crvUSD pool would earn without leverage (pure trading fees, in BTC terms).
  • LL — compounding leverage (YieldBasis: L=2L = 2).
  • rborrowr_{\text{borrow}} — effective borrow APR on the protocol's crvUSD line (set by governance).
  • rreleverager_{\text{releverage}} — drag from maintaining constant leverage (AMM fees/price edge paid to arbs, slippage).
  • rrefuelr_{\text{refuel}} — subsidy from recycled borrower interest (see §4.2a).

Because the protocol supplies twice as much notional liquidity (BTC plus borrowed crvUSD) to Curve, gross fee flow scales approximately linearly with LL:

Gross fee APR  =  L⋅rpool.(4.1)\text{Gross fee APR} \;=\; L \cdot r_{\text{pool}}. \tag{4.1}

For L=2L = 2:

Gross fee APR  =  2 rpool.(4.2)\text{Gross fee APR} \;=\; 2\,r_{\text{pool}}. \tag{4.2}

Subtract the two costs:

  1. Borrow cost — interest paid on the crvUSD debt.
  2. Leverage cost — continuous leak to arbitrageurs that keep the ratio at 50%.

Combining:

APRnet=L rpool−(rborrow+rreleverage)(4.3)\boxed{ \text{APR}_{\text{net}} = L\,r_{\text{pool}} - \bigl(r_{\text{borrow}} + r_{\text{releverage}}\bigr) } \tag{4.3}

For YieldBasis' fixed L=2L = 2:

APRnet=2 rpool−(rborrow+rreleverage)(4.4)\boxed{ \text{APR}_{\text{net}} = 2\,r_{\text{pool}} - \bigl(r_{\text{borrow}} + r_{\text{releverage}}\bigr) } \tag{4.4}

4.2 Heuristic for r_releverage​

Backtests (Jan 2019 – Oct 2024) show:

  • Optimised constant-product pools (no leverage) earn ∼3%\sim 3\% APR over that window.
  • Empirically, rreleverage≈2×r_{\text{releverage}} \approx 2\times that value. The cost of keeping leverage perfect is roughly twice what a plain Uniswap-style pool can earn under the same conditions.

This is why the method fails on a pure x⋅y=kx\cdot y = k AMM (fees not big enough) but works on Curve Cryptoswap where rpoolr_{\text{pool}} is materially higher. Not hard-coded on-chain; a modelling shortcut:

rreleverage≈2⋅rxy=kopt(empirical).(4.5)r_{\text{releverage}} \approx 2 \cdot r_{xy = k}^{\text{opt}} \quad \text{(empirical)}. \tag{4.5}

4.2a Implementation nuance: Cryptoswap fee split + refueling loop​

Equations (4.1)–(4.4) are the whitepaper-clean theoretical model. Two effects shift the realised numbers:

  1. Cryptoswap's internal fee split. The pool reserves a fraction of trading-fee profit for its rebalance reserve (tracked via xcp_profit vs virtual_price); only the LP share reaches LEVAMM's collateral value. In the original Twocrypto design the LP share was fixed at 50%. The v3 pools expose it as the governance-set reserved_profit_fraction ρ\rho, set per pool; read it on the pool contract for the live value. Practical substitution:
rpool,realised  ≈  ρ⋅rpool,raw.(4.6)r_{\text{pool,realised}} \;\approx\; \rho \cdot r_{\text{pool,raw}}. \tag{4.6}

LEVAMM's own trading-fee capture adds on top.

  1. Refueling loop. Borrower interest is not paid to an external creditor. It is swept out of LEVAMM and donated entirely to the Cryptoswap pool, where it funds price_scale rebalance cost. At steady state, interest paid becomes rebalance subsidy. So rborrowr_{\text{borrow}} and part of rreleverager_{\text{releverage}} cancel via the donation flow:
rrefuel  ≈  rborrow(steady state).(4.7)r_{\text{refuel}} \;\approx\; r_{\text{borrow}} \quad \text{(steady state)}. \tag{4.7}

Net realised LP drag is the residual rreleverage−rrefuelr_{\text{releverage}} - r_{\text{refuel}}, not rborrow+rreleverager_{\text{borrow}} + r_{\text{releverage}}:

APRnet,realised≈L rpool,realised−(rreleverage−rrefuel)(4.8)\boxed{ \text{APR}_{\text{net,realised}} \approx L\,r_{\text{pool,realised}} - \bigl(r_{\text{releverage}} - r_{\text{refuel}}\bigr) } \tag{4.8}

Eq. (4.4) remains useful as the whitepaper-clean envelope; Eq. (4.8) describes what an LP sees on-chain.

4.3 Continuous vs. discrete compounding​

All rates above are quoted as simple APRs for intuition. For continuous compounding:

APYnet=exp⁡ ⁣(APRnet)−1.(4.9)\text{APY}_{\text{net}} = \exp\!\big(\text{APR}_{\text{net}}\big) - 1. \tag{4.9}

Given the magnitudes (single-digit percentages for costs, double-digit for fees), APR ≈ APY within a few bps.

Takeaway. YieldBasis only wins if the doubled fee stream outpaces borrow + rebalance drag. Governance controls those drags (via borrow rate and AMM params), keeping net APR attractive in most regimes.


5. Token incentives & admin-fee function​

YieldBasis splits real fee flow between unstaked yb-LP holders (they want BTC/ETH-denominated fees) and veYB holders (protocol value capture). The split is governed by an admin-fee curve that depends on how much of the liquidity is staked.

5.1 Admin-fee formula​

Let:

  • TT = total yb-LP supply,
  • ss = amount of yb-LP staked,
  • fmin⁡f_{\min} = minimum admin fee when nobody stakes,
  • faf_a = actual admin-fee fraction routed to veYB.

The curve:

fa  =  1−(1−fmin⁡) 1−sT(5.1)\boxed{ f_a \;=\; 1 - (1 - f_{\min}) \, \sqrt{1 - \frac{s}{T}} } \tag{5.1}

Limits:

  • s=0⇒fa=fmin⁡s = 0 \Rightarrow f_a = f_{\min} (unstaked LPs keep 1−fmin⁡1-f_{\min} of fees).
  • s=T⇒fa→1s = T \Rightarrow f_a \to 1 (all fees to veYB; stakers opted out of fee yield anyway).

The square root makes the increase gentle at first (so early stakers do not massively penalise LPs), then accelerates near full staking to avoid an "everyone stakes, no one gets fees" equilibrium.

5.2 Splitting fee gains / sharing losses​

After each accounting tick (deposit, withdraw, or checkpoint), let

  • v−1v_{-1} = total value of the leveraged position (in BTC terms) before fees this period,
  • v1v_1 = total value after market moves + fees, before anything is allocated,
  • Δv=v1−v−1\Delta v = v_1 - v_{-1} = value change.

Further, let vsv_s and vs∗v_s^* be the staked bucket's current value and watermark; vs,loss=max⁡(vs∗−vs,0)v_{s,\text{loss}} = \max(v_s^* - v_s, 0) is the outstanding watermark shortfall.

LT applies admin fee in two regimes, matching the regime split inside LT's value-update routine:

Recovery regime (watermark open, vs,loss>0v_{s,\text{loss}} > 0, Δv>0\Delta v > 0):

The first slice of value_change covers the watermark at 100 percent; no admin fee applies to that portion. Only the remainder is subject to the admin fee:

vloss  =  min⁡ ⁣(Δv,  vs,loss⋅Ts),(5.2a)v_{\text{loss}} \;=\; \min\!\left(\Delta v,\; v_{s,\text{loss}} \cdot \frac{T}{s}\right), \tag{5.2a} Δvuse  =  vloss+(Δv−vloss)(1−fa),(5.2b)\Delta v_{\text{use}} \;=\; v_{\text{loss}} + (\Delta v - v_{\text{loss}})(1 - f_a), \tag{5.2b} Δa  =  (Δv−vloss) fa.(5.2c)\Delta a \;=\; (\Delta v - v_{\text{loss}})\,f_a. \tag{5.2c}

Post-recovery regime (vs,loss=0v_{s,\text{loss}} = 0, Δv>0\Delta v > 0) or loss regime (Δv≤0\Delta v \leq 0):

Admin fee applies uniformly:

Δvuse  =  Δv (1−fa),Δa  =  Δv fa.(5.3)\Delta v_{\text{use}} \;=\; \Delta v\,(1 - f_a), \qquad \Delta a \;=\; \Delta v\,f_a. \tag{5.3}

Losses share pro-rata between buckets (no admin fee on a negative value_change in this regime):

Δvs  =  Δvuse⋅sT,Δvus  =  Δvuse−Δvs.(5.4)\Delta v_s \;=\; \Delta v_{\text{use}} \cdot \frac{s}{T}, \qquad \Delta v_{us} \;=\; \Delta v_{\text{use}} - \Delta v_s. \tag{5.4}

In the recovery regime, the staked share of Δvuse\Delta v_{\text{use}} is capped at the watermark gap:

Δvs  =  min⁡ ⁣(Δvuse⋅sT,  vs,loss).(5.5)\Delta v_s \;=\; \min\!\left(\Delta v_{\text{use}} \cdot \frac{s}{T},\; v_{s,\text{loss}}\right). \tag{5.5}

Unstaked gets whatever remains:

Δvus  =  Δvuse−Δvs.(5.6)\Delta v_{us} \;=\; \Delta v_{\text{use}} - \Delta v_s. \tag{5.6}

Intent. Admin fee is taken only on value that is genuinely new from the staked bucket's perspective. Losses from prior periods must be restored to stakers before veYB begins collecting. This is what gives the watermark mechanism its economic meaning rather than leaving it cosmetic.

5.3 Negative rebase for staked supply​

Staked yb-LP rebases down when value allocated to stakers (after fees) is less than proportional to total value. Let

  • v1′v_1' = new total value after admin fee (v−1+Δvusev_{-1} + \Delta v_{\text{use}}),
  • vs′v_s' = new staked value after sharing profit/loss,
  • ss = staked token supply before rebase,
  • TT = total token supply before rebase,
  • δs\delta s = staked tokens burned (negative rebase).

The value share must match the token share:

s−δsT−δs  =  vs′v1′.(5.7)\frac{s - \delta s}{T - \delta s} \;=\; \frac{v_s'}{v_1'}. \tag{5.7}

Solve for δs\delta s:

δs=s v1′−T vs′ v1′−vs′ (5.8)\boxed{ \delta s = \frac{s\,v_1' - T\,v_s'}{\,v_1' - v_s'\,} } \tag{5.8}

Post-rebase supplies:

snew=s−δs,Tnew=T−δs.(5.9)s_{\text{new}} = s - \delta s, \qquad T_{\text{new}} = T - \delta s. \tag{5.9}

Numerical cap. As v1′→vs′v_1' \to v_s' (staking ratio approaches 100%), the denominator in (5.8) collapses and δs\delta s would blow up. The protocol caps it by clamping the per-step rebase to:

δsmax⁡  =  ∣Δv⋅Tv−1+Δv+1⋅1−faϵmin⁡∣,(5.10)\delta s_{\max} \;=\; \left|\frac{\Delta v \cdot T}{v_{-1} + \Delta v + 1} \cdot \frac{1 - f_a}{\sqrt{\epsilon_{\min}}}\right|, \tag{5.10}

where ϵmin⁡=10−4\epsilon_{\min} = 10^{-4} — the floor on the unstaked fraction below which the cap kicks in. At staking ratios below that floor, δs\delta s is clamped rather than allowed to diverge. The on-chain constant name and exact integer scale live in Dev: LT.

Unstaked tokens never rebase; they accumulate (or lose) value via the (1−fa)(1-f_a) fee stream.

Intuition. Stakers opt into emissions instead of cash fees. If their side under-earns (because they took earlier losses), their token count is cut (negative rebase) so each remaining token still represents its fair slice of vs′v_s'.


Where this is used elsewhere​

Topic pageRefers to
Compounding Leverage§1, §2 (identity), Eq (2.7)
Compounding Leverage§3.2–§3.7 (invariant, x₀, safety bounds)
Fee Mechanics§5.1 (faf_a), §5.2 (recovery-first)
Volatility Decay§1.4 (IL), §4 (APR decomposition)
yb-LP Share Value Derivation§3.4 (Eq 3.9), §3.5 (flash-loan)
Emission Dynamics§4 (APR context)