Simple Swap
Direct single-DEX token swaps
Simple Swap is the most straightforward and gas-efficient swap type, routing the entire trade through a single DEX adapter.
Structure
TokenA ────[Single DEX Adapter]────> TokenB
(100% of liquidity)Characteristics:
Single liquidity pool
Direct token pair
Lowest gas cost
Fastest execution
When Simple Swap is Used
The API automatically selects Simple Swap when:
✅ Direct pool exists - TokenA/TokenB pool is available ✅ Sufficient liquidity - Pool depth handles the swap amount ✅ Best rate - Single pool offers competitive pricing ✅ Gas efficiency priority - Minimizing transaction cost
Example Scenarios
Scenario 1: WBNB → USDT on BSC
Analysis:
100% liquidity via PancakeSwapV3
Direct WBNB/USDT pool
Gas: ~120k units
Single transaction
Scenario 2: ETH → USDC on Ethereum
Analysis:
UniswapV3 0.3% fee tier
Most liquid ETH/USDC pool
Optimal for amounts < $100k
Smart Contract Encoding
SwapParams Structure
Execution Flow
Gas Costs
BSC
PancakeSwapV2
100k-120k
BSC
PancakeSwapV3
120k-150k
Ethereum
UniswapV2
110k-130k
Ethereum
UniswapV3
130k-180k
Note: V3 pools cost more due to concentrated liquidity calculations.
Advantages
✅ Lowest Gas Cost
Simple Swap has minimal overhead:
Single adapter call
No liquidity splitting
No intermediate swaps
✅ Fastest Execution
Fewer operations mean:
Lower transaction time
Less block space usage
Higher success rate
✅ Predictable Slippage
Single pool = single price impact:
Easy to calculate expected output
Transparent price mechanics
Consistent behavior
✅ Best for Small Amounts
For typical retail swaps ($100-$10k):
Pool depth is sufficient
Gas savings matter more
Price difference negligible vs. batch swaps
Limitations
❌ Limited by Pool Depth
Large swaps may experience:
High price impact
Insufficient liquidity
Better rates available via splitting
Example:
❌ Single Point of Failure
If the pool:
Has low liquidity temporarily
Experiences a price anomaly
Is being manipulated
Alternative routes might be better.
Code Examples
JavaScript (ethers.js)
Python
Best Practices
✅ Verify Pool Liquidity
Before executing large simple swaps:
✅ Set Appropriate Slippage
✅ Monitor Gas Prices
Comparison with Other Swap Types
Gas Cost
⭐⭐⭐⭐⭐ Lowest
⭐⭐⭐ Medium
⭐⭐ Higher
Best Rate
⭐⭐⭐ Good
⭐⭐⭐⭐⭐ Best
⭐⭐⭐ Variable
Complexity
⭐ Simplest
⭐⭐⭐ Complex
⭐⭐⭐⭐ Most Complex
Large Orders
⭐⭐ Limited
⭐⭐⭐⭐⭐ Excellent
⭐⭐⭐ Good
Slippage
⭐⭐⭐ Predictable
⭐⭐⭐⭐ Lower
⭐⭐⭐ Variable
Troubleshooting
Issue: High Price Impact
Solution:
Reduce swap amount
Try batch swap instead
Wait for better liquidity
Issue: Transaction Fails
Possible causes:
Pool liquidity changed
Slippage too tight
Deadline expired
Solution:
Fetch fresh route
Increase slippage tolerance
Set longer deadline
Issue: Unexpected Output
Check:
Pool fee tier (0.05%, 0.3%, 1%)
Recent price movements
MEV sandwich attacks (use private relay)
Related Topics
Batch Swap - Split liquidity across DEXes
Multi-Hop Swap - Sequential routing
API Reference - Build route endpoint
Gas Optimization - Reduce costs
Summary
Simple Swap is ideal for:
✅ Small to medium-sized trades ($100-$50k)
✅ Popular token pairs with deep liquidity
✅ When gas cost matters
✅ Quick, straightforward swaps
Use Batch or Multi-Hop swaps for:
❌ Large trades requiring price optimization
❌ Exotic token pairs without direct pools
❌ When saving 0.1-0.5% on rate justifies extra gas
Last updated