LI.FI Messaging Flow Documentation
Overview
LI.FI Messaging Flow enables seamless interactions with centralized and hybrid exchanges that use message-based APIs (such as Hyperliquid) instead of traditional on-chain transactions. This flow delivers gasless, approval-free operations for cross-chain transfers involving protocols that operate with off-chain signed messages. Traditional DeFi operations require users to send on-chain transactions, manage gas fees, and approve token spending for each interaction. Messaging flow eliminates these friction points by using off-chain signed messages (EIP-712) that are relayed to destination protocols through LI.FI’s backend infrastructure.Key Benefits of Messaging Flow
- No Token Approvals Required: Unlike transaction-based flows, messaging flow doesn’t require users to approve token spending
- Gasless Operations: Users sign messages off-chain without paying gas fees for the message itself (some operation might require fee payments, not gas)
- Asynchronous Execution: Messages are relayed and processed asynchronously, with status tracking via
taskId - Seamless Integration: Works out-of-the-box with LI.FI API, SDK, and Widget
How Messaging Flow Works
The messaging flow operates through a multi-step process that replaces traditional on-chain transactions with off-chain signed messages:- Quote/Route Generation: User requests a quote or route with
executionType=message(will generate ONLY message-based routes) orexecutionType=all(both transaction and messages options) - Message Creation: LI.FI generates an EIP-712 typed message containing the operation details
- User Signature: User signs the message off-chain in their wallet (no gas required)
- Message Relay: Signed message is submitted to LI.FI’s
/v1/advanced/relayendpoint - Backend Processing: LI.FI backend validates and forwards the message to the destination protocol (e.g., Hyperliquid)
- Task Tracking: Backend returns a
taskIdfor tracking the asynchronous operation - Status Monitoring: Status can be checked via
/v1/statusendpoint using thetaskIdparameter
Flow Diagram
Key Differences from Transaction Flow
| Aspect | Transaction Flow | Messaging Flow |
|---|---|---|
| Execution Type | On-chain transaction | Off-chain signed message |
| Gas Fees | User pays gas for each transaction | No gas for signing messages |
| Token Approvals | Required (separate transaction) | Not required (skipApproval: true) |
| Status Tracking | txHash | taskId |
| User Action | Send transaction | Sign typed message |
Important Parameters
estimate.skipApproval: Automatically set totruefor messaging flows, indicating no approval transaction is neededestimate.executionType: Set to"message"to identify steps that use messaging flowtypedData: Contains the EIP-712 message structure that users need to sign
The executionType Parameter
TheexecutionType parameter controls which types of routes are returned by the LI.FI API. This optional parameter is available in:
GET /v1/quotePOST /v1/advanced/routes
Values
transaction(default): Returns only routes using traditional on-chain transactions, excluding messaging flow routesmessage: Returns only routes that use messaging flowall: Returns both transaction-based and message-based routes
Example Usage
Get only message-based routes:The /relay Endpoint
POST /v1/advanced/relay
Purpose: Submit signed EIP-712 messages for relaying to destination protocols. Endpoint:https://li.quest/v1/advanced/relay
Request Body
The request body is aRelayRequest object containing:
- Step Information: Standard LI.FI step data (tool, action, estimate)
- Typed Data: Array of signed EIP-712 messages
- Signature: User’s signature for each message
Request Schema
Response
Success Response (200 OK):
400 Bad Request):
Response Fields
status: Either"ok"or"error"data.taskId: Unique hex-encoded identifier for tracking the message relay operationdata.code: Error code (only present when status is “error”)data.message: Error message (only present when status is “error”)
Status Tracking with taskId
After relaying a message, you receive ataskId that uniquely identifies the operation. Use this to track the message processing status.
GET /v1/status
Endpoint:https://li.quest/v1/status
Query Parameters:
taskId(optional): The task ID returned from/relayendpointtxHash(optional): Transaction hash (for traditional transactions)toChain(optional): Destination chain ID or keybridge(optional): Bridge tool identifierfromChain(optional): Source chain ID or key
taskId or txHash. For messaging flow, use taskId.
Example Request
Response Format
The status endpoint returns the current state of the transfer:Current Usage & Supported Protocols
Messaging flow is currently used for interactions with the following protocols:1. Hyperliquid (Primary Use Case)
Protocol: Hyperliquid Operation: Withdrawals from Hyperliquid to EVM chains Bridge Tool:hyperliquidSA
Message Type: SendAsset, “
How it works:
- User has tokens on Hyperliquid spot account
- Signs a
SendAssetmessage to withdraw to an EVM chain - LI.FI relays the message to Hyperliquid’s API
- Hyperliquid processes the withdrawal and sends tokens to destination chain
2. Unit Protocol
Protocol: Unit Protocol Operation: Withdrawals to Hyperliquid via Unit bridge Bridge Tool:unit
Message Type: SpotSend
Chain IDs:
- From: 1337 (Hyperliquid/Hypercore)
- To: EVM chains, Bitcoin, Solana
Supported Message Types
Hyperliquid
LI.FI Messaging Flow supports three EIP-712 message types for Hyperliquid operations. Each message type follows a specific structure and is used for different operations.1. SpotSend
Purpose: Spot token transfers Use Case: Used by Unit protocol for deposits to Hyperliquid Bridge Tool:unit
Message Structure:
2. SendAsset
Purpose: Asset transfers between DEXs (spot accounts) Use Case: Used for Hyperliquid withdrawals to EVM chains Bridge Tool:hyperliquidSA
Message Structure:
Integration Guide
Using the API Directly
Step 1: Get a Quote/Route Request a quote withexecutionType=message or executionType=all:
estimate.executionType === "message" and estimate.skipApproval === true.
Step 3: Sign the Message
Use the typedData from the route to request a signature from the user’s wallet:
/relay endpoint:
taskId to check status:
Best Practices
- Always check
estimate.skipApproval: If true, skip approval transaction - Validate signatures: Ensure the message is signed correctly before relaying
- Store taskId: Save the taskId returned from
/relayfor status tracking - Poll status endpoint: Check status periodically until completion
Limitations & Considerations
Current Limitations
- Supported Protocols: Currently limited to Hyperliquid and Unit protocol
Future Enhancements
As the messaging flow matures, additional protocols and chains may be supported. Protocol teams interested in integration can contact the LI.FI team.FAQ
Q: Do I need to do anything special to use messaging flow? A: No. If you’re using the LI.FI SDK or Widget, messaging routes are automatically included and handled. For direct API usage, setexecutionType=all to see message routes.
Q: Why does my route have skipApproval: true?
A: This indicates the route uses messaging flow and doesn’t require a token approval transaction.
Q: How long does it take for a message to be processed?
A: Processing time varies by protocol. For Hyperliquid, withdrawals typically complete within a few seconds.
Q: Can I cancel a message after relaying?
A: Once a message is relayed and accepted by the protocol, it cannot be cancelled through LI.FI. Check with the specific protocol for their cancellation policies.
Q: How do I know if a route uses messaging flow?
A: Check the estimate.executionType field. If it’s "message", the route uses messaging flow.
Next Steps
- Integrate: Use the LI.FI SDK, Widget, or API to access messaging flow routes
- Test: Try a small withdrawal from Hyperliquid using the messaging flow
- Monitor: Use the
taskIdto track your operations via the status endpoint - Contact: Reach out to the LI.FI team for protocol integration requests

