Liquidation price
liq_priceCalculates liquidation prices for isolated Hyperliquid perpetual positions or single-collateral Aave V3 loans using margin tiers, entry, size, margin, collateral, debt, and threshold inputs.
Instructions
Liquidation price of a fresh isolated Hyperliquid perp position (kind=perp: side, entry, size in coins, isolated margin in USD, and either coin to use that market's live margin tiers or maxLeverage for a single tier), or of a single-collateral, single-debt Aave V3 loan in standard mode (kind=loan: collateral amount, debt in USD, collateral price, liquidation threshold). Uses Hyperliquid's documented formula and Aave's health factor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | No | perp: market whose live margin tiers to use | |
| kind | Yes | ||
| side | No | Position side | |
| size | No | perp: size in coins | |
| entry | No | perp: entry price | |
| price | No | loan: collateral price in USD | |
| margin | No | perp: isolated margin in USD | |
| debtUsd | No | loan: debt in USD | |
| collateral | No | loan: collateral amount in tokens | |
| maxLeverage | No | perp: max leverage for a single tier, instead of coin | |
| liqThreshold | No | loan: liquidation threshold, 0..1 |