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.

23 stars

Best use case

uniswap-pool-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using uniswap-pool-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/uniswap-pool-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/jiayaoqijia/cryptoskill/main/skills/defi/uniswap-pool-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/uniswap-pool-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How uniswap-pool-analysis Compares

Feature / Agentuniswap-pool-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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 `L` value 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:

```typescript
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

```typescript
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:

1. Query `tickBitmap` to find initialized ticks
2. For each initialized tick, read `ticks(tickIndex)` to get `liquidityNet`
3. Walk from `MIN_TICK` to `MAX_TICK`, accumulating net liquidity changes
4. 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)

Related Skills

gate-info-trendanalysis

23
from jiayaoqijia/cryptoskill

Trend and technical analysis. Use this skill whenever the user asks for technical or trend analysis of one coin. Trigger phrases include: technical analysis, K-line, RSI, MACD, trend, support, resistance. MCP tools: info_markettrend_get_kline, info_markettrend_get_indicator_history, info_markettrend_get_technical_analysis, info_marketsnapshot_get_market_snapshot.

gate-exchange-marketanalysis

23
from jiayaoqijia/cryptoskill

The market analysis function of Gate Exchange, such as liquidity, momentum, liquidation, funding arbitrage, basis, manipulation risk, order book explainer, slippage simulation. Use when the user asks about liquidity, depth, slippage, buy/sell pressure, liquidation, funding rate arbitrage, basis/premium, manipulation risk, order book explanation, or slippage simulation (e.g. market buy $X slippage). Trigger phrases: liquidity, depth, slippage, momentum, buy/sell pressure, liquidation, squeeze, funding rate, arbitrage, basis, premium, manipulation, order book, spread, slippage simulation.

gate-info-coinanalysis

23
from jiayaoqijia/cryptoskill

Coin comprehensive analysis. Use this skill whenever the user asks to analyze a single coin. Trigger phrases include: analyze, how is, worth buying, look at. MCP tools: info_coin_get_coin_info, info_marketsnapshot_get_market_snapshot, info_markettrend_get_technical_analysis, news_feed_search_news, news_feed_get_social_sentiment.

v3-pools-heyanon

23
from jiayaoqijia/cryptoskill

Safe execution layer for Uniswap V3-style concentrated liquidity across Uniswap, PancakeSwap, WAGMI, and OkuTrade.

uniswap-v4

23
from jiayaoqijia/cryptoskill

Swap tokens and read pool state on Uniswap V4 (Base, Ethereum). Use when the agent needs to: (1) swap ERC20 tokens or ETH via Uniswap V4, (2) get pool info (price, tick, liquidity, fees), (3) find the best pool for a token pair, (4) quote expected swap output via the on-chain V4Quoter, (5) set up Permit2 approvals for the Universal Router, or (6) execute exact-input swaps with proper slippage protection. Supports Base and Ethereum mainnet, plus Base Sepolia testnet. TypeScript with strict types. Write operations need a private key via env var.

uniswap-v4-tools

23
from jiayaoqijia/cryptoskill

Tools for querying V4 pools, swap quotes, and hook-enabled liquidity pools.

uniswap-v4-pools

23
from jiayaoqijia/cryptoskill

Query and execute swaps on Uniswap V4 pools with hook-enabled custom logic and advanced pool configurations.

uniswap-v4-hooks

23
from jiayaoqijia/cryptoskill

Query and execute swaps on Uniswap V4 pools with custom hooks architecture.

uniswap-v4-agent

23
from jiayaoqijia/cryptoskill

Execute swaps and query pool info on Uniswap V4 with hooks support across Ethereum, Base, Arbitrum, and Optimism.

uniswap-v4-agent-hooks

23
from jiayaoqijia/cryptoskill

Toolkit for AI agents to interact with Uniswap V4 hooks and custom pool configurations.

uniswap-swap-simulation

23
from jiayaoqijia/cryptoskill

Simulate and analyze Uniswap swaps including price impact, slippage, optimal routing, and gas estimation. Use when the user asks about swap execution, routing, price impact, or MEV considerations.

uniswap-poolspy

23
from jiayaoqijia/cryptoskill

Track newly created Uniswap liquidity pools across 9 networks. Monitor new token listings and early liquidity events in real-time.