Add liquidity
add liquidity is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.
This command is beneficial for users who wish to contribute to a liquidity pool on protocols like Uniswap or PancakeSwap, earning fees and liquidity tokens in the process.
Parameters
Exchange: The decentralized exchange where the liquidity pool resides. The available exchanges will be dependent on the "SwapNames" list set in your environment.
Token A ID and Token B ID: The pair of tokens involved in the liquidity pool to which you want to add liquidity. The available tokens will be dependent on the "CoinNames" list set in your environment.
Amount A and Amount B: The amount of each respective token that you want to contribute to the liquidity pool.
Transaction Info Variable: (optional) The variable to store the transaction information after the liquidity is added. The default is '#txinfo'.
Example
add liquidity("Uniswap", "ETH", "DAI", "1", "1000", '#transaction') alert(#transaction)
The script above adds liquidity to the ETH-DAI pool on Uniswap, contributing 1 ETH and 1000 DAI. It then alerts the transaction details to the user.
Always remember to double-check your input values before adding liquidity, because all transactions on the blockchain are irreversible. Make sure the tokens and values you use in the command match the actual tokens that exist on the blockchain and the holdings in your wallet.