Skip to main content
The lighter.raw.trades table contains raw trade data from Lighter.

Table Details

PropertyValue
Clustering Key(s)to_date("timestamp")

Table Columns

Column NameDescription
trade_idUnique identifier for the trade
tx_hashOn-chain transaction hash
typeTrade type: ‘trade’, ‘liquidation’, or ‘deleverage’
market_idMarket this trade belongs to
sizeTrade size in base asset units
priceExecution price
usd_amountUSD value
ask_account_idAccount ID of the ask (sell) side
bid_account_idAccount ID of the bid (buy) side
ask_idOrder ID of the ask side
bid_idOrder ID of the bid side
ask_client_idClient-assigned order ID for ask side
bid_client_idClient-assigned order ID for bid side
is_maker_askTrue if the maker is on the ask side
block_heightBlock height of the trade
timestampUTC timestamp of the trade
maker_feeMaker fee in ppm
taker_feeTaker fee in ppm
taker_position_size_beforeTaker’s position size before this trade
maker_position_size_beforeMaker’s position size before this trade
taker_position_sign_changedWhether taker’s position sign changed
maker_position_sign_changedWhether maker’s position sign changed

Sample Query

SELECT
    trade_id,
    timestamp,
    market_id,
    type,
    size,
    price,
    usd_amount
FROM lighter.raw.trades
WHERE timestamp >= CURRENT_DATE - 1
ORDER BY timestamp DESC
LIMIT 100