Withdraw Your Tokens

To withdraw all liquidity and remove all funds from the vault simply burn the 1 Arrakis LP token in your wallet (created in the vault initialization step). Whoever holds this ERC20 token can burn it to remove this liquidity (so don't send it around unless that is intended behavior!)

Here's the command to withdraw your liquidity and end the tutorial:

yarn tutorial1-withdraw --network goerli

Congratulations! You have completed the first Arrakis V2 tutorial.

Have questions or feedback? Ask in our discord

What Does This Script Do?

We burn the total supply of the Arrakis LP token in our wallet, withdrawing all liquidity from the market and all tokens from the vault:

const tx = await vault.burn(
    userBalance, // amount LP token to burn
    userAddr // address to receive underlying tokens

Last updated