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

# Liquidations

> Lighter liquidation events

The `lighter.dex.liquidations` table contains liquidation events only. The taker is the liquidated account, and the maker is the counterparty.

### Table Details

| Property          | Value                               |
| ----------------- | ----------------------------------- |
| Clustering Key(s) | `to_date("timestamp")` (base table) |

## Table Columns

### Market Information

| Column Name      | Description            |
| ---------------- | ---------------------- |
| market\_type     | 'perpetuals' or 'spot' |
| coin             | Market symbol          |
| token\_a\_symbol | Base token symbol      |
| token\_b\_symbol | Quote token symbol     |

### Liquidation Details

| Column Name               | Description                                                           |
| ------------------------- | --------------------------------------------------------------------- |
| amount                    | Liquidation size in base asset units                                  |
| price                     | Execution price                                                       |
| usd\_amount               | USD value of the liquidation                                          |
| liquidated\_account\_id   | Account ID of the liquidated party                                    |
| counterparty\_account\_id | Account ID of the counterparty (maker)                                |
| liquidated\_l1\_address   | EVM wallet address of the liquidated party. NULL if no mapping exists |
| counterparty\_l1\_address | EVM wallet address of the counterparty. NULL if no mapping exists     |
| buyer                     | Account ID of the buyer (bid side)                                    |
| seller                    | Account ID of the seller (ask side)                                   |
| buyer\_l1\_address        | EVM wallet address of the buyer. NULL if no mapping exists            |
| seller\_l1\_address       | EVM wallet address of the seller. NULL if no mapping exists           |

### Transaction Information

| Column Name       | Description                |
| ----------------- | -------------------------- |
| timestamp         | UTC timestamp of the event |
| transaction\_hash | On-chain transaction hash  |
| trade\_id         | Unique trade identifier    |
| unique\_id        | Alias of trade\_id         |

### Fees & Margins

| Column Name                        | Description                                |
| ---------------------------------- | ------------------------------------------ |
| liquidation\_fee\_rate             | Liquidation fee as decimal fraction        |
| liquidation\_fee\_amount           | Liquidation fee in USD                     |
| liquidated\_position\_size\_before | Liquidated account's position before event |
| liquidated\_max\_leverage          | Liquidated account's max leverage          |
| market\_max\_leverage              | Maximum leverage for this market           |
| maintenance\_margin\_fraction      | Market maintenance margin fraction         |
| closeout\_margin\_fraction         | Market closeout margin fraction            |

## Sample Query

```sql theme={null}
SELECT
    timestamp,
    coin,
    amount,
    price,
    usd_amount,
    liquidated_account_id,
    counterparty_account_id,
    liquidation_fee_amount
FROM lighter.dex.liquidations
WHERE timestamp >= CURRENT_DATE - 7
ORDER BY timestamp DESC
LIMIT 100
```
