Overview
depositFor (same-chain) or depositForAvailable (cross-chain composer destination) calls.
Step 1: Select a Vault
Fetch available vaults and let the user choose one.Step 2: Get a Quote
Once the user specifies a source chain, token, and amount, request a quote.estimate- Expected output amount, estimated shares, gas costapproval- Token approval details (if needed)route_options- Available bridge routes for cross-chain deposits (with bridge name, logo, estimated time, gas cost)
Step 3: Approve Token Spending
IfquoteData.approval is not null, the user needs to approve the token first.
Tip: For native token deposits (e.g., ETH), theapprovalfield will benulland you can skip this step.
Step 4: Build the Transaction
Submit the deposit details to get the final transaction. Optionally pass apreferred_bridge if the user selected a specific route.
Step 5: Send the Transaction
Send the transaction using the user’s wallet.Step 5b: Handle Two-Step Cross-Chain Deposits
For certain vault types (Midas, Veda, Custom, IPOR, Lido), the build response hastwo_step: true. LiFi Composer doesn’t natively understand these deposit interfaces, so we split the flow:
- Step 1 = bridge tokens to the user’s wallet on the destination chain (the main
transaction_request) - Wait for LiFi to confirm the bridge is
DONE - Step 2 = same-chain deposit on the destination, using
buildData.deposit_tx