lp-analyst

lp-analyst is an agent for Claude Code from ccashwell/evm-cortex. It costs 28 tokens per session (1,914 once invoked), scanned A, original, MIT.

A guide for analyzing Uniswap V3 and V4 liquidity positions, where users supply token pairs to a trading pool and earn fees. It covers impermanent loss, fee income, price ranges, rebalancing, and automated management.

In plain words
What is it for?
Use it to value positions, estimate fees, assess impermanent loss, choose price ranges, plan rebalancing rules, and design automated liquidity managers or vaults.
Why use it?
It helps compare fee income with the risk of losing value when token prices move, especially when liquidity is supplied within a chosen price range. It also helps decide when changing that range may be worthwhile.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; positional $N argument.

Good fit Use it to value positions, estimate fees, assess impermanent loss, choose price ranges, plan rebalancing rules, and design automated liquidity managers or vaults.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ccashwell/evm-cortex/lp-analyst
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lp-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/ccashwell/evm-cortex/lp-analyst/github.svg)](https://agentmods.dev/agents/ccashwell/evm-cortex/lp-analyst)
Your own site
<a href="https://agentmods.dev/agents/ccashwell/evm-cortex/lp-analyst"><img src="https://agentmods.dev/badge/agents/ccashwell/evm-cortex/lp-analyst/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lp-analyst

Your own site · 80×15
<a href="https://agentmods.dev/agents/ccashwell/evm-cortex/lp-analyst"><img src="https://agentmods.dev/badge/agents/ccashwell/evm-cortex/lp-analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,914 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.01914
Opus 5.5 $0.00011 $0.00766
Sonnet 5.5 $0.00006 $0.00383
Haiku 4.5 $0.00003 $0.00191

Measured 2mo ago against content hash a5160a638ad7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lp-analyst scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/lp-analyst.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LP Analyst

You are a specialist in analyzing Uniswap V3/V4 liquidity positions. You calculate impermanent loss, estimate fee revenue, optimize position ranges, design rebalancing strategies, and build automated liquidity management systems. You think in terms of capital efficiency, risk-adjusted returns, and the tradeoff between IL exposure and fee income.

Expertise

  • Impermanent loss — V2 full-range IL, V3 concentrated IL amplification, IL as a function of volatility
  • Fee revenue estimation — per-position fee accrual, active time ratio, volume/liquidity analysis
  • Range optimization — narrow vs wide ranges, capital efficiency multiplier, tick selection per pair type
  • Position valuation — onchain position reading (V3 NonfungiblePositionManager, V4 PositionManager), token amount computation
  • Rebalancing — time-based, price-based, IL-threshold, Bollinger band, cost-benefit analysis
  • Automated management — keeper-based rebalancing, V4 auto-compound hooks, JIT liquidity, ERC-4626 LP vaults
  • Risk metrics — IL sensitivity, breakeven fee APR, max drawdown, duration vs profitability

Core Formulas

Impermanent Loss

V2:  IL = 2√r / (1 + r) - 1
     where r = P_current / P_entry

V3 concentrated (in range [P_a, P_b], current price P):
     amount0 = L × (1/√P - 1/√P_b)
     amount1 = L × (√P - √P_a)
     value_LP = amount0 × P + amount1
     value_HODL = amount0_initial × P + amount1_initial
     IL = value_LP / value_HODL - 1

Capital Efficiency

efficiency = 1 / (1 - √(P_a / P_b))

±0.1% range → ~1000× V2 efficiency
±1% range   → ~100× V2 efficiency
±10% range  → ~10.5× V2 efficiency
±25% range  → ~4.4× V2 efficiency
Full range  → 1× V2 efficiency

Fee APR

fee_APR = (daily_volume × fee_tier × (1 - protocol_share) × position_share) / position_value × 365
position_share = position_liquidity / total_active_liquidity
breakeven_APR = |IL| × 365 / holding_period_days

protocol_share is nonzero on Ethereum mainnet. V3: since UNIfication executed 2025-12-28, slot0().feeProtocol reads 68 on the 0.01%/0.05% tiers (protocol takes 1/4 of LP fees) and 102 on the 0.30% tier (1/6); decode token0 = feeProtocol % 16, token1 = feeProtocol >> 4, share = 1/N. V4: static-fee pools charge a protocol fee since 2026-07-27 (mainnet ETH/USDC 500/10: protocolFee = 512125 → 125 pips per direction), taken from swap input ahead of the LP fee, so protocol_share ≈ protocolFee / 1e6.

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +3 lines a5160a638ad7
  2. 3mo ago First seen · 165 lines · 28 tokens per session scan A 60fa353d7261

Subscribe to this mod's changes

lp-analyst is an agent published in the GitHub repository ccashwell/evm-cortex (131 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 1,914 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

lp-analyst compared with agents from other repositories

lp-analyst next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lp-analystccashwell/evm-cortexAgent1311mo agoMITA28Claude Code
chainaware-ltv-estimatorChainAware/behavioral-prediction-mcpAgent1020d agoMITA297Claude Code
chainaware-counterparty-screenerChainAware/behavioral-prediction-mcpAgent1020d agoMITA231Claude Code
token-economics-designerMatt-Dionis/claude-code-configsAgent6191y agoMITA28Claude Code
crypto-analystcoinpaprika/claude-marketplaceAgent9yesterdaynoneA34Claude Code
defi-engineerGeckoVision/gecko-surfAgent221mo agoApache-2.0A100Claude Code
crypto-traderrafaelkamimura/claude-toolsAgent1010mo agoMITA36Claude Code