impermanent-loss

Calculate impermanent loss for AMM liquidity pools with Python.

266|54|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/agiprolabs/claude-trading-skills --skill impermanent-loss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: impermanent-loss
Source: https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/impermanent-loss
Command: npx skills add https://github.com/agiprolabs/claude-trading-skills --skill impermanent-loss

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps users understand and quantify the financial risk of impermanent loss (IL) when providing liquidity to Automated Market Maker (AMM) decentralized exchanges.

Core Features & Use Cases

  • Impermanent Loss Calculation: Computes IL for both constant-product and concentrated liquidity pools based on price changes.
  • Breakeven Analysis: Determines the required trading volume and fees to offset expected IL based on volatility.
  • Scenario Modeling: Simulates LP performance over time using Monte Carlo methods to assess profitability probabilities.
  • Use Case: A user considering depositing into a new AMM pool can use this Skill to estimate potential IL under various market conditions and determine if the expected fees are sufficient to make the position profitable.

Quick Start

Use the impermanent-loss skill to calculate the impermanent loss for a 2x price change in a constant-product AMM.

Frequently Asked Questions about impermanent-loss

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate impermanent loss for constant-product and concentrated liquidity AMM pools?

To calculate impermanent loss for AMM pools, this Skill computes IL for both constant-product and concentrated liquidity based on asset price changes. It models LP performance to evaluate the financial risk of providing liquidity.

What is the breakeven trading volume needed to offset impermanent loss in yield farming?

The breakeven volume for yield farming is determined by analyzing asset volatility and fee rates. This Skill calculates the required trading fees and volume to offset expected impermanent loss, helping assess if a position will be profitable.

Can I simulate LP performance over time using Monte Carlo methods for DeFi risk management?

Yes, you can simulate LP performance over time using Monte Carlo methods for DeFi risk management. This Skill simulates various market conditions to assess profitability probabilities and quantify the statistical risk of liquidity provision.

Does this impermanent loss calculator require Python and numpy to run?

Yes, calculating impermanent loss with this Skill requires Python and the numpy dependency. It utilizes Python scripts for the advanced mathematical computations and statistical modeling needed to analyze AMM liquidity provision risks.

When should I not use concentrated liquidity for automated market maker pools?

You should reconsider concentrated liquidity when expected asset volatility makes breakeven fees unlikely. This Skill models impermanent loss under various market conditions to identify when price divergence outpaces fee earnings in AMM pools.