Skip to main content

Advanced Concepts & Economics

This page goes beyond “How it Works” and explains the machinery, incentives, and economics that make YieldBasis function at scale.

Math-heavy details live in the Math Primer leverage derivation (√p → p), LEVAMM invariant & x₀, flash‑loan sizing (φ), net APR equation, and the admin-fee curve.


1. System Architecture (High‑Level)

YieldBasis is a stack of coordinated contracts built around Curve.

ComponentWhat it doesWho touches it?
Curve Cryptoswap Pools (BTC/crvUSD)Hold BTC & crvUSD, generate trading feesAnyone (swappers, arbers, protocol)
LEVAMMPrices LP ↔ crvUSD to keep leverage at 2×; tracks collateral and debtOnly via the VirtualPool (no UI)
VirtualPoolBundles flash loans, LP mint/burn, debt ops into 1 txArbitrageurs call a single swap()
LT ContractUser deposits/withdrawals; manages stablecoin allocation and debt ceiling; handles fee distributionUsers, Protocol
LT TokenReceipt token for user deposits/withdrawals (e.g., yb-BTC, yb-ETH)Users
LiquidityGauge (Staker)ERC4626 vault for staking LT tokens; earns YB emissionsStakers
veYB / StakingGovernance token; receives admin feesGovernance participants

1.1 Data & Value Flows

An on‑chain Crypto/USD oracle feeds the LEVAMM so it can compute the anchor state and the exact debt target (always 50% of LP value). When a user deposits crypto (BTC, ETH), the protocol flash‑borrows the same USD value in crvUSD, adds both assets to the Curve pool to mint LP, holds that LP as collateral in the LEVAMM, then borrows crvUSD against it to repay the flash loan—leaving a 2× leveraged (50/50) position.

Trading fees accrue in the Curve pool. When harvested, 50% funds pool rebalancing while the remaining 50% (after deducting volatility decay costs) is split between unstaked LT holders and veYB according to the dynamic admin fee.

Separately, crvUSD debt accrues interest at a governance‑set rate. This interest is donated back entirely (100%) into the Curve Cryptoswap pool, deepening liquidity and helping the pool recenter its concentrated liquidity around the current price.

Whenever the debt/value ratio drifts from 50%, the LEVAMM exposes a tiny price difference; arbitrageurs take a single swap through the VirtualPool, which atomically flash‑borrows, mints/burns LP, adjusts debt, settles the flash loan, and pockets the difference, restoring 2× leverage without user intervention.

1.2 High‑Level Sequence

  1. User deposits BTC -> receives LT tokens.
  2. The contract flash‑borrows crvUSD equal to the BTC’s USD value.
  3. It adds BTC + crvUSD as liquidity to the Curve Cryptoswap pool and mints LP tokens (spot price remains unchanged because liquidity is added in balanced proportion).
  4. Those LP tokens are held as collateral in the LEVAMM.
  5. The protocol borrows crvUSD against that LP (from its allocated debt ceiling) and repays the flash loan, leaving a net 50% debt / 50% equity position (2× leverage).
  6. Going forward, if BTC moves, arbitrageurs restore leverage via the VirtualPool (and LEVAMM) so the debt-to-value ratio stays at 50% (2x leverage).

1.3 Oracle & Pricing Inputs

The LEVAMM needs a single Crypto/USD reference price (p₀) to know what “50% debt” should be and to center its pricing curve. p₀ feeds the calculations for the anchoring term x₀(p₀) and the ideal debt level.


2. Leverage Engine

YieldBasis fixes leverage at . Practically: debt is always 50% of the LP’s USD value. Curve LP value grows roughly like price\sqrt{price}. By keeping a constant compounding leverage of 2×, the protocol “squares” that curve so your position scales with price itself. That gives you linear Crypto exposure and no impermanent loss versus simply holding your Crypto.

Math reference: The leverage identity V_* ∝ V_c^L and why picking L = 2 turns √p → p are derived in Math Primer §2 (Eq. 2–4).

Why exactly 2×?

  • It’s the precise leverage that turns p\sqrt{p} into p.
  • At 50% debt, the LP’s USD side is usually enough to close the loan cleanly at any time, as both the USD portion and the loan comprise 50% of the position value.
  • Operationally, “keep debt at 50%” is simple to monitor and rebalance.

What if leverage were higher than 2×?

  • Then your position would scale faster than the price of your Crypto (pL2p^\frac{L}{2} for other LL). You’d outperform on the way up but underperform on the way down — i.e. you’ve reintroduced “divergence” versus just holding your Crypto (a leverage-style loss, not the classic AMM IL, but still a mismatch from the goal of removing IL).
  • It also increases liquidation risk and subsidy requirements (more debt to maintain, more to repay when price falls).

So locking leverage at 2× is the sweet spot: linear BTC tracking, no AMM IL, manageable debt, and clean unwind mechanics.

2.1 How it’s kept at 50%

When BTC moves, the LP value changes:

  • Price up: LP value ↑, debt fixed -> debt/value < 50% -> protocol adds debt to regain 50% (mints crvUSD, mints LP).
  • Price down: LP value ↓, debt fixed -> debt/value > 50% -> protocol repays debt to regain 50% (redeems LP for crvUSD).

The LEVAMM exposes a tiny profit so arbitrageurs do this in one swap via the VirtualPool.

For the full arbitrage flow please see section 3. Rebalancing Flow.

Possible Edge Cases to restore leverage:

  • Very fast moves can widen spreads; it may take a few swaps to hit exactly 50%.
  • Over‑tight Curve concentration can cause temporary drawdowns when restoring leverage “breaks” (see §8).
  • If crvUSD wobbles around $1, the ratio skews briefly; the oracle smooths this out.

Full derivations (e.g. why value ∝ collateral^L) are in the Math Primer.


3. Rebalancing Flow

YieldBasis keeps debt / LP value = 50% (2× leverage) by exposing an arbitrage opportunity whenever the ratio moves. Two internal pieces make this work:

  • LEVAMM – holds LP tokens on one side and tracks crvUSD debt on the other; it shifts price so trades push the ratio back to 50%.
  • VirtualPool – a router that wraps flash loans, Curve LP mint/burn, and CDP mint/repay into one atomic swap the arbitrageur invokes. It is essentially the interface for arbitrageurs.

3.1 When do we need to restore leverage?

As soon as the price of the underlying crypto moves, LP value changes but debt doesn’t:

  • Crypto price up: LP value ↑, debt fixed -> debt / value < 0.5 -> need more debt
  • Crypto price down: LP value ↓, debt fixed -> debt / value > 0.5 -> need less debt

Approximate target change in debt:

Δd ≈ 0.5 * (LP_value_new - LP_value_old)

Math reference: The quadratic for the flash‑loan amount φ (whitepaper Eq. 39–41) is shown in Math Primer §3.5.

3.2 Arbitrage Walkthrough — Where the Profit Actually Is

The arbitrage opportunity lives in the LEVAMM price for LP <-> crvUSD.

  • Debt too low (Crypto price up): LP is quoted expensive in crvUSD -> pay crvUSD, get LP, unwrap to Crypto + crvUSD, repay flash loan, keep the spread.
  • Debt too high (Crypto price down): LP is cheap -> buy LP with crvUSD, unwrap, repay debt, pocket leftover Crypto.

The VirtualPool bundles every leg (flash‑borrow, LP mint/burn, CDP mint/repay) into one atomic swap(). The arbitrageur still makes only a single call.

Example: BTC +10% (need to add debt)

Before move
LP ≈ $200k (1 BTC + 100k crvUSD), debt = 100k crvUSD -> 50% debt / value.

After move
BTC -> $110k, LP ≈ $210k, debt still 100k -> debt / value ≈ 47.6% (< 50%).
LEVAMM now quotes LP at a premium in crvUSD.

Arb trade:

  • Arb sends ~0.0476 BTC (~$5,238) to the VirtualPool.
  • VirtualPool flash‑borrows ~4,762 crvUSD to form a balanced $10k LP mint in Curve (keeps Curve spot unchanged).
  • Sells that LP to the LEVAMM for ~$10,070 crvUSD.
  • Repays the flash loan (4,762 crvUSD) and keeps ~$308 crvUSD as profit.
  • Protocol debt increases by ~$10,070 -> back near 50% again.

End state
LP ≈ $220k, debt ≈ $110k -> debt / value ≈ 50%. Leverage restored; arb walks away paid.

Example: BTC –10% (need to reduce debt)

Before move
Same starting point: LP ≈ $200k, debt = 100k -> 50% debt / value.

After move
BTC -> $90k, LP ≈ $190k, debt still 100k -> debt / value ≈ 52.6% (> 50%).
LEVAMM now quotes LP at a discount.

Arb trade:

  • Arb inputs 10,000 crvUSD to the VirtualPool.
  • VirtualPool takes ~$10,070 worth of LP from the LEVAMM (discounted).
  • Removes that LP from Curve symmetrically -> gets ~0.053 BTC + ~5,300 crvUSD.
  • Repays 10,000 crvUSD of protocol debt; any leftover BTC (~0.112 BTC) is the arb profit.
  • Debt drops by 10k -> ratio back at ~50%.

End state
LP ≈ $179.9k, debt ≈ $90k -> debt / value ≈ 50%. Arb paid in BTC this time.

Who captures it? Any MEV/arb bot watching the LEVAMM price. It’s atomic & oracle‑anchored, so it’s effectively risk‑free.

Where does profit come from? A small AMM spread plus a subsidy budget funded by recycled crvUSD borrow interest — not directly from LP principal.

Math reference: The invariant (x₀(p₀) − d) · y = I(p₀) and the closed‑form x₀ root are in Math Primer §3 (Eq. 5–6).


4. Borrowing & Interest Recycling (crvUSD line)

YieldBasis borrows crvUSD from its own, isolated CDP line on Curve. The interest it “pays” never leaves the system; it is fully used to rebalance the Curve Cryptoswap pool.

How YieldBasis worksHow YieldBasis works
Interest Rate Recycling Flow: 100% of borrower interest is recycled into rebalancing the Cryptoswap pool. Pool fees are then split: 50% for pool rebalancing, 50% distributed between liquidity providers and dynamic admin fees (to veYB holders) AFTER accounting for the volatility decay.

4.1 Dedicated crvUSD CDP Line

  • Isolated market: The protocol mints/repays crvUSD against its LP collateral from a special crvUSD mint market, separate from public crvUSD borrowers. Only YieldBasis can borrow from this special market.
  • Governance‑set rate: Curve/YB governance can tune the borrow APR specifically for leveraged liquidity use (doesn’t affect public CDPs and their borrow rates).

4.2 How Interest Is Captured

  1. Debt accrues interest on the LEVAMM (accounting-only increase in d).
  2. Anyone can call distribute_borrower_fees() to harvest this interest.
  3. The harvested crvUSD is donated into the Cryptoswap pool via add_liquidity() with the donation flag enabled.
  4. 100% of crvUSD borrowing interest is recycled this way, it deepens pool liquidity and helps the pool recenter its concentrated liquidity around the current price.

4.3 Why It Matters — and What Can Go Wrong

Upsides

  • No external lender bottleneck: Borrow capacity scales with LP collateral; no utilization spikes or liquidity shortages.
  • Predictable leverage cost: Governance can smooth the borrow rate instead of exposing LPs to market swings.
  • Self‑funding ops: Interest doesn’t leak; it powers rebalancing and protocol revenue.

Edge cases to watch

  • Borrow rate too high: Net APR shrinks; governance must balance subsidy needs vs LP returns.
  • Subsidy underfunded: The AMM difference narrows; rebalancing may lag or need wider quotes.
  • crvUSD off‑peg: Debt is counted at $1 via oracle; deviations skew apparent leverage temporarily (see Risk §9).

More detail: Whitepaper's “Using CDP Interest Rate for Rebalancing” section and §5 Fee Split & Admin‑Fee Dynamics show how this budget flows to LPs and veYB.


5. Fee Split & Admin‑Fee Dynamics

YieldBasis generates trading fees from the underlying BTC/crvUSD Curve pools. These fees follow a specific distribution path:

5.1 Fee Distribution Flow

  1. 50% → Pool Rebalancing: This portion funds the Curve pool's internal concentrated liquidity rebalancing mechanism (Cryptoswap's passive rebalancing).

  2. 50% → Available for Distribution: From this portion, volatility decay costs are first subtracted.

  3. Net Distributable Amount: Whatever remains after covering volatility decay is split between unstaked LT holders and veYB holders according to the dynamic admin fee.

The net APR expression APR = 2·r_pool − (r_borrow + r_releverage) and its assumptions are in Math Primer §4 (Eq. 7).

5.2 Pool Rebalancing

YieldBasis is built on top of Cryptoswap pools which use fully passive concentrated liquidity. The pool automatically concentrates and rebalances liquidity around the pool's recent average price.

As prices move, the algorithm re-centers or "rebalances" its liquidity to follow. The 50% allocation to pool rebalancing funds this mechanism.

Read more about pool rebalancing here: Cryptoswap: In Depth

5.3 Volatility Decay

Volatility decay is the cost of maintaining constant 2× leverage during price movements. When BTC moves, arbitrageurs rebalance the position to maintain 50% loan-to-value ratio. Each rebalancing trade incurs small costs: AMM spreads, gas fees, and arbitrageur profit margins.

Frequent, large price swings mean more rebalancing and higher cumulative costs.

Important: This is NOT impermanent loss. Impermanent loss happens when your liquidity position fails to track the underlying asset. Volatility decay is the operational cost of MAINTAINING that 1:1 tracking.

Volatility decay can be thought of as losses which happen in loans on Llamalend (Curve's lending infrastructure) when loans are undergoing soft-liquidation. Smart contracts are written in a way that if volatility decay happens, fees are taken to cover it.

5.4 Dynamic Admin Fee

The admin fee determines how the net distributable amount (after volatility decay) splits between unstaked LT holders and veYB.

Variables:

  • T — total LT supply
  • s — amount of LT staked (in LiquidityGauge)
  • f_min — minimum admin fee (e.g., 10%) when nobody stakes
  • f_a — actual admin fee fraction

Formula:

f_a = 1 - (1 - f_min) * √(1 - s/T)
  • If no one stakes (s = 0)f_a = f_min (unstaked LT holders keep ~90% if f_min = 10%)
  • If everyone stakes (s = T)f_a → 100% (all fees go to veYB since LT holders chose emissions instead)
  • In between → fee ramps up smoothly and non-linearly

Math reference: The admin‑fee function and the negative‑rebase formula are in Math Primer §5 (Eq. 8 and 5.6).

5.5 Admin Fee Behavior During Recovery

When the pool has experienced losses (tracked by ideal_staked > staked), special rules apply if sufficient tokens are staked (staked >= MIN_STAKED_FOR_FEES):

  1. No admin fee during recovery: Admin fees are not charged until losses are fully repaid.
  2. Admin doesn't absorb losses: On negative value changes, admin fee is not applied (admin doesn't pay for losses).
  3. Normal behavior resumes after recovery: Once staked returns to ideal_staked, the standard admin fee applies again.

If very few tokens are staked (staked < MIN_STAKED_FOR_FEES), the original behavior applies where admin fees are charged on both gains and losses.

5.6 Flow of Value

Stake choiceReceivesForfeits
Unstaked LTTrading fees (1 - f_a) after volatility decayYB emissions
Staked LTYB emissionsTrading fees
veYB (locked YB)Admin fee f_a after volatility decayLiquidity of YB

5.7 Game Theory Intuition

As more LPs stake for YB rewards, the admin fee approaches 100% and the fee pool for unstaked LPs shrinks. However, with fewer unstaked LPs remaining, each receives a proportionally larger share of that smaller pool.

  • Set f_min too high: Unstaked LPs might flee; yields look unattractive.
  • Set f_min too low: veYB value capture shrinks; weak governance incentive.

5.8 Regarding the APRs of LT and Staked LT

Using ybBTC as the example for the BTC market:

It was previously claimed that when faf_a increases, the unstaked ybBTC holders still extract meaningful yield. It is now to be shown. Consider that a quantity of ss ybBTC had been staked, and the total distributable income and the total quantity of ybBTC are both unity. Then:

fa=1(1fmin)1sf_a = 1-(1-f_{min})\sqrt{1-s}

The yield to ybBTC holders is: ybBTCyield=(1fmin)1sybBTC_\text{yield} = (1-f_{min})\sqrt{1-s}

This quantity is distributed to 1s1-s ybBTC units. Then the marginal yield has a dependency of the form

ybBTCyieldMarginal=(1fmin)1s1s=1fmin1sybBTC_\text{yieldMarginal} = \frac{(1-f_{min})\sqrt{1-s}}{1-s} = \frac{1-f_{min}}{\sqrt{1-s}}

With a derivative w.r.t ss of

ds×ybBTCyieldMarginal=1fmin2(1s)3/2d_s \times ybBTC_\text{yieldMarginal} = \frac{1-f_{min}}{2(1-s)^{3/2}}

It is now observed that the derivative is positive for any admissible value of ss, which means that the APR of ybBTC indeed grows together with faf_a and incentivises ybBTC retention when the latter shrinks.

If the quantity of veYB were kept constant, a very similar observation would hold for veYB; it does not entirely hold precisely because of the liquidity-mining emissions.

Moreover, a similar consideration for liquidity-mining shows that it loses in marginal effeciency as more ybBTC is staked, also because the emission scales as a square root, and the quantity of recipients scales linearly.

For ss staked ybBTC and a total ybBTC of unity:

Edaily=EmaxsE_{daily} = E_{max}\sqrt{s}

Edaily,marginal=Emaxss=EmaxsE_\text{daily,marginal} = \frac{E_{max}\sqrt{s}}{s} = \frac{E_{max}}{\sqrt{s}}

ds×Edaily,marginal=Emax2ssd_s \times E_\text{daily,marginal} = -\frac{E_{max}}{2s\sqrt{s}}

Observe that this derivative is negative for all admissible ss. It then follows that an increased collective investment in liquidity mining both provides diminishing returns and increases the APR of the remaining ybBTC, which helps preventing the system from collapsing into one of the two extreme states (either all staked or all unstaked), with the precise equilibria being determined by the quantity and price of veYB, which is exogenous to the above considerations.