简介
一键部署本地测试网 Uniswap 池,支持自定义流动性、价格范围和费率参数,无需编写 Solidity 即可创建受控测试环境
原始描述
Deploy a custom Uniswap pool on the local testnet with configurable parameters. Create pools with specific conditions (thin liquidity, wide spreads, exact tick ranges) to test agent behavior under controlled scenarios. Requires a running local testnet.
通过你的 Agent 添加
安装目录:create-test-pool/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
create-test-pool 是一项专为 DeFi 开发者与策略研究员设计的测试基础设施工具,旨在通过自然语言指令快速部署定制化 Uniswap 流动性池。该技能将原本需要多步 Solidity 合约交互的复杂流程(计算 sqrtPriceX96、排序 token 地址、初始化池子、铸造 LP NFT)简化为单一命令,显著降低测试环境搭建门槛。
显著优势
自动化工程复杂度:工具自动处理 token 地址解析(支持 "WETH/USDC" 等常用符号)、token0/token1 地址排序、精度换算及价格到 tick 的数学转换。用户只需声明目标价格(如 "ETH $2000"),无需理解底层的 Q64.96 定点数编码。
灵活的边缘场景模拟:支持创建薄流动性池($1,000 级别)测试高滑点行为,或设置极端价格区间验证边界条件。可配置 0.01% 至 1% 的四档费率层级,覆盖主流交易对需求。
集成式资金管理:自动检测并补充部署者账户(Anvil 默认账户 #1)的 token 余额,通过 whale impersonation 解决测试网资金问题,避免手动 faucet 操作中断工作流。
局限性
依赖本地测试网:技能强制要求运行中的本地 fork(Anvil/Hardhat),无法直接操作主网或公共测试网现有池子。若需分析生产环境池状态,应切换至 analyze-pool。
V2 功能受限:Uniswap V2 池固定 0.3% 费率,不支持自定义 tick 范围,高级流动性策略测试必须使用 V3 模式。
预部署池冲突:Fork 主网状态下,常见交易对(如 WETH/USDC 0.05%)可能已存在,工具行为转为向现有池添加流动性而非创建新地址,可能影响隔离性测试需求。
适用人群
- 量化策略开发者:快速验证 MEV 机器人、套利算法在特定流动性深度下的表现
- 智能合约审计员:构造极端市场条件测试边界安全假设
- 前端集成工程师:生成稳定可复现的测试数据用于 UI 组件开发
风险提示
虽然操作限于本地测试环境,但需注意:
- Fork 状态与真实主网存在延迟,价格预言机数据可能陈旧
- 自动资金补充功能可能掩盖合约实际 token 需求,迁移至生产环境前需重新验证经济学假设
- V3 集中流动性模型的无常损失计算复杂度显著高于 V2,测试参数设置需与生产策略保持一致
技能正文
name: create-test-pool description: >- Deploy a custom Uniswap pool on the local testnet with configurable parameters. Create pools with specific conditions (thin liquidity, wide spreads, exact tick ranges) to test agent behavior under controlled scenarios. Requires a running local testnet. model: sonnet allowed-tools:
- mcp__uniswap__deploy_mock_pool
- mcp__uniswap__fund_test_account
- mcp__uniswap__get_pool_info
- mcp__uniswap__search_tokens
Create Test Pool
Overview
Deploys a custom Uniswap pool on the local testnet with exact parameters you specify. This lets you create controlled test environments -- thin liquidity pools, extreme price ranges, specific fee tiers -- to test how agents behave under edge conditions.
Why this is 10x better than doing it manually:
- No Solidity scripting: Creating a V3 pool manually requires calling
createAndInitializePoolIfNecessary, computingsqrtPriceX96, calculating tick ranges, approving tokens, and callingmint. This does it all with natural language. - Token resolution: Say "WETH/USDC" and it resolves addresses, decimals, and sorts tokens correctly. No need to look up contract addresses.
- Automatic funding: If the deployer account doesn't have enough tokens, the tool handles whale impersonation to fund the deployment.
- Price-to-tick conversion: Specify a price like "2000" (USDC per WETH) and the tool computes the correct
sqrtPriceX96and tick range. - Edge case testing: Create pools with $100 liquidity to test thin-market behavior, or pools at extreme prices to test boundary conditions.
- Verification: After deployment, you can immediately query the pool with
get_pool_infoto confirm state.
When to Use
Activate when the user says anything like:
- "Create a WETH/USDC pool with thin liquidity"
- "Deploy a test pool with 0.05% fee"
- "Set up a DAI/USDC pool at 1:1"
- "Create a pool with only $1000 liquidity"
- "Deploy a V2 pair for testing"
- "I need a pool with a narrow tick range"
- "Create a WBTC/WETH pool at the current price"
- "Set up a pool to test high slippage scenarios"
Do NOT use when no testnet is running (use setup-local-testnet first), or when the user wants to interact with existing mainnet pools (use analyze-pool).
Parameters
Parameter
Required
Default
How to Extract
token0
Yes
--
First token: "WETH", "USDC", or a 0x address
token1
Yes
--
Second token: "USDC", "DAI", or a 0x address
version
No
v3
"v2" or "v3"
fee
No
3000
Fee tier: 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%)
initialPrice
No
--
Price of token0 in token1 terms (e.g. 2000 for ETH at $2000)
liquidityUsd
No
1,000,000
Dollar value of initial liquidity
tickLower
No
auto
V3 lower tick (advanced users only)
tickUpper
No
auto
V3 upper tick (advanced users only)
Workflow
Step 1: Verify Testnet is Running
| Parameter | Required | Default | How to Extract |
|---|---|---|---|
| token0 | Yes | -- | First token: "WETH", "USDC", or a 0x address |
| token1 | Yes | -- | Second token: "USDC", "DAI", or a 0x address |
| version | No | v3 | "v2" or "v3" |
| fee | No | 3000 | Fee tier: 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%) |
| initialPrice | No | -- | Price of token0 in token1 terms (e.g. 2000 for ETH at $2000) |
| liquidityUsd | No | 1,000,000 | Dollar value of initial liquidity |
| tickLower | No | auto | V3 lower tick (advanced users only) |
| tickUpper | No | auto | V3 upper tick (advanced users only) |
Step 1: Verify Testnet is Running
If the tool returns TESTNET_NOT_RUNNING, tell the user:
No local testnet is running. Let me set one up first.
Then suggest using setup-local-testnet or offer to do it for them.
Step 2: Extract Parameters
Parse the user's request carefully:
- Token pair: "WETH/USDC", "ETH/DAI", "WBTC/WETH"
- Map "ETH" to "WETH" (Uniswap uses wrapped ETH)
- Fee tier: "0.05% fee" → 500, "0.3%" → 3000, "1%" → 10000, "0.01%" → 100
- Price: "at $2000" → initialPrice: 2000 (for WETH/USDC)
- Liquidity: "thin liquidity" → liquidityUsd: 1000, "$10M" → liquidityUsd: 10000000
- Version: "V2 pair" → version: "v2", default is "v3"
Common liquidity descriptions:
- "thin" / "low" / "shallow" → $1,000 - $10,000
- "moderate" / "normal" → $100,000 - $1,000,000
- "deep" / "high" → $10,000,000+
Step 3: Fund Deployer If Needed
If the pool requires tokens the deployer might not have, call mcp__uniswap__fund_test_account first to ensure the deployer (account #1: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) has sufficient tokens.
Step 4: Deploy the Pool
Call mcp__uniswap__deploy_mock_pool with the extracted parameters.
Step 5: Verify and Present
Present the deployed pool with full details:
Test Pool Deployed
Pool: WETH/USDC (V3, 0.05% fee)
Address: 0xNEW...
Price: 1 WETH = 2,000 USDC
Liquidity: ~$1,000,000
Tick Range: -204714 to -199514 (±50% around current price)
Token0: USDC 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 (6 decimals)
Token1: WETH 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 (18 decimals)
Test Scenarios This Pool Enables:
- Swap testing: "Get a quote for 1 WETH → USDC"
- LP testing: "Add liquidity to the WETH/USDC pool"
- Price impact: "What's the price impact of swapping 100 WETH?"
- Time-dependent: "Advance 7 days and check fee accumulation"
Step 6: Suggest Follow-ups
Next Steps:
- Query pool state: "Get info on pool 0xNEW..."
- Test a swap against this pool
- Create another pool with different parameters
- Advance time to test fee accumulation: "Time travel 7 days"
Important Notes
- Tokens are automatically sorted. Uniswap requires token0 < token1 by address. The tool handles this.
- V3 pools need initialization. The tool calls
createAndInitializePoolIfNecessary which sets the initial price.
- Default tick range is ±50%. If no tick range is specified, liquidity is spread across a wide range around the initial price.
- Deployer is Anvil account #1. The first Anvil default account is used for deployment.
- Pool may already exist on fork. If you fork Ethereum and try to create a WETH/USDC 0.05% pool, it already exists. The tool will add liquidity to the existing pool.
- V2 pools always have 0.3% fee. The fee parameter is ignored for V2.
Error Handling
Error
User-Facing Message
Suggested Action
TESTNET_NOT_RUNNING
"No local testnet is running."
Run setup-local-testnet first
TESTNET_TOKEN_NOT_FOUND
"Cannot resolve token X."
Use a well-known symbol or provide the 0x address
TESTNET_CONTRACT_NOT_FOUND
"NonfungiblePositionManager not found on this chain."
Fork Ethereum mainnet which has all V3 contracts
TESTNET_DEPLOY_POOL_FAILED
"Failed to deploy pool: {reason}"
Check token balances, fund deployer if needed
Next Steps:
- Query pool state: "Get info on pool 0xNEW..."
- Test a swap against this pool
- Create another pool with different parameters
- Advance time to test fee accumulation: "Time travel 7 days"
- Tokens are automatically sorted. Uniswap requires token0 < token1 by address. The tool handles this.
- V3 pools need initialization. The tool calls
createAndInitializePoolIfNecessarywhich sets the initial price. - Default tick range is ±50%. If no tick range is specified, liquidity is spread across a wide range around the initial price.
- Deployer is Anvil account #1. The first Anvil default account is used for deployment.
- Pool may already exist on fork. If you fork Ethereum and try to create a WETH/USDC 0.05% pool, it already exists. The tool will add liquidity to the existing pool.
- V2 pools always have 0.3% fee. The fee parameter is ignored for V2.
Error Handling
Error
User-Facing Message
Suggested Action
TESTNET_NOT_RUNNING
"No local testnet is running."
Run setup-local-testnet first
TESTNET_TOKEN_NOT_FOUND
"Cannot resolve token X."
Use a well-known symbol or provide the 0x address
TESTNET_CONTRACT_NOT_FOUND
"NonfungiblePositionManager not found on this chain."
Fork Ethereum mainnet which has all V3 contracts
TESTNET_DEPLOY_POOL_FAILED
"Failed to deploy pool: {reason}"
Check token balances, fund deployer if needed
| Error | User-Facing Message | Suggested Action |
|---|---|---|
TESTNET_NOT_RUNNING |
"No local testnet is running." | Run setup-local-testnet first |
TESTNET_TOKEN_NOT_FOUND |
"Cannot resolve token X." | Use a well-known symbol or provide the 0x address |
TESTNET_CONTRACT_NOT_FOUND |
"NonfungiblePositionManager not found on this chain." | Fork Ethereum mainnet which has all V3 contracts |
TESTNET_DEPLOY_POOL_FAILED |
"Failed to deploy pool: {reason}" | Check token balances, fund deployer if needed |
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。