Skip to main content
Tip: For advanced integrations, we recommend using Relay APIs. For simpler use cases, the Relay SDK automates steps and provides helpful callbacks, reducing manual effort.

Step Execution using the API

The Relay platform returns the steps needed to execute a quote, such as submitting a deposit transaction or signing a message. Follow the transaction targets, calldata, and amounts returned by the quote endpoint; they depend on the route and deposit method. Step descriptions are display text, not a specification of fund ownership or settlement. Some API responses retain legacy “relayer” wording; use id, kind, and data to drive execution, and see Input Validation for verifying protocol deposits. The flow looks like this:

Fetching Steps

Call the Get Quote API to start your execution.

Iterate Through Steps

Iterate through the steps in array order, taking the necessary actions. Skip steps whose status is already complete. Step ids can repeat, so track each step by its position rather than its id.

Executing Steps

Each step carries its own status, data, and check. Complete it according to its kind (signature or transaction).

Checking the fill status

After a step is signed or submitted you should check on the progress of the fill

Success!

Once all the steps are complete you can consider the action complete and notify the user.

Signature Step

A message that needs to be signed. Every signature comes with sign data and post data. The first action we need to take is to sign the message, keep in mind the signatureKind and use the appropriate signing method. Refer to your crypto library of choice on how to sign (viem, web3, etc).
Posting the data After the message is signed the second action is to submit the post body to the endpoint provided in the post data. You’ll also need to provide the signature that was generated from the sign data as a query parameter. If the request is successful we can mark the step as complete locally. Always post to the step’s own data.post.endpoint: permit signatures from /quote/v3 point to /execute/permits/v2, while other signatures, such as Hyperliquid nonce mappings, use their own endpoint. When a /execute/permits/v2 response includes steps, run those transaction steps before the remaining quote steps. The design pattern of this API is completely generic, allowing for automatic support of new types of liquidity without needing to update the app. This data can be fed directly into an Ethereum library such as viem, making it easy to sign and submit the exact data that is needed. Consecutive signature steps A quote can return more than one signature step in a row, with the same id. Sign and post them in the order they appear: a later signature can be refused until the earlier one is posted. Not every step has a check; for example, the MulticallAuthorization step of an ERC-3009 permit has none.

Transaction Step

A transaction that needs to be submitted onchain. After the transaction is submitted onchain you can poll the step’s check endpoint. The endpoint will return a status which when successful will return ‘success’. The step can then be successfully marked as complete. Submit the transaction on the chain given by the step’s data.chainId.

Step IDs

Each step has an id that identifies the type of action required. Ids can repeat within one quote, for example two approve steps when a token needs its allowance reset first. Understanding these step IDs helps you build better UX and handle each step appropriately.

Transaction Steps

Signature Steps

Common Step Flows

Depending on the action and tokens involved, Relay chains steps together. Here are common flows you may encounter:

Step ID Examples

Below are detailed examples of each step type you may encounter when working with the Quote API.

deposit

Submit the deposit transaction returned in the quote. A solver uses its own liquidity to complete the cross-chain fill; the deposit target depends on the quoted route. The following historical response illustrates the step shape, not an address to reuse for new deposits.

approve

An approval transaction to approve the transfer of an ERC20 token. Always followed by an additional step (deposit or swap).

send

Send funds to a recipient on the same chain.

authorize

Sign authorization for specific operations. This step is used in two scenarios:
  1. Permits: Signs a Permit2 or EIP-3009 authorization for a gasless deposit or same-chain swap. See the examples below.
  2. Hyperliquid Deposits: Signs a nonce-mapping signature for v2 Hyperliquid deposits.
  3. Claiming App Fees: Signs an EIP-191 message to verify wallet ownership before claiming accrued app fees.
The app fee claim API still returns its signature in a step’s items array and posts it to /execute/permits:
App Fee Claim Example

Cross-chain permit

The authorize step for cross-chain permits. Uses Permit2 or TransferWithAuthorization (EIP-3009).

Same-chain permit

The authorize step that signs authorization for same-chain ERC-20 → native swap permits using PermitBatchWitnessTransferFrom. Same-chain ERC-20 → ERC-20 swaps do not use this step; they return approve and swap transaction steps even when usePermit: true is set.

Full Quote Example

Along with the steps, the response returns fees, originGas, and details. fees breaks the quote’s cost into execution, swap, platform, app, and sponsored components, and originGas is the estimated gas the wallet pays on the origin chain; see Fees. details holds the input and output amounts, the rate, the time estimate in seconds, and the user’s balance. Values in this example are illustrative.

Checking the fill status

Along with the step data there’s an optional check object. You can use this object to check if the status of the transaction is complete. The object details the method and the endpoint to request. You should poll this until the endpoint returns success.
The check api will always return a status, to get a full list of statuses, please refer to the Get Status API Reference.

SDK Reference

To review the official way the SDK handles execution, please refer to the executeSteps file which implements executing steps detailed above.