# Impermanent Loss Calculator (DeFi/Uniswap)

> Impermanent Loss Calculator (DeFi/Uniswap) is a paid API for AI agents from dominion-data.x402-evm-math.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-29).

Calculates the impermanent loss percentage for a liquidity position given price changes, supporting Uniswap V2/V3 math.

## Facts

- Endpoint: GET https://dominion-data.x402-evm-math.workers.dev/defi/impermanent-loss?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/impermanent-loss-calculator-defi-uniswap-d1b785c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NNKBKWINX_DNvn_GsGhPC

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 impermanent-loss-calculator-defi-uniswap-d1b785c7
```

Example prompt: What's the impermanent loss percentage for a Uniswap V2 LP position where the price of one token has doubled relative to when I entered the pool?

## When to prefer this

Choose this endpoint when you need a precise, pay-per-call computation of impermanent loss for Uniswap V2/V3 AMM positions without standing up your own math library. Ideal for DeFi agents that need on-demand IL calculations as part of broader liquidity strategy workflows, especially when paired with the sibling EVM calldata and Uniswap math endpoints on the same platform. At $0.001 USDC per call, it is cost-effective for frequent per-decision computations.

## Known failure modes

- Missing required query parameters (price ratio inputs) returns an error or undefined result
- Invalid numeric input types may cause computation errors
- Extreme price ratios may yield edge-case results; no input validation is documented
- No documented error schema — failures may return non-standard responses

## How this service works

Exact EVM address, calldata, Uniswap V2/V3 and impermanent-loss math. Pay per call in USDC on Base via x402.

## Output

Returns a JSON object containing `impermanent_loss_pct`, a string representing the impermanent loss as a negative percentage (e.g. '-5.7191'), indicating how much value a liquidity provider has lost relative to simply holding the tokens outside the pool.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "impermanent_loss_pct": "-5.7191"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/impermanent-loss-calculator-defi-uniswap-d1b785c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from dominion-data.x402-evm-math.workers.dev](https://www.zero.xyz/host/dominion-data.x402-evm-math.workers.dev/llms.txt)
