# DeFi Shield IL Simulator

> DeFi Shield IL Simulator is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $1/call, status unknown (last checked 2026-09-15).

Runs a 200-scenario Monte Carlo simulation of impermanent loss for a liquidity pool position, returning breakeven APY and risk score

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/defi/il-simulate
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-436e5409
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OheTTqoQpppFOgHVYpQ1e

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-shield-hazel-vercel-app-436e5409 -d '<json body>'
```

Example prompt: Run a 200-scenario Monte Carlo impermanent loss simulation for an ETH/USDC liquidity pool position of $10,000 with 30% annualized volatility over a 90-day horizon and tell me the breakeven APY and risk score.

## When to prefer this

Use this endpoint when you need probabilistic, scenario-based impermanent loss analysis rather than a simple deterministic IL formula. Ideal when a user wants to understand the full distribution of outcomes, needs a breakeven APY figure to decide whether to enter a pool, or wants a risk score for comparing multiple LP opportunities. Prefer over static IL calculators when volatility assumptions matter.

## Known failure modes

- Invalid token pair or unsupported pool — returns 400 with validation error
- Volatility or time horizon out of acceptable range — returns 422 with parameter constraints
- Simulation engine timeout for extreme parameter combinations — returns 504
- Payment not received or insufficient USDC — returns 402 payment required
- Missing required fields in POST body — returns 400 with field-level error details

## Output

Returns 200 simulated impermanent loss outcomes across price paths, the breakeven APY needed to net-positive the position, a risk score summarizing downside exposure, and key percentile statistics (e.g. median IL, 95th percentile loss).

## Example request

```json
{
 "input": {
  "body": {
   "days": 90,
   "pool_fee_pct": 0.3,
   "volatility_a": 0.65,
   "volatility_b": 0.45,
   "token_a_price": 2500,
   "token_b_price": 1,
   "investment_usd": 10000,
   "daily_volume_usd": 5000000
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "properties": {
      "days": {
       "type": "number",
       "description": "Simulation period in days"
      },
      "pool_fee_pct": {
       "type": "number",
       "description": "Pool fee percentage (e.g. 0.3)"
      },
      "volatility_a": {
       "type": "number",
       "description": "Annualized volatility of token A (0-1)"
      },
      "volatility_b": {
       "type": "number",
       "description": "Annualized volatility of token B (0-1)"
      },
      "token_a_price": {
       "type": "number",
       "description": "Current price of token A in USD"
      },
      "token_b_price": {
       "type": "number",
       "description": "Current price of token B in USD"
      },
      "investment_usd": {
       "type": "number",
       "description": "Investment amount in USD"
      },
      "daily_volume_usd": {
       "type": "number",
       "description": "Daily trading volume in USD"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "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/defi-shield-hazel-vercel-app-436e5409/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
