Skip to main content
This page covers the errors you may encounter when using Composer and how to handle them. Composer uses the same error system as the broader LI.FI API, and the errors documented here are contextualised for Composer-specific scenarios.

API Errors (Quote/Route Request)

When requesting a Composer quote via GET /quote or POST /advanced/routes, the API may return errors. These follow the standard LI.FI error format:
  1. HTTP status code (e.g., 200, 404, 429, 500)
  2. LI.FI error code (numeric)
  3. Error message (human-readable)

Relevant API Error Codes

For the complete list of API error codes, see Error Codes.

Tool Errors

The API may also return tool-specific errors describing issues with the underlying protocols. These use the ToolError format:

Relevant Tool Error Codes

Example: Handling Tool Errors


Transaction Failures

Pre-Execution Simulation Failure

Composer simulates the entire execution path before returning a quote. If simulation fails, the API returns an error instead of a transaction that would revert onchain. This protects users from wasting gas on failed transactions. Common simulation failure causes:
  • The vault is not accepting deposits (paused, full, or restricted)
  • The token path involves incompatible tokens
  • Insufficient liquidity in the swap path

Onchain Transaction Revert

In rare cases, a transaction may revert onchain even after passing simulation (e.g., due to mempool front-running or rapid state changes between simulation and execution). If this happens:
  1. The user’s tokens remain in their wallet (for same-chain atomic transactions)
  2. Gas fees for the reverted transaction are still consumed
  3. Retry with a fresh quote to get updated simulation results

Cross-Chain Failure Modes

Cross-chain Composer flows have two phases. Each phase is atomic within its chain, but the overall flow is eventually consistent.

Status Values

Poll GET /v1/status to track cross-chain Composer transactions. The status values are:

Substatus Values

When Status is PENDING

When Status is DONE

When Status is FAILED

Handling Cross-Chain Failures

For the full status reference, see Transaction Status Tracking.

Common Composer Issues


Error Codes

Complete LI.FI API error code reference

Status Tracking

Full status and substatus reference

API Parameters

Composer-specific API parameters

Limitations

Current Composer limitations