BTB
/

Yield Basis

Leveraged Farmingwebsite
Curve-team protocol on Ethereum that gives BTC/ETH LPs (WBTC, cbBTC, tBTC, WETH) a 2x-leveraged Curve crvUSD-pool position designed to cancel impermanent loss. Agents deposit the asset into a market's LT to get yb-LP shares (yb-WBTC, yb-cbBTC, yb-tBTC, yb-WETH), withdraw, optionally stake shares in the gauge for YB emissions, lock YB as veYB, vote gauges and claim veYB fees.

What you can do

find-marketGet a market's contractsFactory.markets(i) for i in 7..10 (active) -> (asset, cryptopool, amm, lt, price_oracle, virtual_pool, staker). Check LT.is_killed() == false.
depositDeposit BTC/ETH asset for yb-LP1) Read pool.POLICY(); compute debt with the price rule (assets * pool.price_oracle() // 10**asset_decimals) on YBTwocryptoPolicy pools (WBTC, cbBTC, tBTC), or with the LEVAMM-book rule on the WETH pool (live YBOraclizedPolicy). 2) expected = LT.preview_deposit(assets, debt); min_shares = expected * (1 - tolerance). 3) asset.approve(LT, assets). 4) Simulate then send LT.deposit(assets, debt, min_shares, receiver).
withdrawRedeem yb-LP for the assetIf staked, unstake first (gauge.redeem or StakeZap.withdraw_and_unstake). expected = LT.preview_withdraw(shares); compare with pricePerShare to see the TRD; LT.withdraw(shares, expected * (1 - tolerance), receiver) with a gas margin.
deposit-and-stakeDeposit and stake for YB emissions in one txasset.approve(StakeZap, assets); StakeZap.deposit_and_stake(gauge, assets, debt, min_shares, receiver).
stakeStake existing yb-LPLT.approve(gauge, amount); gauge.deposit(amount, receiver).
claim-ybClaim YB emissionsgauge.claim(YB, user) or gauge.claim(); preview with gauge.preview_claim(YB, user).
lock-ybLock YB for veYBYB.approve(veYB, amount); veYB.create_lock(amount, unlockTime <= now + 4y). Then GaugeController.vote_for_gauge_weights([gauges],[bps]) and FeeDistributor.claim() weekly.
Leverage: each market holds a 2x-leveraged Curve LP position funded by pooled crvUSD debt (target ~50% debt). Arbitrage keeps it on target; in fast markets or gas spikes leverage can drift. Borrow rate is set by the DAO per market (up to 100%/yr).
Withdrawals can realise a Temporary Redemption Discount (TRD): preview_withdraw can be below pricePerShare for hours to weeks; always set min_assets from preview_withdraw.
Caps: deposits revert 'Debt too high' when a market's LEVAMM would exceed AMM.max_debt()/2 (limited by crvUSD allocation); deposits can also revert 'Unsafe min/max' or 'LT deviation' (WETH oracle-report pool).
Staked positions give up Fundamental Value growth for YB emissions and have a watermark: after losses staked shares can redeem below the deposit until gains close the gap. YB price and gauge weight drive the return.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
Factory (market registry)factory on ethereum0x370a449FeBb9411c95bf897021377fe0B7D100c0
read market_count()
Number of deployed markets (11 on 2026-11-25: indexes 0-10; 7-10 active, 0-6 deprecated).
read markets(uint256)
Market struct (asset_token, cryptopool, amm (LEVAMM), lt (yb-LP token / vault), price_oracle, virtual_pool, staker (gauge)). Onchain state does not flag deprecated markets; compare with the contract-addresses page.
read emergency_admin()
Curve Emergency DAO multisig that can kill/revive a market.
read fee_receiver()
FeeSplitter that receives LT admin fees.
yb-WBTC (LT, market 7: WBTC, 2x leveraged WBTC/crvUSD Curve LP)vault on ethereum0x651D4b8168488FA163D85304662E8278d4c55BAa
write deposit(uint256,uint256,uint256,address)
Deposit WBTC and mint yb-WBTC shares. Args (assets in raw WBTC units, 8 decimals; debt = crvUSD the LEVAMM borrows, raw 18-decimal units; min_shares (18 decimals) slippage floor; receiver). Approve WBTC (0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599) to this LT first. Not ERC-4626 despite the event names. Pool policy: YBTwocryptoPolicy (use the price rule: debt = assets * pool.price_oracle() // 10**8). Pool = 0x313698667d7FDD6789a9BC70821309ff891E729A, LEVAMM = 0x7b9817eb5C49A99875138A5d52bF64a8B2cFFFFE. Reverts 'Debt too high' when the deposit would exceed the market cap (AMM.max_debt()/2), 'Deposit to staker' if receiver is the gauge (use StakeZap to deposit+stake). Simulate before sending.
read preview_deposit(uint256,uint256)
Expected shares for (assets, debt). Does not run the LT deviation check; reverts 'Debt too high' over the cap.
write withdraw(uint256,uint256,address)
Burn shares and receive WBTC: (shares, min_assets in raw WBTC units, receiver). Unstake from the gauge first (reverts 'Withdraw to/from staker'). Give a gas margin (reverts 'GAS' if the gauge checkpoint retry lacks 200k gas). If the market is killed: 'We're dead. Use emergency_withdraw'.
read preview_withdraw(uint256)
Redemption Value: WBTC (raw units) you would get now for a share amount, including the Temporary Redemption Discount (TRD). Use it to set min_assets.
read pricePerShare()
Fundamental Value of one share in WBTC, scaled to 18 decimals regardless of asset decimals (oracle-based; excludes TRD and is not an upper bound). TRD = preview_withdraw(1e18) * 10**(18-8) / pricePerShare() - 1.
write emergency_withdraw(uint256,address,address)
Exit when the market is killed or its oracle reverts: (shares, receiver, owner). Returns (asset_out, stables_to_return int256); if negative you must pay that much crvUSD, so approve crvUSD (0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E) to this LT first. No slippage parameter.
read preview_emergency_withdraw(uint256)
Quote (asset_received, stables_to_return) for emergency_withdraw.
read is_killed()
True if the market is killed (then only emergency_withdraw works).
read balanceOf(address)
yb-WBTC share balance (18 decimals). Staked shares sit in the gauge and are not counted here.
write approve(address,uint256)
ERC-20 approve, e.g. let the gauge pull shares before staking.
Gauge g(yb-WBTC) (market 7 staking, YB emissions)staking on ethereum0xAa0b1d265F23972eafB7d088e963BD31403A58F5
write deposit(uint256,address)
Stake yb-WBTC: (LT shares, receiver); mints gauge shares (ERC-4626 style). Approve this gauge on the LT first. Staked positions earn YB emissions instead of Fundamental Value growth and carry watermark risk.
write withdraw(uint256,address,address)
Unstake an exact amount of LT shares: (assets, receiver, owner).
write redeem(uint256,address,address)
Unstake by gauge shares: (shares, receiver, owner); returns LT shares.
write claim(address,address)
Claim rewards: (reward token, user). Use YB 0x01791F726B4103694969820be083196cC7c045fF for emissions; claim() with no args claims YB for msg.sender.
read preview_claim(address,address)
Claimable amount of a reward token for a user (raw units).
read convertToAssets(uint256)
LT shares for a gauge-share amount (includes the pending staker rebase; can be below 1:1).
read previewRedeem(uint256)
LT shares a redeem would return.
read balanceOf(address)
Gauge share balance (18 decimals).
yb-cbBTC (LT, market 8: cbBTC, 2x leveraged cbBTC/crvUSD Curve LP)vault on ethereum0x722FC3640BA007C3E9867CCdB0dCa59F2e2F29F9
write deposit(uint256,uint256,uint256,address)
Deposit cbBTC and mint yb-cbBTC shares. Args (assets in raw cbBTC units, 8 decimals; debt = crvUSD the LEVAMM borrows, raw 18-decimal units; min_shares (18 decimals) slippage floor; receiver). Approve cbBTC (0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf) to this LT first. Not ERC-4626 despite the event names. Pool policy: YBTwocryptoPolicy (use the price rule: debt = assets * pool.price_oracle() // 10**8). Pool = 0x862CB4E988FB66E72f128d1183829f8c05B6c6A0, LEVAMM = 0x49F51d7e279252F3C9a09678fdC65B4dBd5CB196. Reverts 'Debt too high' when the deposit would exceed the market cap (AMM.max_debt()/2), 'Deposit to staker' if receiver is the gauge (use StakeZap to deposit+stake). Simulate before sending.
read preview_deposit(uint256,uint256)
Expected shares for (assets, debt). Does not run the LT deviation check; reverts 'Debt too high' over the cap.
write withdraw(uint256,uint256,address)
Burn shares and receive cbBTC: (shares, min_assets in raw cbBTC units, receiver). Unstake from the gauge first (reverts 'Withdraw to/from staker'). Give a gas margin (reverts 'GAS' if the gauge checkpoint retry lacks 200k gas). If the market is killed: 'We're dead. Use emergency_withdraw'.
read preview_withdraw(uint256)
Redemption Value: cbBTC (raw units) you would get now for a share amount, including the Temporary Redemption Discount (TRD). Use it to set min_assets.
read pricePerShare()
Fundamental Value of one share in cbBTC, scaled to 18 decimals regardless of asset decimals (oracle-based; excludes TRD and is not an upper bound). TRD = preview_withdraw(1e18) * 10**(18-8) / pricePerShare() - 1.
write emergency_withdraw(uint256,address,address)
Exit when the market is killed or its oracle reverts: (shares, receiver, owner). Returns (asset_out, stables_to_return int256); if negative you must pay that much crvUSD, so approve crvUSD (0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E) to this LT first. No slippage parameter.
read preview_emergency_withdraw(uint256)
Quote (asset_received, stables_to_return) for emergency_withdraw.
read is_killed()
True if the market is killed (then only emergency_withdraw works).
read balanceOf(address)
yb-cbBTC share balance (18 decimals). Staked shares sit in the gauge and are not counted here.
write approve(address,uint256)
ERC-20 approve, e.g. let the gauge pull shares before staking.
Gauge g(yb-cbBTC) (market 8 staking, YB emissions)staking on ethereum0xF8764cBcdb15a9E4c7CA1b0b8a578d9ebEEC1b6f
write deposit(uint256,address)
Stake yb-cbBTC: (LT shares, receiver); mints gauge shares (ERC-4626 style). Approve this gauge on the LT first. Staked positions earn YB emissions instead of Fundamental Value growth and carry watermark risk.
write withdraw(uint256,address,address)
Unstake an exact amount of LT shares: (assets, receiver, owner).
write redeem(uint256,address,address)
Unstake by gauge shares: (shares, receiver, owner); returns LT shares.
write claim(address,address)
Claim rewards: (reward token, user). Use YB 0x01791F726B4103694969820be083196cC7c045fF for emissions; claim() with no args claims YB for msg.sender.
read preview_claim(address,address)
Claimable amount of a reward token for a user (raw units).
read convertToAssets(uint256)
LT shares for a gauge-share amount (includes the pending staker rebase; can be below 1:1).
read previewRedeem(uint256)
LT shares a redeem would return.
read balanceOf(address)
Gauge share balance (18 decimals).
yb-tBTC (LT, market 9: tBTC, 2x leveraged tBTC/crvUSD Curve LP)vault on ethereum0x771F7290428d830ECd41E980745c327e507823Ec
write deposit(uint256,uint256,uint256,address)
Deposit tBTC and mint yb-tBTC shares. Args (assets in raw tBTC units, 18 decimals; debt = crvUSD the LEVAMM borrows, raw 18-decimal units; min_shares (18 decimals) slippage floor; receiver). Approve tBTC (0x18084fbA666a33d37592fA2633fD49a74DD93a88) to this LT first. Not ERC-4626 despite the event names. Pool policy: YBTwocryptoPolicy (use the price rule: debt = assets * pool.price_oracle() // 10**18). Pool = 0x4F52C3a81E33521e5a9A47FD9D3BE475D2279c2e, LEVAMM = 0x0e357Af536592F275C6Aa07b8AC2CA6EB3d0cF5a. Reverts 'Debt too high' when the deposit would exceed the market cap (AMM.max_debt()/2), 'Deposit to staker' if receiver is the gauge (use StakeZap to deposit+stake). Simulate before sending.
read preview_deposit(uint256,uint256)
Expected shares for (assets, debt). Does not run the LT deviation check; reverts 'Debt too high' over the cap.
write withdraw(uint256,uint256,address)
Burn shares and receive tBTC: (shares, min_assets in raw tBTC units, receiver). Unstake from the gauge first (reverts 'Withdraw to/from staker'). Give a gas margin (reverts 'GAS' if the gauge checkpoint retry lacks 200k gas). If the market is killed: 'We're dead. Use emergency_withdraw'.
read preview_withdraw(uint256)
Redemption Value: tBTC (raw units) you would get now for a share amount, including the Temporary Redemption Discount (TRD). Use it to set min_assets.
read pricePerShare()
Fundamental Value of one share in tBTC, scaled to 18 decimals regardless of asset decimals (oracle-based; excludes TRD and is not an upper bound). TRD = preview_withdraw(1e18) * 10**(18-18) / pricePerShare() - 1.
write emergency_withdraw(uint256,address,address)
Exit when the market is killed or its oracle reverts: (shares, receiver, owner). Returns (asset_out, stables_to_return int256); if negative you must pay that much crvUSD, so approve crvUSD (0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E) to this LT first. No slippage parameter.
read preview_emergency_withdraw(uint256)
Quote (asset_received, stables_to_return) for emergency_withdraw.
read is_killed()
True if the market is killed (then only emergency_withdraw works).
read balanceOf(address)
yb-tBTC share balance (18 decimals). Staked shares sit in the gauge and are not counted here.
write approve(address,uint256)
ERC-20 approve, e.g. let the gauge pull shares before staking.
Gauge g(yb-tBTC) (market 9 staking, YB emissions)staking on ethereum0xe83D888FE3213DD3471DE0bC1957E0f94F038483
write deposit(uint256,address)
Stake yb-tBTC: (LT shares, receiver); mints gauge shares (ERC-4626 style). Approve this gauge on the LT first. Staked positions earn YB emissions instead of Fundamental Value growth and carry watermark risk.
write withdraw(uint256,address,address)
Unstake an exact amount of LT shares: (assets, receiver, owner).
write redeem(uint256,address,address)
Unstake by gauge shares: (shares, receiver, owner); returns LT shares.
write claim(address,address)
Claim rewards: (reward token, user). Use YB 0x01791F726B4103694969820be083196cC7c045fF for emissions; claim() with no args claims YB for msg.sender.
read preview_claim(address,address)
Claimable amount of a reward token for a user (raw units).
read convertToAssets(uint256)
LT shares for a gauge-share amount (includes the pending staker rebase; can be below 1:1).
read previewRedeem(uint256)
LT shares a redeem would return.
read balanceOf(address)
Gauge share balance (18 decimals).
yb-WETH (LT, market 10: WETH, 2x leveraged WETH/crvUSD Curve LP)vault on ethereum0x2B9c9f3BdcEb5d8E36a4704F08a78Fca53343cEa
write deposit(uint256,uint256,uint256,address)
Deposit WETH and mint yb-WETH shares. Args (assets in raw WETH units, 18 decimals; debt = crvUSD the LEVAMM borrows, raw 18-decimal units; min_shares (18 decimals) slippage floor; receiver). Approve WETH (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) to this LT first. Not ERC-4626 despite the event names. Pool policy: YBOraclizedPolicy (oracle-report policy: when the LEVAMM book holds collateral, debt must be proportional to the book, debt = calc_token_amount([debt, assets], True) * AMM.get_debt() / AMM.collateral_amount(), iterated, or deposit reverts 'LT deviation'). Pool = 0x656341Ef90b622c6634e0573772FfB7f3669b9f3, LEVAMM = 0x5f8D24F33Cc5a1D5D1bf012261E6A2214C92233c. Reverts 'Debt too high' when the deposit would exceed the market cap (AMM.max_debt()/2), 'Deposit to staker' if receiver is the gauge (use StakeZap to deposit+stake). Simulate before sending.
read preview_deposit(uint256,uint256)
Expected shares for (assets, debt). Does not run the LT deviation check; reverts 'Debt too high' over the cap.
write withdraw(uint256,uint256,address)
Burn shares and receive WETH: (shares, min_assets in raw WETH units, receiver). Unstake from the gauge first (reverts 'Withdraw to/from staker'). Give a gas margin (reverts 'GAS' if the gauge checkpoint retry lacks 200k gas). If the market is killed: 'We're dead. Use emergency_withdraw'.
read preview_withdraw(uint256)
Redemption Value: WETH (raw units) you would get now for a share amount, including the Temporary Redemption Discount (TRD). Use it to set min_assets.
read pricePerShare()
Fundamental Value of one share in WETH, scaled to 18 decimals regardless of asset decimals (oracle-based; excludes TRD and is not an upper bound). TRD = preview_withdraw(1e18) * 10**(18-18) / pricePerShare() - 1.
write emergency_withdraw(uint256,address,address)
Exit when the market is killed or its oracle reverts: (shares, receiver, owner). Returns (asset_out, stables_to_return int256); if negative you must pay that much crvUSD, so approve crvUSD (0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E) to this LT first. No slippage parameter.
read preview_emergency_withdraw(uint256)
Quote (asset_received, stables_to_return) for emergency_withdraw.
read is_killed()
True if the market is killed (then only emergency_withdraw works).
read balanceOf(address)
yb-WETH share balance (18 decimals). Staked shares sit in the gauge and are not counted here.
write approve(address,uint256)
ERC-20 approve, e.g. let the gauge pull shares before staking.
Gauge g(yb-WETH) (market 10 staking, YB emissions)staking on ethereum0xd829456FD63Ada7DE0657714A3A7A26DE403E3D8
write deposit(uint256,address)
Stake yb-WETH: (LT shares, receiver); mints gauge shares (ERC-4626 style). Approve this gauge on the LT first. Staked positions earn YB emissions instead of Fundamental Value growth and carry watermark risk.
write withdraw(uint256,address,address)
Unstake an exact amount of LT shares: (assets, receiver, owner).
write redeem(uint256,address,address)
Unstake by gauge shares: (shares, receiver, owner); returns LT shares.
write claim(address,address)
Claim rewards: (reward token, user). Use YB 0x01791F726B4103694969820be083196cC7c045fF for emissions; claim() with no args claims YB for msg.sender.
read preview_claim(address,address)
Claimable amount of a reward token for a user (raw units).
read convertToAssets(uint256)
LT shares for a gauge-share amount (includes the pending staker rebase; can be below 1:1).
read previewRedeem(uint256)
LT shares a redeem would return.
read balanceOf(address)
Gauge share balance (18 decimals).
StakeZaprouter on ethereum0xE862bC39B8D5F12D8c4117d3e2D493Dc20051EC6
write deposit_and_stake(address,uint256,uint256,uint256,address)
Deposit and stake in one tx: (gauge, assets, debt, min_shares (LT shares, not gauge shares), receiver). Approve the asset to the zap. debt follows the same pool-policy rule as LT.deposit. Returns gauge shares.
write withdraw_and_unstake(address,uint256,uint256,address)
Unstake and withdraw in one tx: (gauge, gauge shares, min_assets (raw asset units), receiver). Approve the gauge shares to the zap first. Returns asset amount.
YB tokentoken on ethereum0x01791F726B4103694969820be083196cC7c045fF
read balanceOf(address)
YB balance (18 decimals). Max supply 1,000,000,000 YB; minted only via GaugeController emissions.
write approve(address,uint256)
Approve veYB (VotingEscrow) before create_lock / increase_amount.
write transfer(address,uint256)
ERC-20 transfer.
veYB (VotingEscrow)governance on ethereum0x8235c179E9e84688FBd8B12295EfC26834dAC211
write create_lock(uint256,uint256)
Lock YB: (amount raw 18-dec, unlock unix time). Unlock time is rounded down to a week and must be <= now + 4 years. Approve YB first. Mints a veYB NFT; one lock per address.
write increase_amount(uint256)
Add YB to an existing, unexpired lock (two-arg form increase_amount(uint256,address) adds to another address's lock).
write increase_unlock_time(uint256)
Extend the unlock time (rounded down to a week, max 4 years ahead).
write infinite_lock_toggle()
Toggle permalock (no decay). Turning it off requires no active gauge votes and restarts a 4-year decay.
write withdraw()
Withdraw all YB after the lock expired (permalocks must be toggled off first).
read getVotes(address)
Current voting power (18 decimals); decays linearly to the unlock time. balanceOf() is the NFT count, not voting power.
read locked(address)
(amount, end) of an address's lock.
GaugeControllergovernance on ethereum0x1Be14811A3a06F6aF4fA64310a636e1Df04c1c21
write vote_for_gauge_weights(address[],uint256[])
Vote YB emissions to gauges with your veYB: (gauges, weights in basis points, total <= 10000). Max 50 gauges; at most once per gauge every 10 days; lock must not be expired.
read gauge_relative_weight(address)
Share of emissions a gauge gets (1e18 = 100%).
read get_gauge_weight(address)
Raw gauge weight.
read n_gauges()
Number of gauges; gauges(i) lists them.
read preview_emissions(address,uint256)
YB a gauge will have received by a timestamp (18 decimals).
FeeDistributor (veYB fee claims)other on ethereum0xD11b416573EbC59b6B2387DA0D2c0D1b3b1F7A90
write claim(address,uint256,bool)
Claim weekly admin fees (paid as yb-LP tokens) for veYB: (receiver, epoch_count (max 50 per call, default 50), use_vest false for normal users). claim() with no args claims for msg.sender.
read preview_claim(address,uint256,bool)
Tokens and amounts a claim would pay; marked non-view in the ABI, call it with eth_call.
write fill_epochs()
Anyone: spread newly received fees over the next 4 weekly epochs.