Liquidity Migration: Step-by-Step Guide
In this article
A liquidity migration moves your token's trading liquidity from one decentralized exchange (DEX) or liquidity pool to another. This is common when a project upgrades its token contract, moves to a more popular DEX, or consolidates fragmented liquidity. The goal is to ensure your token remains tradeable without disruption. Before you start, you need admin access to the token contract, ownership of the existing liquidity pool, and a new pool address ready. You'll also need enough native tokens (e.g., ETH, BNB) to pay gas fees.
What You'll Need
- Admin or owner keys for the token contract and the old liquidity pool.
- A new liquidity pool address on the target DEX (e.g., Uniswap, PancakeSwap).
- The token contract address and its ABI (if interacting directly).
- A wallet with the native gas token (ETH, BNB, etc.) for transaction fees.
- Access to a blockchain explorer (like Etherscan or BscScan) for verification.
Step-by-Step
- Prepare the new pool. Create the new liquidity pool on the target DEX by providing the initial liquidity. If you're moving to a new DEX, you may need to add the token manually. Ensure the pool has the correct token pair (e.g., TOKEN/ETH) and that you have the pool address.
- Remove liquidity from the old pool. Go to the old DEX's liquidity management page. Select the pool you're migrating from and click "Remove Liquidity." Set the amount to 100% (or your full share) and confirm the transaction in your wallet. This burns your LP tokens and returns your underlying tokens (e.g., your token and ETH) to your wallet.
- Verify the returned tokens. After the removal, check your wallet balance to confirm you received the expected amounts of your token and the paired asset. Note that you might have incurred a small impermanent loss if the price moved.
- If migrating to a new token contract: If you're also changing the token contract (e.g., a migration to a new version), you need to swap the old tokens for new ones. This is typically done via a migration contract or a manual swap. Ensure all holders are aware of the migration process.
- Add liquidity to the new pool. On the new DEX, go to the "Add Liquidity" page. Select your token and the paired asset. Enter the amounts you want to provide. The interface will show the price and your share. Confirm the transaction.
- Set the initial price (if needed). If the new pool is fresh, the price will be set by the ratio of tokens you add. To match the old price, calculate the ratio from the old pool before removal and replicate it. For example, if the old pool had 100,000 TOKEN and 10 ETH, add the same ratio.
- Update external references. Change the token's trading address on your website, DEX aggregators, and any listing sites. If you have a migration portal, update it to reflect the new pool.
- Notify the community. Announce the migration on your official channels (Telegram, Discord, Twitter). Provide the new pool address and clear instructions for users who might still hold LP tokens from the old pool.
- Verify the new pool. Use a blockchain explorer to confirm the new pool has liquidity and that trades are going through. Check the LP token supply and your wallet's LP balance.
Common Mistakes
- Removing liquidity at the wrong time. If you remove liquidity during a period of high volatility, you might suffer impermanent loss that could have been avoided. Wait for a stable price if possible.
- Forgetting to update the token's trading address. If you don't update the address on your website and aggregators, users will still try to trade on the old, empty pool.
- Adding liquidity with an incorrect ratio. If you set the price too high or low, arbitrageurs will immediately trade against the pool, causing a loss for you.
- Not checking the new pool's contract. Ensure the new DEX's pool contract is legitimate and not a malicious clone. Always verify the address on the official DEX site.
- Leaving dust in the old pool. Some users might have tiny LP amounts. Make sure to communicate that they need to remove their own liquidity before the migration is complete.
Tips
- Do a test run first. If you have a small amount, do a test migration with a tiny portion to ensure the process works before moving the bulk.
- Keep gas fees in mind. During network congestion, gas fees can be high. Schedule the migration during off-peak hours to save costs.
- Use a multi-sig wallet. If you have a team, use a multi-sig wallet for the migration to prevent a single point of failure.
- Document everything. Record the old and new pool addresses, transaction hashes, and the exact steps you took. This helps with audits and community trust.
- Consider a migration contract. For large projects, a smart contract that automatically swaps old LP tokens for new ones can simplify the process for users.
Troubleshooting
- Transaction fails when removing liquidity. This is often due to insufficient gas or a slippage tolerance that's too low. Increase the gas limit and slippage (e.g., to 1-2%) and try again.
- Tokens not appearing in wallet after removal. Check the blockchain explorer for the transaction. If it succeeded, the tokens should be there. If not, the transaction might have been reverted. Check for any error messages.
- New pool shows zero liquidity. If you added liquidity but the pool shows zero, you might have added to the wrong pool (e.g., different token pair). Verify the pool address and the token pair.
- Price is different from expected. This can happen if the old pool had a different ratio due to trades. Recalculate the ratio from the old pool's last state and adjust the new pool accordingly.
- Users can't trade the new token. If the token contract changed, ensure that the new contract is verified and that the DEX has the correct address. Also, check if the token has a transfer tax or other restrictions that might affect trading.
Frequently Asked Questions
Do I need to migrate if I'm just moving to a new DEX?
Yes, if you want your token to be tradeable on the new DEX, you need to move the liquidity. Otherwise, the old pool remains the only place to trade.
What happens to my LP tokens after migration?
When you remove liquidity, your LP tokens are burned, and you receive the underlying assets. You then add those assets to the new pool to get new LP tokens.
Can I migrate liquidity without a smart contract?
Yes, you can do it manually by removing and adding liquidity. A smart contract is only necessary for complex migrations, like when the token contract itself changes.
How long does a liquidity migration take?
It depends on network congestion. Each transaction (removal and addition) can take anywhere from seconds to minutes. Plan for at least 10-15 minutes for the whole process.
Will I lose money during migration?
You might incur impermanent loss if the price changes between removal and addition. Also, gas fees are non-refundable. Otherwise, you should retain the same value.
What if I don't have all the paired tokens needed?
You can add liquidity with a different ratio, but that will change the price. To maintain the same price, you need to add the same ratio as the old pool.