Remove liquidity

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
'''defi remove liquidity''' is a command that allows you to remove your tokens from a liquidity pool on a decentralized exchange.
+
'''remove liquidity''' is a command that allows you to withdraw your contribution from a liquidity pool on a decentralized exchange.
 
+
This command is especially useful for enterprise users who are providing liquidity and want to retrieve their staked tokens.
+
 
+
== User Level ==
+
 
+
This command is exclusively available for enterprise users.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where you want to remove liquidity from.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.  
  
'''Token A ID:''' The ID of the first token that you want to remove from the liquidity pool.
+
'''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 ID of the second token that you want to remove from the liquidity pool.
+
'''Amount:''' The amount of the liquidity tokens that you want to remove from the liquidity pool.
  
'''Amount:''' The amount of liquidity tokens you want 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) 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 remove liquidity("Uniswap", "ETH", "DAI", "1", "#transactionInfo")
+
ui console view
ui text msg("Transaction Info: {#transactionInfo}")
+
config defi wallet("your private key")
 +
remove liquidity("PancakeSwap", "ETH", "DAI", "1", '#txinfo')
 +
log object(#txinfo)
 
</pre>
 
</pre>
  
In this example, the script is removing liquidity equivalent to one Uniswap liquidity token from the ETH/DAI liquidity pool on Uniswap, and then displaying the transaction information.
+
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.

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