Skip to main content
A same-chain buy of an xStock on Optimism or an Ondo GM token on BSC normally runs as one atomic transaction. Because these assets are minted against short-lived RFQ quotes, an atomic transaction can revert if the quote expires before it mines. With sameChainIntent=true, the Route API splits the trade into two transactions. Your transaction swaps tokenIn into the settlement token and hands it to a one-time intent address. Enso then buys tokenOut in a second transaction on a fresh quote and sends it to receiver.
Same-chain intents are separate from async redeems (allowAsync). allowAsync is for vault withdrawals that pay out later and cannot be combined with intents.

How it works

  1. Your user signs and submits transaction 1 on chainId. If tokenIn is not already the settlement token, transaction 1 swaps it into the settlement token first.
  2. Transaction 1 checks that the amount meets the intent trigger and that the block timestamp is at or before validUntil, publishes the intent on-chain, and transfers the settlement token to intent.address.
  3. Enso observes the published intent, requests a fresh quote, buys tokenOut, and sends at least minAmountOut to receiver in transaction 2.
  4. If the buy cannot fill before the 5-minute deadline, the settlement token is refunded to refundReceiver, or to receiver when refundReceiver is not set.
Delivery is asynchronous. tokenOut arrives in transaction 2, not transaction 1.

Supported assets

Same-chain intents apply when tokenOut is a supported mintable position with a single underlying token and tokenIn is not one of those positions. Same-chain intent execution must also be enabled on chainId. Selling an xStock or Ondo GM token (passing one as tokenIn) stays on the normal atomic route because selling still requires an RFQ quote in transaction 1.

Request

Same-chain intents are available on GET and POST /api/v1/shortcuts/route. They are not available on /quote or the public Bundle API. Unsupported requests silently fall back to the normal atomic route, so always check for intent in the response.

Example: buy an xStock on Optimism

Set ENSO_API_KEY to your API key, ADDRESS to the user’s wallet, and XSTOCK_TOKEN to the target xStock or wrapped xStock address on Optimism. This request swaps 0.1 ETH on Optimism into USDC in transaction 1, hands the USDC to an intent address, and buys $XSTOCK_TOKEN for $ADDRESS in transaction 2.
When tokenIn is already the settlement token (USDC on Optimism for xStocks, or USDT on BSC for Ondo GM), transaction 1 skips the swap and transfers tokenIn directly to the intent address. The response, trimmed to the fields that matter here:
Execute any required preTransactions first, then sign and submit tx. Save the transaction hash from tx to track execution.

Response fields

Track execution with /intent/status

Track a same-chain intent with GET /api/v1/intent/status, passing chainId and the hash of transaction 1 (txHash). Do not use /api/v1/bridge/check or /api/v1/bridge/route, which return 404 because there is no bridge.
Example response after transaction 2 executes:

Status values

In-flight status lookups refresh every 3 seconds, so polling every few seconds is sufficient.

Error responses

GET /api/v1/intent/status also accepts the source transaction hash of a cross-chain intent, but it reports only the intent execution stage. For cross-chain intents, continue using GET /api/v1/bridge/route to follow both the bridge and execution.

Deadlines and refunds

  • Submission cutoff. Transaction 1 enforces block.timestamp <= validUntil on-chain, where validUntil is at most 3 minutes after quoting (the 5-minute deadline minus a 2-minute execution buffer). Submitting transaction 1 late causes it to revert, so the user keeps tokenIn.
  • Intent expiry and refund. Once transaction 1 succeeds, transaction 2 has until the 5-minute deadline (intent.data.deadline) to buy at least minAmountOut of tokenOut. If the buy does not complete in time, the settlement token (USDC for xStocks, USDT for Ondo GM on BSC) is refunded on chainId after the deadline.
  • Refund recipient. Refunds go to refundReceiver, or to receiver when refundReceiver is omitted. destinationBridgeRefundReceiver is ignored on same-chain intents because there is no bridge.
  • No fees on refund. Route fees are collected only when transaction 2 executes, so a refunded intent pays no feeAmount or ensoFeeAmount.

Fees

  • Transaction 1 charges no route or Enso platform fees.
  • feeAmount (and ensoFeeAmount, when Enso’s platform fee applies under your fee policy) are denominated in the settlement token, matching cross-chain intents, and are collected on transaction 2.
  • intent.data.keeperFee reports the execution fee in the settlement token: token is the settlement token address, intentFee is the execution fee in base units, and refundFee is currently "0".
  • amountOut is net of route fees and intent.data.keeperFee.intentFee.
  • metadata.bridgeFees is empty ([]).

Fallback cases and errors

Requests that fall back to the normal atomic route

The API silently returns a normal atomic route (without intent in the response) when any of the following apply:
  • sameChainIntent is not true.
  • tokenOut is not a supported mintable xstocks, wrapped-xstocks, or ondo-gm position with a single underlying token.
  • tokenIn is itself an xstocks, wrapped-xstocks, or ondo-gm position.
  • More than one tokenIn or tokenOut is passed.
  • amountIn is a placeholder variable instead of a concrete amount.
  • slippage is "0".
  • minAmountOut is set.
  • ignoreStandards is non-empty.
  • allowAsync is true.
  • swapType is set to a value other than "any".
  • Same-chain intent execution is not enabled on chainId.

Requests that return an error

These cases return an HTTP error instead of falling back:

Updated 2026-11-25