# DeFi Oracle IL Calculator

> DeFi Oracle IL Calculator is a paid API for AI agents from oraclius.vercel.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Calculates impermanent loss percentage for liquidity providers given a price change, with multiple scenarios and interpretation

## Facts

- Endpoint: POST https://oraclius.vercel.app/api/il-calculator
- 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/defi-oracle-il-calculator-452f5d49
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R7MS9ZDM-q8XRSPJnfyXn

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 defi-oracle-il-calculator-452f5d49 -d '<json body>'
```

Example prompt: What would my impermanent loss be if the token price changes by +75%? I'm considering adding liquidity to an AMM pool and want to understand the IL risk.

## When to prefer this

Choose this endpoint when you need a quick, quantitative impermanent loss calculation for DeFi liquidity provision decisions. Ideal when an agent or user is evaluating whether to provide liquidity to an AMM pool and wants to understand the downside IL risk for a given expected price movement. More useful than manual formula computation because it also returns scenario comparisons and a plain-English interpretation.

## Known failure modes

- Missing required price_change_pct field returns 400 error
- Payment not submitted or insufficient USDC balance causes 402 payment required
- price_change_pct of -100% (complete price collapse) may cause division by zero or edge case errors
- Extremely large price changes (e.g. 10000%) may return edge case values
- Network timeouts from on-chain RPC data sources could cause 503 errors

## How this service works

DeFi data for AI agents — yield rates, swap routes, IL calculator, liquidation risk, MEV scanner, TVL tracking. Powered by DeFiLlama + on-chain RPC data. Pay with USDC on Base via x402.

## Output

Returns the impermanent loss percentage for the given price change, the mathematical formula used, an array of IL scenarios across different price change magnitudes for context, and a human-readable interpretation explaining the loss impact.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "price_change_pct"
 ],
 "properties": {
  "price_change_pct": {
   "type": "number",
   "description": "Price change percentage (e.g. 50 for +50%)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object"
  },
  "formula": {
   "type": "string"
  },
  "scenarios": {
   "type": "array"
  },
  "interpretation": {
   "type": "string"
  },
  "impermanent_loss_pct": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-oracle-il-calculator-452f5d49/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from oraclius.vercel.app](https://www.zero.xyz/host/oraclius.vercel.app/llms.txt)
