ybBTC is the generalized description of the LP token representing a share in the Yield Basis pools. Its core feature is impermanent loss mitigation, which protects capital used for liquidity provision from depreciation in the event of volatile asset price movements.
Therefore, this section explains the design of the (ERC20 BTC - crvUSD) pool and the mathematical underpinnings of IL protection.
1. YBBTC POOL DESIGN FOR IMPERMANENT LOSS MITIGATION
ybBTC is the liquidity position (or a pool share) of the (ERC20 BTC - crvUSD) pool. This pool has three core design features:
Basic Design: The pool uses Curve's CryptoSwap AMM concentrated liquidity pool.
Leverage: The user's LP position (ERC20 BTC + crvUSD) is used as collateral to mint crvUSD. Minted crvUSD is deposited into the pool, increasing the position size. This applies leverage to the user's position, enhances capital efficiency, and makes the position value correspond to the BTC value, not the square root.
This design establishes a mathematical foundation for mitigating IL:
YB Leverage pool∝BTC price,Pool without leverage∝
crvUSD in ybwBTC Pool
48,503,683
crvUSD in ybwBTC Pool
crvUSD in ybcbBTC Pool
48,522,812
crvUSD in ybcbBTC Pool
crvUSD in ybtBTC Pool
48,654,749
crvUSD in ybtBTC Pool
crvUSD Fees in wBTC Pool
181,176
crvUSD Fees in wBTC Pool
crvUSD Fees in cbBTC Pool
166,200
crvUSD Fees in cbBTC Pool
crvUSD Fees in tBTC Pool
162,160
crvUSD Fees in tBTC Pool
BTC price
Rebalancing: The pool's ERC20 BTC and crvUSD balances are automatically adjusted to be in the concentrated liquidity range, optimizing liquidity depth for the pool's users.
The rebalancing process optimizes liquidity by using 50% of the pool's trading fees (ERC20 BTC and crvUSD). The share of the crvUSD borrow rate is also used for rebalancing the position.
2. IN-DEPTH EXPLANATION OF IL MITIGATION
As mentioned, the leverage applied to the user's LP position in the pool is the core design feature that provides mathematical requirements for IL mitigation.
The in-depth explanation of leverage and its IL mitigation function:
The Yield Basis leverage algorithm uses the (ERC20 BTC - crvUSD) position as collateral for a crvUSD loan. Its size corresponds to the crvUSD part of the position and is added to the user's position, doubling the value change rate in case of BTC price movements.
Due to ×2 leverage, the rate of position value change (growth or decay) equals ×2 that of the unleveraged one. It squares the position value (vu2) compared to the unleveraged one, mitigating the impermanent loss in this AMM pool.
Statement: application of ×2 leverage to the position results in squaring the position value (vu2).
Proof:
We start from the fact that ×2 leverage means position value grows or declines ×2 faster than the unleveraged one.
The relative value changing rate for the LP position is the value change ΔVl divided by the value itself Vl. In the continuous limit it reduces to VldVl:
vldvl=2⋅vudvu
vl is the leveraged position's value
vu is the unleveraged position's value
v and are the relative rates of change for the value of the unleveraged and leveraged position
Integrating both sides of the equation (constants are discarded):
lnvl=2lnvu
Exponentiating both sides of the equation:
vl=vu2
Squaring the position size (vu2) eliminates the Impermanent Loss in the Yield Basis pools.
Below we outline the fundamental reasons for impermanent loss in AMM pools and demonstrate how (vu2) solves it:
Let there be a classic cpAMM pool with tokens X and Y, all prices denominated in Y, and the amounts denominated by the same symbols. By definition of the cpAMM:
XY=L2 and P=XY
Expressing the token amounts in terms of the spot price and the AMM invariant:
Y=XL2⟹Y2=XYL2⟹Y2=PL2⟹{Y2=PL2X=YL=
Deriving the value of the liquidity provider's position in the AMM:
V=Y+PX=LP+PLP=2LP⟹V∝P
We demonstrated that Liquity Provider's (LP) position value in the ordinary AMM pool is proportional to P.
This means that liquidity providers don't receive the full appreciation of position value corresponding to the pool's assets' price movements against each other. Even more, they have a money loss compared to holding the same asset portfolio outside the AMM pool. It is an infamous and well-known problem Impermanent Loss Problem, inherent in all AMMs.
Yield Basis solved this problem by adding the built-in leverage function to the pool design. As a result of the leverage, the Liquidity Provider's position value is the square of the originally provided liquidity to the pool (vu2).
In turn, it leads to vYB_Position∝vAMM2∝P⟹vYB_Position∝P.
Yield Basis design leads to the following ybBTC features:
The LP position (ybBTC token) in Yield Basis fully appreciates with the pool assets price movements
IL is mitigated
LPs generate yield from trading fees, avoiding capital depreciation risks typical for other AMMs.
3. DUAL-INCENTIVE SYSTEM
The trading fees obtained from the underlying pool are distributed in YieldBasis according to the following formula:
fadmin=1−(1−A)1−s
Where fadmin is the portion of fees due to the veYB holders (termed the effective admin fee), A is the minimal admin fee (with a value of 10%), and s is the portion of ybBTC currently staked. Whenever a user stakes his ybBTC, the value of s is updated; therefore, effectively, the user relinquishes his yield back into the common pool, wherefrom it is distributed normally (i.e., the effective admin fee goes to the veYB holders, and the rest is retained by the ybBTC holders; st-ybBTC holders receive proportional YB emissions instead).
Consider the following illustration: suppose that s0 ybBTC (in relative reckoning) was staked before a user staked Δs more. Then he effectivelty relinquished the following quantity of yield (paying the same cost for emitting a quantity of YB):
YB_emission_cost=Δs⋅F(1−A)1−s0
Where F is the amount of trading fees collected in this epoch. These relinquished yield, however, is not distributed according to a special rule, but rather goes back into the general pool of distribution. It, then, follows, that from this relinquished yield, just like from the rest of the distributed yield, the following portions are allocated to each recipient group:
ybBTC_portion=(1−A)1−s0−Δs
veYB_portion=1−(1−A)1−s0−Δs
4. YB Liquidity Mining
30% of the total YB supply is relegated to the community Liquidity Mining program. In it, there is a daily emission of YB according to the following rules:
The maximal emission rate is computed as though the locally available supply were mined over four years: Emax=4yearsremainingLMSupply
The actual emission rate is computed by scaling the maximal emission rate by the square root of the current stake rate: E=Emaxs
The actual emission is distributed pro rata among st-ybBTC holders
5. Details regarding the technical implementation of ybBTC
The user who desires to peruse the source code is referred to the corresponding repository. Deployment of new pools is not considered and should instead be read about in the Yield Basis docs.
The user who wishes to deposit his BTC into a YB pool in order to make them yield-bearing invokes the deposit() method of the leveraged token (LT) contract and receives an appropriate amount of shares (that is to say, ERC4626 equivalents of ybBTC tokens). Withdrawal is handled via the withdraw() method. As in other ERC4626 pools, rewards automatically compound.
If the user then wishes to stake his ybBTC to receive YB mints, he invokes the deposit() method of the corresponding Liquidity Gauge contract. WIthdrawals are also handled via the withdraw() function, but, since the deposit token no longer matches the reward token (as here, the deposits are made in ybBTC, and the rewards are obtained in YB), rewards must be manually claimed by invoking the claim() function of the same contract.
6. Trading and arbitrage
There exist two contracts usable as trading endpoints, namely the Leverage AMM and the Virtual Pool. The latter is an interface for the former, allowing the user to trade directly between the stablecoin and the wrapped BTC without directly coming into possession of any LP tokens of the associated pool; the former allows trading between stablecoins and LP tokens (which then can be redeemed or retained by the buyer). They share the exchange function (that being exchange()) and a swap output preview getter.