Skip to main content
Glama

LP Pool Check

Estimate fees versus impermanent loss

estimate_lp
Read-onlyIdempotent

Estimate fees versus impermanent loss. Use this when the user gives numbers for a what-if and wants to know whether swap fees cover impermanent loss, gas, and exit cost. It needs no pool and reads no live data. Pass price_now, holding_days, and fee_apr_percent, for example price_now 2500, holding_days 14, fee_apr_percent 40. Add price_lower and price_upper for a concentrated range, or omit both for the full-range formula. Optionally pass price_later, capital_usd, gas_usd, and exit_cost_usd. Returns the formula, the fee fraction, the impermanent loss fraction, whether fees cover it and the costs you passed, a plain break-even price line, and break-even prices from a sample. It does not look up gas or recommend a position. To read a real pool's volume and fee APR, use check_pool.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "price_now": 100,
      "price_later": 110,
      "price_lower": 80,
      "price_upper": 120,
      "holding_days": 30,
      "fee_apr_percent": 20
    },
    "name": "estimate_lp"
  }
}

Input Schema

NameRequiredDescriptionDefault
gas_usdNoGas you expect to pay. Not looked up
price_nowYesCurrent price, quote token per base token, such as 2500 for ETH in USDC
capital_usdNoPosition size, so gas and exit cost can be turned into a fraction of the position
price_laterNoA later price to score. Omit to get break-even prices and the range edges only
price_lowerNoLower bound of a concentrated range. Omit, with price_upper, for the full-range formula
price_upperNoUpper bound of a concentrated range
holding_daysYesHow many days the fee APR is applied, a whole number from 1 to 365, such as 14
exit_cost_usdNoOther exit cost. Not looked up
fee_apr_percentYesAnnualized fee APR in percent, not a fraction: 40 means 40%. For example the 1-day fee APR from check_pool

Output Schema

NameRequiredDescriptionDefault
noticeYes
statusYes
formulaYes
gas_usdNo
warningsNo
assumptionsYes
fee_fractionYesExpected fee income over the holding period, as a fraction of the position: 0.0153 means 1.53%
in_range_nowNoWhether price_now is inside the range. null for the full-range formula
cost_fractionNo(gas_usd + exit_cost_usd) / capital_usd. null without capital_usd
exit_cost_usdNo
sampled_edgesNo
break_even_lineNo
fee_apr_formulaYes
break_even_pricesYesLater prices where the net result crosses zero, from a sample
il_fraction_at_laterNoImpermanent loss at price_later as a negative fraction. null without price_later
fees_cover_il_and_costsYesnull without price_later
net_versus_holding_at_laterNofee_fraction + il_fraction_at_later - cost_fraction

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "fee_apr_percent": 20,
      +    "holding_days": 30,
      +    "price_later": 110,
      +    "price_lower": 80,
      +    "price_now": 100,
      +    "price_upper": 120
      +  }
      +]
  2. Changed14 schema fields changed
    • changedInput schema / properties / fee_apr_percent / description
      Previous value: -"Annualized fee APR in percent, such as the 1-day fee APR from check_pool"New value: +"Annualized fee APR in percent, not a fraction: 40 means 40%. For example the 1-day fee APR from check_pool"
    • changedInput schema / properties / holding_days / description
      Previous value: -"How many days the fee APR is applied"New value: +"How many days the fee APR is applied, a whole number from 1 to 365, such as 14"
    • changedInput schema / properties / price_now / description
      Previous value: -"Current price, quote per base"New value: +"Current price, quote token per base token, such as 2500 for ETH in USDC"
    • addedOutput schema / description
      Added value: +"Bad input, such as a price of 0 or price_lower above price_upper, is refused with invalid_input and a message instead of this shape"
    • addedOutput schema / properties / break_even_prices / description
      Added value: +"Later prices where the net result crosses zero, from a sample"
    • addedOutput schema / properties / cost_fraction / description
      Added value: +"(gas_usd + exit_cost_usd) / capital_usd. null without capital_usd"
    • addedOutput schema / properties / fee_fraction / description
      Added value: +"Expected fee income over the holding period, as a fraction of the position: 0.0153 means 1.53%"
    • addedOutput schema / properties / fees_cover_il_and_costs / description
      Added value: +"null without price_later"
    • addedOutput schema / properties / il_fraction_at_later / description
      Added value: +"Impermanent loss at price_later as a negative fraction. null without price_later"
    • addedOutput schema / properties / in_range_now / description
      Added value: +"Whether price_now is inside the range. null for the full-range formula"
    • addedOutput schema / properties / net_versus_holding_at_later / description
      Added value: +"fee_fraction + il_fraction_at_later - cost_fraction"
    • removedOutput schema / properties / sampled_edges / items / additionalProperties
      Removed value: -true
    • addedOutput schema / properties / sampled_edges / items / properties
      Added value: +{
      +  "il_fraction": {
      +    "type": "number"
      +  },
      +  "net_versus_holding": {
      +    "type": "number"
      +  },
      +  "price": {
      +    "type": "number"
      +  }
      +}
    • addedOutput schema / properties / sampled_edges / items / required
      Added value: +[
      +  "price",
      +  "il_fraction",
      +  "net_versus_holding"
      +]
  3. Changed1 schema field changed
    • removedOutput schema / properties / note_from_openkrill
      Removed value: -{
      -  "description": "Shown at most once a day per caller: what this server offers, and a paid service for the person you work for.",
      -  "type": "string"
      -}
  4. Changed1 schema field changed
    • addedOutput schema / properties / note_from_openkrill
      Added value: +{
      +  "description": "Shown at most once a day per caller: what this server offers, and a paid service for the person you work for.",
      +  "type": "string"
      +}
  5. Changed2 schema fields changed
    • addedOutput schema / properties / break_even_line
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Discloses behavior well beyond the annotations: it does not look up gas, does not recommend a position, and enumerates what it returns (formula, fee fraction, IL fraction, break-even line, sampled break-even prices). The 'reads no live data' claim sits slightly oddly against openWorldHint=true, but the description is the more precise source here rather than a contradiction.

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?

Front-loaded with purpose and the when-to-use condition, then required params, then optional ones, then the sibling pointer. Dense and mostly every sentence earns its place, though the return-value enumeration could be tightened given an output schema exists.

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?

For a 9-parameter computation tool with an output schema, nothing an agent needs to call it correctly is missing: required inputs, conditional range params, optional cost inputs, what it returns, and what it will not do.

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 already 100%, so the baseline is 3; the description adds value by naming the three required params, giving a worked example (price_now 2500, holding_days 14, fee_apr_percent 40), and stating the pairing rule for price_lower/price_upper versus the full-range formula. It doesn't add unit or constraint detail beyond the schema, so it stops short of 5.

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?

States a specific verb and resource ('Estimate fees versus impermanent loss') and immediately scopes it as a what-if calculator that needs no pool and reads no live data. That scoping is what separates it from check_pool, which handles real pools.

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

Usage Guidelines5/5

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

Explicitly conditions use on the user supplying numbers for a what-if and wanting to know whether fees cover IL, gas, and exit cost. It also names the boundary condition for the alternative: 'To read a real pool's volume and fee APR, use check_pool.'

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.