Overview
Understanding the four swap routing strategies
DexAggregator automatically detects and implements the optimal swap type based on liquidity distribution and routing efficiency. Understanding these types helps you interpret the routing logic and optimize your integrations.
The Four Swap Types
Quick Comparison
Simple Swap
WBNB ─────[PancakeSwapV3]────→ USDT
(100% of liquidity)When used: Direct pool exists with sufficient liquidity
Batch Swap
WBNB ─────[PancakeSwapV3 60%]────→ USDT
└────[UniswapV2 40%]─────────┘When used: Multiple pools offer competitive rates
Multi-Hop Swap
When used: No direct TokenA-USDT pool exists
Parallel Multi-Hop
When used: Complex routing through multiple intermediate paths
Automatic Detection
The API automatically selects the optimal swap type:
Analyze Route Structure - Examine KyberSwap's routing recommendation
Calculate Split Ratios - Determine liquidity distribution
Select Swap Type - Choose the most efficient encoding
Generate Calldata - Encode parameters for smart contract
Detection Logic
Response Field: swapType
swapTypeEvery response includes the detected swap type:
Gas Costs by Type
Simple
100k-150k
Lowest gas cost
Batch
150k-250k
Scales with number of splits
Multi-Hop
200k-300k
Depends on hop count
Parallel Multi-Hop
300k-500k
Most complex, highest gas
Choosing Swap Types
When Simple is Best
✅ Direct liquidity pool exists
✅ Single pool has sufficient depth
✅ Lowest gas cost priority
When Batch is Better
✅ Multiple competitive price sources
✅ Large swap amounts
✅ Price improvement > gas cost
When Multi-Hop is Needed
✅ No direct pool available
✅ Intermediate token has deep liquidity
✅ Common routing pattern (e.g., via WETH)
When Parallel Multi-Hop Wins
✅ Very large swap amounts
✅ Single path has insufficient depth
✅ Multiple intermediate routing options
Examples by Token Pair
Popular Pairs (Simple/Batch)
Exotic Pairs (Multi-Hop)
Large Amounts (Parallel Multi-Hop)
Route Visualization
The routeInfo field provides detailed routing breakdown:
Simple Swap
Batch Swap
Multi-Hop Swap
Understanding Percentages
In Batch and Parallel Multi-Hop swaps, percentages indicate liquidity split:
The smart contract handles the splitting automatically based on executorData.
Best Practices
Optimization Tips
Don't force swap types - Let the API choose automatically
Monitor gas costs - Complex types may not justify price improvement
Set appropriate slippage - Multi-hop swaps may have higher slippage
Test exotic pairs - Understand routing before large swaps
Important Notes
Swap type is determined by KyberSwap's routing algorithm
Custom routes allow manual swap type selection
More complex types don't always mean better rates
Gas costs scale with routing complexity
Deep Dive Pages
Learn more about each swap type:
Simple Swap - Direct single-DEX swaps
Batch Swap - Parallel liquidity splitting
Multi-Hop Swap - Sequential routing
Parallel Multi-Hop - Advanced parallel routing
Related Topics
Build Route API - Automatic routing
Custom Route API - Manual routing
Last updated