Add liquidity
Line 1: | Line 1: | ||
'''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange. | '''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange. | ||
− | |||
− | |||
== Parameters == | == Parameters == |
Revision as of 20:16, 4 July 2023
add liquidity is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.
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("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid') log object(#txid)
Please replace "your private key" with your actual DeFi wallet's private key.
Be mindful when you are handling your private key. It's a sensitive piece of data that allows full control over your funds in your DeFi wallet. Therefore, never share this key publicly or with anyone.
The script above adds liquidity to the ETH-DAI pool on PancakeSwap, contributing 1 ETH and 1000 DAI. It then logs the transaction details to the console.
Note that this script assumes that the tokens already exist in you wallet in the specified amounts.
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.