# 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 %}

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FnelRgJNCrCi2pxeFPtDZ%2Fimage.png?alt=media&#x26;token=192783d5-7516-43f3-b4e6-af18adc25aa0" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FQl7XEnOT2hYXKr0NnIfH%2Fimage.png?alt=media&#x26;token=6d15453c-5d07-45e3-b40b-d6cbf6e8b745" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2F6EwFzZtZaKsX4xQ5UW0W%2Fimage.png?alt=media&#x26;token=044458be-da47-44e5-91da-4dda4ee8a2b7" alt=""><figcaption></figcaption></figure>

{% 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 %}

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FzgLIyPfHTf97jTQ8Z0G2%2Fimage.png?alt=media&#x26;token=a904d3b8-25be-4b21-928e-ab0827f53a78" alt=""><figcaption></figcaption></figure>

{% 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 %}

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FfNlhpk3ULeqWqyZor16x%2Fimage.png?alt=media&#x26;token=a22fce71-43d6-4bea-8bb0-080edd9c1aab" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FbPj3U8ltoHVpTiz39GsZ%2Fimage.png?alt=media&#x26;token=3cd5bc21-83ce-45eb-be87-5085a72ebb7c" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2F9ijMsGuvhbnlX6u5pcyj%2Fimage.png?alt=media&#x26;token=d1658146-e2e6-4130-b4dc-13f60eb948b8" alt=""><figcaption></figcaption></figure>

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)').
