Add liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(2 intermediate revisions by one user not shown)
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.
 
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 ==
 
== Parameters ==
Line 7: Line 5:
 
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
 
'''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.  
+
'''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool to which you want to add liquidity. These can be the symbol of the token or their contract addresses.
  
 
'''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool.
 
'''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool.
Line 28: Line 26:
 
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.
 
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.
+
Note that this script assumes that the tokens already exist in you wallet in the specified amounts. It also assumes you have enough of the native token to pay gas fees.
 
+
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.
+

Latest revision as of 02:06, 5 July 2023

add liquidity is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.

[edit] 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. These can be the symbol of the token or their contract addresses.

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'.

[edit] 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. It also assumes you have enough of the native token to pay gas fees.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox