# Charm Simulator

### Introduction <a href="#heading-introduction" id="heading-introduction"></a>

There are no reliable, user-friendly simulators for Liquidity Provision (LP) strategies. As a result, liquidity providers cannot assess the effectiveness of an LP strategy, or determine whether a vault utilising such strategies will perform well.

[*Charm Simulator*](https://alpha.charm.fi/arbitrum/backtest) is a permissionless and easy-to-use simulator to backtest the performance of an LP strategy. It works for any Uniswap v3 pool\*, and any strategy supported by [Alpha Vaults](https://alpha.charm.fi/). Anyone can use *Charm Simulator* to test the performance of a vault before it is created.

\*The first version of *Charm Simulator* will support Mainnet pools. L2 pools will be supported in future versions.

### How to use Charm Simulator <a href="#heading-how-to-use-charm-simulator" id="heading-how-to-use-charm-simulator"></a>

1. Click on [Backtest](https://alpha.charm.fi/arbitrum/backtest), and select the pool to backtest:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FedrOx0LSjOgDVEQ1mWZz%2Fimage.png?alt=media&#x26;token=acedf54d-531b-44aa-a28e-5fe3be4533b0" alt=""><figcaption></figcaption></figure>

2. Enter the strategy’s parameters using the tooltip as guidance. The docs contain [further guidance](https://learn.charm.fi/charm/manage-liquidity/user-guides/vault-parameters#strategy-parameters).

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FZixrA3T5ydS9zT5yibrM%2Fimage.png?alt=media&#x26;token=134407c7-c886-475c-b224-c837b60e84f3" alt=""><figcaption></figcaption></figure>

3. Select the dates to backtest:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FCkFz3BZQiBx1wRC7eVUE%2Fimage.png?alt=media&#x26;token=6ccffc51-1920-4bd1-bac3-7e523f3d1a57" alt=""><figcaption></figcaption></figure>

4. Click **Run Backtest** to run the simulator:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FUTQK4hVQ3uwPl5da5Lt7%2Fimage.png?alt=media&#x26;token=973d8824-086a-40b5-94f0-0b3ebf32324e" alt=""><figcaption></figcaption></figure>

5. **Repeat** steps 2 to 4 until the best performing LP strategy have been found.
6. Click **Create Vault** to implement the strategy:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FiIFAy0Dz0proCwc6bv4w%2Fimage.png?alt=media&#x26;token=d50c74d3-b74b-4fc8-8843-eada500596ef" alt=""><figcaption></figcaption></figure>

7. Click **Create Vault** again to open up your browser wallet to create a vault:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FGNaII4Uhz6ItY8YxgdVj%2Fimage.png?alt=media&#x26;token=ec7cc6ac-c7d6-43c1-9557-f7a2597cce1e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FSyew6bv9SQmLiPtTA1gw%2Fimage.png?alt=media&#x26;token=b27569bc-eb9f-4cbe-af9b-5d6042261590" alt=""><figcaption></figcaption></figure>

8. Follow the prompts in your browser wallet to create the vault.
9. When the transaction confirms, a welcome screen will appear to confirm the vault was created:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2F7Uhs5L2pWPWbiCc1Ahvq%2Fimage.png?alt=media&#x26;token=4da07023-fb08-4dde-ad8f-131af42d2a3f" alt=""><figcaption></figcaption></figure>

10. Click [Next Steps](https://learn.charm.fi/charm/manage-liquidity/user-guides/create-vault/next-steps) to learn some of the things you can do with your vault.
11. Click **View Your Vault** to see your vault — it’s now ready to accept deposits!

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2F1kFLsX7JsDwXOzxBmero%2Fimage.png?alt=media&#x26;token=a365d7b0-c9fc-4f95-a646-4d491ae2fd88" alt=""><figcaption></figcaption></figure>

12. You can now deposit into the vault, and [automate rebalance](https://learn.charm.fi/charm/manage-liquidity/user-guides/walkthroughs/automating-rebalance) to let the vault run by itself.

**Congratulations! You just created a vault with your own custom LP strategy!**

## Assumptions <a href="#ef8f" id="ef8f"></a>

*Charm Simulator* uses the following assumptions:

1. The protocol fee is set to 1% of Uniswap fees, and manager fee is set to 0%.
2. The first deposit is always in a 50:50 ratio.
3. There is only one depositor, and no withdrawals.
4. All the vault’s liquidity is in a Uniswap V3 pool at all times.
5. The strategy always rebalances at exactly the time determined by the [Rebalance Frequency](https://learn.charm.fi/charm/manage-liquidity/user-guides/vault-parameters#rebalance-period-period).

## Caveats <a href="#ecf1" id="ecf1"></a>

*Charm Simulator* offers a way to backtest an LP strategy using historical data. It should only be used for research purposes because:

* It does not guarantee future performance, because it only uses historical data.
* The actual performance also depend on the pattern of withdrawal and deposits, the manager fee, and what other liquidity managers do in response to an LP strategy.
* It will not implement the strategy unless a vault is [created](https://alpha.charm.fi/ethereum/create).
* The simulator uses the raw swaps data downloaded from Uniswap V3. They have not been pre-processed to filter out spurious swaps, or unusual liquidity patterns. These factors are more likely to affect smaller pools, and the simulator results for these pools may be less accurate.

## Conclusion <a href="#id-40a1" id="id-40a1"></a>

[*Charm Simulator*](https://alpha.charm.fi/arbitrum/backtest) is a permissionless backtester for LP strategies. Anyone can use it to test an LP strategy, and then [implement](https://alpha.charm.fi/ethereum/create) it for any Mainnet pool. Future versions of *Charm Simulator* will support L2 pools, and faster load time for all pools.
