# 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="/files/y3U6Bd3zv6lIOOO49iwt" 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="/files/6IomDh5NjLUpVVaRytlg" 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="/files/USB1lP0uB3vjQ7kEKsAh" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/N9cpPv2N4BdjrI01NqrI" 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="/files/I4lJsNXZp1NkHvqWgx0T" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/P8BYKxK6x2XZIVzxBr27" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/jHkesRtILuYrgHuJjI3x" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/VvQ598Am0IvOdTgsTw2P" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/7Dm3EJJPO0yM9fGAxDcu" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/8WYjMYhaw2Fh74wgvvqn" 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="/files/Crhbrp1SWpNyFtVgLM5E" 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 %}


---

# 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/manage-liquidity/user-guides/walkthroughs/automating-rebalance.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.
