> ## 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.

# Perpetual Market Stats

> Hourly perpetual market snapshots with prices, open interest, and funding rates

The `lighter.assets.perpetual_market_stats` table provides hourly snapshots of perpetual market data including prices, open interest, and funding rates.

### Table Details

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

## Table Columns

### Market Information

| Column Name        | Description                                                |
| ------------------ | ---------------------------------------------------------- |
| market\_id         | Market identifier                                          |
| funding\_timestamp | Snapshot timestamp (hourly)                                |
| symbol             | Market symbol (e.g., BTC, ETH)                             |
| market\_type       | 'perp' or 'spot'                                           |
| base\_symbol       | Base asset symbol                                          |
| quote\_symbol      | Quote asset symbol                                         |
| collateral\_symbol | Collateral asset symbol (e.g., USDC). NULL for spots       |
| base\_l1\_address  | L1 contract address of the base asset. NULL for perpetuals |

### Prices

| Column Name        | Description                                        |
| ------------------ | -------------------------------------------------- |
| index\_price       | Oracle/index price at snapshot time                |
| mark\_price        | Mark price used for PnL, liquidations, and funding |
| last\_trade\_price | Last traded price at snapshot time                 |

### Open Interest & Funding

| Column Name            | Description                           |
| ---------------------- | ------------------------------------- |
| open\_interest         | Open interest in USD at snapshot time |
| open\_interest\_limit  | Maximum OI allowed                    |
| current\_funding\_rate | Live funding rate at snapshot time    |
| funding\_rate          | Last settled funding rate             |
| funding\_clamp\_small  | Funding rate lower clamp parameter    |
| funding\_clamp\_big    | Funding rate upper clamp parameter    |

### Rolling 24h Metrics

| Column Name                 | Description                         |
| --------------------------- | ----------------------------------- |
| daily\_base\_token\_volume  | Rolling 24h volume in base units    |
| daily\_quote\_token\_volume | Rolling 24h volume in quote/USD     |
| daily\_price\_low           | Rolling 24h price low               |
| daily\_price\_high          | Rolling 24h price high              |
| daily\_price\_change        | Rolling 24h price change percentage |

### Metadata

| Column Name   | Description                |
| ------------- | -------------------------- |
| \_created\_at | Row creation timestamp     |
| \_updated\_at | Row last-updated timestamp |

## Sample Query

```sql theme={null}
SELECT
    symbol,
    funding_timestamp,
    mark_price,
    open_interest,
    current_funding_rate
FROM lighter.assets.perpetual_market_stats
WHERE funding_timestamp >= CURRENT_DATE - 1
  AND symbol = 'BTC'
ORDER BY funding_timestamp DESC
LIMIT 100
```
