# Agent402 UK Impermanent Loss Calculator

> Agent402 UK Impermanent Loss Calculator is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.002/call, status down (last checked 2026-09-15).

Calculates Uniswap-style constant-product AMM impermanent loss given a price ratio between old and new token prices.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/math/impermanent-loss
- Price: $0.002/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-impermanent-loss-calculator-4fa137fb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JE1BE8smePO8ASbMojMM8

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 agent402-uk-impermanent-loss-calculator-4fa137fb -d '<json body>'
```

Example prompt: What's the impermanent loss for a Uniswap-style liquidity position if the price ratio has changed to 2.0 (new price is double the old price)?

## When to prefer this

Use this endpoint when you need a quick, reliable computation of Uniswap-style constant-product AMM impermanent loss from a single price ratio input, without needing to set up any DeFi library or write the sqrt-based IL formula yourself. Ideal for DeFi dashboards, LP position trackers, and pre-investment risk tools where you want a lightweight serverless math call.

## Known failure modes

- Missing price_ratio field returns a 400 validation error
- price_ratio of 0 or negative is mathematically invalid and likely returns an error
- Extremely large or small price ratios may cause floating point precision issues
- Non-numeric price_ratio value returns a type validation error
- Payment not included or insufficient USDC results in 402 Payment Required

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns the impermanent loss as a percentage (or decimal multiplier) representing the value loss a constant-product AMM liquidity provider incurs compared to simply holding the underlying tokens, given the input price ratio using the standard sqrt-based IL formula.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "price_ratio": {
   "type": "number",
   "description": "New/old price ratio"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "price_ratio": 1.5,
  "impermanent_loss_pct": -2.020305089104421
 }
}
```

## More

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