Remove liquidity
Line 1: | Line 1: | ||
− | '''remove liquidity''' is a command that | + | '''remove liquidity''' is a command that allows you to remove liquidity from a liquidity pool on a decentralized exchange. |
+ | |||
+ | This command is beneficial for users who wish to retrieves their assets from a liquidity pool on protocols like Uniswap or PancakeSwap. | ||
== Parameters == | == Parameters == | ||
− | '''Exchange:''' The decentralized exchange | + | '''Exchange:''' The decentralized exchange where the liquidity pool resides. The available exchanges will be dependent on the "SwapNames" list set in your environment. |
− | '''Token A ID:''' The | + | '''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool from which you want to remove liquidity. The available tokens will be dependent on the "CoinNames" list set in your environment. |
− | ''' | + | '''Amount:''' The amount of liquidity you want to remove from the pool. |
− | + | '''Transaction Info Variable:''' (optional) The variable to store the transaction information after the liquidity is removed. The default is '#txinfo'. | |
− | + | ||
− | '''Transaction Info Variable:''' ( | + | |
== Example == | == Example == | ||
− | |||
<pre> | <pre> | ||
− | + | remove liquidity("SushiSwap", "DAI", "USDC", "10", "#transaction") | |
− | + | alert(#transaction) | |
− | remove liquidity(" | + | |
− | + | ||
</pre> | </pre> | ||
− | + | The above script removes liquidity from the DAI-USDC pool on SushiSwap, retrieving an amount equal to 10 liquidity tokens. It then alerts the user to the transaction details. | |
− | + | ||
− | The | + | |
− | + | Always remember to double-check your inputted values before removing liquidity, because all transactions on the blockchain are irreversible. Make sure the tokens and values you use in the command match the actual tokens that exist on the blockchain and the holdings in your wallet. | |
− | + | ||
− | + | ||
− | + |
Revision as of 19:08, 4 July 2023
remove liquidity is a command that allows you to remove liquidity from a liquidity pool on a decentralized exchange.
This command is beneficial for users who wish to retrieves their assets from a liquidity pool on protocols like Uniswap or PancakeSwap.
Parameters
Exchange: The decentralized exchange where the liquidity pool resides. The available exchanges will be dependent on the "SwapNames" list set in your environment.
Token A ID and Token B ID: The pair of tokens involved in the liquidity pool from which you want to remove liquidity. The available tokens will be dependent on the "CoinNames" list set in your environment.
Amount: The amount of liquidity you want to remove from the pool.
Transaction Info Variable: (optional) The variable to store the transaction information after the liquidity is removed. The default is '#txinfo'.
Example
remove liquidity("SushiSwap", "DAI", "USDC", "10", "#transaction") alert(#transaction)
The above script removes liquidity from the DAI-USDC pool on SushiSwap, retrieving an amount equal to 10 liquidity tokens. It then alerts the user to the transaction details.
Always remember to double-check your inputted values before removing liquidity, because all transactions on the blockchain are irreversible. Make sure the tokens and values you use in the command match the actual tokens that exist on the blockchain and the holdings in your wallet.