Add liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
'''defi add liquidity''' is a command that adds 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 particularly useful for enterprise users who want to contribute to liquidity and earn rewards from providing liquidity on a decentralized exchange.
+
 
+
== User Level ==
+
 
+
This command is exclusively available for enterprise users.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where you want to add liquidity.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
  
'''Token A ID:''' The ID of the first token that you want to add to the liquidity pool.
+
'''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 ID of the second token that you want to add to the liquidity pool.
+
'''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool.
  
'''Amount A:''' The amount of "Token A" 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'.
 
+
'''Amount B:''' The amount of "Token B" that you want to contribute to the liquidity pool.
+
 
+
'''Transaction Info Variable:''' (Optional) This advanced parameter is the variable to which the transaction details will be stored. If not specified, it will default to a variable named '#txinfo'.
+
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
defi add liquidity("Uniswap", "ETH", "DAI", "1", "2000", "#transactionInfo")
+
ui console view
ui text msg("Transaction Info: {#transactionInfo}")
+
config defi wallet("your private key")
 +
add liquidity("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid')
 +
log object(#txid)
 
</pre>
 
</pre>
  
In this example, the script contributes one ETH token and 2000 DAI tokens to a liquidity pool on the Uniswap decentralized exchange. It then displays the transaction info in the User Interface.
+
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.

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