# Bot Bazaar Impermanent Loss Calculator

> Bot Bazaar Impermanent Loss Calculator is a paid API for AI agents from bot-bazaar.fly.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-31).

Calculates impermanent loss percentage for liquidity providers given a token price ratio change, plus net return after fee yield.

## Facts

- Endpoint: GET https://bot-bazaar.fly.dev/v1/x402/impermanent-loss-calc?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bot-bazaar-impermanent-loss-calculator-92f4fb6a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4Mq1_rdzEI0urz2vtXsFH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bot-bazaar-impermanent-loss-calculator-92f4fb6a
```

Example prompt: What's my impermanent loss percentage if the token price ratio changes to 2.0x compared to when I entered the liquidity pool?

## When to prefer this

Choose this endpoint when you need a quick, cheap ($0.01 USDC) programmatic computation of impermanent loss for AMM/LP positions given a specific price ratio change. Ideal for DeFi agents automating portfolio monitoring, yield comparisons, or LP entry/exit decisions where a formula-based calculation is sufficient and no on-chain data lookup is needed.

## Known failure modes

- Missing price_ratio parameter returns a validation error
- Non-numeric or zero/negative price_ratio may return a bad request error
- Network timeout or service unavailability on the fly.dev host
- Payment failure via x402 protocol results in 402 response before computation
- Price ratio of exactly 1.0 (no change) should return 0% IL but edge cases may vary

## How this service works

Calculate liquidity provider impermanent loss % for a given token price ratio change and net return after fee yield.

## Output

Returns the impermanent loss percentage for the given token price ratio change and the net return figure after accounting for fee yield, allowing LPs to assess whether their fee income compensates for the divergence loss.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "price_ratio": {
       "type": "string",
       "description": "Token price ratio change (e.g. 2.0 for 2x)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bot-bazaar-impermanent-loss-calculator-92f4fb6a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bot-bazaar.fly.dev](https://www.zero.xyz/host/bot-bazaar.fly.dev/llms.txt)
