Withdraw LP from Jediswap V2

Follow these step-by-step process to withdraw your liquidity from Jediswap V1.

1

Get all LP positions

  • Click on function "get_all_tokens_for_owner"

  • In the "owner" field, paste your Starknet wallet address

  • Select "Decimal" in the response format

  • Click "Query"

  • Note down all the "token ids" from the response, you can withdraw each LP position one by one.

2

Get LP balance

  • Scroll down on the above contract

  • Click on function "get_position"

  • In the "token_id" field paste one of the "token id" received from step 1

  • Click query and copy the value for "liquidity" field from the response

3

Decrease liquidity

  • Go to write contract from top-right in the above contract

  • Connect your Starknet wallet

  • Click on function "decrease_liquidity"

  • In the fields input below values

    • token_id = Same token id you used step 2

    • liquidity = liquidity value you received from step 2

    • amount0_min = 0

    • amount1_min = 0

    • deadline = 10000000000

  • Click on "Transact" and approve tx on your wallet

4

Withdraw funds

  • In the same contract as above, click on function "collect"

  • In the fields input below values

    • token_id = Same token id you used step 2 and 3

    • recipient = your Starknet wallet address where you want to receive funds

    • amount0_max = "0xffffffffffffffffffffffffffffffff"

    • amount1_max = "0xffffffffffffffffffffffffffffffff"

5

Burn your LP NFT

  • Your funds should already be in your wallet from step 4

  • To keep your wallet positions clear, you can optionally burn the LP NFT

  • In the same contract as step 3, go to function "burn"

  • In the "token_id" field paste the same token id you used in step 4

  • Click transact and confirm tx on your Starknet wallet

6

Repeat these steps for each of your position from step 1

Last updated