Skip to main content
Quote Simulation dry-runs eligible same-chain EVM route candidates against current chain state during route generation for /v1/advanced/routes and /v1/quote. A separate step-transaction simulation can run when LI.FI builds executable EVM transaction data.

The problem

A quote can look valid and still revert when the user broadcasts it. State moves between quote time and execution: balances change, pool reserves shift, a token behaves in a way the quote didn’t account for. The user pays gas for a failed transaction, and your product carries the support cost and the loss of trust.

How LI.FI solves it

For eligible requests to /v1/advanced/routes and /v1/quote, LI.FI builds and simulates candidate transactions against current on-chain state. Candidates that fail the enforced check are filtered out. When executable transaction data is generated through /v1/quote or /v1/advanced/stepTransaction, the step-simulation pipeline can separately simulate that built transaction and reject a revert. Route simulation runs on the LI.FI side during route generation. It doesn’t require the user to hold the input token or grant an approval first, so there’s no extra step in your flow and no change to how the user signs.
Simulation reduces reverted transactions but does not guarantee execution. It filters routes that would revert at quote time, but it can’t prevent a failure if on-chain state changes between the quote and when the user broadcasts the transaction.

What you see as an integrator

Nothing to configure and nothing new to handle. Quote Simulation raises the quality of the routes LI.FI returns rather than exposing a parameter you set. The observable effect is that a route which would fail on-chain is absent from the response.
Quote Simulation isn’t an integrator-controllable flag. LI.FI enables route simulation per integrator, and /v1/advanced/routes has no request field to opt out. The skipSimulation parameter belongs to transaction-generation endpoints and controls step simulation only; it does not disable route simulation.

Route simulation scope

  • EVM chains only. Non-EVM chains aren’t simulated.
  • Same-chain swaps only. Cross-chain routes are out of scope for route simulation.
  • Higher-value trades. Route simulation applies above a deployment-wide trade-value threshold. This threshold is not configured per integrator.
  • Requires the user’s address on the quote request, which is the normal case for execution.
Step simulation does not have the same-chain restriction or trade-value threshold. It can simulate supported EVM step transactions, including steps in cross-chain routes, subject to its own configuration and chain/tool support.

Route simulation vs. step simulation

Simulation can run at two stages:
  • Route simulation. POST /v1/advanced/routes and GET /v1/quote can build and simulate eligible same-chain EVM candidate transactions during route generation, then omit candidates that fail the enforced check. This feature is gated by deployment configuration, integrator eligibility, trade-value threshold, source address, and chain/tool support.
  • Step simulation. GET /v1/quote selects a single-step route and builds executable data for that step, while POST /v1/advanced/stepTransaction builds it for a chosen step. The EVM transaction-generation pipeline can simulate that individual built transaction at this point and use the result for revert handling and gas estimation.
An eligible /v1/quote request can run both route and step simulation. It returns a single-step route with transaction data, not the first step of a multi-step route. Each simulation stage has its own eligibility checks; neither endpoint guarantees that every request is simulated.

Request and response parameters

skipSimulation (boolean, query parameter, default false) — skips step simulation during transaction generation for the call. It is available on GET /v1/quote and POST /v1/advanced/stepTransaction. On /v1/quote, skipSimulation=true does not disable route simulation. There is no equivalent parameter on POST /v1/advanced/routes; its separate route-simulation gate is not controlled by this field. Successful step simulation can feed a measured gas value into the type: "SEND" entry of the estimate.gasCosts array on the quote/step response. When simulation is skipped, unsupported, disabled, or does not return gas used, LI.FI uses the tool-provided gas estimate instead and still applies its gas buffer. The following fields refer to the SEND entry in estimate.gasCosts:

Gas-limit behavior

When step simulation succeeds and reports gas used, LI.FI derives the returned SEND gas cost from that measured value and applies its gas-buffer policy. Otherwise, including when skipSimulation=true, it falls back to the gas limit supplied by the underlying tool and still applies LI.FI’s gas buffer. Submit the transaction with transactionRequest.gasLimit. If inspecting estimate.gasCosts, use the entry with type: "SEND"; do not assume its source was simulation unless the API explicitly exposes that metadata for your integration.

Latency

Simulation is one of several inputs into overall response time — see API latency and optimization for the full breakdown. Use skipSimulation only to skip eligible step simulation on a transaction-generation request; it does not bypass route simulation or guarantee a particular latency improvement.

Availability

Quote Simulation’s route-simulation feature is enabled per integrator as an enterprise feature. Step simulation is controlled separately.

Contact the LI.FI team to enable

Share your chains and typical trade sizes. We confirm coverage and enable simulation for your integrator key.