AddLiquidity

Uniswap V2 - AddLiquidity

Description

Add Liquidity on V2 Pool without minAmount protection and recipient if LP tokens is the sender

Method

addLiquidity_noMinProtection(bytes32,address,address,uint256,uint256)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

FCT Uniswap library

Method Parameters

NamePlugin TypeDescription

method

FctString (hashed)

Method string. In the FCT it will be a hashed value

tokenA

FctAddress

TokenA that will be added to LP

tokenB

FctAddress

TokenB that will be added to LP

amountADesired

FctValue

TokenA amount that will be added to LP

amountBDesired

FctValue

TokenB amount that will be added to LP

Returned Values

NamePlugin TypeDescription

amountA

FctValue

amountB

FctValue

liquidity

FctValue

Example

Example with initParams

const addLiquidity = new FCT_UNISWAP.actions.SimpleAddLiquidity({
 chainId: 1,
 initParams: {
   to: "0x..." // FCT Uniswap library 
   methodParams: {
     method: "...",
     tokenA: "0x...",
     tokenB: "0x...",
     amountADesired: "...",
     amountBDesired: "...",
   }
 }
})

Example without initParams

const addLiquidty = new FCT_UNISWAP.actions.SimpleAddLiquidity({ 
  chainId: 1
})

swap.input.set({
   to: "0x..." // FCT Uniswap library 
   methodParams: {
     method: "...",
     tokenA: "0x...",
     tokenB: "0x...",
     amountADesired: "...",
     amountBDesired: "...",
   }
})

Learn more

Learn more about Uniswap here

Last updated