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 in the process.
Parameters
Exchange: The decentralized exchange where the liquidity pool resides.
Token A ID and Token B ID: The pair of tokens involved in the liquidity pool to which you want to add liquidity.
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
ui console view config defi wallet("your private key") add liquidity("Uniswap", "ETH", "DAI", "1", "1000", '#txid') log object(#txid)
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.