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

Table Details

PropertyValue
Clustering Key(s)to_date("funding_timestamp") (base table)

Table Columns

Market Information

Column NameDescription
market_idMarket identifier
funding_timestampSnapshot timestamp (hourly)
symbolMarket symbol (e.g., BTC, ETH)
market_type’perp’ or ‘spot’
base_symbolBase asset symbol
quote_symbolQuote asset symbol
collateral_symbolCollateral asset symbol (e.g., USDC). NULL for spots
base_l1_addressL1 contract address of the base asset. NULL for perpetuals

Prices

Column NameDescription
index_priceOracle/index price at snapshot time
mark_priceMark price used for PnL, liquidations, and funding
last_trade_priceLast traded price at snapshot time

Open Interest & Funding

Column NameDescription
open_interestOpen interest in USD at snapshot time
open_interest_limitMaximum OI allowed
current_funding_rateLive funding rate at snapshot time
funding_rateLast settled funding rate
funding_clamp_smallFunding rate lower clamp parameter
funding_clamp_bigFunding rate upper clamp parameter

Rolling 24h Metrics

Column NameDescription
daily_base_token_volumeRolling 24h volume in base units
daily_quote_token_volumeRolling 24h volume in quote/USD
daily_price_lowRolling 24h price low
daily_price_highRolling 24h price high
daily_price_changeRolling 24h price change percentage

Metadata

Column NameDescription
_created_atRow creation timestamp
_updated_atRow last-updated timestamp

Sample Query

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