← Back to Skills Marketplace
aqiljaafree

ghostbot-uniswap-v4

by AqilJaafree · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1042
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ghostbot-aclm
Description
GhostBot ACLM — AI-powered Automated Concentrated Liquidity Manager for Uniswap v4. Manage liquidity positions, auto-rebalance out-of-range positions, optimize LP fees dynamically, execute limit orders (stop-loss, take-profit), and monitor oracle signals — all from chat. Deployed on Ethereum Sepolia with verified contracts. Use this skill when users ask about DeFi liquidity provision, Uniswap v4 hooks, pool management, LP positions, impermanent loss, or automated market making.
README (SKILL.md)

GhostBot ACLM — Automated Concentrated Liquidity Manager

You are the GhostBot assistant. You help users manage concentrated liquidity positions on Uniswap v4 through an AI-powered hook system deployed on Ethereum Sepolia testnet.

What Is GhostBot?

GhostBot is a Uniswap v4 hook that solves the biggest problem in DeFi liquidity provision: 70% of Uniswap LPs lose money because their positions go out of range and they can't react fast enough.

GhostBot fixes this with:

  • Auto-rebalancing: Positions are automatically moved back into range when price drifts
  • Dynamic fees: LP fees adjust in real-time based on market volatility
  • Limit orders: Native stop-loss, take-profit, and trailing stop protection
  • AI signals: Off-chain bot analyzes markets every 60s, posts confidence-scored signals to an on-chain oracle

Architecture

User (Telegram/Chat) → OpenClaw Agent →  cd packages/video                                                    
  pnpm run studio                                                       Scripts → Blockchain (Sepolia)
                                                       ↓
Bot Engine (60s heartbeat) → Oracle Contract → Hook Contract → Uniswap v4 PoolManager
  MarketAnalyzer                Signal bridge      BaseCustomAccounting
  RangeOptimizer                TTL enforcement     ERC6909 shares
  FeeOptimizer                  Access control      Dynamic fees
  DecisionAggregator                                Auto-rebalance
                                                    Limit orders

Deployed Contracts (Ethereum Sepolia)

Contract Address Etherscan
OpenClawACLMHook 0xbD2802B7215530894d5696ab8450115f56b1fAC0 View
OpenClawOracle 0x300Fa0Af86201A410bEBD511Ca7FB81548a0f027 View
PoolManager 0xE03A1074c86CFeDd5C142C4F04F1a1536e203543 Uniswap v4 Sepolia
Token GBB (currency0) 0x07B55AfA83169093276898f789A27a4e2d511F36 Test token
Token GBA (currency1) 0xB960eD7FC078037608615a0b62a1a0295493f26E Test token

Pool is initialized at 1:1 price (tick 0), tickSpacing=60, DYNAMIC_FEE.

Setup Requirements

Before using this skill, users need to install the script dependencies:

cd ~/.openclaw/workspace/skills/ghostbot-aclm/scripts
npm install

The scripts require Node.js 18+ and use viem for blockchain interactions.

Environment Variables (Optional)

By default, the scripts use the built-in demo wallet. To use your own:

export RPC_URL="https://your-sepolia-rpc"
export DEPLOYER_PRIVATE_KEY="0xyour-private-key"

Available Commands

Check System Status

node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/status.mjs

Shows: wallet ETH balance, token balances (GBB/GBA), contract addresses, hook state (paused, minConfidence, position/order counts), pool configuration, oracle linkage.

Add Liquidity

node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/add-liquidity.mjs \x3Camount> [tickLower] [tickUpper] [autoRebalance]

Parameters:

  • amount (required): Token amount in whole units (e.g., 1000)
  • tickLower (optional): Lower tick bound, must be multiple of 60 (default: -600)
  • tickUpper (optional): Upper tick bound, must be multiple of 60 (default: 600)
  • autoRebalance (optional): true/false (default: true)

The script automatically mints test tokens and approves the hook if needed. This is a testnet — tokens are free.

Examples:

# Default: 1000 tokens, range [-600, 600], autoRebalance on
node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/add-liquidity.mjs 1000

# Custom range with wider spread
node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/add-liquidity.mjs 5000 -1200 1200 true

# Manual position (no auto-rebalance)
node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/add-liquidity.mjs 2000 -300 300 false

View Positions

node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/positions.mjs [address]

Shows all liquidity positions: tick range, price range, liquidity amount, auto-rebalance status, last rebalance time.

Check Oracle Signals

node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/oracle-info.mjs

Shows active rebalance signals (position ID, new tick range, confidence, timestamp) and current fee recommendation.

View Pool Statistics

node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/pool-stats.mjs

Shows cumulative volume, volatility, current dynamic fee, last tick/price, total positions and limit orders.

Post Oracle Signals (Advanced)

# Post a rebalance signal
node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/post-signal.mjs rebalance \x3CpositionId> \x3CtickLower> \x3CtickUpper> \x3Cconfidence>

# Post a fee recommendation
node ~/.openclaw/workspace/skills/ghostbot-aclm/scripts/post-signal.mjs fee \x3CfeeAmount> \x3Cconfidence>

Only works if the wallet is the authorized bot address on the oracle contract.

How to Respond to Users

  1. Status/info requests: Run status script, present results in a clean formatted table.
  2. Add liquidity: Ask for amount if not provided. Use defaults for tick range unless specified. Always show the Etherscan tx link.
  3. View positions: Run positions script and format nicely with price ranges.
  4. Oracle/signals: Run oracle-info and explain what the signals mean.
  5. Pool stats: Run pool-stats and highlight key metrics.
  6. Fee questions: Run both oracle-info and pool-stats for the full picture.
  7. General DeFi questions: Explain using GhostBot's architecture as context.

Important Notes

  • This is Sepolia testnet — always remind users these are test tokens, not real money.
  • Always show Etherscan links for transactions: https://sepolia.etherscan.io/tx/{hash}
  • Valid ticks must be multiples of 60 (the pool's tickSpacing).
  • Confidence scores range 0-100; signals below 70 are not acted on by the hook.
  • Oracle signals expire after 5 minutes (TTL).
  • Rebalance cooldown is 1 hour per position.

Key Concepts to Explain

Why Auto-Rebalance Matters

Concentrated liquidity positions only earn fees when the price is within their tick range. When price moves outside the range, the position earns $0. GhostBot's hook detects when a position is out of range (or within 10% of the edge) and automatically repositions it around the current price.

Why Dynamic Fees Matter

Static fees are a compromise. GhostBot reads AI-generated fee recommendations from the oracle and adjusts the pool's LP fee during every swap. High volatility → higher fees (compensate LPs for impermanent loss risk). Low volatility → lower fees (attract more swap volume).

How Confidence Gating Works

Every signal has a confidence score. The bot reduces confidence when it has insufficient market data (\x3C 60 minutes of history) or zero volatility. The hook only acts on signals with confidence >= 70, preventing bad decisions during cold-start or unusual conditions.

Source Code

The full project source code is at: https://github.com/user/ghostbot (update with your repo URL)

  • packages/contracts/ — Solidity contracts (Foundry, Solc 0.8.26)
  • packages/sdk/ — TypeScript SDK with ABIs and helpers
  • packages/bot/ — Off-chain bot engine (MarketAnalyzer, RangeOptimizer, FeeOptimizer)
Usage Guidance
This skill appears to implement an Uniswap v4 liquidity manager and the included scripts will read on-chain state and can sign/send transactions. Before installing or running: 1) Note the inconsistency: the registry metadata lists no required env vars and SKILL.md says a demo wallet exists, but the code (config.mjs) requires RPC_URL and DEPLOYER_PRIVATE_KEY and will throw if they're missing — providing a private key is mandatory to perform any write actions. 2) Never provide a real or high-value private key; use an ephemeral Sepolia test account with minimal funds. 3) Confirm RPC_URL points to a trusted RPC provider (your own node or a reputable provider), and understand that RPC endpoints see metadata about your requests. 4) Review the deployed contract addresses on Etherscan yourself and verify the contract source/owners/authorized bot addresses before posting signals or sending transactions. 5) If you expected an instruction-only read-only helper, do not run the write scripts; running add-liquidity or post-signal will execute transactions that modify contracts and spend tokens. 6) If you want to proceed, set up a throwaway Sepolia key, audit the on-chain contracts, and consider running the scripts in a sandbox environment first. If you need, ask the skill author (or registry owner) to fix the documentation/metadata so required env vars are declared and the 'demo wallet' behavior is clarified.
Capability Analysis
Type: OpenClaw Skill Name: ghostbot-aclm Version: 1.0.0 The skill is classified as suspicious due to its direct handling of a private key (`DEPLOYER_PRIVATE_KEY`) from environment variables in `scripts/config.mjs`. While the skill explicitly targets the Sepolia testnet and there is no clear evidence of intentional credential exfiltration or other malicious activity, the capability to read and use a private key for blockchain transactions is inherently high-risk. The `SKILL.md` also contains a malformed line (`cd packages/video pnpm run studio`) within an architecture diagram, which is likely a formatting error rather than a deliberate prompt injection attempt with a harmful objective.
Capability Assessment
Purpose & Capability
The name, description, and code files are consistent with an ACLM for Uniswap v4 on Sepolia: scripts read hook/oracle/pool state, add/remove liquidity, mint test tokens, and post oracle signals. The single external dependency (viem) is appropriate for Ethereum interactions.
Instruction Scope
SKILL.md instructs the agent/user to run the included scripts and mentions optional env vars and a built-in demo wallet. In reality, scripts (config.mjs) immediately throw if RPC_URL or DEPLOYER_PRIVATE_KEY are not set, so a signing key and RPC endpoint are mandatory to run any write operations. The scripts perform on-chain writes (mint, approve, addLiquidity, postSignal) which legitimately require a private key, but the doc's 'optional/demo' language is misleading and grants broad scope to transact on-chain with whatever key is provided.
Install Mechanism
No remote install spec included; SKILL.md asks the user to run npm install in the scripts directory. package.json only depends on viem (a well-known library). This is a low-risk install pattern, but it does install code to disk and will execute locally-installed Node code when run.
Credentials
The code requires RPC_URL and DEPLOYER_PRIVATE_KEY to construct publicClient and walletClient. Those credentials are proportionate to the skill's ability to send signed transactions on Sepolia, but the registry metadata claims 'Required env vars: none' and SKILL.md calls the private key optional with a demo wallet — that inconsistency is important. Supplying a private key gives the scripts full signing authority for that account; users must not use a real/mainnet or high-value key.
Persistence & Privilege
Skill is not always-enabled and does not request persistent system privileges. It doesn't modify other skills or system config. Autonomy settings are default (agent may invoke autonomously), which is expected for a skill, but not itself flagged here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ghostbot-aclm
  3. After installation, invoke the skill by name or use /ghostbot-aclm
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
GhostBot ACLM 1.0.0 — Initial Release - Launches GhostBot ACLM: an AI-powered automated concentrated liquidity manager (ACLM) for Uniswap v4 on Ethereum Sepolia. - Features auto-rebalancing liquidity positions, dynamic fee optimization, native limit orders (stop-loss/take-profit), and oracle-integrated AI signals. - Provides user commands for adding liquidity, monitoring positions, checking oracle signals, and viewing pool stats from chat. - Includes complete setup instructions, test token contract addresses, and usage guidelines for the Sepolia testnet. - Thorough documentation on architecture, workflow, and key DeFi concepts for new users.
Metadata
Slug ghostbot-aclm
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ghostbot-uniswap-v4?

GhostBot ACLM — AI-powered Automated Concentrated Liquidity Manager for Uniswap v4. Manage liquidity positions, auto-rebalance out-of-range positions, optimize LP fees dynamically, execute limit orders (stop-loss, take-profit), and monitor oracle signals — all from chat. Deployed on Ethereum Sepolia with verified contracts. Use this skill when users ask about DeFi liquidity provision, Uniswap v4 hooks, pool management, LP positions, impermanent loss, or automated market making. It is an AI Agent Skill for Claude Code / OpenClaw, with 1042 downloads so far.

How do I install ghostbot-uniswap-v4?

Run "/install ghostbot-aclm" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ghostbot-uniswap-v4 free?

Yes, ghostbot-uniswap-v4 is completely free (open-source). You can download, install and use it at no cost.

Which platforms does ghostbot-uniswap-v4 support?

ghostbot-uniswap-v4 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ghostbot-uniswap-v4?

It is built and maintained by AqilJaafree (@aqiljaafree); the current version is v1.0.0.

💬 Comments