Skip to main content
Glama

calculate_impermanent_loss

Calculate impermanent loss for 50/50 liquidity pools by comparing value changes between tokens, showing USD and percentage losses with net gain/loss including trading fees at different APY levels.

Instructions

Calculate exact impermanent loss for a 50/50 LP pair.

Given price change percentages for both tokens, calculates exact IL in USD and percentage. Also returns: value if held vs value in LP, and net gain/loss including trading fees at various APY levels (5%, 10%, 20%, 50%).

ALWAYS FREE — pure math, no API call needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_a_price_changeYes
token_b_price_changeYes
investment_amountNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it's a calculation tool ('pure math'), has no cost ('ALWAYS FREE'), requires no external calls ('no API call needed'), and describes what it returns (IL in USD/percentage, value comparisons, net gain/loss with fees). It doesn't mention error handling or performance characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Perfectly front-loaded with the core purpose first, followed by supporting details in logical order. Every sentence earns its place: first states what it calculates, then explains inputs, then lists outputs, and ends with implementation details. Zero wasted words in 4 concise sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (so return values don't need description), no annotations, and moderate complexity, the description is quite complete. It explains the calculation's purpose, inputs, multiple outputs, and implementation characteristics. The main gap is incomplete parameter documentation given 0% schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but only partially does. It explains that parameters are 'price change percentages for both tokens' which clarifies token_a_price_change and token_b_price_change, but doesn't mention the investment_amount parameter or its default value. The description adds some meaning but leaves one parameter undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('calculate exact impermanent loss'), the resource ('for a 50/50 LP pair'), and distinguishes from siblings by focusing on IL calculation rather than analysis, discovery, simulation, or tracking. It provides exact scope details like USD/percentage outputs and comparison metrics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context for evaluating liquidity pool performance with price changes, but doesn't explicitly state when to use this vs alternatives like 'simulate_profit' or 'analyze_pool'. It does specify it's 'ALWAYS FREE — pure math, no API call needed' which provides helpful usage context about cost and implementation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/omniologynow-rgb/profitspot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server