Uniswap v3 Concentrated Liquidity Management System
Uniswap v3 allowed LP providers to concentrate liquidity in narrow price ranges—capital efficiency increased 4000x on stablecoin pairs. But a new pain emerged: once the price leaves the range, the position stops earning fees. Imagine you deposited $10k in ETH/USDC, and ETH drops 5%—you earn zero fees until the price returns. Manual monitoring of dozens of positions is impossible, and downtime losses can exceed income. Our team solved this for dozens of projects, from small DeFi protocols to large vault aggregators. For a client with an ETH/USDC pool on Arbitrum, we built a system that reduced position downtime from 30% to 2%.
We have years of experience and have completed over 50 blockchain projects. Our clients save 20% to 35% on fees through automated rebalancing. Below, we break down the technical components required for such a system.
Why automated concentrated liquidity management?
Manually managing ranges on multiple pairs is a sure way to lose money on fees and gas. An automatic rebalancing system solves this. We ensure stable operation and optimal yield by delivering a turnkey solution. Contact us for an audit of your current strategy—we'll propose the best approach.
Mathematics of Concentrated Liquidity: What Your System Needs to Know
Tick architecture and price ranges
In Uniswap v3, price is divided into discrete ticks, each corresponding to a 0.01% price change. A position's range is [tickLower, tickUpper]. The liquidity required depends on the current price relative to the range:
- Price inside range: both tokens needed in a specific proportion
- Price below range: only token1 (quote)
- Price above range: only token0 (base)
This creates amplified impermanent loss: with a narrow range, you quickly end up with a single token when the price passes through. The rebalancing system must account for this when calculating new boundaries.
How to optimally calculate the range?
Range width is a trade-off between fee APR and rebalancing frequency. The formula: gas cost for rebalancing should be no more than 10-15% of collected fees over the period. At $10 gas per rebalancing and 50% APR on a $10k position, rebalancing is permissible roughly every 3-4 hours. The system calculates this dynamically.
| Range Width | Fee APR (high volatility) | Rebalancing Frequency |
|---|---|---|
| ±1% of current price | Very high (10-50x base) | Every few hours |
| ±5% | High (5-15x) | Several times a day |
| ±20% | Moderate (2-5x) | Once every few days |
| Full range (v2 equivalent) | Base | Never |
How to choose a rebalancing strategy?
The choice depends on pair volatility, fee rates, and gas cost. Below we compare three popular approaches.
| Strategy | Complexity | Rebalance Frequency | Best for |
|---|---|---|---|
| Static shift | Low | High | Stable pairs (USD-pegged) |
| Asymmetric split | Medium | Medium | ETH/USDC, WBTC/ETH |
| Adaptive ranges | High | Low | High volatility |
Rebalancing Strategies
Static ranges with automatic shift
The simplest strategy: the range width is fixed (e.g., ±5%), but the center shifts when the price exits the range. Trigger: price reaches 80-90% of the range boundary. Problem: in high volatility, range oscillation occurs—the price quickly crosses boundaries back and forth, each time triggering an expensive rebalance. Solution: a cooldown period between rebalances plus a check that the rebalance is profitable. Our keeper bot processes rebalances 100x faster than manual handling.
Volatile/Base asset split
For pairs like ETH/USDC, an asymmetric approach: main liquidity in a wide range (±20%), additional liquidity in a narrow range around the current price (±2%). The wide range provides constant fees, the narrow range maximizes capital efficiency when the price is stable. At rebalance, only the narrow range is reviewed. This approach is used by Arrakis Finance (PALM) and Gamma Strategies. Implemented via two separate NFT positions in Uniswap v3's NonfungiblePositionManager.
Volatility-adaptive ranges
A more advanced strategy: the range width adapts to historical volatility. During low volatility (stablecoin period)—narrow range. During high volatility—wide range to reduce rebalancing frequency. Volatility is computed via on-chain TWAP delta: we read slot0.sqrtPriceX96 every N blocks and calculate rolling standard deviation. No external oracles required.
System Architecture
On-chain and off-chain components
Vault contract (Solidity): stores positions, manages liquidity, collects fees. Users deposit tokens and receive LP shares (ERC-20). The vault is periodically called by a keeper bot.
Position Manager: a wrapper around INonfungiblePositionManager from Uniswap v3. Encapsulates mint/burn/collect logic for positions inside the Vault.
Keeper (Node.js/TypeScript): an off-chain component that monitors the current price, determines if rebalancing is needed, evaluates gas vs. accumulated fees, and calls rebalance() on the Vault. Runs every N minutes (configurable).
Technical details of keeper architecture
The keeper bot consists of two modules: price monitoring (subscription to Swap events or RPC polling) and transaction executor. For Ethereum we use Flashbots for protected execution; for L2—direct RPC with high speed.
Fee reinvestment: automated collection of accumulated fees via collect() and reinvestment by adding to the position. Done at each rebalance or on a separate schedule.
Integration with Uniswap v3 Periphery
Key contracts for interaction:
-
NonfungiblePositionManager—creating and managing positions -
SwapRouter02—swaps during rebalancing (when the token ratio does not match the target) -
Quoter v2—swap simulation to calculate slippage before execution
During rebalancing, a preliminary swap is often needed: if we closed a position and got 70% token0 / 30% token1, but the new position requires 50/50—we swap the excess. Done via SwapRouter with slippage tolerance computed through Quoter.
How to protect against MEV attacks during rebalancing?
A rebalancing transaction with a large swap is a prime target for MEV bots. For a $100k swap in a rebalance, a sandwich attack can cost 0.5-2% of the amount. Solutions:
- Minimum
amountOutMinimumvia Quoter—limits allowable slippage - Flashbots bundle on Ethereum—hides the transaction from the mempool
- Splitting large swaps into multiple transactions (TWAP swap)
What's Included in Development
We provide a complete package: open-source smart contracts, keeper service, API documentation, tests (Foundry + fork tests), deployment instructions. Optionally—UI dashboard and integration with The Graph. We also conduct audits and offer a 6-month warranty.
Development Process
- Strategy specification (2–3 days). Choose a strategy (static shift / split / adaptive), target pairs, networks, risk parameters.
- Contract development (5–8 days). Vault + Position Manager + tests in Foundry. Fork tests on the real Uniswap v3 mainnet state.
- Keeper service (3–4 days). Node.js + viem, price monitoring, rebalance trigger logic, transaction submission.
- UI (optional, 3–5 days). Dashboard with current positions, APR, pending fees, rebalance history.
- Deployment and support (2–3 days). Deploy contracts, configure keepers, monitor in the first weeks.
Timeline Estimates
A basic system with one strategy for one pair—1 to 1.5 weeks. A multi-strategy vault with adaptive ranges, multi-pool support, and full UI—2 to 3 weeks. Timelines depend on the complexity of the chosen strategy and keeper infrastructure requirements.
For more details, refer to the Uniswap V3 Whitepaper, which describes the underlying tick and position architecture.
Contact us to evaluate your task. Order a turnkey solution and get a ready-made concentrated liquidity management system, saving up to 30% on fees through automation.







