Skip to main content
Glama

evm_get_impermanent_loss

Calculate impermanent loss for liquidity providers by comparing current LP position value against holding the tokens separately, including fee earnings, to assess net LP risk.

Instructions

Calculate impermanent loss for liquidity providers.

Compares current LP position value vs holding assets separately. Essential for LP risk management.

PARAMETERS:

  • chain: Target EVM chain

  • token0: { symbol, initialPrice, currentPrice, amount }

  • token1: { symbol, initialPrice, currentPrice, amount }

  • poolAddress: Pool address for live data (optional)

  • includeFeesEarned: Include estimated fees in calculation (optional)

  • feeRate: Pool fee rate as percent (e.g., 0.3 for 0.3%) (optional)

CALCULATION: • Compares LP value vs holding tokens • Accounts for price divergence • Includes fee earnings offset • Shows IL percentage

Returns IL amount, percentage, fee earnings, and net position.

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": {
      "chain": "<chain>",
      "token0": "<token0>",
      "token1": "<token1>"
    },
    "name": "evm_get_impermanent_loss"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYes
token0Yes
token1Yes
feeRateNoPool fee rate (e.g., 0.3 for 0.3%)
poolAddressNoPool address for live data (optional)
includeFeesEarnedNoInclude estimated fees in calculation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does add real value by disclosing the calculation method (price divergence, fee offset, IL percentage) and the return shape, and it implies a pure read-only computation. It does not say what happens when poolAddress is supplied (does it override the provided prices? require network access? fail if the pool is unknown?), nor does it state precision or expected input formats for the string-typed prices.

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

Conciseness3/5

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

Headers and bullets make it scannable and the purpose is front-loaded, but there is duplication: 'Compares current LP position value vs holding assets separately' is restated verbatim in spirit under CALCULATION as 'Compares LP value vs holding tokens'. The PARAMETERS block largely re-reads the schema rather than adding insight, so the length is not fully earned.

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

Completeness3/5

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

For a six-parameter tool with nested objects and no output schema, the description does the right thing by summarizing the return values (IL amount, percentage, fee earnings, net position). What is missing is the operational detail an agent needs to call it confidently: how poolAddress changes behavior, whether fees are estimated or read on-chain, and acceptable price string formats.

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 coverage is only 50%, so the description has to compensate, and it does list all six parameters with short glosses, including the nested token0/token1 fields (symbol, initialPrice, currentPrice, amount) and the 0.3 = 0.3% feeRate convention. It falls short on the ambiguous case: the interaction between poolAddress and the manual price fields is left unexplained, and 'amount' units are never clarified.

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 opening sentence names a specific verb (calculate) and resource (impermanent loss) plus the target user (liquidity providers). The follow-up 'Compares current LP position value vs holding assets separately' pins down the actual computation, and no sibling tool in the catalog covers IL, so confusion risk is low.

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?

'Essential for LP risk management' only implies the context of use; there is no explicit when-to-use, no when-not-to-use, and no routing to alternatives (e.g., evm_get_pool_info for live pool state). The optional-parameter semantics hint at two modes (manual prices vs poolAddress) but never state which to prefer.

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

Deploy Server

Other Tools