Skip to main content
POST
Get a set of routes for a request that describes a transfer of tokens
Need opinionated routing defaults? Include options.preset in the request body and review the API presets overview for the supported configurations.
Set options.pools.deny in the request body to exclude specific AMM pools or Solana venues from routing. Provide 1–100 identifiers:
  • Uniswap V2/V3: a non-zero EVM pool address (0x + 40 hex characters)
  • Uniswap V4: <poolManagerAddress>-<poolId>, where poolId is 0x + 64 hex characters
  • Solana: a venue’s program ID (base58), for example HumidiFi 9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp. It excludes every pool of that venue. Individual Solana pool addresses are not supported.
Only some exchanges can exclude pools, so the entries restrict which exchanges a swap can use:
  • EVM pool entries restrict swaps on every chain except Solana to fly.
  • Solana program IDs restrict swaps on Solana to jupiter, titan and okx.
  • Swaps on a chain with no matching entries are not restricted.
Pool exclusions are request-scoped and are not carried in the returned steps. When you request transaction data for each step, you must pass the same list again as the denyPools query parameter to /v1/advanced/stepTransaction. Repeat the query parameter for multiple entries, as with /v1/quote. Without it, swaps are re-quoted with no exclusions, so the transaction can use a pool or venue you excluded.

Headers

x-lifi-api-key
string

Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.

Body

application/json

The request object describes a desired any-to-any transfer and contains all information necessary to calculate the most efficient routes.

A description of a token transfer

fromChainId
number<number>
required

The sending chain id

fromAmount
string
required

The amount that should be transferred including all decimals (e.g. 1000000 for 1 USDC (6 decimals))

fromTokenAddress
string
required

The address of the sending Token

toChainId
number<number>
required

The id of the receiving chain

toTokenAddress
string
required

The address of the receiving Token

options
Root Type for RouteOptions · object

Optional configuration for the routes

Example:
fromAddress
string

The sending wallet address

toAddress
string

The receiving wallet address

fromAmountForGas
string

The amount of the token to convert to gas on the destination side.

Response

The resulting routes that can be used to realize the described transfer of tokens

A list of routes that can be used to realize the described transfer of tokens

routes
Root Type for Route · object[]
required

List of possible Routes for the given transfer

unavailableRoutes
object[]

An object representing the routes that are unavailable for the given transfer