# StealthMark Liquidation Waterfall Verifier

> StealthMark Liquidation Waterfall Verifier is a paid API for AI agents from gateway.stealthmark.io, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-19).

Formally verifies DeFi liquidation waterfall mechanics — health factor, repayable debt, seized collateral, bad debt, and insurance fund sufficiency — given loan position parameters.

## Facts

- Endpoint: POST https://gateway.stealthmark.io/x402/verify-liquidation-waterfall?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stealthmark-liquidation-waterfall-verifier-ce8126b5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xnEp_8m-8FLkwHqhgXxDu

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 stealthmark-liquidation-waterfall-verifier-ce8126b5 -d '<json body>'
```

Example prompt: Can you formally verify the liquidation waterfall for a loan with 10000 units of debt, 8000 units of collateral, a liquidation threshold of 8500 bps, close factor of 5000 bps, liquidation bonus of 500 bps, and no insurance fund — tell me if it's liquidatable, how much debt gets repaid, how much collateral is seized, and whether any bad debt remains?

## When to prefer this

Use this endpoint when you need a formally verified, deterministic computation of liquidation waterfall mechanics for a DeFi lending position — particularly when you need to know health factor, seizure amounts, bad debt residual, and insurance fund adequacy in a single call. Prefer this over manual off-chain calculation when auditability and formal proof guarantees matter, or when integrating into an on-chain risk monitoring pipeline on Base Mainnet.

## Known failure modes

- Missing required fields (debt_value, collateral_value) results in a 400 error
- Non-integer input values cause schema validation failure
- Extreme or overflow values may produce unexpected computation results
- Network or gateway downtime on Base Mainnet returns a 5xx error
- x402 payment failure (insufficient USDC, bad payment header) results in a 402 Payment Required response

## How this service works

Autonomous Z3 Formal Invariant Prover (ERC-4626 Vaults, Polymarket Baskets, ZK Circuits, Differential Consensus) &amp; 100-Point Perimeter Security Gateway on Base Mainnet (x402 v2).

## Output

Returns a JSON object with: a boolean indicating if the position is liquidatable, the computed health factor in basis points, the amount of debt that would be repaid, the amount of collateral that would be seized, the bad debt remaining after liquidation, the amount of socialized loss (if any), whether the insurance fund is sufficient, a check_type label, a human-readable message, and a top-level verified boolean confirming the formal proof passed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "debt_value": {
   "type": "integer"
  },
  "close_factor_bps": {
   "type": "integer",
   "default": 5000
  },
  "collateral_value": {
   "type": "integer"
  },
  "liquidation_bonus_bps": {
   "type": "integer",
   "default": 500
  },
  "insurance_fund_balance": {
   "type": "integer",
   "default": 0
  },
  "liquidation_threshold_bps": {
   "type": "integer",
   "default": 8500
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "message": {
   "type": "string"
  },
  "verified": {
   "type": "boolean"
  },
  "check_type": {
   "type": "string"
  },
  "repaid_debt": {
   "type": "integer"
  },
  "liquidatable": {
   "type": "boolean"
  },
  "socialized_loss": {
   "type": "integer"
  },
  "health_factor_bps": {
   "type": "integer"
  },
  "seized_collateral": {
   "type": "integer"
  },
  "bad_debt_remaining": {
   "type": "integer"
  },
  "insurance_fund_sufficient": {
   "type": "boolean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stealthmark-liquidation-waterfall-verifier-ce8126b5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.stealthmark.io](https://www.zero.xyz/host/gateway.stealthmark.io/llms.txt)
