Liquidation Risk
liquidation_riskAssess a Hyperliquid perpetual account's liquidation risk using its address. Returns margin summary, liquidation prices, estimated distance, and funding drag to help manage positions.
Instructions
KEY TOOL. Liquidation risk for one perp account (clearinghouseState + userFunding): margin summary (accountValue, totalRawUsd, totalMarginUsed, withdrawable), cross maintenance margin, per-position leverage/entry/mark/unrealizedPnl and liquidationPx when the venue provides it. Positions in the LIVE clearinghouseState response carry NO markPx: mark is resolved per coin from metaAndAssetCtxs (fallback allMids) and each row says where it came from in mark_px_source ('position' | 'metaAndAssetCtxs' | 'allMids' | null). When liquidationPx is null, liq_distance_pct is an ESTIMATE from the maintenance-margin ratio (crossMaintenanceMarginUsed / marginSummary.accountValue; isolated positions use marginUsed / positionValue) - flagged 'estimated': true, liqPx stays null (honest). funding_drag totals negative funding payments from userFunding. Address must be 0x + 40 hex. Example: liquidation_risk(address="0x...")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||