> For the complete documentation index, see [llms.txt](https://docs.arcadia.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arcadia.finance/protocol/asset-managers/rebalancers.md).

# Rebalancers

Non-custodial permissioned Asset Managers that auto-rebalance concentrated liquidity positions. Trust assumptions, strategies, hooks, fee tiers, the gas allowance and stAAA benefits.

Rebalancers manage concentrated liquidity positions dynamically, solving the challenge of maintaining optimal liquidity ranges in rapidly changing market conditions. They automatically adjust position ranges to maximize fee-earning.

Detailed insights into our Rebalancer's innovative approach can be found in [our in-depth technical deep dive](/deep-dives/rebalancers.md).

## Properties

Rebalancers are:

* Immutable.
* Non-Custodial but triggering is Permissioned.
* The contract relies on economic incentives, with the initiator of the rebalance earning a small reward.

A unique feature of Arcadia's Rebalancers is the innovative Hook structure. This extensible design allows account owners to implement custom logic and additional checks for their rebalancing strategies. The Hook system is open for development by both protocol users and third-party developers.

## Strategies

Rebalancing is always a tradeoff between the opportunity cost of being out of range and the costs of rebalancing the position.

Finding the optimal strategy that determines when to rebalance, and which new lower and upper price to use, is a complex problem to solve, and it depends on multiple factors:

* Type of liquidity pool (stable pool, correlated assets, volatile assets…)
* Market conditions (bullish, bearish, flat)
* Objectives of the position owner
* Chain conditions e.g. gas price
* …

The Rebalancer is made in such a way that it works with any rebalance strategy. The main logic is strategy agnostic: it takes as input an old position, the new upper price and the new lower price.

## Trust Assumptions

The Rebalancer is a smart contracts that can only perform a single atomic action (rebalancing CLPs), it never holds assets.

But it does require input from a permissioned (whitelisted by the Owner, not Arcadia) user, further called the Initiator. ![Initiator](https://1842996165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCZEtaA6yEHQp1bLQVU4p%2Fuploads%2Fgit-blob-90cd95dea32103436d18cfaa2408f70e8e837dde%2Finitiator.png?alt=media)

The initiator has to call the Rebalancer contract and has to determine:

* When to rebalance
* The range of the new Liquidity Position

A malicious initiator can still only rebalance via the Rebalancer, while it is a trusted role, they can never steal funds or Liquidity from the Account Owner.

The worst a malicious/incompetent Rebalancer can do, is trigger Rebalances at bad moments and move liquidity to non-optimal ranges, resulting in value lost due to swap fees, slippage and opportunity cost. But they can never “rug” the assets of an Account.

Since Initiators can be revoked/replaced at any time by the Account Owner, they are incentivised to rebalance optimally, to keep earning fees for their services.

The Rebalancer is permissioned, but that does not mean it is centralised. Each Account Owner can choose if they enable the Rebalancer at all. And if they do, they can choose who they set as initiator. Different initiators can for instance run different rebalance strategies, or ask different fee amounts for their services.

## Rebalancing Limits and Economic Filters

Rebalancing costs gas, and Arcadia pays that gas up front. The rebalancer therefore decides, per position, who is paying for each one: the fees the position earned, Arcadia, or the Account Owner in AAA. Positions nobody is paying for are not rebalanced.

The free allowance is measured in **gas**, not in a number of rebalances. A rebalance on Optimism and one on Robinhood differ in cost by more than a thousand times, so a "1 per day" quota was generous on the cheap chains and did not cover a single rebalance on the expensive ones.

### Decision Logic

A position only reaches these checks once its **strategy** has decided it should be rebalanced (price out of range, minimum time elapsed, and so on). Everything below is about who pays.

The checks run **in order**, and the first one that admits the position wins.

#### Before any position is looked at

These are chain-wide, and they exist to bound what a single chain can cost in a day.

**Protocol Owned Liquidity is not subject to any of this.** POL accounts are excluded from the rebalancer described on this page and are served by their own keeper paths, so nothing below can stop or delay a POL rebalance or a POL limit order: POL never enters the pipeline these checks run in.

| Guard                           | What it stops                                                                                                                                                                                                                               |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Gas-price ceiling**           | Nothing is sent while gas is above the chain's ceiling, whatever the position economics say. Allow list included.                                                                                                                           |
| **Daily sponsored-gas ceiling** | Bounds what Arcadia gives away per chain per day. It stops the allow list, the large-position bypass and the free allowance. Positions that earn their own gas, and ones paid for in AAA, keep running, because those cost Arcadia nothing. |
| **Per-account revert backoff**  | An account whose last 3 rebalances reverted on-chain, with none landing since, is retried on a growing interval instead of every cycle (see below). Scoped to that account.                                                                 |
| **Data outages**                | If asset data or prices cannot be fetched, positions that need them are skipped for that cycle. Allow-listed owners still run, since that decision needs none of the missing inputs.                                                        |

#### 1. Allow list

A small number of owners (protocol partners) rebalance without any economic checks. It is not available on every chain, and it is switched off while the daily sponsored-gas ceiling is reached. Those positions are then **refused, not charged**.

#### 2. The position pays for itself

The expected revenue from pending fees is compared to the gas cost:

```
revenue  = pending fees (USD) * initiator fee %
gas cost = rebalance gas units * gas price * native token price (USD)
```

`rebalance gas units` is a per-chain average. The measured figure is checked before sending, see [Simulating before sending](#simulating-before-sending).

Admitted when `revenue >= multiplier x gas cost`. The multiplier is **2x** on Base, Unichain and Optimism, and **3x** on Ethereum and Robinhood, where a failed or marginal rebalance costs far more.

This is the path most positions take, and it consumes none of the owner's allowance.

#### 3. Large positions

Positions worth **$50,000 or more** are rebalanced even when their pending fees do not cover the gas: keeping a large position in range is worth more to Arcadia than the gas costs.

On Ethereum and Robinhood the rebalance also has to at least break even. Sponsoring a loss-making rebalance costs enough on those chains that it is not done automatically.

#### 4. The Account Owner's gas allowance

Everything from here down is work the owner's side pays for.

Every owner gets a **daily and weekly allowance denominated in the chain's native token**, shared across all of their accounts and across rebalances on every chain. A rebalance is admitted when its **full** cost fits both the daily and the weekly remainder.

| stAAA staked | Daily allowance | Weekly allowance |
| ------------ | --------------- | ---------------- |
| 0            | 0.00006         | 0.0003           |
| 3,000        | 0.00009         | 0.00045          |
| 6,000        | 0.00012         | 0.0006           |
| 9,000        | 0.00015         | 0.00075          |
| 30,000       | 0.00036         | 0.0018           |

The daily allowance is two typical Base rebalances and the weekly allowance is ten. Every **3,000 stAAA** adds one more per day.

Figures are native token. At $2,500 per ETH the base allowance is about $0.15 a day and $0.75 a week. The dApp shows the current dollar value of what is left.

A rebalance has to fit **both** remainders.

| Chain     | Typical gas | One rebalance | In one day, 0 stAAA | Every day, 0 stAAA | Every day, 3,000 stAAA |
| --------- | ----------- | ------------- | ------------------- | ------------------ | ---------------------- |
| Optimism  | 0.001 gwei  | 0.000005      | 12                  | \~8.6              | \~12.9                 |
| Base      | 0.006 gwei  | 0.000030      | 2                   | \~1.4              | \~2.1                  |
| Unichain  | 0.006 gwei  | 0.000030      | 2                   | \~1.4              | \~2.1                  |
| Robinhood | 0.3 gwei    | 0.00075       | 0                   | 0                  | 0                      |
| Ethereum  | 3 gwei      | 0.015         | 0                   | 0                  | 0                      |

The every-day figure is the weekly allowance divided by seven. The weekly allowance is five times the daily one.

One rebalance on Robinhood costs about 12 days of the base allowance, and on Ethereum about 250. The free allowance does not fund a rebalance on either chain, so positions there run when their own fees cover the gas (check 2 above) or when the owner pays in AAA. Waiting for cheaper gas is not a third option on those chains: the wait ends at the price where one rebalance fits the remaining allowance, which on Robinhood is 0.024 gwei with no stAAA and 0.144 gwei with 30,000, and on Ethereum 0.012 and 0.072 gwei. All four are far below what those chains normally cost.

Because the allowance is denominated in gas, it tracks the gas price on its own and there is no per-chain quota to retune when gas moves.

Holding AAA does not raise the allowance. It has to be staked into stAAA. The allowance is also counted across all of an owner's accounts, so splitting a position across accounts does not multiply it.

#### 5. Pay with AAA

An owner who has approved AAA to the Gas Relayer has the gas cost converted to AAA and charged on execution, and the rebalance runs immediately. Approving is treated as "run this now", so it is tried **before** waiting for cheaper gas.

Both the approval **and** the AAA balance have to cover the cost. The charge is rescaled to the gas the rebalance actually burned, bounded by what the owner was verified able to pay.

**Gas Relayer:** `0xD938C8d04cF91094fecAF0A2018EAac483a40137`

#### 6. Wait for gas to come within the allowance

If neither the allowance nor AAA can pay at the current gas price, the rebalance **waits** for up to **6 hours** instead of being refused. The gas price moves and the allowance does not, so a cost that does not fit now may fit later. The dApp shows the gas price it is waiting for.

A rebalance only waits when there is allowance left for it to fit into. Reaching the 6-hour deadline does **not** authorise it: the free tier is never run at a loss to Arcadia. It runs when gas falls far enough, when the position earns enough to pay for itself, or when the owner approves AAA.

#### 7. Otherwise, not rebalanced this cycle

The position is skipped with a reason the dApp renders in the automation history, and reconsidered next cycle.

### Simulating before sending

Checks 2, 4 and 5 price gas from a per-chain average. Once the swap route is built, the transaction is simulated and its gas measured, and that figure is checked against the limit set by whichever check admitted the position:

| Admitted by                    | Limit on the measured gas cost                         |
| ------------------------------ | ------------------------------------------------------ |
| The position pays for itself   | Fees must cover 2x it, or 3x on Ethereum and Robinhood |
| Your gas allowance             | The allowance remaining when it was admitted           |
| You pay in AAA                 | Your AAA approval and balance                          |
| Allow list, or $50,000 or more | No limit, Arcadia pays the gas                         |

Over the limit, the transaction is not sent and the automation history records why. No gas is spent.

Compounds and yield claims are checked the same way, against the fees they collect.

### When a rebalance keeps failing

Every rebalance, compound and yield claim is simulated immediately before it is sent, so one that would revert is not sent and costs nothing. A revert **on chain** means the simulation passed and the state changed before the transaction landed, usually a price move or an exposure cap filling up.

After 3 consecutive reverts with none landing since, the account is retried on a growing interval:

| Consecutive reverts | Retried every |
| ------------------- | ------------- |
| 3                   | 15 minutes    |
| 4                   | 30 minutes    |
| 5                   | 1 hour        |
| 6                   | 2 hours       |
| 8 or more           | 6 hours (cap) |

It is a slowdown, not a stop: any attempt can succeed, and one success clears it immediately.

The automation history names the revert reason, which decides what to do about it:

| Reason                                                        | What it means                                                                                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| New position's liquidity below your minimum-liquidity setting | The liquidity minted is below the floor you set. Slippage and leftover tokens both reduce it; lowering the floor accepts more of both. |
| Pool price moved away from the trusted price                  | A wider tolerance would let it through.                                                                                                |
| Would leave the account below its health requirement          | Repay or deposit before it can rebalance.                                                                                              |
| Protocol exposure cap is full                                 | Nothing on your side to change.                                                                                                        |
| Asset manager not the one we are authorised to call           | Re-save your automation settings.                                                                                                      |

### Summary

| Situation                                                    | Outcome                                                        |
| ------------------------------------------------------------ | -------------------------------------------------------------- |
| Pending fees cover the gas (2x, or 3x on Ethereum/Robinhood) | Rebalanced, free, allowance untouched                          |
| Position worth $50k or more                                  | Rebalanced, sponsored by Arcadia                               |
| Gas cost fits your daily and weekly allowance                | Rebalanced, charged to your allowance                          |
| You staked AAA into stAAA                                    | Larger allowance: +1 typical Base rebalance per 3,000 stAAA    |
| Allowance too small for current gas                          | Waits up to 6 hours for gas to fall, or approve AAA to run now |
| You approved AAA to the Gas Relayer                          | Rebalanced now, gas charged in AAA                             |
| Recent rebalances reverted on-chain                          | Retried on a growing interval; the history names the reason    |
| Simulated gas above the limit                                | Not sent, no gas spent, retried next cycle                     |
| Daily sponsored-gas ceiling reached                          | Only self-paying and AAA-paid rebalances continue              |

### Configuration

| Parameter                           | Value                                                                  |
| ----------------------------------- | ---------------------------------------------------------------------- |
| Daily allowance                     | 0.00006 native token (two typical Base rebalances)                     |
| Weekly allowance                    | 0.0003 native token (ten Base rebalances, about 1.4 per day)           |
| stAAA bonus                         | +0.00003/day and +0.00015/week per 3,000 stAAA                         |
| Rebalance gas units, for the checks | 5,000,000; 2,500,000 on Robinhood                                      |
| Rebalance gas units, for the send   | Measured by simulation                                                 |
| Profitability multiplier            | 2x (Base, Unichain, Optimism), 3x (Ethereum, Robinhood)                |
| Large-position threshold            | $50,000                                                                |
| Maximum wait for cheaper gas        | 6 hours                                                                |
| Gas-price ceiling                   | 5 gwei (Base, Unichain, Optimism, Robinhood), 100 gwei (Ethereum)      |
| Revert backoff                      | After 3 consecutive reverts, 15 min doubling to a 6 h cap, per account |

### Checking Your Status

The asset manager modal in the dApp shows:

* What your allowance has left, in money and in whole actions on this chain
* Your stAAA balance and the allowance it earns you
* Your AAA approval to the Gas Relayer, and a suggested amount
* Whether a rebalance is waiting for cheaper gas, and the gas price it is waiting for
* Why the last skipped rebalance was skipped

## Costs and Fees

When rebalancing there are a number of costs/inefficiencies involved:

* **1. Initiator Fee:** The initiator of the rebalance (who triggers it) receives an initiator fee ($$fee\_{initiator}$$) based on the pending yield earned of the position.
* **2. Slippage & leftovers:** Both slippage and leftovers result in a less than optimal amount of liquidity minted (Leftovers are not really a cost since they are deposited back into the account, but they no longer earn yield). Slippage & Leftovers are capped by the maximal decrease in liquidity ($$MDL$$), which compares the optimal rebalance (i.e., assuming no slippage and leftovers) to the current rebalance.
* **3. Impermanent Loss:** Rebalancing realizes impermanent loss. It is not a cost due to rebalancing, but a loss in value compared to the initial position that is realized by rebalancing.

Note that **2.** is capped to the downside (if exceeded the transaction reverts) but is most of the time much smaller or even positive (the swap can be done with a lower average fee than that of the pool and slippage can be positive as well).

Both the initiator $$fee\_{initiator}$$ and the $$MDL$$ are set by the Account Owner, they can differ for different strategies and different pools. The Initiator can change the rebalance parameters, but only advantageous to the Account Owner (lower fees, lower max slippage).

The fees and settings for the current initiators are set to:

| Rebalancer                                                                                          | Initiator                                                                                                             | Strategy | $$fee\_{initiator}$$ | $$MDL$$ |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | ------- |
| [Slipstream V1 Rebalancer](https://basescan.org/address/0x5802454749cc0c4A6F28D5001B4cD84432e2b79F) | [0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE](https://basescan.org/address/0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE) | Any      | 10% of yield earned  | 1%      |
| [Slipstream V2 Rebalancer](https://basescan.org/address/0x953Ff365d0b562ceC658dc46B394E9282338d9Ea) | [0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE](https://basescan.org/address/0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE) | Any      | 10% of yield earned  | 1%      |
| [Uniswap V3 Rebalancer](https://basescan.org/address/0xbA1D0c99c261F94b9C8b52465890Cca27dd993Bd)    | [0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE](https://basescan.org/address/0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE) | Any      | 10% of yield earned  | 1%      |
| [Uniswap V4 Rebalancer](https://basescan.org/address/0x01EDaF0067a10D18c88D2876c0A85Ee0096a5Ac0)    | [0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE](https://basescan.org/address/0xDc9B596ce15F859673D1Be72e2Aadd41DD3aC4fE) | Any      | 10% of yield earned  | 1%      |

Note: all rebalances will be subject to the Yield Success Fee of the protocol, as can be found in the [Fees](/protocol/fees.md) section.
