# DeFi Oracle Liquidation Risk Calculator

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

Calculates liquidation risk for a DeFi lending/borrowing position given collateral and borrow token details, returning risk level and recommendations

## Facts

- Endpoint: POST https://oraclius.vercel.app/api/liquidation-risk
- Price: $0.15/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-liquidation-risk-calculator-a6f61cc4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nltjhP8diz7RdbuWI-pkp

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-calculator-a6f61cc4 -d '<json body>'
```

Example prompt: What's my liquidation risk if I borrow $5000 USDC using $8000 worth of ETH as collateral, with a liquidation threshold of 0.8?

## When to prefer this

Use this endpoint when an AI agent needs to evaluate whether a specific DeFi lending position is safe or at risk of liquidation — particularly when the agent has position details like collateral value, borrow amount, and token pair. Prefer this over generic DeFi data APIs when you need actionable risk recommendations and liquidation price thresholds in a single call. Powered by DeFiLlama and live on-chain data, making it more reliable than purely off-chain estimates.

## Known failure modes

- Missing required borrow_token or collateral_token returns 400 validation error
- Unknown or unsupported token symbols may return empty or null price data
- If on-chain RPC data is unavailable the endpoint may return stale or error response
- Extremely illiquid token pairs may lack price feeds resulting in incomplete liquidation calculation
- Payment failure via x402/USDC on Base will block access with 402 response

## 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 chain, borrow and collateral token symbols, a structured position object, a risk_level string (e.g. low/medium/high/critical), a liquidation object with price thresholds and health factor details, and an array of actionable recommendations to reduce 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-calculator-a6f61cc4/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)
