Ghostbot

Openclaw automated concentrated liquidity manager for Uniswap v4

Ghostbot

Created At

HackMoney 2026

Project Description

Openclaw/Clawdbot/Moltbot extra skill GhostBot ACLM — Automated Concentrated Liquidity Manager

The Problem: 70% of Uniswap v3/v4 liquidity providers lose money.
Concentrated liquidity demands constant monitoring — when price drifts outside your tick range, your position earns zero fees while suffering impermanent loss. Most LPs can't watch markets 24/7, and by the time they react, the damage is done.

The Solution: GhostBot is a Uniswap v4 hook that turns passive liquidity into an AI-managed position. An off-chain bot engine runs a 60-second heartbeat cycle — analyzing volatility, computing optimal tick ranges, and calculating dynamic fees. These signals are posted to an on-chain oracle with confidence scores. During every swap, the hook reads the oracle and autonomously rebalances out-of-range positions, adjusts LP fees based on market conditions, and executes limit orders (stop-loss, take-profit, trailing stops). No manual intervention required.

How It Works:

  1. MarketAnalyzer computes rolling 24h volatility and price trend (bullish/bearish/neutral)
  2. RangeOptimizer calculates optimal tick width using volatility-scaled k-factor with trend bias
  3. FeeOptimizer sets dynamic fees (0.01%–1.00%) — higher during volatility, lower during calm
  4. DecisionAggregator gates all signals at 70+ confidence before posting to the oracle
  5. On-chain Hook reads signals during swap callbacks, rebalances positions, and updates fees automatically

Architecture: Three-layer system — TypeScript bot engine → Solidity oracle (signal bridge with 5-min TTL) → Solidity hook (BaseCustomAccounting with ERC-6909 shares). Users interact via Telegram through an OpenClaw AI agent that can add liquidity, check positions, view oracle signals, and monitor pool stats — all from chat.

How it's Made

Built With:

  • Context7 MCP — Up-to-date library docs for Uniswap v4, OpenZeppelin, viem
  • OpenZeppelin Uniswap Hooks MCP — Hook contract scaffolding (BaseCustomAccounting)
  • Foundry — Solidity testing & deployment (forge, cast)
  • Solidity 0.8.26 — Smart contracts (EVM Cancun, via_ir optimizer)
  • Uniswap v4 Core — PoolManager, hooks, ERC-6909
  • OpenZeppelin — Access control, pausable, reentrancy guard
  • TypeScript + tsup — SDK & bot engine
  • viem — Blockchain interactions (RPC, tx signing, ABI encoding)
  • OpenClaw — AI agent gateway with Telegram integration
  • ClawHub — Skill publishing platform
  • Sepolia Testnet — Live deployment & testing
background image mobile

Join the mailing list

Get the latest news and updates