> For the complete documentation index, see [llms.txt](https://learn.charm.fi/charm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.charm.fi/charm/manage-liquidity/user-guides/walkthroughs/automating-rebalance.md).

# Automating Rebalance

An automation provider (eg [Gelato Functions](https://app.gelato.network/functions)) can be used to trigger rebalance on your behalf. Here is how to do it:

1. **Top up your balance in Gelato's** [**1Balance**](https://app.gelato.network/1balance) **app - see** [**here**](https://docs.gelato.network/web3-services/1balance) **for further guidance.**

2. **Set the** [**Rebalance Delegate**](/charm/manage-liquidity/user-guides/walkthroughs/edit-vault.md#public-rebalancing) **to the Zero Address** (`0x0000000000000000000000000000000000000000`) and press Submit:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FG4mg5sqFmeSsQMUvr8VC%2FScreenshot%202024-03-24%20at%2010.33.19.png?alt=media&amp;token=ba4cc353-3ae9-4baf-a9bd-a5549933d858" alt=""><figcaption></figcaption></figure>

3. **Copy the** [**Rebalancing Period**](/charm/manage-liquidity/user-guides/walkthroughs/edit-vault.md#changing-the-rebalance-period) **from** [**Edit Vault**](/charm/manage-liquidity/user-guides/walkthroughs/edit-vault.md)**:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FoJpqQkFp8jwqLpAOPai0%2FScreenshot%202024-03-24%20at%2009.58.30.png?alt=media&amp;token=a605d702-6369-4d03-a22f-4f53235a6f7c" alt=""><figcaption></figcaption></figure>

4. **Add&#x20;*****extra 10 seconds*****&#x20;to Rebalancing Period, and paste the total as the Time Interval in** [**New Task** ](https://app.gelato.network/new-task)**in Gelato Functions:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FtqjhiBakH06Rgc49mowP%2FScreenshot%202024-03-25%20at%2006.52.19.png?alt=media&amp;token=d69f17e1-90b2-4a34-aca8-ea51e4d1699a" alt=""><figcaption></figcaption></figure>

5. **If you are doing rebalance for the first time, click Start Immediately:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FLpwKUWEKiFY0WoxoTXvk%2FScreenshot%202024-03-24%20at%2010.03.05.png?alt=media&amp;token=4d1507b7-b862-4678-82b6-c630bf626a12" alt=""><figcaption></figcaption></figure>

6. **Otherwise, un-click Start Immediately and input when you want the next rebalance to happen.** The difference between the next start date and time and the last rebalance must be larger than [**Rebalancing Period**](/charm/manage-liquidity/user-guides/walkthroughs/edit-vault.md#changing-the-rebalance-period)**.**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FZpOEhSZ8i5Lt6qXxMmMo%2FScreenshot%202024-03-24%20at%2010.05.14.png?alt=media&amp;token=af99a8eb-1223-471e-95c9-7c5dcafa3c0c" alt=""><figcaption></figcaption></figure>

7. **Click Transaction in the next section:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FdbSObgrsTiszs1oZdVB9%2FScreenshot%202024-03-24%20at%2010.06.31.png?alt=media&amp;token=a6f1ed81-a051-40a0-9a38-a2cb40ada332" alt=""><figcaption></figcaption></figure>

8. **Get your vault's contract address from the address bar:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2Fld0fXfKI8AmCoY7m6NNC%2FScreenshot%202024-03-24%20at%2009.55.09.png?alt=media&amp;token=4b0af8b6-3655-4587-b00b-dcf9f658a450" alt=""><figcaption></figcaption></figure>

9. **Paste in the contract address:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2F7YxkOPobULao06lJ0UTh%2FScreenshot%202024-03-24%20at%2010.08.11.png?alt=media&amp;token=9de5130b-96db-4996-8710-e3c5be33636e" alt=""><figcaption></figcaption></figure>

10. **Select rebalance() as the function to be automated:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FF8yXz1nbNpUIHubtNQym%2FScreenshot%202024-03-24%20at%2010.09.15.png?alt=media&amp;token=c4d54934-b3a5-4b70-b63d-98d8c6c31b6b" alt=""><figcaption></figcaption></figure>

10. **Give your task a name, and click Create Task:**

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FbqHL35HPv2F206onkwBy%2FScreenshot%202024-03-24%20at%2010.15.58.png?alt=media&amp;token=e9b105b0-d8d9-4696-9ca0-0dea362634b8" alt=""><figcaption></figcaption></figure>

11. **When the transaction confirms, the vault begin rebalancing automatically!** You can see it in your vault on Charm:

<figure><img src="https://3306594273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FncWpbfiN022KvH5AGrQq%2Fuploads%2FTSwwALUsuEcNswgFCXxC%2FScreenshot%202024-03-24%20at%2010.53.09.png?alt=media&amp;token=0d985bf1-6e2b-4793-afe9-921d437cb99b" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
You vault is now fully automated!

You don't need to do anything else to earn fees income and increase liquidity, apart from making sure you have enough balance in step 1 to pay for gas fees.
{% endhint %}

{% hint style="danger" %}
Even though your vault is fully automated, you still need to [monitor its performance](/charm/provide-liquidity/user-guides/performance-page.md), and [change the strategy](/charm/manage-liquidity/user-guides/walkthroughs/edit-vault.md#managing-liquidity) if it is not performing.

\
If you change the [Rebalancing Period](/charm/manage-liquidity/user-guides/vault-parameters.md#rebalance-period-period), the old task needs to be cancelled, and steps 3 to 10 need to be repeated.
{% endhint %}
