# DeFi Oracle — Liquidation Risk Analyzer

> DeFi Oracle — Liquidation Risk Analyzer is a paid API for AI agents from defi-oracle-two.vercel.app, paid per call via x402, $0.15/call, status unknown (last checked 2026-09-15).

Calculates liquidation risk for DeFi lending positions given collateral and borrow token details, returning risk level, liquidation thresholds, and actionable recommendations.

## Facts

- Endpoint: POST https://defi-oracle-two.vercel.app/api/liquidation-risk
- Price: $0.15/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-oracle-liquidation-risk-analyzer-fa56ebbb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_btNhkYM7x2sfAvLb9OgFP

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-liquidation-risk-analyzer-fa56ebbb -d '<json body>'
```

Example prompt: Check my liquidation risk: I'm borrowing $5,000 USDC against $8,000 worth of ETH as collateral, with a liquidation threshold of 0.8 — am I in danger of getting liquidated and what should I do?

## When to prefer this

Use this endpoint when an AI agent needs to evaluate whether a DeFi lending position is at risk of forced liquidation, especially when you have specific borrow and collateral token pairs and USD values. It is purpose-built for liquidation risk analysis (not general yield or swap routing), returning a risk level and actionable recommendations — prefer it over generic on-chain data fetchers when the goal is position health monitoring.

## Known failure modes

- Missing required fields (borrow_token or collateral_token) returns a validation error
- Unknown or unsupported token symbols may result in no price data and an error
- Extreme or unrealistic USD values may produce inaccurate risk calculations
- Downstream RPC or DeFiLlama API unavailability causes 5xx errors
- Payment failure via x402/USDC on Base blocks the request before processing

## 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 a structured object containing the chain, borrow token, collateral token, computed position metrics, a risk_level string (e.g. low/medium/high), detailed liquidation parameters (price triggers, health factor), and an array of human-readable recommendations for managing or reducing liquidation risk.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "borrow_token",
  "collateral_token"
 ],
 "properties": {
  "borrow_token": {
   "type": "string"
  },
  "collateral_token": {
   "type": "string"
  },
  "borrow_amount_usd": {
   "type": "number"
  },
  "collateral_value_usd": {
   "type": "number"
  },
  "liquidation_threshold": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "type": "string"
  },
  "borrow": {
   "type": "string"
  },
  "position": {
   "type": "object"
  },
  "collateral": {
   "type": "string"
  },
  "risk_level": {
   "type": "string"
  },
  "liquidation": {
   "type": "object"
  },
  "recommendations": {
   "type": "array",
   "items": {
    "type": "string"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-oracle-liquidation-risk-analyzer-fa56ebbb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-oracle-two.vercel.app](https://www.zero.xyz/host/defi-oracle-two.vercel.app/llms.txt)
