# Impermanent Loss

> Calculate Impermanent Loss (IL) for Liquidity Provider positions.

- Skill: `jiayaoqijia/impermanent-loss` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add jiayaoqijia/impermanent-loss`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jiayaoqijia/impermanent-loss/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jiayaoqijia (https://skillmd.com/u/jiayaoqijia)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jiayaoqijia/impermanent-loss

---


# Impermanent Loss Calculator

A financial utility that helps agents quantify the risk of providing liquidity. It calculates the divergence loss experienced when the price ratio of pooled tokens changes.

## Quick Start

```python
# Calculate IL if one token doubles in price (200% or 2.0x ratio change)
il_data = await agent.run_tool(
    "il_calc",
    price_change_ratio=2.0
)
print(il_data)
```

## Scripts

| Script | Purpose |
|--------|---------|
| [il_calc.py](scripts/il_calc.py) | Mathematical calculator for IL scenarios |

## Best Practices

1. Use to audit active LP positions.
2. Combine with 'Yield Calculator' to see if trading fees cover the IL.

