Uniswap Pool Analysis
Analyze Uniswap pool data including liquidity distribution, fee tiers, tick ranges, and TVL. Use when the user asks about pool metrics, liquidity analysis, or wants to query on-chain pool state.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 648 · 2 current installs · 2 all-time installs
by@wpank
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The name/description and the instructions align: the SKILL.md describes reading Uniswap pool state (slot0, liquidity, ticks) via viem and computing distributions — all appropriate for a 'Uniswap Pool Analysis' skill. Nothing in the task appears unrelated to pool analysis.
Instruction Scope
The runtime instructions explicitly use process.env.ETHEREUM_RPC_URL and recommend using a shared 'packages/common/' chain config and subgraph endpoints. However the skill declares no required env vars or config paths. The SKILL.md therefore directs the agent to access environment variables and repository-local configuration that are not announced — this is scope creep and could cause the agent to read secrets or local files unexpectedly.
Install Mechanism
This is instruction-only with no install spec or code files, so there is no installer-writing-to-disk risk from the published bundle. Note: README contains example npx install commands pointing at a GitHub path and 'clawhub' which would pull external code if the user follows them — that is external to the published skill and should be audited separately.
Credentials
The SKILL.md expects an ETHEREUM_RPC_URL and mentions RPC URLs, subgraph endpoints, and shared chain config, but requires.env is empty and no primary credential is declared. Requesting an RPC URL (often a secret if using a paid provider) is reasonable for the purpose, but the omission of any declared env requirements is an incoherence that could lead to silent attempts to read environment variables or fallback to user/system defaults.
Persistence & Privilege
The skill does not request persistent/always-on presence (always: false) and does not attempt to modify other skills or system config in the published content. Autonomous invocation is allowed by platform default, which is normal; there are no extra privilege requests in the bundle.
What to consider before installing
This skill appears to do what it says (on-chain Uniswap pool analysis) but there are a few inconsistencies you should resolve before installing or running it:
- SKILL.md reads process.env.ETHEREUM_RPC_URL but the skill does not declare any required environment variables. Decide which RPC provider you will use and whether that URL is OK to supply (do not provide private keys or account secrets). Prefer read-only public RPC endpoints or carefully scoped provider keys.
- The instructions reference a local 'packages/common/' chain config and subgraph endpoints. Verify whether that config exists in your environment or in the external repository referenced by the README; otherwise the agent may try to read files that aren't present.
- The README shows example install commands that fetch code from a GitHub repo and via 'clawhub' — if you follow those, audit the remote repo before running any installer (it may contain code not present in this published bundle).
- If you want to use this skill, ask the publisher to update requires.env to declare ETHEREUM_RPC_URL (and any other needed endpoints), or provide clear guidance on safe default endpoints. Also request clarification about the 'packages/common/' dependency.
Confidence: medium — the core functionality is coherent, but missing declarations around network endpoints/config are non-trivial and could cause unexpected environment access if not clarified.Like a lobster shell, security has layers — review code before you run it.
Current versionv0.1.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Uniswap Pool Analysis
Overview
This skill covers querying and analyzing Uniswap v3/v4 pool state on-chain using viem.
Key Concepts
- sqrtPriceX96: Encoded price format used by Uniswap v3/v4. Convert with
price = (sqrtPriceX96 / 2^96)^2 - Ticks: Discrete price points defining liquidity ranges. Tick spacing depends on fee tier.
- Liquidity: The
Lvalue representing active liquidity at the current tick.
Fee Tiers (v3)
| Fee (bps) | Tick Spacing | Typical Use |
|---|---|---|
| 1 (0.01%) | 1 | Stablecoin pairs |
| 5 (0.05%) | 10 | Correlated pairs |
| 30 (0.30%) | 60 | Standard pairs |
| 100 (1.00%) | 200 | Exotic pairs |
Querying Pool State
Use the Uniswap v3 Pool ABI to read on-chain state:
import { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";
const client = createPublicClient({
chain: mainnet,
transport: http(process.env.ETHEREUM_RPC_URL),
});
// Read slot0 for current price and tick
const [
sqrtPriceX96,
tick,
observationIndex,
observationCardinality,
observationCardinalityNext,
feeProtocol,
unlocked,
] = await client.readContract({
address: poolAddress,
abi: poolAbi,
functionName: "slot0",
});
// Read liquidity
const liquidity = await client.readContract({
address: poolAddress,
abi: poolAbi,
functionName: "liquidity",
});
Price Conversion
function sqrtPriceX96ToPrice(
sqrtPriceX96: bigint,
decimals0: number,
decimals1: number,
): number {
const price = Number(sqrtPriceX96) / 2 ** 96;
return (price * price * 10 ** decimals0) / 10 ** decimals1;
}
function tickToPrice(
tick: number,
decimals0: number,
decimals1: number,
): number {
return (1.0001 ** tick * 10 ** decimals0) / 10 ** decimals1;
}
Liquidity Distribution
To analyze liquidity distribution across ticks:
- Query
tickBitmapto find initialized ticks - For each initialized tick, read
ticks(tickIndex)to getliquidityNet - Walk from
MIN_TICKtoMAX_TICK, accumulating net liquidity changes - Plot cumulative liquidity vs price for the distribution
Multi-chain Support
Always accept a chainId parameter. Use the shared chain config from packages/common/ to resolve:
- RPC URL
- Pool factory address
- Quoter address
- Subgraph endpoint (if available)
Files
2 totalSelect a file
Select a file to preview.
Comments
Loading comments…
