# DeFi Collateralized Loan Health & Liquidation Calculator

> DeFi Collateralized Loan Health & Liquidation Calculator is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-12).

Calculates health factor, current LTV, liquidation price, and how much to repay or add as collateral to reach a safe 1.5 health factor for an Aave/Compound-style DeFi loan.

## Facts

- Endpoint: POST https://api.vextorium.com/calculadora-liquidacion-prestamo-pago?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-collateralized-loan-health-liquidation-calculator-685cfd0b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LMQSti3H-rlfzKQZaLM0z

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-collateralized-loan-health-liquidation-calculator-685cfd0b -d '<json body>'
```

Example prompt: I have a DeFi loan with 2 ETH as collateral at $2,700 each and I owe $3,000 — can you calculate my health factor, liquidation price, and how much I'd need to repay or add to reach a 1.5 health factor?

## When to prefer this

Use this endpoint when you need a fast, protocol-agnostic calculation of DeFi loan risk metrics (health factor, LTV, liquidation price) without querying a live blockchain. Ideal for agents monitoring collateralized positions, alerting users before liquidation, or computing rebalancing actions. It targets Aave/Compound-style single-collateral, single-debt positions and handles edge cases like near-1.5 health factor recovery calculations. If you need on-chain real-time price feeds, combine with a Chainlink oracle endpoint first.

## Known failure modes

- Missing required fields (colateral_cantidad, colateral_precio, deuda_usd) results in validation error
- Zero or negative collateral price or debt causes division errors or nonsensical results
- LTV or liquidation threshold values outside realistic protocol ranges may yield misleading outputs
- Network timeout or service unavailability returns no response

## How this service works

Collateralized DeFi loan (Aave/Compound style): health factor, current LTV, collateral liquidation price, drop it can withstand, extra borrowing room and how much to repay or add to reach a 1.5 health factor.

## Output

Returns a JSON object with: health factor, loan status (e.g. 'vigilar'/'safe'), current LTV percentage, collateral value in USD, liquidation price per collateral unit, maximum price drop the position can withstand as a percentage, additional borrowing capacity in USD, and the amount to repay (USD) or collateral to add to restore the health factor to exactly 1.5. Includes a note about single-collateral/single-debt assumptions.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "colateral_cantidad",
      "colateral_precio",
      "deuda_usd"
     ],
     "properties": {
      "deuda_usd": {
       "type": "number"
      },
      "ltv_max_pct": {
       "type": "number",
       "description": "Default 80"
      },
      "colateral_precio": {
       "type": "number"
      },
      "colateral_cantidad": {
       "type": "number"
      },
      "umbral_liquidacion_pct": {
       "type": "number",
       "description": "Default 82.5"
      }
     }
    },
    "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",
      "null"
     ],
     "properties": {
      "nota": {
       "type": [
        "string",
        "null"
       ]
      },
      "estado": {
       "type": [
        "string",
        "null"
       ]
      },
      "deuda_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "factor_salud": {
       "type": [
        "number",
        "null"
       ]
      },
      "ltv_actual_pct": {
       "type": [
        "number",
        "null"
       ]
      },
      "para_factor_1_5": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "devolver_usd": {
         "type": [
          "number",
          "null"
         ]
        },
        "o_anadir_colateral": {
         "type": [
          "number",
          "null"
         ]
        }
       }
      },
      "precio_liquidacion": {
       "type": [
        "number",
        "null"
       ]
      },
      "puede_pedir_mas_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "valor_colateral_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "caida_soportable_pct": {
       "type": [
        "number",
        "null"
       ]
      }
     }
    }
  
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "nota": "Cálculo con un solo colateral y deuda estable. Cada protocolo y activo tiene su propio umbral de liquidación.",
  "estado": "vigilar",
  "deuda_usd": 3000,
  "factor_salud": 1.485,
  "ltv_actual_pct": 55.56,
  "para_factor_1_5": {
   "devolver_usd": 30,
   "o_anadir_colateral": 0.02020202
  },
  "precio_liquidacion": 1818.18181818,
  "puede_pedir_mas_usd": 1320,
  "valor_colateral_usd": 5400,
  "caida_soportable_pct": 32.66
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-collateralized-loan-health-liquidation-calculator-685cfd0b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
