AddLiquidity
Uniswap Action Plugin - AddLiquidity
Description
Swaps an exact amount of ETH for as many output tokens as possible, along the route determined by the path.
Method
addLiquidity(address, address, uint256, uint256, uint256, uint256, address, uint256)
Input Parameters
Name | Plugin Type | Description |
---|---|---|
to |
| Uniswap V2 Router address |
Method Parameters
Name | Plugin Type | Description |
---|---|---|
tokenA |
| A pool token |
tokenB |
| A pool token |
amountADesired |
| The amount of tokenA to add as liquidity if the B/A price is <= amountBDesired/amountADesired (A depreciates). |
amountBDesired |
| The amount of tokenB to add as liquidity if the A/B price is <= amountADesired/amountBDesired (B depreciates). |
amountAMin |
| Bounds the extent to which the B/A price can go up before the transaction reverts. Must be <= amountADesired. |
amountBMin |
| Bounds the extent to which the A/B price can go up before the transaction reverts. Must be <= amountBDesired. |
to |
| Recipient of the liquidity tokens. |
deadline |
| Unix timestamp after which the transaction will revert. |
Returned Values
Name | Plugin Type | Description |
---|---|---|
amountA |
| The amount of tokenA sent to the pool. |
amountB |
| The amount of tokenB sent to the pool. |
liquidity |
| The amount of liquidity tokens minted. |
Example
Example with initParams
Example without initParams
Learn more
Learn more about Uniswap AddLiquidity function here
Last updated