How to Remove Liquidity from TakoSwap Smart Contract

Multiplier
5 min readOct 26, 2021

Pre-requisites:

1. Chrome or Brave browser preferred

2. MetaMask wallet extension on browser

3. TLP tokens in your current account (please note down the number of tokens in your wallet)

2-Step process:

Step 1: To approve LP tokens to be used by TakoSwap Router.

Step 2: To use TakoSwap Router Contract to remove liquidity & receive funds.

Below is a lookup table for Token addresses and Tako Liquidity Pool (TLP) token addresses.

Lookup for Tokens & TLP Tokens addresses

  1. LP Pool: USDC-ETH
    Token Address: `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`
    TLP Token Address: 0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc
    Etherscan: https://etherscan.io/address/0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc
  2. LP Pool: USDT-ETH
    Token Address: `0xdac17f958d2ee523a2206206994597c13d831ec7`
    TLP Token Address: 0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852
    Etherscan: https://etherscan.io/address/0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852
  3. LP Pool: UNI-SUSHI
    Token Address A: `0x6b3595068778dd592e39a122f4f5a5cf09c90fe2`
    Token Address B: `0x1f9840a85d5af5bf1d1762f925bdaddc4201f984`
    TLP Token Address: 0x743c17e6509f70Dcd01D1Caa09d96d99a2307773
    Etherscan: https://etherscan.io/address/0x743c17e6509f70Dcd01D1Caa09d96d99a2307773
  4. LP Pool: SUSHI-ETH
    Token Address: `0x6b3595068778dd592e39a122f4f5a5cf09c90fe2`
    TLP Token Address: 0xCBC7e3674f2b3508833317cc4a31Aa5C0Fe45E09
    Etherscan: https://etherscan.io/address/0xCBC7e3674f2b3508833317cc4a31Aa5C0Fe45E09
  5. LP Pool: UNI-ETH
    Token Address: `0x1f9840a85d5af5bf1d1762f925bdaddc4201f984`
    TLP Token Address: 0x54f0860d6951b389a7656B6B3915d5BD2270ca0b
    Etherscan: https://etherscan.io/address/0x54f0860d6951b389a7656B6B3915d5BD2270ca0b
  6. LP Pool: MXX-ETH
    Token Address: `0x8a6f3BF52A26a21531514E23016eEAe8Ba7e7018`
    TLP Token Address: 0x2A015980f843923DecE20a83eE275E98840f10B8
    Etherscan: https://etherscan.io/address/0x2A015980f843923DecE20a83eE275E98840f10B8
  7. LP Pool: MXX-TAKO
    Token Address A: `0x531C3A8926e4c4b4cC50DC1De83E1E7fa0B2738E`
    Token Address B: `0x8a6f3BF52A26a21531514E23016eEAe8Ba7e7018`
    TLP Token Address: 0xCF8B6348c30420fd343c552cDB5b836fE62FE854
    Etherscan: https://etherscan.io/address/0xCF8B6348c30420fd343c552cDB5b836fE62FE854
  8. LP Pool: TAKO-ETH
    Token Address: `0x531C3A8926e4c4b4cC50DC1De83E1E7fa0B2738E`
    TLP Token Address: 0xCE9597260c8D7B5b52d2642Fb7B0Eebd34F2A5D2
    Etherscan: https://etherscan.io/address/0xCE9597260c8D7B5b52d2642Fb7B0Eebd34F2A5D2

Approve TLP tokens

  1. Select & Visit the correct Etherscan URL from the above lookup table based on the tokens which were used to add the liquidity.
  2. Make sure to be on `Write Contract` and Click on `Connect to Web3`.

3. Select the MetaMask option if you have MetaMask Extension installed, or as necessary.

4. Once connected, please confirm you are connected properly by checking your wallet address in the blue “Connected — Web3 (wallet address)” button.

5. Please fill in relevant details under Approve.

Spender address will be `0xB3f37E28F521671e1F368a1a06DC9Dc7C9914D02`.

Value will be TLP tokens in the wallet multiplied by 10**18.

For eg. If you have 2 TLP tokens in your wallet, the value will be 2000000000000000000.

Please use https://eth-converter.com/ Ether to Wei converter for the correct values.

Please copy back the Wei in the value field.

6. Once all details are filled, click on the `write` button and confirm the transaction in the wallet to approve TLP tokens. Please proceed to `Removing Liquidity using Smart Contract` now.

Removing Liquidity using Smart Contract

  1. Visit the TakoSwap Router https://etherscan.io/address/0xB3f37E28F521671e1F368a1a06DC9Dc7C9914D02#writeContract

Please confirm the Smart Contract address is `0xB3f37E28F521671e1F368a1a06DC9Dc7C9914D02`

2. Make sure to be on `Write Contract`. Click on `Connect to Web3`.

3. Select the MetaMask option if you have MetaMask Extension installed or as necessary.

4. Once connected, please confirm you are connected properly by checking your wallet address in the blue “Connected — Web3 (wallet address)” button.

5. Now there are 2 options available.

If you have added liquidity for UNI-SUSHI or MXX-TAKO LP then select the `removeLiquidity` method ( Go to step 6 onwards).

If you have added liquidity for USDC-ETH, USDT-ETH, SUSHI-ETH, UNI-ETH, MXX_ETH or TAKO-ETH then select the `removeLiquidityETH` method (
Go to step 7 onwards).

6. In case `removeLiquidity` has been chosen. Please fill in all of the following using the table provided below.

Token A and Token B addresses can be found in the table provided at the top depending upon the pool.

Liquidity can be checked as the amount of LP tokens in your wallet or on explorer.

`to` will be the address where the token will be received.

Deadline will be the `current Unix epoch time` plus 3600 more. For that please visit https://www.epochconverter.com/ to get the current Unix epoch time & add 3600 to it.

For eg. The unix timestamp shown in the image below is 1635228187 so value that we will use in the field will be (1635228187 + 3600) = 1635231787

7. In case `removeLiquidityETH` has been chosen. Please fill in all the following using the table provided below.

Token addresses can be found in the table provided at the top depending upon the pool.

Liquidity can be checked as the amount of LP tokens in your wallet or on explorer.

`to` will be the address where the token will be received.

Deadline will be the `current Unix epoch time` plus 3600 more. For that please visit https://www.epochconverter.com/ to get the current Unix epoch time & add 3600 to it.

For eg. The unix timestamp shown in the image below is 1635228187 so value that we will use in the field will be (1635228187 + 3600) = 1635231787

8. Once all details are filled, click on the `write` button and confirm the transaction in the wallet to remove the liquidity and get back tokenA and tokenB/ETH in the wallet.

--

--