Looping?
A price monitoring script that watches ETH/USDC on Base every 2 minutes via a free Alchemy RPC endpoint. It checks your position boundaries against current price and triggers action when needed.
Core bot logic
The four functions the bot executes:
First — range checker. Every 2 minutes: fetch current ETH price, compare to your position's lower and upper tick, if within 5% of either boundary flag for rebalance.
Second — rebalancer. When triggered: remove liquidity from current position, calculate new range centred on current price at ±12%, re-add all liquidity. One transaction sequence on Base costing pennies.
Third — fee collector. Every 7 days regardless of price: collect accumulated fees into your wallet. On Base this is $0.01-$0.05 gas. Fees sit in your wallet not the pool — important distinction.
Fourth — alerting. Every event gets logged and a Telegram message sent to you. Rebalance executed, fees collected, bot error — you know immediately. You're never blind to what the bot is doing.
Monitoring dashboard (Weeks 8-10)
A simple private web dashboard — could be as basic as a Google Sheet auto-populated by the bot, or a lightweight web page — showing:
Current position boundaries Current ETH price vs range Fees earned today, this week, this month Number of rebalances executed Effective APY calculated from real on-chain data Estimated annual income at current rate
Without the bot — ETH drifts outside your ±12% range. You're earning zero. You don't notice for a day or two. By the time you rebalance you've missed fees.
With the bot — the moment ETH approaches the boundary, it resets. You're almost always earning. That's the 88-90% in-range efficiency versus maybe 60-70% manually.
On $100,000 at this pool's average APY — the difference between 70% in-range efficiency and 90% is roughly $16,000 per year in additional fees.
For a bot that costs £2,000 to build and $10 a month to run.
That's the whole story.
What a perfectly optimised bot achieves:
The pool generates a fixed amount of fees from trading volume. That doesn't change. What changes is your share of those fees relative to your capital.
Two variables determine your share:
Concentration — how tight your range is relative to other LPs. Tighter means you own a larger percentage of the active liquidity at the current price. More of every fee goes to you.
In-range time — what percentage of time you're actually earning. 95% in-range efficiency versus 70% is the difference between capturing nearly all the potential yield or losing a third of it.
A well-programmed bot with the time-confirmation logic maximises both simultaneously. Tightest viable range. Highest achievable in-range efficiency.
What else the bot could do:
This is where it gets genuinely interesting. Once you have the infrastructure — a server running 24/7, connected to Base via Alchemy, watching on-chain data — you're not limited to just rebalancing. The same foundation supports a much broader capability set.
Capability 1 — Multi-position management
Right now we've talked about one position. The bot can manage multiple positions simultaneously — your personal position, client A's position, client B's position — all from the same script. Each position gets its own parameters. Different range widths, different capital sizes, different rebalancing thresholds. One bot, multiple clients. The marginal cost of adding a client position is essentially zero.
Capability 2 — Dynamic range adjustment based on volatility
Instead of a fixed ±8% range regardless of market conditions, the bot measures recent ETH volatility and adjusts the range width automatically:
Low volatility period — tighten to ±5% for maximum yield capture High volatility period — widen to ±15% to avoid constant rebalancing Extreme volatility — exit position entirely and alert you This is a more sophisticated version of what you're already doing manually with macro awareness — automated into the bot itself.
Capability 3 — Macro signal monitoring
Remember the global liquidity dashboard we discussed earlier in this conversation — the one parked as agenda item 1? The bot can monitor those signals programmatically:
Fetch ETH borrow rates from Aave API — rising rates signal speculative demand returning Monitor stablecoin supply growth via DeFiLlama API Track BTC dominance via CoinGecko API When pre-configured thresholds are crossed — send you an alert saying "bull signal detected — consider exiting LP" This is your manual macro framework partially automated. The bot doesn't make the exit decision — you do — but it watches the signals for you continuously and flags when conditions change.
Capability 4 — Performance reporting
Every Sunday morning the bot sends you a Telegram message with:
Number of rebalances executed Projected annual income at current run rate Per-client breakdown if managing multiple positions This is the report you show clients. Automated, accurate, on-chain verifiable.
Capability 5 — Emergency exit
If ETH drops more than a configurable threshold — say 20% in 24 hours — the bot sends an urgent alert and optionally executes a full position exit automatically, converting everything back to USDC. You configure whether the bot acts automatically or just alerts you. For client positions you probably want alert-only. For your own position you might want auto-exit below a certain threshold.
Capability 6 — Fee optimisation
The bot tracks gas prices on Base and times fee collection and compounding transactions to the cheapest moments. On Base this is mostly irrelevant given penny costs — but it's a trivial addition that shows clients the system is optimised at every level.
Capability 7 — Multi-pool capability
The same bot architecture works on any Uniswap V3 pool on any EVM chain. Once built for WETH/USDC on Base — pointing it at a different pool is changing a few configuration parameters. If you identify another high-performing pool — Arbitrum, Optimism, or a new opportunity — the bot infrastructure is already there.
Capability 8 — Client dashboard API
The bot logs all its activity to a database. A simple web dashboard reads from that database and displays each client's real-time position data. Not a manual spreadsheet — a live system. Position value, fees earned today, APY, rebalance history. This is what a professional product looks like versus a manual operation.