Overview
LI.FI Composer, also referred to as “contract calls”, “zaps”, or “transaction orchestration”, delivers one-click UX for any combination of onchain actions across any number of chains. Composer provide a streamlined way to bundle multiple actions within a single transaction on same-chain or cross-chain, eliminating the need for users to coordinate multiple transactions and navigate different interfaces by abstracting complex onchain operations into a single user intent. Current DeFi UX forces users to hop between multiple platforms and manage potentially dozens of transactions just to complete a single workflow. Composer solves this by transforming multi-step, multi-chain operations into a single click, reducing the need for multiple steps, lowering gas fees, and enhancing the user experience.Key Benefits of LI.FI Composer
- Single Transaction Execution: Composer allow multiple actions to be completed in one transaction, eliminating the need for users to sign and pay for each individual action separately.
- Cost Efficiency: By batching actions into a single transaction, Composer reduce gas costs, as each step in a multi-action sequence does not require its own transaction fee.
- Improved User Experience: Composer minimize the complexity of onchain interactions by consolidating them, making it easier for users to perform multi-step operations without extensive technical knowledge.
- Atomic Transactions (same-chain only): Composer are executed as atomic transactions (same-chain only), meaning all actions are completed as a single unit or none at all, ensuring security and consistency in execution.
How LI.FI Composer Work
LI.FI Composer work by consolidating a series of contract calls into a single transaction through an onchain VM. Each Zap is designed to follow a predefined sequence of actions that enables users to perform complex DeFi operations without needing to interact directly with multiple protocols. This single transaction can perform multiple actions on behalf of the user, such as:- Swapping Tokens: Convert one asset to another using decentralised exchanges (DEXs)
- Depositing into Vaults: Deposit into protocols like lending protocols or yield-bearing vaults
- Staking: Stake into LSTs and restaking protocols
- Onchain VM (Execution Engine): Smart contract that can call any other onchain protocol or series of them, handling all onchain execution without requiring users to understand blockchain interactions.
- eDSL and Compiler: Purpose-built domain-specific language to express contract interactions in Typescript — this gets compiled to bytecode for the VM to execute on-chain.
Value Proposition for Integrators
Protocol Teams Integrate their protocols as Composer to expand user accessibility and adoption. Partner protocols can be invited to Composer backend code base. Wallet & DeFi Platforms Composer offer users more sophisticated onchain actions, and “campaigns” can be created for further user engagement (e.g., deposit into new protocol). This significantly reduces user friction whilst expanding the breadth of DeFi operations your platform can support. Onchain Protocols (e.g., lending protocol) Composer allows users to perform a 1-click cross-chain action into the desired protocol. For example, users with assets on Base can deposit into a lending protocol on Arbitrum in 1-click.Supported Actions in LI.FI Composer
LI.FI Composer currently support the following actions:- DeFi Protocol Interactions: Deposit into, withdraw from, or interact with supported lending platforms, yield farms, and staking protocols
- Cross-Chain Protocol Access: Execute cross-chain operations to access protocols on different chains through the broader LI.FI API
- Tokenised Position Management: Handle vault tokens and other tokenised positions
Example Workflow: Cross-Chain DeFi Deposit with Composer
Traditional Flow: User wants to deposit into a Morpho vault on Base but only holds ETH on Ethereum- 4+ transactions across 2+ websites
- Manual coordination of bridges, swaps, gas management, and protocol deposits
- Bridge ETH from Ethereum to Base
- Swap portion of ETH to USDC on Base
- Deposit USDC into Morpho vault
- Return vault tokens to user
Technical Details
Key Technical Features
- Atomicity via pre-execution simulation: Simulates the entire execution path before submitting transactions onchain, providing users with certainty about outcomes and preventing failed transactions
- Dynamic calldata injection: Automatically intercepts and injects necessary parameters between transaction steps when step 2 requires data from step 1’s output
- LI.FI ecosystem integration: As part of the broader LI.FI ecosystem, Composer can combine cross-chain swaps, bridges, and protocol interactions in a single workflow, enabling complex operations like cross-chain swap + deposit combinations
Current Capabilities & Limitations
Limitations- No Solana or non-EVM chain support
- Tokenised positions only (e.g., vault tokens)
- Morpho V1 and V2 vaults
- Aave V3 markets
- Kinetiq - deposit only
- Euler
- Ethena (USDe to sUSDe, ENA to sENA) - deposit only
- Felix Vanilla
- HyperLend
- Pendle
- Maple - deposit only
How to Implement LI.FI Composer
No custom integration required! Composer works out-of-the-box with the LI.FI API, Widget and SDK. To utilise Composer, developers can leverage the LI.FI API, which provides endpoints for executing Composer.Technical Implementation
Vault token addresses need to be inputted into theGET /quote and POST /routes endpoints
- Documentation:
- For a detailed explanation of the difference between
/quoteand/route, refer to this page.
API Examples
Example 1: Same-Chain Deposit (USDC to Morpho Vault on Base)
fromChain: 8453 (Base)toChain: 8453 (Base - same chain)fromToken: USDC on BasetoToken: Morpho Vault token addressfromAmount: 1000000 (1 USDC with 6 decimals)
Use Cases for LI.FI Composer
- Cross-Chain Yield Farming: Deposit an asset on one chain, bridge it to another chain, and deposit into a yield farming protocol in a single transaction.
- Multi-Chain Arbitrage: Execute operations across different chains to exploit opportunities without needing separate transactions for each chain.
- Onboarding New Users to DeFi: Simplify user onboarding by allowing them to perform multi-step DeFi operations in a single, seamless transaction.
- Protocol Access Simplification: Enable users to access any supported protocol from any supported chain with a single click.

