Use this skill when the user wants to deploy a Uniswap V4 hook and launch a new V4 pool with liquidity in one flow, or asks things like 'create a V4 pool', 'deploy a hook and launch a pool', 'launch ETH/USDC V4 pool', 'deploy V4 pool with my tokens', 'create a new Uniswap V4 pool from scratch', 'set up a V4 LP from zero'. Executes the full 3-step V4 pool launch: (1) deploy hook via CREATE2 factory, (2) initialize pool via PoolManager, (3) mint LP position via PositionManager — all via onchainos wallet contract-call with no private key required. Integrates Uniswap AI liquidity-planner for range calculation and viem-integration for calldata encoding.
Full 3-step Uniswap V4 pool deployment in one skill — deploy hook → initialize pool → mint LP position — all executed via onchainos wallet contract-call with no private key needed.
We ran this exact flow during the XLayer Skills hackathon:
| Step | TX | Details |
|---|---|---|
| Hook deployed | 0x2372...6db6 | CREATE2, afterInitialize flag |
| Pool initialized | 0xe228...2e37 | ETH/USDC 0.30% on Base |
| LP minted |
0x0d8a...9711 |
| NFT #2159266, 0.00041 ETH |
| Hook address | 0xA5F8bdB306774B6068aC8e73eAAd53B3649d5000 | Base mainnet |
| Pool ID | 0xf13ad8e1...8b77f | ETH/USDC + XLayerHook |
When the user invokes this skill, collect these params (ask only for missing ones):
| Param | Description | Example |
|---|---|---|
token0 | First token address or symbol (sorted lower address) | ETH / 0x0000...0000 |
token1 | Second token address or symbol (sorted higher address) | USDC / 0x8335... |
amount | How much to deposit | 0.001 ETH / $5 / 50 USDC |
chain | Target chain | base / arbitrum / ethereum |
| Param | Description | Default |
|---|---|---|
fee_tier | Pool fee tier | 0.30% (3000) |
range_type | tight / medium / wide / single-eth / single-usdc | medium |
price_lower | Manual lower price bound (overrides range_type) | auto-calculated |
price_upper | Manual upper price bound (overrides range_type) | auto-calculated |
hook_address | Reuse existing hook (skip deploy step) | deploy new |
"launch ETH/USDC V4 pool on Base with 0.001 ETH"
→ token0=ETH, token1=USDC, amount=0.001 ETH, chain=base, fee=0.30%, range=medium
"create a tight range USDC/WBTC pool on Arbitrum, deposit $20 USDC"
→ token0=USDC, token1=WBTC, amount=20 USDC, chain=arbitrum, fee=0.05%, range=tight
"deploy V4 pool for my token 0xabc... paired with ETH, wide range, 0.01 ETH"
→ token0=ETH, token1=0xabc..., amount=0.01 ETH, chain=base, fee=1%, range=wide
"use our existing hook 0xA5F8... and add 0.0005 ETH to the ETH/USDC pool"
→ skip hook deploy, skip pool init if exists, just mint LP
Read
../okx-agentic-wallet/_shared/preflight.md. If that file does not exist, read_shared/preflight.mdinstead.
| Chain | Chain ID | PoolManager | PositionManager | CREATE2 Factory |
|---|---|---|---|---|
| Base | 8453 | 0x498581fF718922c3f8e6A244956aF099B2652b2b | 0x7C5f5A4bBd8fD63184577525326123B519429bDc | 0x4e59b44847b379578588920cA78FbF26c0B4956C |
| Ethereum | 1 | 0x000000000004444c5dc75cB358380D2e3dE08A90 | 0x7C5f5A4bBd8fD63184577525326123B519429bDc | 0x4e59b44847b379578588920cA78FbF26c0B4956C |
| Arbitrum | 42161 | 0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32 | 0xd88E1F408CF6E5A2793D01e2aB00aB9E097E0f56 | 0x4e59b44847b379578588920cA78FbF26c0B4956C |
Parse user input → fill defaults → show plan:
V4 Pool Launch Plan
──────────────────────────────────────────────────
Pair: ETH / USDC
Chain: Base (8453)
Fee tier: 0.30% (tick spacing: 60)
Amount: 0.001 ETH
Range type: medium (±1.5× weekly volatility)
Steps:
[1] Deploy XLayerHook via CREATE2 ~$0.016
[2] Initialize ETH/USDC pool ~$0.004
[3] Mint LP position ~$0.007
─────────────────────────────────────────────
Total gas est: ~$0.027
Wallet: 0x6924...e406
──────────────────────────────────────────────────
Check balance:
onchainos wallet balance --chain <chainId>
If ETH < (amount + $0.05 gas buffer): stop, show funding instructions.
# Fetch current price
onchainos market price --chain <chainId> --address <token0_address>
# Fetch 30d kline for volatility
onchainos market kline --chain <chainId> --address <token0_address> --bar 1D --limit 30
daily_returns = [(close[i] - close[i-1]) / close[i-1] for i in range(1, 30)]
daily_vol = std_dev(daily_returns)
weekly_vol = daily_vol × sqrt(7)
# Range presets (user picks or default = medium)
range_multipliers = {
"tight": 0.5, # ±3-5%
"medium": 1.5, # ±8-15%
"wide": 3.0, # ±20-40%
"single-eth": None, # range entirely above current (ETH only)
"single-usdc": None, # range entirely below current (USDC only)
}
if range_type == "single-eth":
price_lower = currentPrice × 1.02
price_upper = currentPrice × 1.25
elif range_type == "single-usdc":
price_lower = currentPrice × 0.75
price_upper = currentPrice × 0.98