Deposit and Withdraw
Last updated
Last updated
This guide explains how to interact with the yoVaults
smart contracts (yoETH
, yoUSD
, yoBTC
) on the Base blockchain. These contracts implement the Tokenized Vault Standard, enabling users and integrators to deposit ERC-20 tokens ("assets") and receive yield-bearing yoTokens in return.
The guide outlines how to:
Connect to the vaults with Ethers.js
Use read functions (previewDeposit
, previewMint
, previewRedeem
) to estimate outcomes
Execute deposit and redemption transactions
Understand how yoTokens ↔ assets conversion works
All vaults follow the same contract interface and live on Base chain (chain ID 8453).
preview*
FunctionsThese functions estimate how many shares or assets you'll receive/spend before making a transaction.
previewDeposit(assets)
Estimate how many yoTokens you get for a given asset amount:
previewMint(shares)
Estimate how many assets are needed to mint a specific number of yoTokens:
maxWithdraw(owner)
Returns the maximum amount of assets that can currently be withdrawn by the given address.
previewRedeem(shares)
Estimate how many assets you'd get back when redeeming yoTokens:
deposit(assets, receiver)
Deposit a specific amount of assets and receive yoTokens in return:
requestRedeem(yoTokens, receiver, owner)
Burn yoTokens and receive assets in return. You cannot request an exact asset amount.
Deposit assets for yoTokens
deposit()
previewDeposit()
Mint exact amount of yoTokens
mint()
previewMint()
Redeem yoTokens for assets
requestRedeem()
previewRedeem()
All values must be parsed using correct decimals (e.g. ethers.parseUnits("1.0", 18)
).
ETH / yoETH decimals: 18
cbBTC / yoBTC decimals: 8
USDC / yoUSD decimals: 6
Only requestRedeem
is supported for withdrawals because depending on the withdrawal amount, the yoVault may not have enough available liquidity to fill the redeem order. In those cases, the withdrawal will remain pending for up to 24 hours. The protocol will fill the redeem order and send the assets directly to the receiver
specified in the requestRedeem
transaction
All the yoVaults follow the same ABI and differ only by address.
yoETH
0x3a43aec53490cb9fa922847385d82fe25d0e9de7
yoUSD
0x0000000f2eb9f69274678c76222b35eec7588a65
yoBTC
0xbcbc8cb4d1e8ed048a6276a5e94a3e952660bcbc