Get started with LI.FI Earn in under 5 minutes. List vaults, get vault details, check user positions, and deposit via Composer.
This quickstart walks you through the core Earn flows: discovering vaults via the Earn Data API, checking a user’s positions, and then executing a deposit via Composer.
Fetch full details for a specific vault by chain ID and contract address:
curl -X GET 'https://earn.li.fi/v1/earn/vaults/8453/0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A' \ --header 'x-lifi-api-key: YOUR_API_KEY'
Use GET /v1/earn/chains and GET /v1/earn/protocols to build dynamic filter UIs showing only the chains and protocols that currently have vaults. Both endpoints return lightweight lists and can be fetched once per session.
Once you’ve found a vault, use its contract address as the toToken with Composer to execute a deposit. Composer handles the swap, bridge (if cross-chain), and deposit in a single transaction.
# Deposit 1 USDC into a Morpho vault on Basecurl -X GET 'https://li.quest/v1/quote?\fromChain=8453&\toChain=8453&\fromToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\toToken=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&\fromAddress=0xYOUR_WALLET_ADDRESS&\toAddress=0xYOUR_WALLET_ADDRESS&\fromAmount=1000000'
The deposit step uses Composer (li.quest), not the Earn Data API. See the Composer API Integration Guide for full details on executing transactions.