query_cohort_critical
Identify borrowers entering critical health factor tiers across lending protocols to monitor near-liquidation risk using real-time telemetry data.
Instructions
Get near-liquidation cohort signals showing account populations by health factor tier (critical/high/moderate), entry/exit rates, and deterioration velocity. Early warning on borrowers entering critical health factor tiers. Source: Liquidationbot real-time telemetry.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| window | No | Time window for aggregation (default: 1h) | |
| network | No | Filter by blockchain network | |
| protocol | No | Filter by lending protocol |
Implementation Reference
- src/tools/crypto.ts:166-229 (handler)Registration and handler implementation for query_cohort_critical.
server.registerTool( "query_cohort_critical", { title: "Near-Liquidation Cohort Signals", description: "Get near-liquidation cohort signals showing account populations by health " + "factor tier (critical/high/moderate), entry/exit rates, and deterioration " + "velocity. Early warning on borrowers entering critical health factor tiers. " + "Source: Liquidationbot real-time telemetry.", inputSchema: { window: z .enum(["5m", "1h", "24h"]) .optional() .describe("Time window for aggregation (default: 1h)"), network: z .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"]) .optional() .describe("Filter by blockchain network"), protocol: z .enum([ "aave_v3", "compound_v3", "venus", "radiant", "morpho_blue", "llamalend", "zerolend", "makerdao", ]) .optional() .describe("Filter by lending protocol"), }, }, async ({ window, network, protocol }) => { const res = await apiGet<CryptoQueryResponse>( "/api/v1/crypto/cohorts/critical", { window: window ?? "1h", network, protocol, }, ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const summary = `Found ${count} cohort record(s) for window=${window ?? "1h"}.`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, );