Simple Swap
Direct single-DEX token swaps
Structure
TokenA ────[Single DEX Adapter]────> TokenB
(100% of liquidity)When Simple Swap is Used
Example Scenarios
Scenario 1: WBNB → USDT on BSC
Scenario 2: ETH → USDC on Ethereum
Smart Contract Encoding
SwapParams Structure
Execution Flow
Gas Costs
Network
DEX Type
Typical Gas
Advantages
✅ Lowest Gas Cost
✅ Fastest Execution
✅ Predictable Slippage
✅ Best for Small Amounts
Limitations
❌ Limited by Pool Depth
❌ Single Point of Failure
Code Examples
JavaScript (ethers.js)
Python
Best Practices
✅ Verify Pool Liquidity
✅ Set Appropriate Slippage
✅ Monitor Gas Prices
Comparison with Other Swap Types
Feature
Simple
Batch
Multi-Hop
Troubleshooting
Issue: High Price Impact
Issue: Transaction Fails
Issue: Unexpected Output
Related Topics
Summary
Last updated