Prerequisites: Complete the Get a Quote guide first to obtain a valid quote.
Overview
After obtaining a quote, you can execute the swap by generating the necessary transaction data (bytecode) and submitting it to the blockchain. The Pods API handles the complexity of preparing the transaction data for different providers and swap types.Executing a Swap
Endpoint
Request Body
Example Request
Response Format
The API returns transaction data ready to be signed and executed:Response Fields
id
id
ID created for execution tracking. Use this ID with
GET /actions/{id} when you need execution status after transactions are submitted.chainId
chainId
The chain ID where these transactions should be executed
transactionData
transactionData
EVM routes return an array of transaction legs when
output=bytecode (default). Batch all legs
on the same chainId into one atomic transaction — see
Executing Bytecode. Solana routes return provider-specific
transaction data with a rawTransaction payload. When output=fireblocks, returns a Fireblocks
contract call payload instead of a transaction array. Typical EVM legs:- Approval: Grants permission to the swap contract
- Swap: Executes the actual token swap
- Tracking: Records the swap in Pods’s system
userOperation
userOperation
ERC-4337 user operation object. Only present when
output=userOperation is requested.to
to
The contract address to send the transaction to
data
data
Encoded transaction data (bytecode) for the contract call
value
value
Amount of native token to send (in wei). Usually “0” unless swapping native tokens.
quoteId and id identify different resources. quoteId tracks the saved swap quote and is the {id} for GET /v2/swap/status/{id}. The id returned by this endpoint is used for execution tracking.Transaction Execution
Sign and submit the transaction data on your end — Pods never has custody of your funds.EOA — EIP-7702 (recommended)
Use EIP-7702executeBatch to encode all
transactionData legs into a single type-4 transaction. Map transactionData the same way as
bytecode in the strategy examples.
Smart account — output=userOperation
Request output=userOperation on POST /v2/swap/bytecode (or inline on the quote when both
addresses are set). Submit the returned userOperation through your bundler — one userOp, not a
loop of separate sends.
Fireblocks — output=fireblocks
Pass accountId and submit transactionData to the Fireblocks Transactions API. See
Fireblocks Integration.
Swap Types
The endpoint automatically handles different swap types:- Same-Chain
- Cross-Chain
Same-chain swaps (e.g., USDT to USDC on Ethereum):
- Usually 2-3 transactions: approve + swap (+ tracking)
- Executes immediately on the same blockchain
- Lower fees, faster execution
Error Handling
The API returns appropriate error messages for:- Missing required parameters
- Invalid or expired quote
- Quote not found or already used
- Provider-specific errors during transaction preparation
Complete Workflow
1
Get Quote
Use
GET /v2/swap/quote to get swap quote and pricing2
Generate Bytecode
Use
POST /v2/swap/bytecode with the quote to generate transaction data. Save the returned id.3
Execute Transactions
Sign and send the transactions using your wallet
4
Track Status
For cross-chain swaps, use
GET /v2/swap/status/{quoteId} to monitor quote progress.Pass the quoteId returned in step 1 as the {quoteId} path parameter. Use the id returned in step 2 with GET /actions/{id} when you need execution status.Next Steps
Get Another Quote
Start a new swap
Check Status
Track cross-chain swap progress
Code Examples
View complete implementation examples