Skip to main content

The executable transaction

The payload to send onchain lives in the quote’s tx object: The settlement field tells you which mode applies. Choose your handling from settlement, not from assumptions. You can influence that decision with the optional settlement request parameter on the quote: The response settlement is always the executable mode Rialto returned. Use that value for transaction handling even when you pass a request preference. See Settlement Modes for details. Do not modify quote_id, route, platform_fee, permit2.message.witness, or tx.data except for replacing the Permit2 signature placeholder. A changed route or witness will not match the signed quote and may revert. Use the returned permit2 payload as the source of truth; do not recompute the bytes32 witness quoteId from the UUID yourself.

Permit2 settlement

Permit2 is the default for ERC20 sells. The taker authorizes a single exact transfer by signing an EIP-712 message bound to the precise swap, including recipient, buy token, minimum output, deadline, quote id, and the hash of the route actions. Steps:
  1. If issues.allowance is non-null, ask the taker to approve issues.allowance.spender for at least sell_amount. For Permit2 quotes this spender is the Permit2 contract.
  2. Have the taker wallet sign the permit2 object as EIP-712 typed data.
  3. Splice the returned 65-byte signature into tx.data at tx.signature_offset.
  4. Send the transaction from the taker wallet using to, the patched data, and value.
Most wallet libraries accept the returned domain, types, primaryType, and message directly. If your library rejects EIP712Domain inside types, remove only that key before calling signTypedData; do not change the message or witness fields.

Allowance settlement

A quote returns settlement: “allowance” with no permit2 object and no signature_offset when Permit2 is not the right path, for example native ETH sells, or a flow where the taker already wants to use ERC20 allowance.
  • ERC20 sells. If issues.allowance is non-null, the taker approves issues.allowance.spender for at least the raw sell_amount, then sends the transaction. Do not modify tx.data.
  • Native ETH sells. Send the transaction with tx.value; no ERC20 approval and no signature are needed.

Simulation

Every route Rialto returns is validated against live chain state before it is quoted, so the transaction in a quote is pre-validated. You can also simulate the returned transaction yourself before submitting. A successful simulation confirms the route still fills and the output meets min_buy_amount; a failure means the quote has gone stale, so request a fresh quote.

Submission

For the taker-submitted flow, submit the transaction from the taker wallet. The Rialto API does not sign or broadcast this direct-flow transaction. Quotes reflect live liquidity and can go stale quickly, so request a fresh quote if the user waits.

Direct-flow checklist