Prerequisites: You should have the LI.FI SDK installed and configured. If
not, see Installing the SDK and Configure
SDK.
Quick Example
Deposit USDC into a Morpho vault on Base using the SDK:- Allowance checks and approvals
- Transaction data retrieval (if using
/advanced/routes) - Transaction submission
- Status tracking and polling
- Chain switching (for cross-chain flows)
Step-by-Step Guide
1. Configure the SDK
Set up the SDK once at application startup. You must configure EVM providers for the chains you want to use.2. Request a Composer Quote
UsegetQuote for a single best route (includes transaction data) or getRoutes for multiple options.
Using getQuote
Using getRoutes
3. Execute the Route
TheexecuteRoute function handles the entire execution lifecycle:
4. Monitor Execution
TheupdateRouteHook callback fires on every state change. Use it to update your UI:
Cross-Chain Composer via SDK
Cross-chain Composer works across EVM chains. The integration is identical to same-chain: just use differentfromChain and toChain values. The SDK handles bridge routing, chain switching, and status tracking automatically.
ETH (Ethereum) → Morpho vault (Base)
USDC (Ethereum) → Morpho Vault (Base)
- Bridge selection and execution
- Waiting for bridge completion
- Chain switching to the destination chain
- Executing the Composer deposit on the destination chain
- Status tracking throughout
Execution Options
All execution options are optional but can be useful for advanced use cases:
For the full execution options reference, see Execute Routes/Quotes.
Error Handling
The SDK throws errors that you can catch and handle:Next Steps
Cross-Chain Patterns
Advanced cross-chain Composer flows
Widget Integration
Zero-code Composer via the drop-in Widget
SDK Configuration
Full SDK configuration reference
Vault Deposit Recipes
Copy-paste recipes for common protocols

