Uniswap Create Test Pool
by @wpank
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.
clawhub install create-test-poolπ About This Skill
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:
1. No Solidity scripting: Creating a V3 pool manually requires calling createAndInitializePoolIfNecessary, computing sqrtPriceX96, calculating tick ranges, approving tokens, and calling mint. This does it all with natural language.
2. Token resolution: Say "WETH/USDC" and it resolves addresses, decimals, and sorts tokens correctly. No need to look up contract addresses.
3. Automatic funding: If the deployer account doesn't have enough tokens, the tool handles whale impersonation to fund the deployment.
4. Price-to-tick conversion: Specify a price like "2000" (USDC per WETH) and the tool computes the correct sqrtPriceX96 and tick range.
5. Edge case testing: Create pools with $100 liquidity to test thin-market behavior, or pools at extreme prices to test boundary conditions.
6. Verification: After deployment, you can immediately query the pool with get_pool_info to confirm state.
When to Use
Activate when the user says anything like:
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
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:
Common liquidity descriptions:
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
createAndInitializePoolIfNecessary which sets the initial price.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 |