Deposit Flow
Overview
User selects vault → Get quote → Approve token → Sign intent → Build tx → Send tx → Track statusStep 1: Select a Vault
const response = await fetch('https://api.yieldo.xyz/v1/vaults?chain_id=8453');
const vaults = await response.json();Step 2: Get a Quote
const quote = await fetch('https://api.yieldo.xyz/v1/quote', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
from_chain_id: 42161,
from_token: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
from_amount: '1000000000', // 1000 USDC
vault_id: 'base-steakhouse-prime-usdc',
user_address: userAddress,
}),
});
const quoteData = await quote.json();Step 3: Approve Token Spending
Step 4: Sign the EIP-712 Intent
Step 5: Build the Transaction
Step 6: Send the Transaction
Step 7: Track the Deposit
Complete Example
Last updated
Was this helpful?