IntegrationsQuick StartV2
Swap with V2
Be sure to respect all the necessary requirements present in V2.
Swapping Tokens
Use the provided swapTokens function to swap ETH for USDC:
-
Open the index.js file in your editor.
-
Replace the placeholder values in the main() function:
const signer = new ethers.Wallet(privateKey, provider);
const provider = new ethers.providers.JsonRpcProvider("https://api.hyperliquid-testnet.xyz/evm");
const amountOutMin = ethers.utils.parseUnits("100", 6);
const to = walletAddress; // Replace with your wallet address
const ethAmount = "0.1"; // Amount of ETH to swap
await swapETHForUSDC(provider, signer, amountOutMin, to, ethAmount);- Run the script:
node index.jsV2
Integrate with Hyperswap to access its DEX and liquidity pools on the HyperEVM blockchain. Build trading bots, manage liquidity, or ship DeFi apps with our developer guides.
Add liquidity with V2
Integrate with Hyperswap to access its DEX and liquidity pools on the HyperEVM blockchain. Build trading bots, manage liquidity, or ship DeFi apps with our developer guides.