Individual Contract Integration Guide
⚙️ Setup
Install Ethers
npm install ethersConnect to an RPC & Instantiate the Contract
import { ethers } from "ethers";
import abi from "./yoAbi.json"; // Use the ABI attached below
const provider = new ethers.JsonRpcProvider("https://mainnet.base.org"); // or use any RPC for Ethereum chain
const signer = new ethers.Wallet(PRIVATE_KEY, provider);
const YO_VAULTS = {
yoETH: "0x3a43aec53490cb9fa922847385d82fe25d0e9de7",
yoUSD: "0x0000000f2eb9f69274678c76222b35eec7588a65",
yoBTC: "0xbcbc8cb4d1e8ed048a6276a5e94a3e952660bcbc",
...,
};
const vault = new ethers.Contract(YO_VAULTS.yoETH, abi, signer); // Swap as needed🔍 Simulate with preview* and convertTo Functions
preview* and convertTo FunctionsPricing your positions:
maxWithdraw(owner)
maxWithdraw(owner)convertToAssets(shares)
convertToAssets(shares)Quoting before building a transaction
previewDeposit(assets)
previewDeposit(assets)previewRedeem(shares)
previewRedeem(shares)✍️ Execute Transactions
deposit(assets, receiver)
deposit(assets, receiver)redeem(yoTokens, receiver, owner)
redeem(yoTokens, receiver, owner) Recap: Share-to-Asset Logic
You Want To...
Use This Function
Simulation Tool
Notes
Last updated