---
name: analyzing-liquidity-pools
description: 'Analyze DEX liquidity pools for TVL, volume, fees, impermanent loss, and LP profitability.

  Use when analyzing liquidity pools, calculating impermanent loss, or comparing DEX pools.

  Trigger with phrases like "analyze liquidity pool", "calculate impermanent loss", "LP returns", "pool TVL", "DEX pool metrics", or "compare pools".'
allowed-tools: Read, Write, Bash(crypto:liquidity-*)
version: 1.24.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
  - crypto
  - analyzing-liquidity
compatibility: Designed for Claude Code
title: analyzing-liquidity-pools
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools
last_updated: 2026-10-23T05:08:30.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [ARD.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/ARD.md), [config/settings.yaml](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/config/settings.yaml), [PRD.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/PRD.md), [references/errors.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/references/errors.md), [references/examples.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/references/examples.md), [references/implementation.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/references/implementation.md), [scripts/formatters.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/scripts/formatters.py), [scripts/il_calculator.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/scripts/il_calculator.py), [scripts/pool_analyzer.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/scripts/pool_analyzer.py), [scripts/pool_fetcher.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/scripts/pool_fetcher.py), [scripts/pool_metrics.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/scripts/pool_metrics.py).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/analyzing-liquidity-pools`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/analyzing-liquidity-pools`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/analyzing-liquidity-pools --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/analyzing-liquidity-pools --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Analyzing Liquidity Pools

## Overview

Analyze DEX liquidity pools across Uniswap, Curve, and Balancer to evaluate TVL, trading volume, fee income, and impermanent loss risk. Compare pools across protocols and chains to identify optimal LP opportunities.

## Prerequisites

- Python 3.8+ installed
- Internet access for subgraph/API queries
- Understanding of liquidity providing concepts (IL, fee tiers, TVL)

## Instructions

1. **Analyze a specific pool** by address or token pair:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --pool 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --pair ETH/USDC --protocol uniswap-v3
   ```

2. **Calculate impermanent loss** for a price change:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --il-calc --entry-price 2000 --current-price 3000  # 2000/3000 = ETH price at entry/now in USD
   ```

   Project IL for various scenarios:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --il-scenarios --token-pair ETH/USDC
   ```

3. **Estimate LP returns** with fee APR and position projections:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --pool [address] --detailed
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --pool [address] --position 10000  # 10000 = LP position size in USD
   ```

4. **Compare pools** across protocols or fee tiers:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --compare --pair ETH/USDC --protocols uniswap-v3,curve,balancer
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --compare --pair ETH/USDC --fee-tiers 0.05,0.30,1.00
   ```

5. **Export results** to JSON or CSV:

   ```bash
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --pool [address] --format json --output pool_analysis.json
   python ${CLAUDE_SKILL_DIR}/scripts/pool_analyzer.py --compare --pair ETH/USDC --format csv --output pools.csv
   ```

## Output

Pool analysis reports include chain, TVL, 24h volume, fee tier, fee APR, volume/TVL ratio, and token composition with current price. Impermanent loss reports show IL percentage, dollar impact, HODL vs LP value comparison, and breakeven analysis with days-to-recover based on fee income.

See [`references/implementation.md`](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/references/implementation.md) for detailed output format examples.

## Error Handling

| Error | Cause | Fix |
|-------|-------|-----|
| Pool not found | Wrong address or chain | Verify address and target chain |
| Subgraph timeout | API latency or downtime | Uses cached data with warning |
| Invalid pair | Unsupported protocol | Check supported protocols list |

## Examples

**Analyze top ETH/USDC pool** - Full TVL, volume, and fee breakdown on Uniswap V3:

```bash
python pool_analyzer.py --pair ETH/USDC --protocol uniswap-v3 --chain ethereum
```

**Calculate IL for 2x price increase** - See dollar impact vs holding:

```bash
python pool_analyzer.py --il-calc --entry-price 100 --current-price 200  # 100/200 = token price at entry/now in USD
```

**Compare Uniswap fee tiers** - Find optimal fee tier for ETH/USDC:

```bash
python pool_analyzer.py --compare --pair ETH/USDC --fee-tiers 0.05,0.30,1.00
```

**Export all ETH pairs** - Dump pool data for further analysis:

```bash
python pool_analyzer.py --token ETH --format json --output eth_pools.json
```

## Resources

- The Graph: https://thegraph.com/ - Subgraph queries
- Uniswap Info: https://info.uniswap.org/ - Pool explorer
- DeFiLlama: https://defillama.com/ - TVL data
- [`references/implementation.md`](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/analyzing-liquidity-pools/references/implementation.md) - Detailed output formats, configuration, cross-protocol comparison guide
