# Withdraw liquidity

You can withdraw liquidity at any time to realise any gains or losses. The following are the steps required to withdraw liquidity:

{% hint style="success" %}
**Step 1.** To withdraw liquidity, you first need to [**provide liquidity**](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3S6whoFOOQNr7CgXr/charm-options/liquidity-provision-tutorials/providing-liquidity).
{% endhint %}

{% hint style="info" %}
The **liquidity provided must be withdraw when a market expires, and re-deposited into a new market** when it opens.

Charm is currently working on a vault where liquidity can be automatically rolled over to new markets, so LPs do not need to manually withdraw and re-deposit.
{% endhint %}

{% hint style="success" %}
**Step 2.** **Connect your Metamask** wallet and go to **'Pools':**
{% endhint %}

![](/files/-MX2OF-kNz1zoJAMx4iR)

{% hint style="success" %}
**Step 3.** Your LP tokens will be displayed in '**Active pools**':
{% endhint %}

![](/files/-MW3lvTkifXuoSyOUPF6)

{% hint style="success" %}
**Step 4.** Click **'Withdraw'** to withdraw liquidity. The amount received will be displayed in the following page:
{% endhint %}

![](/files/-MW3mqQg7j4mBE9Ow2vs)

{% hint style="info" %}
This page can also be used to **determine your profit or loss** (before gas fees) from liquidity provision. This is equal to **Amount received - Total cost** (described in Step 8 in [Providing Liquidity](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3k0UFlgv2Vf8MlM-n/charm-options/liquidity-provision-tutorials/providing-liquidity/@drafts))
{% endhint %}

{% hint style="success" %}
**Step 5.** Click **'Withdraw ETH'** to withdraw liquidity, and receive the amount described in above. The following will appear in Metamask:
{% endhint %}

![](/files/-MW3sCNw3SWEM39bkq2-)

{% hint style="info" %}
This shows the **maximum gas fees** to close a position is 0.029358.&#x20;

The amount '0' indicates no money is sent from your wallet to the Blockchain, because you are actually receiving money from the Blockchain. The amount you will receive (before gas fees) is 0.007283 ETH, for a gross profit (before gas fees) of 0 ETH because Amount received = Amount received = 0.007283.
{% endhint %}

{% hint style="success" %}
**Step 5.** Click **confirm** if you wish to proceed.
{% endhint %}

{% hint style="success" %}
**Step 6.** Charm will show the transaction is '**pending**':
{% endhint %}

![](/files/-MW3uCpNqt_x2AJWdGQg)

{% hint style="success" %}
**Step 7.** When your transaction have been executed on the Blockchain, you will received the following **confirmation from Metamask**:
{% endhint %}

![](/files/-MVv2KRtLRwmSmNM8I14)

{% hint style="success" %}
**Step 8.** **Click on the above** to view and check your transaction on Etherscan:
{% endhint %}

![](/files/-MX2P6z4s5Exw5XFVrYg)

From the above, you can **check the following details of your transaction**:

* The amount received should be the same as Step 4.
* The LP shares you returned should be the same as Step 4.
* The final gas fee should be lower than the Metamask estimate in step 5.

{% hint style="success" %}
**Step 9.** Close or exercise your **hedge positions**.
{% endhint %}

The hedge positions are the call or puts you sold in Step 10 of [providing liquidity](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3k0UFlgv2Vf8MlM-n/charm-options/liquidity-provision-tutorials/providing-liquidity/@drafts).&#x20;

If you **withdraw liquidity before a market expires:**&#x20;

* These [positions should be closed](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3k0UFlgv2Vf8MlM-n/charm-options/tutorials/close-a-position/@drafts).

If you **withdraw liquidity before a market expires:**

* These positions should be [exercised](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3k0UFlgv2Vf8MlM-n/charm-options/tutorials/settlement/@drafts).

## Congratulations! You have now withdrawn liquidity.

You can calculate your profit and loss from liquidity provision in the following manner:

**Total profit or loss** = **Amount Received** (Step 4) - **Total Cost** (Step 5 in '[Providing liquidity](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3S6whoFOOQNr7CgXr/charm-options/liquidity-provision-tutorials/providing-liquidity)')

Your chances of getting a high profit will be increased by **purchasing a hedging instrument at Charm** (in step 10 in '[Providing liquidity](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3S6whoFOOQNr7CgXr/charm-options/liquidity-provision-tutorials/providing-liquidity)')**, and only deposit in small amounts** (in step 5 in '[Providing liquidity](https://app.gitbook.com/@charmfinance/s/charm-finance/~/drafts/-MW3S6whoFOOQNr7CgXr/charm-options/liquidity-provision-tutorials/providing-liquidity)').


---

# 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://learn.charm.fi/charm-finance/previous-products-1/overview/liquidity-provision-tutorials/withdrawing-liquidity.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.
