Liquidity adder ETH

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


Add liquidity to a pool. If the pool doesn't exists it will be created.


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

  • ETH:

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

    Receives parameters for ETH.

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

    • 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

  • to address: 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:

    {
      "contract parameters": {
        "contract address": string,
        "abi": {string: any}[],
        "method name": string,
        "parameters": any[],
        "alters": boolean
      },
      "web3_credentials": {"providerUrl": string, "privateKey": string},
      optional "transaction parameters": {string: any}
    }["web3 credentials"]

    Receives credentials for the operation

Output ports

  • result: any

    Sends out the result of the operation in case of success

  • error: {"error": string}

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

Last updated