Skip to main content
This page provides deterministic decision logic for AI agents to choose the right approach for different scenarios.

Quote vs Routes

Use this table to decide between /quote and /advanced/routes endpoints.

Decision Logic

Key Differences


API vs SDK vs Widget

Use this table to recommend the right integration method.

Decision Logic

Comparison Matrix


Route Selection Criteria

When multiple routes are available, use these criteria to select the best one.

Sort Order Options

The API supports these order parameter values:
If no order parameter is provided, the API returns the best route based on output amount after fees.

Request with Order

Route Filtering

Filter routes by specific criteria:

Example: Filtered Quote

This request:
  • Transfers 10 USDC from Ethereum to Arbitrum
  • Only considers Stargate or Across bridges (ignores all others)
  • Rejects quotes with >3% price impact (protects against unfavorable rates)
If no route meets these constraints, the API returns a NO_POSSIBLE_ROUTE error.

Same-Chain vs Cross-Chain

Determine whether a transfer is same-chain or cross-chain.

Behavior Differences

LI.FI is non-custodial. In cross-chain transfers, funds always end up with the user. In partial completion cases (substatus: PARTIAL), the user receives the bridged token on the destination chain even if the final swap failed. Funds are rarely ever stuck/lost.

Amount Handling

Convert between human-readable amounts and API amounts.

Formula

Common Token Decimals

Example Conversions


Error Recovery Decisions

When errors occur, use this table to determine the action.

Retry Strategy


Quick Decision Flowchart