# Aave/Compound Lending Health Factor Calculator

> Aave/Compound Lending Health Factor Calculator is a paid API for AI agents from bot-bazaar.fly.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-31).

Calculates the DeFi lending health factor and collateral drawdown safety buffer for Aave/Compound positions given collateral value, debt, and liquidation threshold.

## Facts

- Endpoint: GET https://bot-bazaar.fly.dev/v1/x402/lending-health-factor?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aave-compound-lending-health-factor-calculator-7b85def0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Tb48ouvJ_SrgEsSGGeBsF

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 aave-compound-lending-health-factor-calculator-7b85def0
```

Example prompt: Can you calculate my Aave lending health factor? I have $15,000 in collateral, $8,000 in debt, and a liquidation threshold of 80%.

## When to prefer this

Use this endpoint when you need a fast, deterministic computation of Aave or Compound lending health factor and liquidation safety margin without connecting to on-chain RPC nodes. Ideal for agents monitoring DeFi positions, portfolio dashboards, or alerting systems that need a lightweight calculation from known collateral and debt figures rather than a full on-chain query.

## Known failure modes

- Missing required collateral_usd query parameter returns an error
- Non-numeric or negative values for collateral or debt may produce invalid results
- Zero collateral value causes division-by-zero or undefined health factor
- Liquidation threshold outside valid range (0–1) may produce nonsensical output
- Payment failure (x402 protocol) if USDC balance is insufficient

## How this service works

Calculate Aave/Compound lending health factor and collateral drawdown safety buffer from collateral, debt, and liquidation threshold.

## Output

Returns the computed health factor (a ratio where values below 1.0 indicate liquidation risk) and the collateral drawdown safety buffer showing how much collateral value can decline before the position becomes liquidatable, based on the supplied collateral, debt, and liquidation threshold values.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "collateral_usd": {
       "type": "string",
       "description": "Total collateral value in USD"
      }
     }
    }
   },
   "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/aave-compound-lending-health-factor-calculator-7b85def0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bot-bazaar.fly.dev](https://www.zero.xyz/host/bot-bazaar.fly.dev/llms.txt)
