impermanent-loss-calculator

impermanent-loss-calculator is a skill for Claude Code, Codex from nirholas/three.ws. It costs 31 tokens per session (901 once invoked), scanned A, original, Apache-2.0.

A calculator for impermanent loss, the difference between providing tokens to an automated market maker and simply holding them. It estimates the result for different price changes and pool types.

In plain words
What is it for?
Use it to calculate percentage and dollar losses, compare liquidity-provider returns with holding, and test price scenarios for a token pair.
Why use it?
It helps you see how changes in the relative token prices can reduce an LP position’s value compared with holding the tokens. This makes the risk easier to judge before adding liquidity.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to calculate percentage and dollar losses, compare liquidity-provider returns with holding, and test price scenarios for a token pair.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nirholas/three.ws/impermanent-loss-calculator
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.

Any agent
npx skills add nirholas/three.ws --skill impermanent-loss-calculator
Clone the repo
git clone --depth 1 https://github.com/nirholas/three.ws

Made for: Claude Code, Codex.

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 impermanent-loss-calculator

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirholas/three.ws/impermanent-loss-calculator/github.svg)](https://agentmods.dev/skills/nirholas/three.ws/impermanent-loss-calculator)
Your own site
<a href="https://agentmods.dev/skills/nirholas/three.ws/impermanent-loss-calculator"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/impermanent-loss-calculator/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 impermanent-loss-calculator

Your own site · 80×15
<a href="https://agentmods.dev/skills/nirholas/three.ws/impermanent-loss-calculator"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/impermanent-loss-calculator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 901 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00031 $0.00901
Opus 5.5 $0.00012 $0.00360
Sonnet 5.5 $0.00006 $0.00180
Haiku 4.5 $0.00003 $0.00090

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

Security

Grade A, and why

impermanent-loss-calculator 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.

data/skills/defi/impermanent-loss-calculator/SKILL.md · 96 lines

How it starts

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

Impermanent Loss Calculator

When to use this skill

Use when the user asks about:

  • Calculating impermanent loss for a liquidity position
  • Understanding how IL works mechanically
  • Comparing LP returns vs holding
  • Estimating IL for various price scenarios
  • Deciding whether to provide liquidity based on IL risk

Explanation Framework

1. Gather Position Details

Collect from the user:

  • Token pair: The two assets in the pool (e.g., ETH/USDC)
  • Entry prices: Price of each token when liquidity was provided
  • Current prices: Price of each token now (or target scenario prices)
  • Pool type: Constant product (50/50), concentrated liquidity, or weighted
  • Position value: Total USD value deposited

2. Impermanent Loss Formula

For a standard constant product AMM (50/50 pool):

IL = 2 * sqrt(r) / (1 + r) - 1

Where r = (new price / entry price) of one token relative to the other.

Present IL as both:

  • A percentage loss relative to holding
  • An absolute dollar amount based on position size

3. Scenario Table

Generate a table showing IL at various price divergence levels:

Price Change Price Ratio (r) IL % IL on $10K Position
0% 1.00 0.00% $0
+/- 10% 1.10 or 0.91 -0.11% -$11
+/- 25% 1.25 or 0.80 -0.60% -$60
+/- 50% 1.50 or 0.67 -2.02% -$202
+/- 75% 1.75 or 0.57 -3.77% -$377
+/- 100% 2.00 or 0.50 -5.72% -$572
+/- 200% 3.00 or 0.33 -13.40% -$1,340
+/- 400% 5.00 or 0.20 -25.46% -$2,546

Customize the table with the user's actual position size.

4. Break-Even Analysis

Calculate how much fee income is needed to offset IL:

  • Required daily fee income = IL amount / days in position
  • Compare against actual or estimated pool fee APR
  • Determine the break-even time horizon
  • State clearly whether the current fee rate covers the IL

5. Concentrated Liquidity Adjustments

For concentrated liquidity positions (Uniswap V3, etc.):

  • IL is amplified inversely proportional to the range width
  • A position concentrated in a ±10% range has roughly 10x the IL of a full-range position at the same price move
  • If price exits the range, the position becomes 100% one token (maximum IL for that range)
  • Factor in capital efficiency gains — narrower ranges earn proportionally more fees

Read the full file on GitHub · 96 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 First seen · 96 lines · 31 tokens per session scan A b349079ba20f

Subscribe to this mod's changes

impermanent-loss-calculator is a skill published in the GitHub repository nirholas/three.ws (287 stars, last pushed yesterday), licensed Apache-2.0. It adds 31 tokens to every session and 901 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-09-03.

Related

impermanent-loss-calculator compared with skills from other repositories

impermanent-loss-calculator next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
impermanent-loss-calculatornirholas/three.wsSkill287yesterdayApache-2.0A31Claude Code, Codex
pay-x402-servicenirholas/x402-payments-mcpSkill919d agoApache-2.0A51Claude Code
x402-proxycascade-protocol/x402-proxySkill104d agoApache-2.0A98Claude Code, Codex
birdeyesendaifun/skillsSkill1284mo agoApache-2.0A64Claude Code, Codex
granite-pay-per-callnirholas/ibm-x402-mcpSkill919d agoApache-2.0A49Claude Code
gblin-agent-treasurygblinproject/gblin-treasury-risk-regimeSkill111d agoMITA133Claude Code
pump-fee-systemnirholas/pump-fun-sdkSkill1523d agononeA39Claude Code, Codex