Skip to main content

How do I show a quote before the user signs?

Show expected output, minimum output, gas, price impact, and any approval from the Route or Bundle response, then collect a signature on the returned transaction.

J
Written by Javier Diaz

Show a quote before the user signs by displaying expected output, minimum output, gas, price impact, and any approval from the Route or Bundle response. Then collect a signature on the returned transaction, not on a handwritten one.

Definition

A quote is the simulated result of the path or bundle at a point in time. It is what the user reviews. It is not a completed trade, and it can go stale if signing is delayed.

How it works

  1. Request a Route or Bundle quote for the current intent.

  2. Show expected output (amountOut or amountsOut), the protected minimum, estimated gas, and priceImpact when present.

  3. Show whether an approval is required, including the token, spender, amount, and chain.

  4. Let the user confirm, then submit approvals and tx as-is.

  5. If the user waits, or changes slippage or amount, request a new quote and refresh the screen.

How Enso does this

Get Started lists quote-review fields: expected output, minimum output, gas, price impact, route path, and approval requirement, all from the Route or Bundle response. priceImpact is documented in the FAQ as coming from simulation. Do not compute a replacement minimum by editing tx.

FAQ

Where does the minimum output come from?

From the slippage or minAmountOut you set on the request, as returned in the quote. Choose one protection method, not both.

Should I show the route path?

Yes, when the response includes it. Docs include the selected path as a quote-review field.

Related articles

  • What is transaction simulation in DeFi?

  • What is slippage in DeFi?

  • What if my quote expired?

  • How do I submit Enso transaction data from my app?

  • How do I add a same-chain swap to my app?

Sources

Did this answer your question?