Add liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''add liquidity''' is a command that adds liquidity to a liquidity pool on a decentralized exchange (DEX). In decentralized finance (DeFi), liquidity pools are smart contrac...")
 
(Example)
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
'''add liquidity''' is a command that adds liquidity to a liquidity pool on a decentralized exchange (DEX).
+
'''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.
 
+
In decentralized finance (DeFi), liquidity pools are smart contracts that contain funds. When you supply equal amounts of two tokens to a pool, you'll receive liquidity tokens in return. These are proof of your contribution to the pool.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where the liquidity is being added.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
  
'''Token A ID:''' The first token of the liquidity pair that is being added to the 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 second token of the liquidity pair that is being added to the 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 are adding 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 are adding to the liquidity pool.
+
 
+
'''Transaction Info Variable:''' (Advanced, optional) The variable name where transaction information will be stored. The default value is '#txinfo'.
+
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
add liquidity("SushiSwap", "ETH", "SUSHI", "10", "10000")
+
ui console view
 +
config defi wallet("your private key")
 +
add liquidity("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid')
 +
log object(#txid)
 
</pre>
 
</pre>
  
In this example, the 'add liquidity' command is adding liquidity to the SushiSwap decentralized exchange. It adds 10 ETH and 10000 SUSHI to the liquidity pool. These two tokens (ETH and SUSHI) make up a liquidity pair in the SushiSwap liquidity pool.
+
Please replace "your private key" with your actual DeFi wallet's private key.
 
+
== Post-run ==
+
  
After running this command, '''RecordTxData''' will be executed to record transaction data.
+
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.
  
**Please note:**
+
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.
  
Adding liquidity involves risk, including impermanent loss. Please make sure to conduct your own research and understand the risks before supplying tokens to a liquidity pool. You should also ensure you have enough balance of the tokens you want to add to the pool.
+
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