Remove liquidity
Line 1: | Line 1: | ||
− | '''remove liquidity''' is a command that allows you to | + | '''remove liquidity''' is a command that allows you to withdraw your contribution from a liquidity pool on a decentralized exchange. |
− | This command is | + | This command is useful for users who previously added liquidity to a pool on protocols like Uniswap or PancakeSwap, and now wish to remove their contribution. |
== Parameters == | == Parameters == | ||
− | '''Exchange:''' The decentralized exchange where the liquidity pool resides | + | '''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 | + | '''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool from which you want to remove liquidity. |
− | '''Amount:''' The amount of liquidity you want to remove from the pool. | + | '''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 | + | '''Transaction Info Variable:''' (optional) The variable to store the transaction details after the liquidity is removed. The default is '#txinfo'. |
== Example == | == Example == | ||
+ | |||
<pre> | <pre> | ||
− | remove liquidity(" | + | config defi wallet("your private key") |
− | + | remove liquidity("PancakeSwap", "ETH", "DAI", "1", '#txid') | |
+ | log object(#txid) | ||
</pre> | </pre> | ||
− | The | + | 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, removing 1 ETH and its equivalent amount of DAI based on the current pool ratios. It then logs the transaction details to the console. | ||
+ | |||
+ | Note that this script assumes that you have the required liquidity tokens in your wallet. | ||
− | Always remember to double-check your | + | Always remember to double-check your input values before removing liquidity, as all transactions on the blockchain are irreversible. |
Revision as of 20:03, 4 July 2023
remove liquidity is a command that allows you to withdraw your contribution from a liquidity pool on a decentralized exchange.
This command is useful for users who previously added liquidity to a pool on protocols like Uniswap or PancakeSwap, and now wish to remove their contribution.
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.
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'.
Example
config defi wallet("your private key") remove liquidity("PancakeSwap", "ETH", "DAI", "1", '#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 removes liquidity from the ETH-DAI pool on PancakeSwap, removing 1 ETH and its equivalent amount of DAI based on the current pool ratios. It then logs the transaction details to the console.
Note that this script assumes that you have the required liquidity tokens in your wallet.
Always remember to double-check your input values before removing liquidity, as all transactions on the blockchain are irreversible.