AGENT SKILL

uniswap-v4-hooks

Find a Uniswap v4 hook for a problem, read its parameters and limitations, and decode what any hook address will do, using the HookForge MCP server or TypeScript SDK. Use when designing or reviewing a v4 pool with hooks.

License 许可
Apache-2.0
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
uniswap-v4-hooks
description
Find a Uniswap v4 hook for a problem, read its parameters and limitations, and decode what any hook address will do, using the HookForge MCP server or TypeScript SDK. Use when designing or reviewing a v4 pool with hooks.

02 资源文件 4

03 SKILL.md 正文

HookForge

HookForge is a catalogue of Uniswap v4 hooks (Solidity + Foundry) with a TypeScript SDK and an MCP server. The packages @hookforge/mcp and @hookforge/sdk are not on npm, so run them from a clone of https://github.com/nirholas/hookforge. Node 20 or newer.

Build the MCP server

git clone https://github.com/nirholas/hookforge && cd hookforge
npm install
npm run build -w @hookforge/registry
npm run build -w @hookforge/mcp
claude mcp add hookforge -- node "$PWD/packages/mcp/dist/server.js"

No API key and no network access are needed. The catalogue ships inside the package.

MCP tools

Tool Use
search_hooks Describe the problem in plain language, get ranked hooks with the matched terms. Start here.
list_hooks The whole catalogue, filterable by tag, family or chain.
get_hook One hook in full: mechanism, prior art, limitation, parameters, permissions, errors, addresses.
decode_hook_address Which callbacks Uniswap will invoke for any hook address, decoded offline from the address bits.
get_deployment A hook's address on a chain plus that chain's PoolManager.
list_chains Chains with a known v4 PoolManager and their ids.

Always read the limitation field from get_hook before recommending a hook. Absence from the catalogue only means HookForge did not publish that hook, not that it is unsafe.

SDK (packages/sdk, built on viem)

import { describePool, findHooks, hookAddress, loadManifest, dynamicFeePoolKey, poolId, permissionsFromAddress } from "@hookforge/sdk";

findHooks({ tag: "mev", chainId: 8453 });           // MEV hooks deployed on Base
hookAddress("depeg-shield", 42161);                  // address on Arbitrum One
const manifest = await loadManifest("depeg-shield"); // manifest.configure.fields, manifest.limitation
const key = dynamicFeePoolKey(tokenA, tokenB, 60, hookAddress("arb-tax-decay", 8453));
const id = poolId(key);                              // matches PoolIdLibrary.toId

describePool(client, poolKey) takes a viem public client and returns pool id, hook identity and catalogue entry for any v4 pool. identifyHook(client, address) reads IHookMetadata (hookName, hookVersion, specURI, hookTags). permissionsFromAddress(address) works offline. formatFee(pips) turns 3000 into "0.30%".

Contracts

npm run contracts:build   # forge build --root contracts
npm run contracts:test    # forge test --root contracts

Worked example

Ask the agent: "my pool gets drained during a stablecoin depeg". Call search_hooks with that sentence, then get_hook on the top slug, read limitation and configure.fields, then get_deployment for the target chain.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81