Skip to main content
After getting a quote and handling any required approvals, you need to execute the actual transfer transaction. This page covers chain verification, gas handling, signing, and broadcasting.

The Transaction Request

The quote response includes a ready-to-use transactionRequest object:

Pre-Execution Checklist

Before sending the transaction:
  • Wallet is connected to the correct chain (transactionRequest.chainId)
  • User has sufficient native token for gas
  • User has sufficient fromToken balance
  • Token approval is confirmed (if ERC20)
  • Quote is still valid (not expired)

Step 1: Verify Chain

Ensure the wallet is on the correct chain before sending:

JavaScript (viem)

Python (web3.py)


Step 2: Estimate Gas (Optional)

The quote includes a gasLimit, but you can re-estimate for accuracy:
The quote’s gasLimit is usually accurate. Only re-estimate if you need precise gas costs or are optimizing for gas efficiency.

Step 3: Build the Transaction

Convert the quote’s transaction request into a sendable transaction:

JavaScript (viem)

Gas Price Options

You can use the quote’s suggested gas price or fetch current prices:

Step 4: Sign and Send

JavaScript (viem)

Python (web3.py)


Step 5: Handle the Result

After execution, save the transaction hash for status polling:

Complete Execution Flow


Error Handling

Common Execution Errors

Retry Logic


Gas Optimization Tips

  1. Use EIP-1559 where supported - More predictable gas costs
  2. Don’t over-estimate gas - Quote’s gasLimit is usually accurate
  3. Check gas prices - High gas times may make transfers expensive
  4. Consider L2s - Arbitrum, Optimism, Base have much lower gas costs