Swap Tokens
Introduction
Swap Functions
When Input Amount Is Specified
When Output Amount Is Specified
Code Examples
1. Swap 10 USDC for USDT using swapExactTokensForTokens with no intermediate swap paths:
swapExactTokensForTokens with no intermediate swap paths:2. Swap 1 AVAX for USDT using swapExactNATIVEForTokens with no intermediate swap paths:
swapExactNATIVEForTokens with no intermediate swap paths:3. Swap USDT to get 10 USDC output using swapTokensForExactTokens that routes through WAVAX. In this example, the first swap occurs through USDT/WAVAX V2.2 pool and the second swap occurs through WAVAX/USDC V1 pool:
swapTokensForExactTokens that routes through WAVAX. In this example, the first swap occurs through USDT/WAVAX V2.2 pool and the second swap occurs through WAVAX/USDC V1 pool:Last updated