Skip to main content

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
LI.FI Composer enable the execution of the following multi-step process in a single transaction: on the Base network, swap USDC for ETH; bridge ETH to the Ethereum network; swap ETH for USDC; and deposit USDC into Aave. Composer uses two core components to achieve this functionality:
  1. 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.
  2. 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
Note: While Composer itself is currently single-chain only, it can leverage the entire LI.FI API/backend for cross-chain functionality as Composer is categorised as a ‘tool’ in the LI.FI backend.

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
Composer Flow: Single transaction executes:
  1. Bridge ETH from Ethereum to Base
  2. Swap portion of ETH to USDC on Base
  3. Deposit USDC into Morpho vault
  4. Return vault tokens to user
By using Composer, LI.FI transforms this complex multi-step process into a seamless one-click operation.

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)
Supported Protocols at Launch Team is open to protocol integration requests based on technical feasibility and community feedback.
  1. Morpho V1 and V2 vaults
  2. Aave V3 markets
  3. Kinetiq - deposit only
  4. Euler
  5. Ethena (USDe to sUSDe, ENA to sENA) - deposit only
  6. Felix Vanilla
  7. HyperLend
  8. Pendle
  9. 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 the GET /quote and POST /routes endpoints Composer is categorised as a “tool” in the LI.FI API and requires manual addition to integrator whitelists

API Examples

Example 1: Same-Chain Deposit (USDC to Morpho Vault on Base)

curl -X GET 'https://li.quest/v1/quote?fromChain=8453&toChain=8453&fromToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&toToken=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&fromAddress=0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE&toAddress=0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE&fromAmount=1000000'
Parameters:
  • fromChain: 8453 (Base)
  • toChain: 8453 (Base - same chain)
  • fromToken: USDC on Base
  • toToken: Morpho Vault token address
  • fromAmount: 1000000 (1 USDC with 6 decimals)
This example demonstrates depositing USDC into a Morpho vault on Base in a single transaction.

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.

Next Steps

Ready to integrate? Contact the LI.FI team to discuss your specific use case and get Composer added to your integrator whitelist.