lp-analyst

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

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.

agentmods
npx agentmods add agents/ccashwell/evm-cortex/lp-analyst
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex
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,659 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00028 $0.01659
Opus 5 $0.00014 $0.00830
Sonnet 5 $0.00006 $0.00332
Haiku 4.5 $0.00003 $0.00166

Measured 2d ago against content hash 60fa353d7261, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 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  → ~5× V2 efficiency
Full range  → 1× V2 efficiency

Fee APR

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

IL Sensitivity (for small price changes)

dIL/dP ≈ -σ²t/8   (continuous approximation)
For 50% ETH volatility over 1 year: IL ≈ -0.5² × 1/8 = -3.125%

Read the full file on GitHub · 165 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. 2d 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 (127 stars, last pushed 22d ago), licensed MIT. It adds 28 tokens to every session and 1,659 once invoked, about $0.0001 per session on Opus 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

Other agents, from other repositories

market-monitor

Real-time crypto market intelligence. Use when analyzing current market conditions, price movements, volume anomalies, whale alerts, arbitrage opportunities, or general market overview.

hugoguerrap/crypto-claude-desk · 34 tokens

chainaware-lending-risk-assessor

Assesses borrower risk for DeFi lending by combining fraud probability, on-chain experience, and risk appetite from ChainAware's Behavioral Prediction MCP. Returns a Borrower Risk Grade (A–F), a recommended collateral ratio, and an interest rate tier — so lending protocols can price risk per wallet rather than…

ChainAware/behavioral-prediction-mcp · 249 tokens

chainaware-ltv-estimator

Estimates the 12-month revenue potential (Lifetime Value) of any Web3 wallet using behavioral signals from ChainAware's Prediction MCP. Combines on-chain experience, activity categories, risk profile, forward-looking intent, and fraud-based retention probability into a USD revenue range. Use this agent PROACTIVELY…

ChainAware/behavioral-prediction-mcp · 297 tokens

chainaware-rwa-investor-screener

Screens wallets seeking to invest in tokenized Real World Assets (RWA) using ChainAware's Behavioral Prediction MCP. Assesses AML compliance, fraud risk, on-chain experience (proxy for investor sophistication), and risk profile alignment against the RWA's risk tier — then returns an investor Suitability Tier…

ChainAware/behavioral-prediction-mcp · 318 tokens

lightning-dev

Use when working on Lightning Network, LDK Node, payment routing, channel management, BOLT11, keysend, L402, or peer connection code. Specialist in LDK Node v0.7.0 Python bindings and the SaturnZap wallet core.

lqwdtech/SaturnZap · 52 tokens

04-dashboard-portfolio-watchlist

You are working on crypto-vision dashboard (apps/dashboard/, Next.js 15). The app already has full implementations for portfolio tracking, watchlist management, and price alerts in the lib layer.

nirholas/crypto-vision · 0 tokens