Yield Basis 백서

Yield Basis

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 24쪽 중 11쪽

e LP amount in the AMM at that oracle touch point (tildes = "ideal" values). For L = 2 L = 2 L = 2 : d ~ = 1 2 p o y ~ \tilde{d} = \tfrac{1}{2} p_o \tilde{y} d ~ = 2 1 ​ p o ​ y ~ ​ . 3.2 LEVAMM invariant & pricing ​ Define x ≡ x 0 ( p o ) − d x \equiv x_0(p_o) - d x ≡ x 0 ​ ( p o ​ ) − d . The LEVAMM uses a constant-product-like invariant: ( x 0 ( p o ) − d ) y = I ( p o ) , (3.2) \big(x_0(p_o) - d\big)\; y \;=\; I(p_o), \tag{3.2} ( x 0 ​ ( p o ​ ) − d ) y = I ( p o ​ ) , ( 3.2 ) with I ( p o ) I(p_o) I ( p o ​ ) constant as long as p o p_o p o ​ stays fixed. At p = p o p = p_o p = p o ​ , the AMM's instantaneous price should equal the oracle: x 0 ( p o ) − d ~ y ~ = p o . (3.3) \frac{x_0(p_o) - \tilde{d}}{\tilde{y}} = p_o. \tag{3.3} y ~ ​ x 0 ​ ( p o ​ ) − d ~ ​ = p o ​ . ( 3.3 ) Substitute d ~ \tilde{d} d ~ from (3.1): x 0 ( p o ) = 2 L − 1 L p o y ~ . (3.4) x_0(p_o) = \frac{2L - 1}{L}\,p_o\,\tilde{y}. \tag{3.4} x 0 ​ ( p o ​ ) = L 2 L − 1 ​ p o ​ y ~ ​ . ( 3.4 ) 3.3 Solving for x₀ with arbitrary y, d ​ Away from the ideal point, y ~ \tilde{y} y ~ ​ is not directly known. From (3.4): y ~ = L 2 L − 1 x 0 p o . (3.5) \tilde{y} \;=\; \frac{L}{2L - 1}\,\frac{x_0}{p_o}. \tag{3.5} y ~ ​ = 2 L − 1 L ​ p o ​ x 0 ​ ​ . ( 3.5 ) Evaluate the invariant at the ideal point: I ( p o ) = ( x 0 − d ~ ) y ~ = ( x 0 − L − 1 L p o y ~ ) 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} I ( p o ​ ) = ( x 0 ​ − d ~ ) y ~ ​ = ( x 0 ​ − L L − 1 ​ p o ​ y ~ ​ ) y ~ ​ . ( 3.6 ) Set that equal to the current-state invariant ( x 0 − d ) y (x_0 - d)\,y ( x 0 ​ − d ) y , substitute (3.5), and rearrange. The result is a quadratic in x 0 x_0 x 0 ​ : x 0 2 ( L 2 L − 1 ) 2 − p o y x 0 + p o y 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} x 0 2 ​ ( 2 L − 1 L ​ ) 2 − p o ​ y x 0 ​ + p o ​ y d = 0. ( 3.7 ) Choose the larger root (matches the ideal-state intuition): x 0 ( p o ) = p o y + ( p o y ) 2 − 4 p o y d ( L 2 L − 1 ) 2 2 ( L 2 L − 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} x 0 ​ ( p o ​ ) = 2 ( 2 L − 1 L ​ ) 2 p o ​ y + ( p o ​ y ) 2 − 4 p o ​ y d ( 2 L − 1 L ​ ) 2 ​ ​ ​ ( 3.8 ) For L = 2 L = 2 L = 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 ~ p o − d ~ = 1 L y ~ p o = x 0 2 L − 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} V = y ~ ​ p o ​ − d ~ = L 1 ​ y ~ ​ p o ​ = 2 L − 1 x 0 ​ ​ . ( 3.9 ) Invariant in closed form. I ( p o ) = ( x 0 − d ~ ) y ~ = x 0 2 p o ( L 2 L − 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} I ( p o ​ ) = ( x 0 ​ − d ~ ) y ~ ​ = p o ​ x 0 2 ​ ​ ( 2 L − 1 L ​ ) 2 . ( 3.10 ) An alternative expression for V V V follows from (3.10): V = 2 I ( p o ) p o − x 0 . (3.11) V \;=\; 2\,\sqrt{I(p_o)\,p_o} - x_0. \tag{3.11} V = 2 I ( p o ​ ) p o ​ ​ − x 0 ​ . ( 3.11 ) 3.5 Flash-loan sizing (φ) ​ When the arbitrageur comes with x x x 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: f f f — LEVAMM fee d d d — current debt y y y — LP amount in the LEVAMM x 0 x_0 x 0 ​ — anchor term from Eq. (3.8) x x x — user-provided crvUSD for this swap x c , y c , S c x_c, y_c, S_c x c ​ , y c ​ , S c ​ — Curve pool's stablecoin reserves, crypto reserves, total LP supply Define r = x c S c ( 1 − f ) . (3.12) r \;=\; \frac{x_c}{S_c}\,(1 - f). \tag{3.12} r = S c ​ x c ​ ​ ( 1 − f ) . ( 3.12 ) The required flash amount ϕ \phi ϕ solves the quadratic (whitepaper Eq. 39): ϕ 2 + ϕ ( x 0 − 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} ϕ 2 + ϕ ( x 0 ​ − d + x − r y ) − y x r = 0. ( 3.13 ) Discriminant: D = ( x 0 − 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} D = ( x 0 ​ − d + x − r y ) 2 + 4 y x r . ( 3.14 ) Choose the positive root: ϕ = D − ( x 0 − d + x − r y ) 2 (3.15) \boxed{ \phi = \frac{\sqrt{D} - (x_0 - d + x - r\,y)}{2} } \tag{3.15} ϕ = 2 D ​ − ( x 0 ​ − d + x − r y ) ​ ​ ( 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.5 d/V < 0.5 d / V < 0.5 . Then x 0 − d x_0 - d x 0 ​ − d is large → LP is "expensive" in crvUSD. Arb brings in crvUSD, mints LP, increases d d d . Debt too high (price down): d / V > 0.5 d/V > 0.5 d / V > 0.5 . Then x 0 − d x_0 - d x 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 = 1 4 L 2 = \dfrac{1}{4L^2} = 4 L 2 1 ​ of collateral value — at L = 2 L = 2 L = 2 : 1 16 = 6.25 % \tfrac{1}{16} = 6.25\% 16 1 ​ = 6.25% (prevents under-leveraging edge cases). MAX_SAFE_DEBT = ( 2 L − 1 ) 2 4 L 2 − 1 8 L 2 = \dfrac{(2L-1)^2}{4L^2} - \dfrac{1}{8L^2} = 4 L 2 ( 2 L − 1 ) 2 ​ − 8 L 2 1 ​ of collateral value — at L = 2 L = 2 L = 2 : 9 16 − 1 32 = 17 32 = 53.125 % \tfrac{9}{16} - \tfrac{1}{32} = \tfrac{17}{32} = 53.125\% 16 9 ​ − 32 1 ​ = 32 17 ​ = 53.125% . For L = 2 L = 2 L = 2 , the critical debt value corresponds to p AMM = 9 16 p o p_{\text{AMM}} = \tfrac{9}{16} p_o p AMM ​ = 16 9 ​ p o ​ ; MAX_SAFE_DEBT sits a 1 32 \tfrac{1}{32} 32 1 ​ buffer below that 9 16 \tfrac{9}{16} 16 9 ​ 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: r pool r_{\text{pool}} r pool ​ — APR the Curve BTC/crvUSD pool would earn without leverage (pure trading fees, in BTC terms). L L L — compounding leverage (YieldBasis: L = 2 L = 2 L = 2 ). r borrow r_{\text{borrow}} r borrow ​ — effective borrow APR on the protocol's crvUSD line (set by governance). r releverage r_{\text{releverage}} r releverage ​ — drag from maintaining constant leverage (AMM fees/price edge paid to arbs, slippage). r refuel r_{\text{refuel}} r 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 L L L : Gross fee APR = L ⋅ r pool . (4.1) \text{Gross fee APR} \;=\; L \cdot r_{\text{pool}}. \tag{4.1} Gross fee APR = L ⋅ r pool ​ . ( 4.1 ) For L = 2 L = 2 L = 2 : Gross fee APR = 2 r pool . (4.2) \text{Gross fee APR} \;=\; 2\,r_{\text{pool}}. \tag{4.2} Gross fee APR = 2 r pool ​ . ( 4.2 ) Subtract the two costs: Borrow cost — interest paid on the crvUSD debt. Leverage cost — continuous leak to arbitrageurs that keep the ratio at 50%. Combining: APR net = L r pool − ( r borrow + r releverage ) (4.3) \boxed{ \text{APR}_{\text{net}} = L\,r_{\text{pool}} - \bigl(r_{\text{borrow}} + r_{\text{releverage}}\bigr) } \tag{4.3} APR net ​ = L r pool ​ − ( r borrow ​ + r releverage ​ ) ​ ( 4.3 ) For YieldBasis' fixed L = 2 L = 2 L = 2 : APR net = 2 r pool − ( r borrow + r releverage ) (4.4) \boxed{ \text{APR}_{\text{net}} = 2\,r_{\text{pool}} - \bigl(r_{\text{borrow}} + r_{\text{releverage}}\bigr) } \tag{4.4} APR net ​ = 2 r pool ​ − ( r borrow ​ + r releverage ​ ) ​ ( 4.4 ) 4.2 Heuristic for r_releverage ​ Backtests (Jan 2019 – Oct 2024) show: Optimised constant-product pools (no leverage) earn ∼ 3 % \sim 3\% ∼ 3% APR over that window. Empirically, r releverage ≈ 2 × r_{\text{releverage}} \approx 2\times r releverage ​ ≈ 2 × 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 = k x\cdot y = k x ⋅ y = k AMM (fees not big enough) but works on Curve Cryptoswap where r pool r_{\text{pool}} r pool ​ is materially higher. Not hard-coded on-chain; a modelling shortcut: r releverage ≈ 2 ⋅ r x y = k opt (empirical) . (4.5) r_{\text{releverage}} \approx 2 \cdot r_{xy = k}^{\text{opt}} \quad \text{(empirical)}. \tag{4.5} r releverage ​ ≈ 2 ⋅ r x y = k opt ​ (empirical) . ( 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: 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: r pool,realised ≈ ρ ⋅ r pool,raw . (4.6) r_{\text{pool,realised}} \;\approx\; \rho \cdot r_{\text{pool,raw}}. \tag{4.6} r pool,realised ​ ≈ ρ ⋅ r pool,raw ​ . ( 4.6 ) LEVAMM's own trading-fee capture adds on top. 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 r borrow r_{\text{borrow}} r borrow ​ and part of r releverage r_{\text{releverage}} r releverage ​ cancel via the donation flow: r refuel ≈ r borrow (steady state) . (4.7) r_{\text{refuel}} \;\approx\; r_{\text{borrow}} \quad \text{(steady state)}. \tag{4.7} r refuel ​ ≈ r borrow ​ (steady state) . ( 4.7 ) Net realised LP drag is the residual r releverage − r refuel r_{\text{releverage}} - r_{\text{refuel}} r releverage ​ − r refuel ​ , not r borrow + r releverage r_{\text{borrow}} + r_{\text{releverage}} r borrow ​ + r releverage ​ : APR net,realised ≈ L r pool,realised − ( r releverage − r refuel ) (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} APR net,realised ​ ≈ L r pool,realised ​ − ( r releverage ​ − r refuel ​ ) ​ ( 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: APY net = exp ⁡  ⁣ ( APR net ) − 1. (4.9) \text{APY}_{\text{net}} = \exp\!\big(\text{APR}_{\text{net}}\big) - 1. \tag{4.9} APY net ​ = exp ( APR net ​ ) − 1. ( 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: T T T = total yb-LP supply, s s s = amount of yb-LP staked, f min ⁡ f_{\min} f m i n ​ = minimum admin fee when nobody stakes, f a f_a f a ​ = actual admin-fee fraction routed to veYB. The curve: f a = 1 − ( 1 − f min ⁡ ) 1 − s T (5.1) \boxed{ f_a \;=\; 1 - (1 - f_{\min}) \, \sqrt{1 - \frac{s}{T}} } \tag{5.1} f a ​ = 1 − ( 1 − f m i n ​ ) 1 − T s ​ ​ ​ ( 5.1 ) Limits: s = 0 ⇒ f a = f min ⁡ s = 0 \Rightarrow f_a = f_{\min} s = 0 ⇒ f a ​ = f m i n ​ (unstaked LPs keep 1 − f min ⁡ 1-f_{\min} 1 − f m i n ​ of fees). s = T ⇒ f a → 1 s = T \Rightarrow f_a \to 1 s = T ⇒ f a ​ → 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 − 1 v_{-1} v − 1 ​ = total value of the leveraged position (in BTC terms) before fees this period, v 1 v_1 v 1 ​ = total value after market moves + fees, before anything is allocated, Δ v = v 1 − v − 1 \Delta v = v_1 - v_{-1} Δ v = v 1 ​ − v − 1 ​ = value change. Further, let v s v_s v s ​ and v s ∗ v_s^* v s ∗ ​ be the staked bucket's current value and watermark; v s , loss = max ⁡ ( v s ∗ − v s , 0 ) v_{s,\text{loss}} = \max(v_s^* - v_s, 0) v s , 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, v s , loss > 0 v_{s,\text{loss}} > 0 v s , loss ​ > 0 , Δ v > 0 \Delta v > 0 Δ 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: v loss = min ⁡  ⁣ ( Δ v , v s , loss ⋅ T s ) , (5.2a) v_{\text{loss}} \;=\; \min\!\left(\Delta v,\; v_{s,\text{loss}} \cdot \frac{T}{s}\right), \tag{5.2a} v loss ​ = min ( Δ v , v s , loss ​ ⋅ s T ​ ) , ( 5.2a ) Δ v use = v loss + ( Δ v − v loss ) ( 1 − f a ) , (5.2b) \Delta v_{\text{use}} \;=\; v_{\text{loss}} + (\Delta v - v_{\text{loss}})(1 - f_a), \tag{5.2b} Δ v use ​ = v loss ​ + ( Δ v − v loss ​ ) ( 1 − f a ​ ) , ( 5.2b ) Δ a = ( Δ v − v loss ) f a . (5.2c) \Delta a \;=\; (\Delta v - v_{\text{loss}})\,f_a. \tag{5.2c} Δ a = ( Δ v − v loss ​ ) f a ​ . ( 5.2c ) Post-recovery regime ( v s , loss = 0 v_{s,\text{loss}} = 0 v s , loss ​ = 0 , Δ v > 0 \Delta v > 0 Δ v > 0 ) or loss regime ( Δ v ≤ 0 \Delta v \leq 0 Δ v ≤ 0 ): Admin fee applies uniformly: Δ v use = Δ v ( 1 − f a ) , Δ a = Δ v f a . (5.3) \Delta v_{\text{use}} \;=\; \Delta v\,(1 - f_a), \qquad \Delta a \;=\; \Delta v\,f_a. \tag{5.3} Δ v use ​ = Δ v ( 1 − f a ​ ) , Δ a = Δ v f a ​ . ( 5.3 ) Losses share pro-rata between buckets (no admin fee on a negative value_change in this regime): Δ v s = Δ v use ⋅ s T , Δ v u s = Δ v use − Δ v s . (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} Δ v s ​ = Δ v use ​ ⋅ T s ​ , Δ v u s ​ = Δ v use ​ − Δ v s ​ . ( 5.4 ) In the recovery regime, the staked share of Δ v use \Delta v_{\text{use}} Δ v use ​ is capped at the watermark gap: Δ v s = min ⁡  ⁣ ( Δ v use ⋅ s T , v s , loss ) . (5.5) \Delta v_s \;=\; \min\!\left(\Delta v_{\text{use}} \cdot \frac{s}{T},\; v_{s,\text{loss}}\right). \tag{5.5} Δ v s ​ = min ( Δ v use ​ ⋅ T s ​ , v s , loss ​ ) . ( 5.5 ) Unstaked gets whatever remains: Δ v u s = Δ v use − Δ v s . (5.6) \Delta v_{us} \;=\; \Delta v_{\text{use}} - \Delta v_s. \tag{5.6} Δ v u s ​ = Δ v use ​ − Δ v s ​ . ( 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 v 1 ′ v_1' v 1 ′ ​ = new total value after admin fee ( v − 1 + Δ v use v_{-1} + \Delta v_{\text{use}} v − 1 ​ + Δ v use ​ ), v s ′ v_s' v s ′ ​ = new staked value after sharing profit/loss, s s s = staked token supply before rebase, T T T = total token supply before rebase, δ s \delta s δs = staked tokens burned (negative rebase). The value share must match the token share: s − δ s T − δ s = v s ′ v 1 ′ . (5.7) \frac{s - \delta s}{T - \delta s} \;=\; \frac{v_s'}{v_1'}. \tag{5.7} T − δs s − δs ​ = v 1 ′ ​ v s ′ ​ ​ . ( 5.7 ) Solve for δ s \delta s δs : δ s = s v 1 ′ − T v s ′ v 1 ′ − v s ′ (5.8) \boxed{ \delta s = \frac{s\,v_1' - T\,v_s'}{\,v_1' - v_s'\,} } \tag{5.8} δs = v 1 ′ ​ − v s ′ ​ s v 1 ′ ​ − T v s ′ ​ ​ ​ ( 5.8 ) Post-rebase supplies: s new = s − δ s , T new = T − δ s . (5.9) s_{\text{new}} = s - \delta s, \qquad T_{\text{new}} = T - \delta s. \tag{5.9} s new ​ = s − δs , T new ​ = T − δs . ( 5.9 ) Numerical cap. As v 1 ′ → v s ′ v_1' \to v_s' v 1 ′ ​ → v s ′ ​ (staking ratio approaches 100%), the denominator in (5.8) collapses and δ s \delta s δs would blow up. The protocol caps it by clamping the per-step rebase to: δ s max ⁡ = ∣ Δ v ⋅ T v − 1 + Δ v + 1 ⋅ 1 − f a ϵ 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} δ s m a x ​ = ​ v − 1 ​ + Δ v + 1 Δ v ⋅ T ​ ⋅ ϵ m i n ​ ​ 1 − f a ​ ​ ​ , ( 5.10 ) where ϵ min ⁡ = 10 − 4 \epsilon_{\min} = 10^{-4} ϵ m i n ​ = 1 0 − 4 — the floor on the unstaked fraction below which the cap kicks in. At staking ratios below that floor, δ s \delta s δ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 − f a ) (1-f_a) ( 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 v s ′ v_s' v s ′ ​ . Where this is used elsewhere ​ Topic page Refers to Compounding Leverage §1, §2 (identity), Eq (2.7) Compounding Leverage §3.2–§3.7 (invariant, x₀, safety bounds) Fee Mechanics §5.1 ( f a f_a f 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) Before you read this 0. Notation & symbols 1. The constant-product problem (why √p shows up) 1.1 Normalising the start 1.2 After a price move 1.3 LP value scales as √p 1.4 Impermanent loss (IL) 2. Compounding leverage — turning √p into p 2.1 Defining "compounding leverage" 2.2 Pick L = 2 to linearise BTC exposure 2.3 What if L ≠ 2? 3. LEVAMM & Virtual Pool 3.1 Ideal debt at the oracle price 3.2 LEVAMM invariant & pricing 3.3 Solving for x₀ with arbitrary y, d 3.4 Useful derived quantities 3.5 Flash-loan sizing (φ) 3.6 Directional intuition 3.7 Safe debt bounds 4. Net APR & cost terms 4.1 Components 4.2 Heuristic for r_releverage 4.2a Implementation nuance: Cryptoswap fee split + refueling loop 4.3 Continuous vs. discrete compounding 5. Token incentives & admin-fee function 5.1 Admin-fee formula 5.2 Splitting fee gains / sharing losses 5.3 Negative rebase for staked supply Where this is used elsewhere ## /dev/quickstart On this page Minimal integration path. The snippets show the call sequence; wire them to your ABI/client setup before using them in production. Setup assumptions ​ The examples below assume: Ethereum mainnet. A Web3/ethers/viem client connected to an RPC endpoint. Contract instances created from the ABIs for Factory , GaugeController , LT , VirtualPool , Li
프로젝트로 돌아가기