# x402toll Impermanent Loss Calculator

> x402toll Impermanent Loss Calculator is a paid API for AI agents from x402toll.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Calculates impermanent loss for a 50/50 constant-product AMM LP position versus simply holding, given initial price, current price, and optional position size.

## Facts

- Endpoint: POST https://x402toll.com/v1/crypto/impermanent-loss
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402toll-impermanent-loss-calculator-a0d74753
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VWBVqnEaowMm6cUYBf53D

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 x402toll-impermanent-loss-calculator-a0d74753 -d '<json body>'
```

Example prompt: I entered an ETH/USDC Uniswap pool when ETH was at $2,000 and now it's at $3,200 — my position was worth $10,000 at entry. How much am I down to impermanent loss compared to just holding?

## When to prefer this

Use this endpoint when you need a precise, formula-based impermanent loss figure for a classic 50/50 constant-product AMM pool (e.g. Uniswap v2, SushiSwap). Ideal when the user wants to compare LP yield vs holding returns, or when quantifying DeFi liquidity risk for a given price movement.

## Known failure modes

- Missing required currentPrice or initialPrice fields returns a 400 error
- Passing zero or negative prices causes invalid computation or error response
- Payment not included or insufficient USDC results in 402 Payment Required
- currentPrice equal to initialPrice returns 0% impermanent loss (valid edge case)

## How this service works

Impermanent loss for a 50/50 constant-product LP position vs simply holding, given the price change of the volatile asset.

## Output

Returns the impermanent loss percentage and, if positionValueUsd is provided, the dollar amount lost versus simply holding the assets outside the pool — enabling a direct comparison between LP strategy and holding strategy for a 50/50 constant-product AMM.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "currentPrice": {
   "type": "number"
  },
  "initialPrice": {
   "type": "number"
  },
  "positionValueUsd": {
   "type": "number",
   "default": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402toll-impermanent-loss-calculator-a0d74753/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402toll.com](https://www.zero.xyz/host/x402toll.com/llms.txt)
