# Pencils Protocol Swap Tutorial

## **- Swap** <a href="#id-6233" id="id-6233"></a>

### Step 1: Go to the Swap page and connect your wallet. <a href="#id-2e6c" id="id-2e6c"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*Jt3vK7WJVBUQEchM" alt="" height="289" width="700"><figcaption></figcaption></figure>

### Step 2: Select the token you want to swap by clicking on the ticker a drop-down allows you to view and the searching feature is enabled. <a href="#id-6fdb" id="id-6fdb"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*I9F4-2dRNm-2V-7K" alt="" height="341" width="700"><figcaption></figcaption></figure>

### Step 3: Enter the amount you wish to trade, review the transaction details displayed, click confirm Swap, and confirm the transaction. <a href="#e38b" id="e38b"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*HF66RnZAmLAZ-itI" alt="" height="302" width="700"><figcaption></figcaption></figure>

### Step 4: Pay the transaction fee, and the swap is successfully completed. <a href="#ab54" id="ab54"></a>

***\*Note: The fee is deducted from your wallet balance. Please ensure you have sufficient token balance; otherwise, the transaction will fail.***

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*BGJhmWVuprTxwVxf" alt="" height="300" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*1e9dMemYSPdhSbeA" alt="" height="301" width="700"><figcaption></figcaption></figure>

## - Adding Liquidity <a href="#id-8c48" id="id-8c48"></a>

### Step 1: Choose the trading pair for which you want to provide liquidity. <a href="#d752" id="d752"></a>

***Example: Add liquidity to the USDC/ETH pool.***

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*xVpI0V4OYyxbsX94" alt="" height="354" width="700"><figcaption></figcaption></figure>

### Step 2: Select the pool fee tier. <a href="#id-6396" id="id-6396"></a>

Based on the guidance provided, choose an appropriate fee tier. For non-stablecoin pairs, it is generally recommended to select the feetier with a 0.3% fee.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*IvYmgF53mFirOSv1" alt="" height="355" width="700"><figcaption></figcaption></figure>

### Step 3: Choose the price range for liquidity provision. <a href="#id-599a" id="id-599a"></a>

In Pencils Swap V3, liquidity aggregation reduces the computational load compared to the standard V2 version, optimizing gas fees. V3 divides the entire price range into selectable price points. Choose a specific price range to minimize gas fees and enhance efficiency.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*umx9on05c2FHAgry" alt="" height="302" width="700"><figcaption></figcaption></figure>

### Step 4: Set the deposit amount for the tokens you wish to provide as liquidity. <a href="#id-212b" id="id-212b"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*Zn7wXnPKNLF3tmhR" alt="" height="356" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*NhguWhO5cO1S5AVP" alt="" height="326" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*NLAxqjf3Iszcy2Lh" alt="" height="326" width="700"><figcaption></figcaption></figure>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*-mf5xBO-50PW-tI5" alt="" height="318" width="700"><figcaption></figcaption></figure>

### Special Case: Providing liquidity outside the spot price range <a href="#id-87ac" id="id-87ac"></a>

* If the lower bound of your price range is entirely above the current market price, you only need to provide a single token, such as ETH.
* Conversely, if the upper bound is completely below the current market price, you only need to provide a single token, such as USDC.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*vkovW_7XTfCqC5Zv" alt="" height="357" width="700"><figcaption></figcaption></figure>

## - Removing Liquidity <a href="#id-4e4c" id="id-4e4c"></a>

### Step 1: Click on Liquidity and select Your Positions. <a href="#id-2a8b" id="id-2a8b"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*zVMSu-JJEVnM60WM" alt="" height="191" width="700"><figcaption></figcaption></figure>

### Step 2: Click on Remove Liquidity. <a href="#f93a" id="f93a"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*05QGE2wGwU2fmFwY" alt="" height="328" width="700"><figcaption></figcaption></figure>

### Step 3: Choose the amount you want to remove and click Remove. <a href="#id-9e41" id="id-9e41"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*79igJfAGmZhu2tpc" alt="" height="270" width="700"><figcaption></figcaption></figure>

### Step 4: Pay the transaction fee, and the liquidity will be successfully removed. <a href="#ece7" id="ece7"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*c0Z8T5E5RhzKwM2F" alt="" height="249" width="700"><figcaption></figcaption></figure>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.pencilsprotocol.io/overview/pencils-protocol-swap-tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
