Skip to main content
Glama

Impermanent Loss

impermanent_loss
Read-onlyIdempotent

Impermanent loss calculator for AMM liquidity positions: full-range constant-product pools (Uniswap v2, Raydium, Orca classic) or concentrated ranges (Uniswap v3/v4, Orca Whirlpools, Raydium CLMM, Meteora) from entry price, current price and an optional price range. Returns LP value vs simply holding, the loss in percent and money, token amounts at entry and now, in-range status and, with a fee APR, the fees earned and break-even. Price: $0.002 USDC per successful call (x402, Solana). Same tool over HTTPS: GET https://scorptech.it.com/api/x402/v1/impermanent-loss

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "entryPrice": "<entryPrice>",
      "currentPrice": "<currentPrice>"
    },
    "name": "impermanent_loss"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoDays the position has been / will be open (for fees)
feeAprNoOptional pool fee APR in percent, to estimate fees earned
entryPriceYesPrice of token0 in token1 (e.g. ETH in USDC) when the position was opened
rangeLowerNoConcentrated liquidity: lower price bound (omit both bounds for full range)
rangeUpperNoConcentrated liquidity: upper price bound
currentPriceYesPrice now (or a scenario price)
depositValueNoPosition value at entry, in token1 / quote terms

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, it discloses the cost model ('$0.002 USDC per successful call (x402, Solana)'), that billing is per successful call, and an equivalent HTTPS endpoint. It also explains conditional behavior: fees earned and break-even only appear when a fee APR is supplied. That is far more than the annotations convey.

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

Conciseness4/5

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

Purpose is front-loaded, followed by supported pool types, inputs/outputs, then pricing and the HTTP endpoint. It is a single dense block, but nearly every clause carries information an agent would need; slightly tighter grouping of the commercial/endpoint details would earn a 5.

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

Completeness5/5

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

With no output schema present, the description carries the return-value burden and does so thoroughly: LP value vs holding, loss in percent and money, token amounts at entry and now, in-range status, plus fee/break-even output. It also covers access (MCP vs HTTPS) and payment, leaving no material gap for correct invocation.

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 coverage is 100%, so all seven parameters are already documented in the schema, including the 'omit both bounds for full range' rule. The description restates the entry-price/current-price/optional-range trio and links feeApr to the fee output, but adds little syntax or convention detail beyond the schema. Baseline 3 applies.

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 states a specific verb+resource ('Impermanent loss calculator for AMM liquidity positions') and immediately enumerates the exact protocols covered in both modes (Uniswap v2/v3/v4, Raydium, Orca classic/Whirlpools, Meteora). No sibling tool in the list covers this domain, and the scope is narrow enough that an agent knows precisely what it computes.

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?

It clearly indicates the situation that selects this tool ('for AMM liquidity positions') and distinguishes two usage modes: full-range constant-product vs concentrated ranges with a supplied price range. It stops short of explicit when-not-to-use guidance or naming an alternative tool, so a 4 rather than a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources