# Onchain Health Factor — DeFi Lending Position Monitor

> Onchain Health Factor — DeFi Lending Position Monitor is a paid API for AI agents from onchain-health.mick8511.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-31).

Returns live DeFi lending health metrics (collateral, debt, available borrow, liquidation threshold, health factor, and liquidation risk) for an EVM address across Aave v3, Spark, and Compound v3 on multiple chains

## Facts

- Endpoint: POST https://onchain-health.mick8511.workers.dev/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/onchain-health-factor-defi-lending-position-monitor-7a63fae1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iqs6lSPC2pEUU6RYLsP4h

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 onchain-health-factor-defi-lending-position-monitor-7a63fae1 -d '<json body>'
```

Example prompt: Can you check the Aave and Compound lending health for wallet 0xAbCd...1234 across Ethereum, Base, and Arbitrum — I want to know the health factor, how close it is to liquidation, and how much borrowing capacity is left?

## When to prefer this

Choose this endpoint when you need live, multi-protocol DeFi lending health data for an EVM address across multiple chains in a single call. It is purpose-built for Aave v3, Spark, and Compound v3 health monitoring with structured risk labels and liquidation flags, making it superior to generic balance APIs for DeFi risk assessment or liquidation monitoring workflows.

## Known failure modes

- Invalid or malformed EVM address returns a 400 validation error
- Address with no DeFi positions returns empty or zero-value protocol entries
- Unsupported chain name in the chains parameter causes a parse or 400 error
- RPC / Multicall3 node failure may cause a 500 or partial data response
- Rate limiting or payment failure (x402) results in a 402 Payment Required response

## How this service works

DeFi lending position health for an EVM address across Ethereum, Base, Arbitrum, Optimism and Polygon: Aave v3 and Spark collateral, debt, available borrow, liquidation threshold and health factor with a risk label, plus Compound v3 borrow, supply and liquidatable flag. Live on-chain reads via Multicall3. Free sample: https://onchain-health.mick8511.workers.dev/sample

## Output

A structured response per chain and protocol (Aave v3, Spark, Compound v3) containing: collateral value in USD, total debt, available borrow, liquidation threshold, numerical health factor, a human-readable risk label (e.g. 'safe', 'warning', 'critical'), and for Compound v3 a liquidatable boolean flag. Data is read live from on-chain via Multicall3 so values reflect the current block state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chains": {
   "type": "string",
   "description": "Comma list: ethereum,base,arbitrum,optimism,polygon (default all)"
  },
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "EVM wallet address"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-health-factor-defi-lending-position-monitor-7a63fae1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchain-health.mick8511.workers.dev](https://www.zero.xyz/host/onchain-health.mick8511.workers.dev/llms.txt)
