> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypedexer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# liquidations

> Liquidation events aggregated per liquidated user and block

Subscribe with `{"method":"subscribe","subscription":{"type":"liquidations"}}`. The server first replays the latest cached events, then streams new ones in real time. Frames match **`LiquidationsUpdate`** in `components/schemas` of the same OpenAPI file.

## Aggregation model

Hyperliquid emits one fill per counterparty when liquidating a position. This stream rolls those fills back into a single event per liquidated user, per block:

* Fills are grouped by `(liquidatedUser, time_ms)`. Within a group, the **victim's fills** (where `user_addr == liquidatedUser`) are aggregated; the other addresses become `liquidators`.
* `size_total`, `notional_total`, and `fee_total_liquidated` are summed across the victim's fills.
* `fill_px_vwap = notional_total / size_total` (volume-weighted).
* `liq_dir` is derived from the victim's `dir` field (`Close Long` ⇒ `long`, `Close Short` ⇒ `short`).
* `liquidators` is deduplicated and lowercased; `liquidator_count` is its length.
* `tid` is the largest trade ID in the group (a liquidation may span several `tid`s, one per counterparty).
