Skip to main content
Glama

Get Liquidation Risk

get_liquidation_risk
Read-only

Assess DeFi liquidation risk for up to 50 wallets across Aave v3 and Compound v3 on Ethereum or Base. Returns per-wallet health factor, tiered risk classification (liquidatable, critical, warning, caution, healthy, no_debt), and an overall_tier aggregate. Per-protocol failures are isolated — one protocol's RPC error does not blank the other's result.

Use when: Use for multi-wallet batch risk assessment (2+ wallets). For a single-wallet DeFi analysis use get_defi_positions, which already includes risk metrics. Use assess_counterparty_risk when the question is counterparty trust rather than position health.

Limitations: View-only scan of Aave v3 and Compound v3 on Ethereum and Base with hardcoded market addresses; not a liquidation simulation or guarantee. Compound v3 exposes only a boolean liquidation flag — no numeric health factor. Duplicate wallet addresses are silently removed.

Alternatives: get_defi_positions, assess_counterparty_risk, get_wallet_positions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idNoChain ID (1=Ethereum, 8453=Base)
wallet_addressesYesWallet addresses to assess (max 50; duplicates are silently removed).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoOn-chain liquidation-risk snapshot at data_block_number. Aave risk_tier is derived from the numeric health factor: liquidatable (<1.0), critical (<1.05), warning (<1.15), caution (<1.5), healthy (≥1.5). Compound v3 exposes only a boolean isLiquidatable — a numeric health factor is not available from this tool; do not attempt to compute, estimate, or infer it via additional tool calls. Do not infer a Compound liquidation or breach price from this output. overall_tier is the worst tier across protocols for each wallet. Aave USD values are base-currency 8-decimal from the Aave oracle. Duplicate wallet addresses in the request are deduplicated silently.
resultsYes
summaryYes
chain_idYes
data_block_numberYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / wallet_addresses / title
      Added value: +"Wallet Addresses"
    • addedInput schema / title
      Added value: +"mcp_get_liquidation_riskArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "AaveRisk": {
      +    "properties": {
      +      "health_factor": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Health Factor"
      +      },
      +      "liquidation_threshold_bps": {
      +        "title": "Liquidation Threshold Bps",
      +        "type": "integer"
      +      },
      +      "ltv_bps": {
      +        "title": "Ltv Bps",
      +        "type": "integer"
      +      },
      +      "risk_tier": {
      +        "title": "Risk Tier",
      +        "type": "string"
      +      },
      +      "total_collateral_usd": {
      +        "title": "Total Collateral Usd",
      +        "type": "number"
      +      },
      +      "total_debt_usd": {
      +        "title": "Total Debt Usd",
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "health_factor",
      +      "risk_tier",
      +      "total_collateral_usd",
      +      "total_debt_usd",
      +      "liquidation_threshold_bps",
      +      "ltv_bps"
      +    ],
      +    "title": "AaveRisk",
      +    "type": "object"
      +  },
      +  "CompoundRisk": {
      +    "properties": {
      +      "base_asset_symbol": {
      +        "title": "Base Asset Symbol",
      +        "type": "string"
      +      },
      +      "borrow_balance_raw": {
      +        "title": "Borrow Balance Raw",
      +        "type": "string"
      +      },
      +      "is_liquidatable": {
      +        "title": "Is Liquidatable",
      +        "type": "boolean"
      +      },
      +      "market_address": {
      +        "title": "Market Address",
      +        "type": "string"
      +      },
      +      "market_name": {
      +        "title": "Market Name",
      +        "type": "string"
      +      },
      +      "risk_tier": {
      +        "title": "Risk Tier",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "market_name",
      +      "market_address",
      +      "base_asset_symbol",
      +      "is_liquidatable",
      +      "borrow_balance_raw",
      +      "risk_tier"
      +    ],
      +    "title": "CompoundRisk",
      +    "type": "object"
      +  },
      +  "ProtocolErrorInfo": {
      +    "properties": {
      +      "error": {
      +        "title": "Error",
      +        "type": "string"
      +      },
      +      "protocol": {
      +        "title": "Protocol",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "protocol",
      +      "error"
      +    ],
      +    "title": "ProtocolErrorInfo",
      +    "type": "object"
      +  },
      +  "RiskSummary": {
      +    "properties": {
      +      "caution_count": {
      +        "title": "Caution Count",
      +        "type": "integer"
      +      },
      +      "critical_count": {
      +        "title": "Critical Count",
      +        "type": "integer"
      +      },
      +      "healthy_count": {
      +        "title": "Healthy Count",
      +        "type": "integer"
      +      },
      +      "liquidatable_count": {
      +        "title": "Liquidatable Count",
      +        "type": "integer"
      +      },
      +      "no_debt_count": {
      +        "title": "No Debt Count",
      +        "type": "integer"
      +      },
      +      "total_wallets": {
      +        "title": "Total Wallets",
      +        "type": "integer"
      +      },
      +      "warning_count": {
      +        "title": "Warning Count",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "total_wallets",
      +      "liquidatable_count",
      +      "critical_count",
      +      "warning_count",
      +      "caution_count",
      +      "healthy_count",
      +      "no_debt_count"
      +    ],
      +    "title": "RiskSummary",
      +    "type": "object"
      +  },
      +  "WalletRiskResult": {
      +    "properties": {
      +      "aave": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/AaveRisk"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "chain_id": {
      +        "title": "Chain Id",
      +        "type": "integer"
      +      },
      +      "compound": {
      +        "items": {
      +          "$ref": "#/$defs/CompoundRisk"
      +        },
      +        "title": "Compound",
      +        "type": "array"
      +      },
      +      "errors": {
      +        "items": {
      +          "$ref": "#/$defs/ProtocolErrorInfo"
      +        },
      +        "title": "Errors",
      +        "type": "array"
      +      },
      +      "overall_tier": {
      +        "title": "Overall Tier",
      +        "type": "string"
      +      },
      +      "wallet_address": {
      +        "title": "Wallet Address",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "wallet_address",
      +      "chain_id",
      +      "overall_tier"
      +    ],
      +    "title": "WalletRiskResult",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / results / items / $ref
      Added value: +"#/$defs/WalletRiskResult"
    • removedOutput schema / properties / results / items / properties
      Removed value: -{
      -  "aave": {
      -    "anyOf": [
      -      {
      -        "properties": {
      -          "health_factor": {
      -            "anyOf": [
      -              {
      -                "type": "number"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ],
      -            "title": "Health Factor"
      -          },
      -          "liquidation_threshold_bps": {
      -            "title": "Liquidation Threshold Bps",
      -            "type": "integer"
      -          },
      -          "ltv_bps": {
      -            "title": "Ltv Bps",
      -            "type": "integer"
      -          },
      -          "risk_tier": {
      -            "title": "Risk Tier",
      -            "type": "string"
      -          },
      -          "total_collateral_usd": {
      -            "title": "Total Collateral Usd",
      -            "type": "number"
      -          },
      -          "total_debt_usd": {
      -            "title": "Total Debt Usd",
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "health_factor",
      -          "risk_tier",
      -          "total_collateral_usd",
      -          "total_debt_usd",
      -          "liquidation_threshold_bps",
      -          "ltv_bps"
      -        ],
      -        "title": "AaveRisk",
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null
      -  },
      -  "chain_id": {
      -    "title": "Chain Id",
      -    "type": "integer"
      -  },
      -  "compound": {
      -    "items": {
      -      "properties": {
      -        "base_asset_symbol": {
      -          "title": "Base Asset Symbol",
      -          "type": "string"
      -        },
      -        "borrow_balance_raw": {
      -          "title": "Borrow Balance Raw",
      -          "type": "string"
      -        },
      -        "is_liquidatable": {
      -          "title": "Is Liquidatable",
      -          "type": "boolean"
      -        },
      -        "market_address": {
      -          "title": "Market Address",
      -          "type": "string"
      -        },
      -        "market_name": {
      -          "title": "Market Name",
      -          "type": "string"
      -        },
      -        "risk_tier": {
      -          "title": "Risk Tier",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "market_name",
      -        "market_address",
      -        "base_asset_symbol",
      -        "is_liquidatable",
      -        "borrow_balance_raw",
      -        "risk_tier"
      -      ],
      -      "title": "CompoundRisk",
      -      "type": "object"
      -    },
      -    "title": "Compound",
      -    "type": "array"
      -  },
      -  "errors": {
      -    "items": {
      -      "properties": {
      -        "error": {
      -          "title": "Error",
      -          "type": "string"
      -        },
      -        "protocol": {
      -          "title": "Protocol",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "protocol",
      -        "error"
      -      ],
      -      "title": "ProtocolErrorInfo",
      -      "type": "object"
      -    },
      -    "title": "Errors",
      -    "type": "array"
      -  },
      -  "overall_tier": {
      -    "title": "Overall Tier",
      -    "type": "string"
      -  },
      -  "wallet_address": {
      -    "title": "Wallet Address",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / properties / results / items / required
      Removed value: -[
      -  "wallet_address",
      -  "chain_id",
      -  "overall_tier"
      -]
    • removedOutput schema / properties / results / items / title
      Removed value: -"WalletRiskResult"
    • removedOutput schema / properties / results / items / type
      Removed value: -"object"
    • addedOutput schema / properties / summary / $ref
      Added value: +"#/$defs/RiskSummary"
    • removedOutput schema / properties / summary / properties
      Removed value: -{
      -  "caution_count": {
      -    "title": "Caution Count",
      -    "type": "integer"
      -  },
      -  "critical_count": {
      -    "title": "Critical Count",
      -    "type": "integer"
      -  },
      -  "healthy_count": {
      -    "title": "Healthy Count",
      -    "type": "integer"
      -  },
      -  "liquidatable_count": {
      -    "title": "Liquidatable Count",
      -    "type": "integer"
      -  },
      -  "no_debt_count": {
      -    "title": "No Debt Count",
      -    "type": "integer"
      -  },
      -  "total_wallets": {
      -    "title": "Total Wallets",
      -    "type": "integer"
      -  },
      -  "warning_count": {
      -    "title": "Warning Count",
      -    "type": "integer"
      -  }
      -}
    • removedOutput schema / properties / summary / required
      Removed value: -[
      -  "total_wallets",
      -  "liquidatable_count",
      -  "critical_count",
      -  "warning_count",
      -  "caution_count",
      -  "healthy_count",
      -  "no_debt_count"
      -]
    • removedOutput schema / properties / summary / title
      Removed value: -"RiskSummary"
    • removedOutput schema / properties / summary / type
      Removed value: -"object"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint annotation, the description explicitly warns that this is a 'View-only scan... not a liquidation simulation or guarantee', discloses that Compound v3 only exposes a boolean flag, and notes that duplicate addresses are silently removed. It also reveals per-protocol failure isolation and hardcoded market addresses, which are material behavioral details an agent could not infer from annotations or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is organized into clear labeled sections (summary, use when, limitations, alternatives) with no filler sentences. The core capability is front-loaded, and every subsequent sentence adds decision-relevant information, though there is minor repetition between the 'Use when' and 'Alternatives' sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with output schema and readOnly annotation, the description covers all necessary selection and invocation context: exact protocols/chains, batch size, aggregate output, sibling routing, and important limitations. Nothing critical is missing for an agent to decide whether and how to call this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the description need not repeat parameter details. It does restate the 'Ethereum or Base' chain choices and the 50-wallet/duplicate-removal constraints already present in the schema, but adds no new parameter-level detail such as address format or default-chain behavior beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb ('Assess'), a precise resource ('DeFi liquidation risk'), and scoping constraints ('up to 50 wallets', 'Aave v3 and Compound v3 on Ethereum or Base'). The description also enumerates concrete outputs (health factor, tiered risk classification, overall_tier), making it immediately distinguishable from portfolio or position tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Use when' section gives an explicit condition ('multi-wallet batch risk assessment (2+ wallets)') and names the correct alternative for single-wallet analysis (get_defi_positions). It also provides a clear decision rule for assess_counterparty_risk, and repeats the route in the 'Alternatives' section.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources