query_network_stress
Calculate network-level market stress indices by analyzing liquidation intensity, gas costs, and execution failure rates to generate composite risk scores for blockchain networks, supporting DeFi lending risk assessment.
Instructions
Get network-level market stress indices combining liquidation intensity, gas costs, and execution failure rates. Provides a 0-100 composite stress score per blockchain. Useful for macro risk assessment across DeFi lending. 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 |
Implementation Reference
- src/tools/crypto.ts:133-162 (handler)Handler function for the query_network_stress tool which calls the /api/v1/crypto/risk/networks endpoint.
async ({ window, network }) => { const res = await apiGet<CryptoQueryResponse>( "/api/v1/crypto/risk/networks", { window: window ?? "1h", network, }, ); 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} network stress record(s) for window=${window ?? "1h"}.`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/tools/crypto.ts:113-132 (registration)Registration of the query_network_stress tool within the server, including its schema definition.
server.registerTool( "query_network_stress", { title: "Market Stress Indices", description: "Get network-level market stress indices combining liquidation intensity, " + "gas costs, and execution failure rates. Provides a 0-100 composite stress " + "score per blockchain. Useful for macro risk assessment across DeFi lending. " + "Source: Liquidationbot real-time telemetry.", inputSchema: { window: z .enum(["1h", "24h", "7d"]) .optional() .describe("Time window for aggregation (default: 1h)"), network: z .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"]) .optional() .describe("Filter by blockchain network"), }, },