β‘Execution
Execution Methods
1. Using the executeSwaps Function
function executeSwaps(
address[] calldata tokens,
uint256 amountIn,
uint256 minAmountOut,
uint256 expectedAmountOut,
Swap[][] calldata hopSwaps,
uint256 feeBps,
address feeRecipient
) external payable nonReentrant returns (uint256 userAmountOut)Required Parameters
Name
Type
Description
Required
2. Using the executeMultiHopSwap Function
Required Parameters
Name
Type
Description
Required
3. Using Calldata Directly from V2 Route
Hop Swaps Data Structure
Swap Struct
Hop Swaps Array Structure
Field Usage by DEX Type
Field
V2 DEXs (1,2,7,18,24)
V3 DEXs (3,4,5,8,10,12,17,19,22)
Others (6,9,11,13,14,16,20,21,23)
Native HYPE Unwrapping
Dead Address for Native HYPE
Usage Examples
Key Points
Last updated