Add liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(6 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. This command is often used by enterprise users engaged in DeFi protocols.
+
'''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange platform where you will be adding liquidity. The exchange can be selected from the dropdown menu.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
  
'''Token A ID:''' The identifier of the first token you want to add to the liquidity pool. Select the token from the dropdown menu or enter its contract address.
+
'''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.
  
'''Token B ID:''' The identifier of the second token you want to add to the liquidity pool. Select the token from the dropdown menu or enter its contract address.
+
'''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool.
  
'''Amount A:''' Quantity of token A that you want to add to the liquidity pool.
+
'''Transaction Info Variable:''' (optional) The variable to store the transaction information after the liquidity is added. The default is '#txinfo'.
 
+
'''Amount B:''' Quantity of token B that you want to add to the liquidity pool.
+
 
+
'''Transaction Info Variable:''' (Optional) The name of a variable that can be used to store the transaction details of the liquidity adding action. By default, it’s set to '#txinfo'.
+
  
 
== Example ==
 
== Example ==
Line 19: Line 15:
 
<pre>
 
<pre>
 
ui console view
 
ui console view
config defi wallet("your private key here")
+
config defi wallet("your private key")
add liquidity("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82","10","2")
+
add liquidity("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid')
log("Transaction Info: {#txinfo}")
+
log object(#txid)
 
</pre>
 
</pre>
  
You should replace "your private key here" with your actual private key. As private keys are sensitive and confidential, handle them with the utmost care.
+
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 output of this script will be the transaction information associated with the liquidity addition. For example, it might include details such as the transaction hash, the amount of gas used, and the moment the transaction was included in a block.
+
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.
  
A potential output could look something like:
+
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.
<blockquote>
+
Transaction Info: {"blockHash":"0x1f51bbceec31819c5ab9a17a73e6cf9a1f412ac85a34005d6ca522a34450dc53","blockNumber":11061824,"contractAddress":null,"cumulativeGasUsed":1690539,"from":"0xe3f3589c4943f8c8a3b2b4c5b5a837c215ba3a8b","gasUsed":21706,"logsBloom":"0x04000000000000040040000000000000000000000000..."}
+
</blockquote>
+

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