Overview
Step-by-step guide
Get a swap quote
Call the Aggregator quote endpoint with the token pair and amount. The response includes
txData (a ready-to-use transaction payload) and amountOutMin (the slippage-protected minimum output).- cURL
- TypeScript
- Python
- Rust
Build and sign the transaction
Construct the transaction from the quote response and have the user sign it.For gasless relaying (enterprise), add a
relayer field with the shard-matched relayer address before signing. The relayer co-signs and covers gas for the user. See Relaying (Gasless V3) for details.Subscribe to the sender address
Before broadcasting, subscribe to If you compute the transaction hash locally, subscribe to
address/{sender} to receive transaction status events for each transaction from that address.tx-status/{hash} for single-transaction tracking. See Tx status tracking for both approaches.Broadcast the signed transaction
requestId.Edge cases
Cross-shard transactions
When sender and contract are on different shards, the transaction requires two block rounds: roughly 12 seconds on the current network. With the upcoming Supernova upgrade (600 ms block times), cross-shard finality drops to approximately 1.2 seconds. ThetxStatus event fires after the receiver’s shard processes the cross-shard message.
Smart contract revert
If the actual swap output falls belowamountOutMin, the smart contract reverts. The transaction appears on-chain with fail status, but token balances remain unchanged. Re-quote with wider slippage and retry.
Related pages
Gas optimization
Choose the right gas price using real-time statistics.
Relaying (Gasless V3)
Detailed reference for the relay action and shard routing.

