Automatic LP Rebalancing for Uniswap v3

Positions in Uniswap v3 quickly fall out of range, and yields drop. We develop turnkey automatic rebalancing: we set up the rules, connect to your wallet, and keep liquidity within the active range. You get predictable returns without manual monitoring.

Blockchain Development Services

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1375
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1349
  • B2B Advance company logo design
    B2B Advance company logo design
    794
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1087
  • AIDER company logo development
    AIDER company logo development
    1032
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1129

Why LP positions in Uniswap v3 go out of range

In Uniswap v3, liquidity is no longer "set and forget": the provider sets the price range in which their capital operates. The narrower the corridor, the higher the liquidity density in that segment and the larger the share of fees the LP position receives.

The flip side is that the price moves beyond the boundaries, and the position instantly stops earning: the entire volume remains in one asset, while the second is sold off as the rate moves.

The mechanics are simple and harsh. While the price is within the range, concentrated liquidity services trades and accrues fees.

As soon as the rate breaks through the upper or lower boundary, trading bypasses it — fees drip to others, and your LP position turns into a one-sided asset: on an upward exit you are entirely in stablecoins, on a downward exit — entirely in the volatile token. This is impermanent loss in its most vivid form: you lock in the worst of the two outcomes.

Manual monitoring does not save you. To keep a position working, you need to track the price, close the range in time, re-deposit liquidity, and repeat this on every noticeable market move — including at night and on weekends.

One missed reversal, and the position sat out of range for a day, earning nothing. Let's break down how automatic rebalancing closes this gap and returns the LP position to working mode without constant human presence.

What automatic LP rebalancing delivers

Automatic rebalancing is a managed process: a Uniswap v3 position stays within an active price range without constant manual intervention. Below is what exactly changes in the operation of a liquidity pool when the boundaries are moved by rules rather than by a phone call.

  • The share of time in range grows. A position outside the boundaries stops collecting fees — this is the main source of downtime. The rule moves the range when the price crosses a threshold, and liquidity returns to work within minutes, rather than after the owner notices a drawdown.
  • Fee collection becomes continuous. While the position is active, accumulation happens on every pool trade. Automation reduces the pauses between rebalancing cycles to a minimum, so fees are collected more evenly, without gaps on days when there was no time to get to it.
  • Manual operations are reduced severalfold. Instead of daily price monitoring and resetting boundaries, all that remains is configuring thresholds and periodically reviewing the report. One set of rules replaces dozens of repetitive actions.
  • A whole class of errors when resetting boundaries disappears. Manually closing and opening a position carries the risk of mixing up the range, forgetting to return liquidity, or acting on emotions after a sharp move. The logic executes identically regardless of market conditions.
  • Cost predictability emerges. Each rebalancing is a transaction with a network fee and possible slippage. Accounting for these costs in the rule prevents the automation from "twitching" on every fluctuation and eating into income with frequent resets.
  • Decisions are recorded and verifiable. Every trigger is logged: price, reason, new range. This makes it possible to review the strategy's behavior on historical data and adjust thresholds, rather than guessing why income declined.

The bottom line is not "profitability magic" but a managed mode: liquidity works in range longer, fees are collected more evenly, and there is less manual routine and the errors associated with it.

Ways to Keep a Position Within a Range

Keeping a position within a range can be done in three fundamentally different ways, and the choice between them is a choice between control, effort, and execution discipline.

Manually resetting the boundaries gives full control, but requires constant presence: while you sleep or are busy with another project, the price moves out of the range, and the position stops earning.

Rebalancing bots remove some of the routine, but operate on a rigid scenario without accounting for your fee and risk strategy.

Automatic rebalancing with policies is when the rules are set in advance and executed without your involvement: when the price moves beyond the boundary, the position is reset according to a defined algorithm rather than by mood.

The key difference from a bot is the set of policies: how often the boundaries can be moved, what minimum shift is considered significant, what to do during a sharp market move.

Approach When it fits Limitations
Manual resetting Low volatility, infrequent trades, full control Requires constant monitoring, human factor, idle time outside the range
Semi-automatic bots Need for control with prompts, medium activity The decision is still yours, reaction delay, risk of missing the moment
Automation with policies Active trading, multiple pairs, discipline needed Requires working out the rules, harder to roll back an incorrect setting

The difference shows over the long run: the manual approach loses not in entry precision, but in regularity. Automation with policies closes exactly this gap — the position stays within the range predictably, rather than when you have time to check the chart.

How we implement automatic rebalancing

Automatic rebalancing is not "turning on a bot" but transferring manual decisions on positions into a verifiable scheme.

A position in Uniswap v3 lives within a set price range: while the price is inside — fees accrue, once it goes beyond the boundary — liquidity stops working and turns into a single asset. The task of rebalancing is to return the range to a working state by a rule, not by mood. Below is how we go through this path from audit to handover.

  1. Audit of current positions. We look at what is already open: in which pairs, in which ranges, how much time the position spent outside the boundaries, what share of fees it actually brought in. We calculate how many times during the period intervention would have been required and what the cost of downtime is.
  2. Designing the rebalancing scheme. We define the logic: range width, shift step, what to do when the price exits — narrow, widen, or move the boundaries. We fix which assets remain in the position and how the pair is reassembled upon a shift.
  3. Setting up triggers. We define the activation conditions: price deviation from the boundary, share of time outside the range, threshold of accumulated fees versus the costs of reassembly. We set up the triggers so that the rule fires without manual confirmation, but with a log of every decision.
  4. Testing on historical data. We run the scheme on past price movements: how many activations, how often the position returned to the range, how what was collected compares to gas costs and slippage. We look at behavior during sharp movements and during sideways markets separately.
  5. Limits and protection. We specify limits: maximum rebalancing frequency, minimum remaining balance, stop under abnormal volatility. This protects against a situation where the rule churns the position more often than it can earn.
  6. Handover and support. We hand over a working scheme with an activation log, instructions for changing parameters, and a clear point of rollback to manual mode. The parameters remain configurable — the market changes, and the rule must change along with it.

Each stage ends with an artifact: a position map, a scheme specification, a set of triggers, a historical run report. Describe your pairs and horizon — we will come back with an assessment and an implementation plan.

Configurations and regulations you receive

We hand over not "server access," but a complete set that allows the system to be operated and passed on to another team. Below is what exactly remains with you after launching automatic LP Uniswap v3 rebalancing.

  • Configuration files — pool parameters, price ranges, trigger thresholds, and per-operation limits are placed in separate configs rather than hardcoded. You change strategy behavior without rebuilding and re-auditing the logic.
  • Flow diagrams — how quotes and pool state reach the decision-making module, where protection against sharp price movements sits, and how a transaction proceeds to confirmation. The diagram is tied to real components, not abstract blocks.
  • Key access policies — signing roles are separated from management roles, and operations go through a dedicated wallet with a limited set of permitted actions. Compromise of a single node does not allow funds to be withdrawn entirely.
  • Documentation — a description of the strategy, the boundaries of its applicability, and the scenarios in which rebalancing deliberately does not trigger. The engineer who comes after us reads a decision, not code.
  • Monitoring regulations — which metrics are collected, at which deviations an alert is sent, and who responds in what order. Separately — the procedure for stopping the strategy and manually withdrawing liquidity.
  • Rollback plan — how to return the position to its initial state in the event of an oracle failure, a gas spike, or an error in the config. It is tested on a testnet before being deployed to mainnet.
  • Change log — every intervention in the parameters is recorded with the reason and result. After a month, it is clear which settings actually affected profitability and which were noise.

The set is designed on the assumption that your team will operate the system. Describe the task — we will come back with an estimate and a plan for which artifacts are needed in your specific case.

Case: rebalancing a pool with a stablecoin pair

What it was before

A pool with a stablecoin pair on Uniswap v3 ran in manual mode: an engineer checked the current price and range boundaries several times a day, and less often during periods of low volatility.

As soon as the pair moved outside the range, the position stopped earning: liquidity remained in the pool, but swaps bypassed it, and the share of time out of range reached 40%.

Each return required a manual operation — withdraw the position, recalculate the boundaries, deposit liquidity again — and all of this with a delay of hours until the engineer was free.

What was changed

We built an automatic rebalancer that monitors the pair's price and the range boundaries according to a given rule.

The logic is simple: while the price is inside the corridor, the position works and fees accrue; when it goes beyond the boundary, the system itself withdraws liquidity, recalculates the range taking volatility into account, and deposits the position back.

The threshold values and the width of the corridor are configurable so as not to disturb the position on every fluctuation and not to lose fees on gas.

What it became

The share of time out of range dropped from 40% to 5% — the position is almost always working rather than idle. Fees grew 2.5x with the same volume of liquidity: it was precisely the density of operation inside the corridor that made the difference.

Manual operations were reduced to occasional checks — the engineer no longer sits over a chart, but looks at a report on how many times the system rebalanced and with what result.

Separately about the risks: rebalancing is not "set it and forget it." We built in protection against sharp price movements, a limit on the frequency of operations, and a log of all actions so that an unsuccessful rule can be rolled back.

On a stablecoin pair this is especially important — here the price moves narrowly, and an error in the boundaries eats up fees faster than it brings them in.

How does automatic rebalancing differ from manual?

Manual rebalancing is a cycle of "saw the price move outside the range → calculated a new interval → sent a transaction." Time passes between these steps: while the operator notices the movement, while they check the current tick and the pool boundaries, while they assemble and sign the transaction, the price moves further.

In Uniswap v3, a position outside the range stops earning fees and fully converts into one of the assets — that is, it stops being liquidity in the sense in which it was intended.

The more volatile the pair, the more often this scenario repeats and the more expensive each minute of downtime becomes.

Automation removes the human from the decision-making loop. A monitor polls the pool state and compares the current price with the position boundaries; when the threshold is crossed, a rule triggers that calculates a new range based on the specified width and shift.

The reaction speed here is measured not in hours but in blocks: while a manual operator is just opening the terminal, the automation has already sent a transaction to withdraw and reopen the position.

Precision is also of a different class — the boundaries are calculated from the actual tick, not from the rounded value the operator saw on the chart.

Labor effort is the third difference. Manual management scales poorly: one position can still tolerate an operator's attention, five require being on duty, and twenty turn into a round-the-clock watch, where a person physically cannot keep up with reacting to fast movements.

Automatic rebalancing maintains any number of positions with a single set of rules, and the operator gets involved only when parameters change — for example, when the market regime shifts and the previous range width stops being reasonable.

There is also a downside: automation is not "smarter" than a human, it is merely faster and more disciplined. If a rule is set with too narrow a range, it will frequently reopen the position and eat up in fees what it earned from collection.

That is why in production, alongside the rebalancing logic, safeguards are put in place: a minimum interval between reopenings, a price deviation threshold, and a limit on total costs per period. Then automation delivers what it is adopted for — predictable reaction without manual duty.

Common technical concerns

Automatic rebalancing of Uniswap v3 LP is a bot that keeps liquidity within a specified price range. Below are answers to the questions most often asked before starting: they concern access to funds, reaction speed, and compatibility with already open positions.

How are keys stored and who has access to the funds?

The private key never leaves the customer's perimeter: transaction signing is performed on their side, and the service only forms and sends prepared operations. We do not request withdrawals and do not gain access to the balance — only to the position we manage.

The rights are limited by the position contract, so access can be revoked at any time without reissuing keys.

How quickly does the bot react when the price leaves the range?

Rebalancing is triggered by the event of the price leaving the boundaries, not by a schedule.

Between the appearance of the signal and the new position, time passes for block confirmation — during this moment the position does not earn fees, and this is factored into the yield calculation. For volatile pairs, a proactive range shift is configured to reduce downtime.

Is this compatible with already open positions?

Yes. The bot connects to an existing position by its identifier and works with the current liquidity, without requiring it to be closed and reopened. If the position is out of range, the first action will be to bring it into a working state. Multi-positions and several pairs on a single wallet are supported.

What risks remain and how are they limited?

The main risk is unfavorable price movement and impermanent loss, which rebalancing does not eliminate but only redistributes. We limit them with slippage limits, a minimum fee threshold for triggering, and protection against frequent rebuilds when gas eats up the profit. All parameters are fixed in the configuration and logged.

What happens if the service or network fails?

The position state is stored on the blockchain, so if the bot stops, the funds remain in the contract and are accessible manually. After recovery, the service reconciles the actual state with the expected one and continues from the current point.

A pause mode is provided, in which new operations are not sent, and the position remains under the customer's control.

Let's discuss your rebalancing task

To come back with an estimate and a plan, rather than generalities, we need to understand your configuration: which Uniswap v3 pools you currently hold liquidity in, on which pairs, with which price ranges, and how often you have to reposition them by hand.

This determines what exactly to automate: just shifting the range when the price moves outside the boundaries, or a full loop with recalculating token proportions, accounting for accumulated fees, and protection against slippage during repositioning.

Rebalancing is not a "button" but a set of rules: triggers (price deviation from the range center, share of time out of range, drop in fee share), thresholds at which repositioning pays off, and behavior during sharp market movements.

We analyze your current pools, look at the history, and select parameters so that the position does not "fall" out of range for long and does not burn fees on frequent repositioning.

Describe the task — we will come back with an estimate and a plan. To make the conversation substantive, send us:

  • a list of pools and pairs where liquidity is currently deployed;
  • current price ranges and how often you shift them;
  • goals: maximum fees, keeping the position in range, or reducing manual work;
  • acceptable risk: are you ready for automatic repositioning without confirmation;
  • infrastructure: where the bot will run, whether there is access to a network node and to your wallet;
  • security constraints: who holds the keys, whether multi-signature access is needed;
  • reporting: which metrics you want to see (yield, time in range, number of rebalances).

Based on this, we will describe the architecture, propose a rebalancing strategy for your pools, and come back with a timeline estimate and a work plan.