Liquidation Risk MCP x402

How close is this address to being liquidated on Aave V3 or Compound III, and what trigger price moves it past the line? Returns health factor, collateral, debt, LTV, liquidation threshold, price-drop-to-liquidation, and a clean safe / warning / danger risk band. Multichain (base / ethereum / arbitrum / optimism / polygon). Pay-per-call USDC on Base — no signup, no API key.

Endpoints

PathPriceWhat it does
POST /v1/risk/aave_v3$0.03Aave V3 Pool.getUserAccountData → HF, LTV, liquidationThreshold, priceDropToLiquidation, risk band.
POST /v1/risk/compound_v3$0.03Compound III Comet (USDC|WETH) borrow + per-collateral breakdown + isLiquidatable + risk band.

Discovery surfaces

Quick example

curl -X POST https://liquidation-risk-mcp.mtree.workers.dev/v1/risk/aave_v3 \
  -H "Content-Type: application/json" \
  -d '{"chain":"base","address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}'
# 402 returned; settle X-PAYMENT and retry.

Methodology

Aave V3: read Pool.getUserAccountData(user)(totalCollateralBase, totalDebtBase, availableBorrowsBase, currentLiquidationThreshold, ltv, healthFactor). Health factor is the raw 1e18-scaled value, exposed as both raw and float. Price-drop-to-liquidation is approximated as 1 - 1/HF when HF > 1. Risk band: <1.1 danger, 1.1–1.5 warning, >=1.5 safe.

Compound III: read borrowBalanceOf + balanceOf + isLiquidatable on the comet, then walk every collateral asset via numAssets / getAssetInfo / collateralBalanceOf to give a per-asset breakdown. The isLiquidatable flag is the protocol's own danger ground truth; the categorical risk band falls back to borrow vs. collateral coverage when not liquidatable. Per-asset USD valuation requires an external price feed; raw balance + liquidate factor are returned for downstream computation.

Repo

github.com/sebastiancoombs/liquidation-risk-mcp