Skip to main content
Glama

ScorpTech x402 Tools

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. Returns JSON with: poolType, priceChangePct, impermanentLossPct, impermanentLossValue, valueIfHeld, valueInPool, inRange, entry. Price: $0.002 USDC per successful call (x402, Base or 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.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and open-world, so the safety profile is covered. The description adds genuinely new behavioral context beyond them: a per-call price of $0.002 USDC charged only on success, the x402 payment rails (Base or Solana), and an equivalent HTTPS endpoint. It stops short of noting rate limits or failure modes, so not a 5.

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 and the full-range/concentrated split are front-loaded, and the return-field list is compact. The single dense paragraph mixes computation, output, pricing, and transport details, and the raw endpoint URL is somewhat incidental, but no sentence is pure filler.

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 seven parameters, no output schema, and only two required inputs, the description compensates by enumerating the returned JSON keys (poolType, impermanentLossPct, valueIfHeld, inRange, etc.) and by disclosing cost and transport. Nothing an agent needs to select or invoke this calculator is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3; the description earns an extra point by explaining what the optional range bounds and feeApr actually do downstream — they switch the pool model and enable fee-earned and break-even output. It does not restate parameter formats or units beyond the schema, which is appropriate.

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 and resource ('Impermanent loss calculator for AMM liquidity positions') and immediately splits the domain into full-range constant-product pools versus concentrated ranges, naming concrete protocols for each. An agent knows exactly what computation is produced without opening the schema.

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

Usage Guidelines3/5

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

It gives the inputs that drive the call ('from entry price, current price and an optional price range') and implies the full-range path when no range is supplied, but never states when to prefer this tool over another or any preconditions/exclusions. Usage is inferable rather than spelled out, which matches a 3.

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