Liquidity adder

[blockchain/ethereum/Uniswap/v2/Liquidity adder]


Add liquidity to the pool. If pool doesn't exist it will be created. TokenB can be ETH also.


Input ports

  • tokenA:

    {"address": string, "desiredAmount": number, optional "minimalAmount": number}

    Receives parameters for tokenA.

    • address: the address of the token

    • desiredAmount: the (maximal) amount we want to add to the liquidity pool in tokenA

    • minimalAmount: the minimal amount we want to add to the liquidity pool in tokenA, if the current exchange ratio implies an amount smaller than that, the operation should fail

  • tokenB or ETH:

    {
      "address": (string or "ETH"),
      "desiredAmount": number,
      optional "minimalAmount": number
    }

    Receives parameters for tokenB/ETH.

    • address: the address of the token or "ETH"

    • desiredAmount: the (maximal) amount we want to add to the liquidity pool in tokenB/ETH

    • minimalAmount: the minimal amount we want to add to the liquidity pool in tokenB/ETH, if the current exchange ratio implies an amount smaller than that, the operation should fail

  • to addres: string

    Receives the address that will get the minted liquidity token.

  • deadline: number

    Receives the unix timestamp of the deadline until the operation should be completed or will be reverted.

  • router contract: {"address": string, "abi": {string: any}[]}

    Receives parameters of the Uniswap V2 Router contract to interact with

  • credentials: {"providerUrl": string, "privateKey": string}

    Receives credentials for the operation

Output ports

  • result: (any or any)

    Sends out the result of the operation in case of success

  • error: ({"error": string} or (any or {"error": string}))

    Sends out any error that occured during the liquidity addition process.

Last updated