Skip to main content

How long is an Enso simulation cached?

Enso Quoter caches a simulation for five minutes. After that, the simulationId expires and validate returns HTTP 404, so you must simulate again.

J
Written by Javier Diaz

Enso Quoter caches a simulation for five minutes. After that, the simulationId expires, and a validate call returns HTTP 404. You must simulate again to get a fresh ID.

Definition

The cache window is the time during which Quoter can compare an unsigned transaction to the simulation the user just reviewed. It is not a guaranteed price lock for later on-chain inclusion.

How it works

  • After POST /api/v1/simulate, keep the returned simulationId.

  • Call POST /api/v1/validate with that ID and the unsigned transaction before the user signs, and within five minutes.

  • If the window has expired, validate returns a 404 message that the simulation was not found or expired.

  • Re-simulate, review the new amountOut and gas, then validate the new ID.

  • Market conditions can still change inside the five-minute window. The simulated amountOut is accurate at simulation time; include slippage protection in the calldata.

How Enso does this

Quoter documents a five-minute cache in How It Works, the Quoter FAQ, and Validating Transactions. Validate as close to the signing moment as possible inside that window. This cache applies to Quoter only. A Route quote is a separate flow and is not this simulationId.

FAQ

Can I extend the cache?

No public Quoter setting extends the five-minute window. Simulate again when it expires or when the transaction changes.

Should I validate immediately after I simulate?

Validate immediately before signing, not far in advance. That keeps the check inside the cache window and closer to current state.

Related articles

  • What is a simulationId?

  • Why did Quoter return a 404 on validate?

  • Why should I re-simulate instead of retrying validation?

  • What if my quote expired?

  • How do I validate that a transaction has not been tampered with?

Sources

Did this answer your question?