Liquidities adder

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


Add liquidity to multiple pools.


Input ports

  • pairs:

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

    Receives a list of parameters for the liquidity pools. Each list item consists of a pair of tokens to be added to the liquidity pool:

    • tokenA

    • tokenB or ETH

    For tokenA the paramters are:

    • 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

    For tokenB or ETH the parameters are:

    • 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 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: {"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