The maximum number of hops allowed in a single route swap is 4.
Simulating a Route Swap
Before executing, it’s crucial to simulate the route swap to get an estimate of the expected output, price impact, and fees.Executing a Route Swap
To execute the swap, you provide the same hop structure along with slippage parameters. The SDK handles the transfer to the first pool and the subsequent routing automatically.Integrator Fees
You can also specify integrator fees for the entire route or for individual hops.Error Handling
Route swaps involve multiple pools and can fail at various points. The SDK provides typed errors with automatic fund recovery. See Error Handling for the complete guide.Next Steps
- Learn about single-pool swaps
- Provide liquidity to earn fees
- Error Handling for complete error reference