write.asset_manager.rebalancer
Automatically rebalance LP positions when price moves out of range, claiming fees and compounding rewards into a new centered position with configurable triggers and offsets.
Instructions
Encode args for the rebalancer automation. When the LP position goes out of range, Arcadia's bot repositions it centered on the current price. All pending fees and staking rewards are claimed and compounded into the new position. Strategy config: 'default' (all params at defaults) uses when_out_of_range — rebalances exactly when price exits range. 'custom' (any param differs) uses time_and_price_based_triggers — adds configurable trigger offsets, cooldowns, and token composition. Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers to build the unsigned tx. Combinable: merge arrays from multiple intent tools to configure several automations in one tx. trigger_lower_ratio and trigger_upper_ratio are independent — asymmetric configs are valid (e.g. trigger_lower_ratio=-50000, trigger_upper_ratio=0 means: trigger 5% of the tick range before the lower boundary is hit, but only trigger exactly at the upper boundary). Ratios represent tick distance, not price: a ratio of 50000 shifts the trigger by 5% of (tick_upper − tick_lower) ticks, which is not the same as 5% of price.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex_protocol | Yes | DEX protocol of the LP position — used to resolve the correct asset manager address. | |
| enabled | No | True to enable, false to disable | |
| compound_leftovers | No | What to reinvest after rebalance (default "all" = compound both) | all |
| optimal_token0_ratio | No | Target token0 composition scaled by 1e6: 500000 = 50%, 750000 = 75% | |
| trigger_lower_ratio | No | Offset from tick_lower, as a fraction of the position's tick range, scaled by 1e6. trigger_tick_lower = tick_lower - tick_range * ratio. 0 = trigger at the boundary. Positive (e.g. 50000 = 5% of tick range): trigger tick is outside the position — price must travel further beyond the range before rebalance fires (delayed). Negative (e.g. -50000 = -5%): trigger tick is inside the position — rebalance fires while price is still within range (preemptive). | |
| trigger_upper_ratio | No | Offset from tick_upper, as a fraction of the position's tick range, scaled by 1e6. trigger_tick_upper = tick_upper + tick_range * ratio. 0 = trigger at the boundary. Positive (e.g. 50000 = 5% of tick range): trigger tick is outside the position — price must travel further beyond the range before rebalance fires (delayed). Negative (e.g. -50000 = -5%): trigger tick is inside the position — rebalance fires while price is still within range (preemptive). | |
| min_rebalance_time | No | Min seconds between rebalances (default 3600 = 1 hour) | |
| max_rebalance_time | No | Max seconds before forced rebalance (default 1e12 = effectively disabled) | |
| strategy_hook | No | Strategy hook address. Defaults to minimal hook. Only override for custom hooks. | |
| chain_id | No | Chain ID: 8453 (Base) or 130 (Unichain) |