snowtrace

Add Liquidity

(addLiquidity)

nonpayable


liquidityParameters

Input should be passed in JSON format - Ex: { "tokenX": "0x...", "tokenY": "0x...", "binStep": "0", "amountX": "0", "amountY": "0", "amountXMin": "0", "amountYMin": "0", "activeIdDesired": "0", "idSlippage": "0", "deltaIds": ["0"], "distributionX": ["0"], "distributionY": ["0"], "to": "0x...", "refundTo": "0x...", "deadline": "0" }

Sign In

Use this function in your app


import { prepareContractCall, sendTransaction } from "thirdweb";
const transaction = await prepareContractCall({
contract,
method: "function addLiquidity((address tokenX, address tokenY, uint256 binStep, uint256 amountX, uint256 amountY, uint256 amountXMin, uint256 amountYMin, uint256 activeIdDesired, uint256 idSlippage, int256[] deltaIds, uint256[] distributionX, uint256[] distributionY, address to, address refundTo, uint256 deadline) liquidityParameters) returns (uint256 amountXAdded, uint256 amountYAdded, uint256 amountXLeft, uint256 amountYLeft, uint256[] depositIds, uint256[] liquidityMinted)",
params: [liquidityParameters]
});
const { transactionHash } = await sendTransaction({
transaction,
account
});