Remove liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
'''remove liquidity''' is a command that lets you remove liquidity from a liquidity pool on a decentralized exchange. This command is crucial for enterprise users who participate in liquidity providing to DeFi protocols and need to withdraw their staked assets.
+
'''remove liquidity''' is a command that allows you to withdraw your contribution from a liquidity pool on a decentralized exchange.
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange platform where you will be removing liquidity. The specific exchange can be chosen from the dropdown menu.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
  
'''Token A ID:''' The identifier of the first token in the liquidity pool from which you want to remove liquidity. You can select the token from the dropdown menu or input its contract address.
+
'''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool from which you want to remove liquidity. These can either be the token symbol or the contract address.
  
'''Token B ID:''' The identifier of the second token in the liquidity pool from which you want to remove liquidity. You can select the token from the dropdown menu or input its contract address.
+
'''Amount:''' The amount of the liquidity tokens that you want to remove from the liquidity pool.
  
'''Amount:''' The quantity of liquidity that you wish to remove from the pool.
+
'''Transaction Info Variable:''' (optional) The variable to store the transaction details after the liquidity is removed. The default is '''#txinfo'''.
 
+
'''Transaction Info Variable:''' (Optional) The name of a variable to store the transaction information related to the liquidity removal action. By default, it's set to '#txinfo'.
+
  
 
== Example ==
 
== Example ==
Line 17: Line 15:
 
<pre>
 
<pre>
 
ui console view
 
ui console view
config defi wallet("your private key here")
+
config defi wallet("your private key")
remove liquidity("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82","5")
+
remove liquidity("PancakeSwap", "ETH", "DAI", "1", '#txinfo')
log("Transaction Info: {#txinfo}")
+
log object(#txinfo)
 
</pre>
 
</pre>
  
Make sure to replace "your private key here" with your actual private key. Private keys are sensitive information that should be handled with utmost care and confidentiality.
+
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 details of the transaction associated with the liquidity removal action. This might include information such as the amount of gas used, the transaction hash, and the block number where the transaction was recorded.
+
The script above removes liquidity from the ETH-DAI pool on PancakeSwap, giving you its value in the underlying tokens. It then logs the transaction details to the console.
  
The output might look something like this:
+
Note that this script assumes that you have the required liquidity tokens invested in the defi exchange. It also assumes you have enough of the native token to pay gas fees.
<blockquote>
+
Transaction Info: {"blockHash":"0x1f51bbceec31819c5ab9a17a73e6cf9a1f412ac85a34005d6ca522a34450dc53","blockNumber":11061825,"contractAddress":null,"cumulativeGasUsed":1690539,"from":"0xe3f3589c4943f8c8a3b2b4c5b5a837c215ba3a8b","gasUsed":21706,"logsBloom":"0x04000000000000040040000000000000000000000000..."}
+
</blockquote>
+

Latest revision as of 02:05, 5 July 2023

remove liquidity is a command that allows you to withdraw your contribution from 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 from which you want to remove liquidity. These can either be the token symbol or the contract address.

Amount: The amount of the liquidity tokens that you want to remove from the liquidity pool.

Transaction Info Variable: (optional) The variable to store the transaction details after the liquidity is removed. The default is #txinfo.

[edit] Example

ui console view
config defi wallet("your private key")
remove liquidity("PancakeSwap", "ETH", "DAI", "1", '#txinfo')
log object(#txinfo)

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 removes liquidity from the ETH-DAI pool on PancakeSwap, giving you its value in the underlying tokens. It then logs the transaction details to the console.

Note that this script assumes that you have the required liquidity tokens invested in the defi exchange. It also assumes you have enough of the native token to pay gas fees.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox