Removing Liquidity using Blastscan
This page gives examples on how to remove liquidity from V2 or V3 pools by using Blastscan instead of the Thruster UI. Thruster does not assume any liability for interactions based on examples.
Users should always research multiple resources when taking actions w/ the blockchain to be well-informed. We provide examples here, but do not have any control over Blastscan nor user input, please interact with caution with Blastscan.
Removing Liquidity from V3 Pools
Step 1: Check Liquidity Amount
Acquire Token ID: Locate your token ID on the Portfolio page or the add liquidity transaction page on Blastscan. Or go to your address on Blastscan to look at all available token IDs in your wallet.
Go to Blastscan: Visit the “Read Contract” tab on the NonfungiblePositionManager contract page on Blastscan.
Enter Token ID: Input your tokenID under the ‘13. positions’ section to check the amount of liquidity in the position.
Step 2: Decrease Liquidity
Switch to Write Contract tab: Switch to the Write Contract tab on NonfungiblePositionManager contract page on Blastscan.
Connect to Web3: Connect to your wallet that holds the V3 position you wish to remove.
Fill in the Parameters in the Decrease Liquidity Function: Locate the '6. decreaseLiquidity' function and enter the required parameters. Example table below w/ descriptions.
*To Calculate amount0Min and amount1Min:
Step 1: Collect Required Inputs:
Liquidity (ℓ): Found using the
NonfungiblePositionManager
contract under the ‘13. positions’ section.Tick Upper (𝑖𝑢): Found using the
NonfungiblePositionManager
contract under the ‘13. positions’ section.Tick Lower (𝑖𝑙): Found using the
NonfungiblePositionManager
contract under the ‘13. positions’ section.Current SqrtPriceX96 (𝑃): The current price of the pool, found under the ‘12.slot0’ section of the pool contract.
Step2-1: In Range Position Calculation: If the position is in range, perform the following formula to calculate the current holdings of token 0 and token 1. See here for technical details.
Step 2-2: Out of Range Position Calculation: If the position is out of range, perform the following formula to calculate the current holdings of token 0 and token 1. See here for technical details.
Name | Type | Description | Example: |
payableAmount |
| Amount of ETH to send with the transaction. | 0 |
tokenId |
| The ID of the position you want to withdraw. | 123923 |
liquidity |
| The amount of liquidity to remove from the position. Receive the liquidity amount from Step 1 | 742137615349833101 |
amount0Min* |
| Minimum amount of token0 expected out. | 359016851604 |
amount1Min* |
| Minimum amount of token1 expected out. | 36364843152141 |
deadline |
| Unix timestamp after which the transaction will revert. | 1719336324 |
Step 3: Collect Tokens
Fill in the Parameters in the Collect function: Locate the '4. collect' function and enter the required parameters. After decreasing liquidity, tokens need to be “collected” to be returned to your wallet. It is important you set the recipient as your wallet, otherwise funds will be lost.
Name | Type | Description | Example |
---|---|---|---|
payableAmount |
| Amount of ETH to send with the transaction. | 0 |
tokenId |
| The ID of the position you want to withdraw. | 123923 |
recipient |
| Your own wallet address. | 0xYourWalletAddress |
amount0Max |
| To claim all available tokens, set the maximum value to 2**128−1 (340282366920938463463374607431768211455) to securely withdraw the full amount. | 340282366920938463463374607431768211455 |
amount1Max |
| To claim all available tokens, set the maximum value to 2**128−1 (340282366920938463463374607431768211455) to securely withdraw the full amount. | 340282366920938463463374607431768211455 |
Step 4 (Optional): Unwrap WETH to ETH
Navigate to the WETH Token Contract: Visit the “Write as Proxy” tab on the WETH Token contract page on Blastscan.
Connect to Web3: Connect your wallet that contains the WETH you want to unwrap.
Fill in the Parameters in Withdraw Function: Locate the '10. withdraw' function to withdraw ETH and decrease your WETH balance.
Removing Liquidity from V2 Pairs
Step 1: Approve the LP token for removing liquidity via the Router
Navigate to Thruster LP Token Contract: You can find the Thruster LP Token contract on Blastscan in your add liquidity transaction record. Click 'Write Contract' tab on the LP Token contract page.
Connect to Web3: Connect your wallet that contains the V2 position you want to remove.
Fill in the Parameters in Approve Function: Locate the '1. approve' function and enter the required parameters.
Name | Type | Description | Example |
---|---|---|---|
spender |
| Enter the Router Address. ThrusterRouter (0.30%): 0x98994a9A7a2570367554589189dC9772241650f ThrusterRouter (1.00%): 0x44889b52b71E60De6ed7dE82E2939fcc52fB2B4E | 0x44889b52b71E60De6ed7dE82E2939fcc52fB2B4E |
value |
| To authorise the maximum value enter the input to 2**128−1 (340282366920938463463374607431768211455). | 340282366920938463463374607431768211455 |
Step 2: Identify Remove Functions
Go to Blastscan: Navigate to the “Write Contract” tab of the contract's page on Blastscan, based on the fee tier.
ThrusterRouter (0.30%) Write Contract.
ThrusterRouter (1.00%) Write Contract.
Identify Remove Functions: Based on the tokens you want to remove, identify the right Remove function call.
Name | Description |
---|---|
removeLiquidity | Removes liquidity from an ERC-20⇄ERC-20 pool. |
removeLiquidityETH | Removes liquidity from an ERC-20⇄WETH pool and receive ETH. |
removeLiquidityETHSupportingFeeOnTransferTokens | Identical to removeLiquidityETH, but succeeds for tokens that take a fee on transfer. |
Step 3: Remove Liquidity
Connect to Web3: Connect your wallet that contains the V2 position you want to remove.
Fill in the Parameters in Remove function: Locate the '4. removeliquidity' function and enter the required parameters.
Name | Type | Description | Example |
tokenA |
| A pool token. | 0x4300000000000000000000000000000000000004 |
tokenB |
| A pool token. | 0x4300000000000000000000000000000000000003 |
liquidity* |
| The amount of liquidity tokens to remove. | |
amountAMin |
| The minimum amount of tokenA that must be received for the transaction to proceed without reverting. You can set it to '0' or another number in 256-bit unit format. | 0 |
amountBMin |
| The minimum amount of tokenA that must be received for the transaction to proceed without reverting. You can set it to '0' or another number in 256-bit unit format. | 0 |
to |
| Recipient of the underlying assets. | 0xYourWalletAddress |
deadline |
| Unix timestamp after which the transaction will revert. | 1719336324 |
*To Calculate amountAMin and amountBMin:
Multiply your proportion of the liquidity by the reserves in the pool.
For example, if getReserves returns 10,000 USDB and 1 WETH, and you are 10% of the pool, then amountAMin and amountBMin should be 1000 USDB and 0.1 WETH multiplied by 0.99 (if you have 1% slippage).
To obtain the liquidity amount number:
Step 1: Navigate to the Thruster LP Token contract: Locate the Thruster LP Token contract on Blastscan. Click on 'Read Contract' on the LP Token contract page.
Step 2: Enter the parameters and execute the query: Locate the ‘8.balanceOf’ function and enter the required parameters.
Name
Type
Description
Example
<input>
address
Recipient of the underlying assets.
0xYourWalletAddress
Last updated