Multi-Hop Swaps Guide
Overview
Multi-hop swaps allow users to trade between tokens that don't have direct trading pairs by using intermediate tokens as bridges. JAMM DEX supports flexible multi-hop paths with different fee tiers for each hop, providing users with optimal swap routes.
Multi-Hop Swap Principles
Basic Concept
Multi-hop swaps break down a complex swap into multiple simple swaps:
TokenA → TokenB → TokenCEach hop is an independent swap operation:
First hop: TokenA → TokenB
Second hop: TokenB → TokenC
Paths and Fees
In JAMM DEX, multi-hop swaps require specifying:
Path array:
[TokenA, TokenB, TokenC]Fees array:
[fee1, fee2]
Note: The fees array length is always one less than the path array length.
Multi-Hop Swap Implementation
Exact Input Multi-Hop Swap
Exact Output Multi-Hop Swap
Path Optimization
Optimal Path Finding
Price Comparison
JU Token Multi-Hop Swaps
JU → Token → Token
Token → Token → JU
Advanced Multi-Hop Strategies
Split Swaps
Split large swaps into multiple smaller swaps to reduce price impact:
Dynamic Path Adjustment
Adjust swap paths based on real-time liquidity:
Monitoring and Analytics
Multi-Hop Swap Event Monitoring
Path Efficiency Analysis
Best Practices
1. Path Selection Strategy
2. Slippage Management
3. Gas Optimization
Summary
Multi-hop swaps are a powerful feature of JAMM DEX. This guide covers:
Basic Principles: How multi-hop swaps work
Implementation Methods: Exact input and output multi-hop swaps
Path Optimization: Optimal path finding and price comparison
Advanced Strategies: Split swaps and dynamic path adjustment
Monitoring Analytics: Event monitoring and efficiency analysis
Best Practices: Path selection, slippage management, gas optimization
By properly using multi-hop swaps, users can efficiently trade between a wider range of token pairs.