How to Add & Remove Liquidity

A tutorial on how to add and remove liquidity through Swift AI's app.

When you navigate to the Liquidity page of the Swift AI app, you’ll see a page that describes your current liquidity positions (if you have any), like this:

Adding A Liquidity Position

On the Liquidity page, click the ‘Create Position’ button.

To choose a specific liquidity pool, select the two underlying assets that make up the liquidity pool you wish to add to. For example, if I want to add to the XTC-WICP pool, I would select XTC and WICP as my two tokens.

What if the token I want to add liquidity to isn’t on Swift AI? 🤔

By default, the Swift AI application pre-loads most of the popular tokens for you.

To import a token that’s not pre-loaded to the Swift AI application, copy and paste the token’s canister ID into the search bar.

If the token follows one of the token standards Swift AI supports (currently, only DIP20) then the symbol & logo will show up in search with a button to import it.

Once imported, you’ll be able to select the token and add liquidity!

Choosing the amount of either one of the tokens will result in the other token automatically populating its amount.

We do this because you have to add liquidity to a pool in a ratio that satisfies the current market prices, or else you're open to losing funds to arbitrage. For example, if 1 WICP = 20 XTC, and we want to deposit 10 ICP into the WICP-XTX pool, we’d also have to deposit 200 XTC.

Clicking the “Review Supply” button (ensuring you’ve entered liquidity in the correct ratio) will show the amount of LP tokens you’ll receive and the respective share of the pool that the LP tokens give you ownership over.

LP tokens are used to prove ownership over a portion of a liquidity pool.

Since the liquidity pool is made up of two underlying assets, your LP tokens hold an intrinsic value.

If all looks good, clicking “Confirm Supply” will bring up a Plug batch transaction that upon approval will execute your addition to the liquidity pool.

Remove From A Liquidity Position

Click the minus button of an existing position remove liquidity from it.

You are able to choose how much liquidity you would like to remove from your position.

Removing liquidity will prompt a batch transaction from Plug. Upon approval, your LP tokens will be burned and the associated amount of the two tokens that make up the liquidity pool will be transferred to your balance in Plug.

Last updated

Was this helpful?