Exchange Wire Formats

Lighter (Perpetuals & Spot) wire format

This page shows how Lighter messages become rows in our Parquet files. For each data type below, you see a real message next to the rows that we publish for it. The page also gives the source and the rule for each column. Put the pointer on a line or a column to see how they connect.

Checked against our pipeline

We recorded these messages from Lighter on 2026-10-05. Our test suite replays each message through the production collector parser and the postprocessor. The test fails if the published rows are different from the rows on this page. Files that we wrote before a change to the pipeline can be different. Refer to Known Gaps & Corrections.

Lighter identifies each market with a market index (1 is BTC, 2048 is ETH/USDC). The collector loads the market list from GET /api/v1/orderBooks when it starts and when it checks for new markets. It subscribes to order_book/<index> and trade/<index> for each active market. It also subscribes one time to market_stats/all (perpetuals) and spot_market_stats/all (spot). These two channels carry all markets, but we publish rows only for the active markets. Perpetual symbols are the base asset (BTC). Spot symbols are BASE/QUOTE on Lighter and BASE_QUOTE in our files (ETH_USDC).

  • Public WebSocket (order book, trades, market stats): wss://mainnet.zklighter.elliot.ai/stream
  • REST (market list): https://mainnet.zklighter.elliot.ai/api/v1/orderBooks

Exchange API reference: apidocs.lighter.xyz. For the conventions that apply to all exchanges, refer to the wire formats overview.

Trades

One row per trade from the trade/<index> channel, from both the trades and liquidation_trades arrays.

  • WebSocket trade/<index>

Trade update

One frame can contain several trades. Each trade becomes a separate row. We sort the rows by trade_time, then by trade_id.

WebSocket message · trade/<index>received 2026-10-05 19:15:04.723749 UTC
{
"channel": "trade:1",
"liquidation_trades": [],
"nonce": 23863348794,
"trades": [
{
"trade_id": 33380750090,
"trade_id_str": "33380750090",
"tx_hash": "0000001ea5bde783000001a10d7db4e4000000000000000000000000000000000000000000000000",
"type": "trade",
"market_id": 1,
"market_kind": "perps",
"size": "0.00010",
"price": "85636.3",
"usd_amount": "8.563630",
"ask_id": 562953487717055,
"ask_id_str": "562953487717055",
"bid_id": 844421361202466,
"bid_id_str": "844421361202466",
"ask_client_id": 31938461114236,
"ask_client_id_str": "31938461114236",
"bid_client_id": 5434,
"bid_client_id_str": "5434",
"ask_account_id": 702384,
"bid_account_id": 750305,
"is_maker_ask": true,
"block_height": 349153116,
"timestamp": 1791227704548,
"taker_position_size_before": "-0.00001",
"taker_entry_quote_before": "0.856509",
"taker_initial_margin_fraction_before": 500,
"taker_position_sign_changed": true,
"maker_fee": 28,
"maker_position_size_before": "39.75775",
"maker_entry_quote_before": "3398551.295093",
"maker_initial_margin_fraction_before": 3333,
"transaction_time": 1791227704597066,
"ask_order_version": 0,
"bid_order_version": 0
},
{
"trade_id": 33380750089,
"trade_id_str": "33380750089",
"tx_hash": "b5313d3bcb15bfa14b7c18ea21330d3e0efdf5ba80874c3e478f9fcfd641d10e248218a5ffabf4ce",
"type": "trade",
"market_id": 1,
"market_kind": "perps",
"size": "0.00031",
"price": "85635.5",
"usd_amount": "26.547005",
"ask_id": 562953487717054,
"ask_id_str": "562953487717054",
"bid_id": 844421361202466,
"bid_id_str": "844421361202466",
"ask_client_id": 34120,
"ask_client_id_str": "34120",
"bid_client_id": 5434,
"bid_client_id_str": "5434",
"ask_account_id": 281474976623775,
"bid_account_id": 750305,
"is_maker_ask": true,
"block_height": 349153116,
"timestamp": 1791227704548,
"taker_position_size_before": "-0.00032",
"taker_entry_quote_before": "27.408314",
"taker_initial_margin_fraction_before": 500,
"maker_fee": 36,
"maker_position_size_before": "1.36744",
"maker_entry_quote_before": "117314.743225",
"maker_initial_margin_fraction_before": 2000,
"transaction_time": 1791227704596967,
"ask_order_version": 0,
"bid_order_version": 0
}
],
"type": "update/trade"
}

Published rows · 2

received_time1791227704723749000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227704548trades[].timestampCopied from the timestamp of the trade. Milliseconds. The same value as trade_time, because the frame has no separate event time.
symbolBTCchannelThe symbol of the market index in channel (1 is BTC). We find it in the market list that the collector loads from GET /api/v1/orderBooks.
trade_id33380750089trades[].trade_idCopied. All Lighter markets share one counter. Thus, the IDs of a market increase but are not contiguous.
price85635.5trades[].priceCopied as the exact decimal string.
quantity0.00031trades[].sizeCopied from size as the exact decimal string. Base asset units.
trade_time1791227704548trades[].timestampCopied from the timestamp of the trade. Milliseconds.
is_buyer_makerfalsetrades[].is_maker_askThe opposite of is_maker_ask. is_maker_ask: true means that the seller was the maker. Thus, the buyer was the aggressor, and is_buyer_maker is false. true if Lighter does not send is_maker_ask.
order_typetradetrades[].typeCopied from type. trade for normal trades, liquidation for liquidations.

Subscription replay with an old liquidation

When the collector subscribes (also after each reconnect), Lighter first sends subscribed/trade. This frame contains the most recent trades and, separately, the most recent liquidations. These liquidations can be hours old. We publish a trade from this frame only when two conditions are true. Its timestamp is not earlier than 5 seconds before the start of the arrival hour. We did not already publish its trade_id. In this example, we publish the two trades. We do not publish the liquidation from 16:23 UTC, which we received at 19:15 UTC.

Shortened: Lighter sent 50 trades and 50 liquidations in this frame. The example shows two trades and the most recent liquidation.

WebSocket message · trade/<index>received 2026-10-05 19:15:04.145348 UTC
{
"channel": "trade:1",
"liquidation_trades": [
{
"trade_id": 33365034814,
"trade_id_str": "33365034814",
"tx_hash": "0000001ea368fe94000001a10ce03f1f000000000000000000000000000000000000000000000000",
"type": "liquidation",
"market_id": 1,
"market_kind": "perps",
"size": "0.00873",
"price": "84943.1",
"usd_amount": "741.553263",
"ask_id": 562953486967141,
"ask_id_str": "562953486967141",
"bid_id": 844421361906196,
"bid_id_str": "844421361906196",
"ask_client_id": 0,
"ask_client_id_str": "0",
"bid_client_id": 152055869430945,
"bid_client_id_str": "152055869430945",
"ask_account_id": 281474976502928,
"bid_account_id": 726722,
"is_maker_ask": false,
"block_height": 349069394,
"timestamp": 1791217385247,
"taker_fee": 10000,
"taker_position_size_before": "0.00873",
"taker_entry_quote_before": "747.818784",
"taker_initial_margin_fraction_before": 200,
"taker_position_sign_changed": true,
"maker_fee": 28,
"maker_position_size_before": "2.22729",
"maker_entry_quote_before": "189612.331672",
"maker_initial_margin_fraction_before": 500,
"transaction_time": 1791217385309461,
"taker_allocated_margin_usdc_before": 15057329,
"ask_order_version": 0,
"bid_order_version": 0
}
],
"nonce": 23863347871,
"trades": [
{
"trade_id": 33380746827,
"trade_id_str": "33380746827",
"tx_hash": "0000001ea5bdc7d8000001a10d7dadd0000000000000000000000000000000000000000000000000",
"type": "trade",
"market_id": 1,
"market_kind": "perps",
"size": "0.00012",
"price": "85636.0",
"usd_amount": "10.276320",
"ask_id": 562953487717006,
"ask_id_str": "562953487717006",
"bid_id": 844421361202510,
"bid_id_str": "844421361202510",
"ask_client_id": 1000700396,
"ask_client_id_str": "1000700396",
"bid_client_id": 57912887826612,
"bid_client_id_str": "57912887826612",
"ask_account_id": 711373,
"bid_account_id": 27927,
"is_maker_ask": false,
"block_height": 349153099,
"timestamp": 1791227702736,
"taker_position_size_before": "-0.00020",
"taker_entry_quote_before": "17.127220",
"taker_initial_margin_fraction_before": 1000,
"maker_fee": 38,
"maker_position_size_before": "-8.04322",
"maker_entry_quote_before": "687471.664393",
"maker_initial_margin_fraction_before": 500,
"transaction_time": 1791227702773021,
"ask_order_version": 0,
"bid_order_version": 0
},
{
"trade_id": 33380746738,
"trade_id_str": "33380746738",
"tx_hash": "0000001ea5bdc718000001a10d7dadd0000000000000000000000000000000000000000000000000",
"type": "trade",
"market_id": 1,
"market_kind": "perps",
"size": "0.00003",
"price": "85636.4",
"usd_amount": "2.569092",
"ask_id": 562953487717000,
"ask_id_str": "562953487717000",
"bid_id": 844421361202507,
"bid_id_str": "844421361202507",
"ask_client_id": 34116,
"ask_client_id_str": "34116",
"bid_client_id": 0,
"bid_client_id_str": "0",
"ask_account_id": 281474976623775,
"bid_account_id": 723636,
"is_maker_ask": true,
"block_height": 349153099,
"timestamp": 1791227702736,
"taker_fee": 100,
"taker_position_size_before": "0.01240",
"taker_entry_quote_before": "1061.781826",
"taker_initial_margin_fraction_before": 200,
"maker_fee": 36,
"maker_position_size_before": "1.36759",
"maker_entry_quote_before": "117327.611953",
"maker_initial_margin_fraction_before": 2000,
"transaction_time": 1791227702737142,
"ask_order_version": 0,
"bid_order_version": 0
}
],
"type": "subscribed/trade"
}

Published rows · 2

received_time1791227704145348000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227702736trades[].timestampliquidation_trades[].timestampCopied from the timestamp of the trade. Milliseconds. The same value as trade_time, because the frame has no separate event time.
symbolBTCchannelThe symbol of the market index in channel (1 is BTC). We find it in the market list that the collector loads from GET /api/v1/orderBooks.
trade_id33380746738trades[].trade_idliquidation_trades[].trade_idCopied. All Lighter markets share one counter. Thus, the IDs of a market increase but are not contiguous.
price85636.4trades[].priceliquidation_trades[].priceCopied as the exact decimal string.
quantity0.00003trades[].sizeliquidation_trades[].sizeCopied from size as the exact decimal string. Base asset units.
trade_time1791227702736trades[].timestampliquidation_trades[].timestampCopied from the timestamp of the trade. Milliseconds.
is_buyer_makerfalsetrades[].is_maker_askliquidation_trades[].is_maker_askThe opposite of is_maker_ask. is_maker_ask: true means that the seller was the maker. Thus, the buyer was the aggressor, and is_buyer_maker is false. true if Lighter does not send is_maker_ask.
order_typetradetrades[].typeliquidation_trades[].typeCopied from type. trade for normal trades, liquidation for liquidations.

Spot trade (ETH/USDC)

Spot markets use the same channel and mapping. Only the symbol is different. Lighter names spot markets BASE/QUOTE, and we publish them as BASE_QUOTE.

WebSocket message · trade/<index>received 2026-10-05 19:18:38.989871 UTC
{
"channel": "trade:2048",
"liquidation_trades": [],
"nonce": 23863586690,
"trades": [
{
"trade_id": 33381085033,
"trade_id_str": "33381085033",
"tx_hash": "0000001ea5caa221000001a10d80fa0e000000000000000000000000000000000000000000000000",
"type": "trade",
"market_id": 2048,
"market_kind": "spot",
"size": "0.0001",
"price": "2713.60",
"usd_amount": "0.000000",
"ask_id": 576742227473933817,
"ask_id_str": "576742227473933817",
"bid_id": 577023702063775400,
"bid_id_str": "577023702063775400",
"ask_client_id": 51016536833,
"ask_client_id_str": "51016536833",
"bid_client_id": 0,
"bid_client_id_str": "0",
"ask_account_id": 314233,
"bid_account_id": 255124,
"is_maker_ask": true,
"block_height": 349154892,
"timestamp": 1791227918862,
"taker_fee": 280,
"taker_position_size_before": "0.0000",
"taker_entry_quote_before": "0.000000",
"taker_position_sign_changed": true,
"maker_fee": 28,
"maker_position_size_before": "0.0000",
"maker_entry_quote_before": "0.000000",
"maker_position_sign_changed": true,
"transaction_time": 1791227918862785,
"ask_order_version": 0,
"bid_order_version": 0
}
],
"type": "update/trade"
}

Published row

received_time1791227918989871000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227918862trades[].timestampCopied from the timestamp of the trade. Milliseconds. The same value as trade_time, because the frame has no separate event time.
symbolETH_USDCchannelThe symbol of the market index in channel (2048 is ETH/USDC). We find it in the market list that the collector loads from GET /api/v1/orderBooks, and replace / with _.
trade_id33381085033trades[].trade_idCopied. All Lighter markets share one counter. Thus, the IDs of a market increase but are not contiguous.
price2713.60trades[].priceCopied as the exact decimal string.
quantity0.0001trades[].sizeCopied from size as the exact decimal string. Base asset units (ETH).
trade_time1791227918862trades[].timestampCopied from the timestamp of the trade. Milliseconds.
is_buyer_makerfalsetrades[].is_maker_askThe opposite of is_maker_ask. is_maker_ask: true means that the seller was the maker. Thus, the buyer was the aggressor, and is_buyer_maker is false. true if Lighter does not send is_maker_ask.
order_typetradetrades[].typeCopied from type. trade for normal trades, liquidation for liquidations.

Notes

  • Sometimes Lighter sends a trade a second time, some seconds later, in a normal update/trade frame. A repeated trade_id is always a repeated delivery of the same trade, because trade_id is one counter for all markets. We publish only the first delivery, also when the repeat comes in the next hour.
  • We put each row in the file for its arrival hour (received_time). Lighter's trade feed can be late by seconds, and sometimes by minutes. Thus, a late trade can be in the file of the next hour. If you need a complete window, filter on trade_time and also load the next hour.
  • We copy order_type as Lighter sends it. Thus, other trade types in the Lighter documentation (deleverage, market-settlement) show with their own names.
  • Files from before the October 2026 pipeline update contain no rows from liquidation_trades and no trades from subscribed/trade replays. Thus, these files do not contain liquidation fills that Lighter sent only in liquidation_trades. They also do not contain trades that the collector did not receive during reconnects.

For the column types and descriptions, refer to the Trades schema.

Order Book

One row per price level from the order_book/<index> channel. First the subscribed/order_book snapshot, then update/order_book updates.

  • WebSocket order_book/<index>

Subscription snapshot

When the collector subscribes, also after each reconnect, Lighter sends the order book as subscribed/order_book. Each snapshot becomes one snapshot row per level and starts a new nonce chain.

Shortened: Lighter sent 1821 bid levels and 1271 ask levels in this snapshot. The example shows the best two levels of each side.

WebSocket message · order_book/<index>received 2026-10-05 19:15:04.141358 UTC
{
"channel": "order_book:1",
"last_updated_at": 1791227703748044,
"offset": 4577935,
"order_book": {
"code": 0,
"asks": [
{
"price": "85635.5",
"size": "0.03539"
},
{
"price": "85635.7",
"size": "0.01700"
}
],
"bids": [
{
"price": "85635.3",
"size": "0.00020"
},
{
"price": "85635.2",
"size": "0.00020"
}
],
"offset": 4577935,
"nonce": 23863347847,
"last_updated_at": 1791227703748044,
"begin_nonce": 0
},
"timestamp": 1791227703769,
"type": "subscribed/order_book"
}

Published rows · 4

received_time1791227704141358000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227703769timestampCopied from the top-level timestamp. This is the time when Lighter's API server published the frame. Milliseconds.
transaction_time1791227703748last_updated_atWe divide the top-level last_updated_at by 1,000 and truncate it to milliseconds. last_updated_at is Lighter's time of the last order book update, in microseconds.
symbolBTCchannelThe symbol of the market index in channel (1 is BTC). We find it in the market list that the collector loads from GET /api/v1/orderBooks.
event_typesnapshottypesnapshot for subscribed/order_book.
first_update_idnull—Null. Lighter sends no first update ID.
final_update_id23863347847order_book.nonceCopied. The sequence number of the matching engine. The update chain starts here.
prev_final_update_idnull—Null for snapshots. Lighter sends begin_nonce 0 in snapshots. This value is not a link to an earlier message.
last_update_id4577935offsetCopied. The message offset of the API server. Lighter also sends it as order_book.offset. It gives the order of the messages but is not contiguous. It starts again when the collector reconnects to a different server.
sidebidorder_book.bidsorder_book.asksbid for levels in bids, ask for levels in asks. One row per level.
price85635.3order_book.bids[].priceorder_book.asks[].priceCopied as the exact decimal string.
quantity0.00020order_book.bids[].sizeorder_book.asks[].sizeCopied from size as the exact decimal string. Base asset units.
order_countnull—Null. Lighter does not report order counts.

Order book update

This is the first update after the snapshot above. Its begin_nonce equals the nonce of the snapshot. This update changes only asks. bids is empty.

WebSocket message · order_book/<index>received 2026-10-05 19:15:04.141780 UTC
{
"channel": "order_book:1",
"last_updated_at": 1791227703793710,
"offset": 4577939,
"order_book": {
"code": 0,
"asks": [
{
"price": "85635.5",
"size": "0.00043"
},
{
"price": "85635.7",
"size": "0.00000"
},
{
"price": "85636.0",
"size": "0.00000"
},
{
"price": "85640.9",
"size": "0.29572"
}
],
"bids": [],
"offset": 4577939,
"nonce": 23863347898,
"last_updated_at": 1791227703793710,
"begin_nonce": 23863347847
},
"timestamp": 1791227703809,
"type": "update/order_book"
}

Published rows · 4

received_time1791227704141780000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227703809timestampCopied from the top-level timestamp. This is the time when Lighter's API server published the frame. Milliseconds.
transaction_time1791227703793last_updated_atWe divide the top-level last_updated_at by 1,000 and truncate it to milliseconds. last_updated_at is Lighter's time of the last order book update, in microseconds.
symbolBTCchannelThe symbol of the market index in channel (1 is BTC). We find it in the market list that the collector loads from GET /api/v1/orderBooks.
event_typeupdatetypeupdate for update/order_book.
first_update_idnull—Null. Lighter sends no first update ID.
final_update_id23863347898order_book.nonceCopied. The sequence number of the matching engine after this update.
prev_final_update_id23863347847order_book.begin_nonceCopied. It equals the nonce of the previous message (snapshot or update). A mismatch is a gap.
last_update_id4577939offsetCopied. The message offset of the API server. Lighter also sends it as order_book.offset. It gives the order of the messages but is not contiguous. It starts again when the collector reconnects to a different server.
sideaskorder_book.bidsorder_book.asksbid for levels in bids, ask for levels in asks. One row per level.
price85635.5order_book.asks[].priceCopied as the exact decimal string.
quantity0.00043order_book.asks[].sizeCopied from size as the exact decimal string. The new total at that price, in base asset units. 0.00000 removes the level.
order_countnull—Null. Lighter does not report order counts.

Notes

  • The prev_final_update_id (begin_nonce) of each update equals the final_update_id (nonce) of the previous message. A snapshot starts a new chain. A mismatch is a gap. If you find a gap, continue from the next snapshot.
  • We publish a message with no levels as one row with side noop, price 0 and quantity 0. Thus, the nonce chain stays complete. A noop update changes no level. A noop snapshot means that the order book is empty. Clear your order book.
  • last_update_id (offset) starts again when the collector reconnects to a different Lighter server. Thus, a lower value after a reconnect is normal. Use the nonce chain to find gaps.
  • Files from before the 2026-09 data-integrity release have the offset in both final_update_id and last_update_id. In these files, prev_final_update_id is empty.
  • Lighter's REST order list (GET /api/v1/orderBookOrders) has no nonce. Thus, you cannot use it as the base for the update stream, and we do not publish it. Files from before the October 2026 pipeline update can contain snapshot rows that we made from this list. This occurred when REST snapshots were on in the collector. Do not use those rows as the base for the order book.
  • Files from before the October 2026 pipeline update have our receive time in milliseconds as event_time and an empty transaction_time.
  • A file can start with a checkpoint snapshot of the order book from the previous hour. Its received_time is the start of the hour, and its transaction_time is null. Its final_update_id is the nonce of the last applied message. In these rows, last_update_id also contains that nonce, not an offset.

For the column types and descriptions, refer to the Order Book schema.

Ticker

One row per market per market_stats/all or spot_market_stats/all frame that includes the market.

  • WebSocket market_stats/all
  • WebSocket spot_market_stats/all

Perpetual market stats

Shortened: This update/market_stats frame contained 99 of the 235 markets in the subscription snapshot. The example shows only BTC (market index 1). Each market becomes a separate row.

WebSocket messagereceived 2026-10-05 19:15:04.354191 UTC
{
"channel": "market_stats:all",
"market_stats": {
"1": {
"symbol": "BTC",
"market_id": 1,
"index_price": "85667.7",
"mark_price": "85635.1",
"mid_price": "85635.4",
"best_ask_price": "85635.5",
"best_bid_price": "85635.3",
"open_interest": "163238852.201930",
"open_interest_limit": "72057594037927936.000000",
"funding_clamp_small": "0.0500",
"funding_clamp_big": "4.0000",
"last_trade_price": "85631.6",
"current_funding_rate": "0.0012",
"funding_rate": "0.0012",
"funding_timestamp": 1791226800002,
"daily_base_token_volume": 9275.68025,
"daily_quote_token_volume": 797148325.667363,
"daily_price_low": 84940.2,
"daily_price_high": 86955.4,
"daily_price_change": -0.20010862040431965,
"base_interest_rate": "0.0100",
"premium": "-0.0277"
}
},
"timestamp": 1791227704229,
"type": "update/market_stats"
}

Published row

received_time1791227704354191000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227704229timestampCopied from the top-level timestamp of the frame. Milliseconds.
symbolBTCmarket_stats.1.market_idThe symbol of market_id in the market list that the collector loads from GET /api/v1/orderBooks.
price_changenull—Null. Lighter sends only the percentage change.
price_change_percent-0.20010862040431965market_stats.1.daily_price_changeCopied. Percent: -0.2 means −0.2 %.
weighted_average_pricenull—Null. Lighter does not send this value.
last_price85631.6market_stats.1.last_trade_priceCopied.
last_quantitynull—Null. Lighter does not send this value.
open_pricenull—Null. Lighter does not send this value.
high_price86955.4market_stats.1.daily_price_highCopied.
low_price84940.2market_stats.1.daily_price_lowCopied.
base_asset_volume9275.68025market_stats.1.daily_base_token_volumeCopied. Base asset units.
quote_asset_volume797148325.667363market_stats.1.daily_quote_token_volumeCopied. Quote currency units.
statistics_open_timenull—Null. Lighter does not send this value.
statistics_close_timenull—Null. Lighter does not send this value.
first_trade_idnull—Null. Lighter does not send this value.
last_trade_idnull—Null. Lighter does not send this value.
total_tradesnull—Null. Lighter does not send this value.

Spot market stats (ETH/USDC)

The data for spot markets comes on spot_market_stats/all. This channel has no mark price, funding or open interest. Spot markets publish only ticker rows.

Shortened: This subscribed/spot_market_stats frame contained 11 spot markets. The example shows only ETH/USDC (market index 2048).

WebSocket messagereceived 2026-10-05 19:15:03.894461 UTC
{
"channel": "spot_market_stats:all",
"spot_market_stats": {
"2048": {
"symbol": "ETH/USDC",
"market_id": 2048,
"index_price": "2709.710000",
"mid_price": "2709.70",
"best_ask_price": "2709.70",
"best_bid_price": "2709.69",
"last_trade_price": "2709.69",
"daily_base_token_volume": 80.6425,
"daily_quote_token_volume": 218436.236399,
"daily_price_low": 2681.47,
"daily_price_high": 2751.24,
"daily_price_change": 0.08791013958504937
}
},
"timestamp": 1791227703768,
"type": "subscribed/spot_market_stats"
}

Published row

received_time1791227703894461000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227703768timestampCopied from the top-level timestamp of the frame. Milliseconds.
symbolETH_USDCspot_market_stats.2048.market_idThe symbol of market_id (2048 is ETH/USDC) in the market list that the collector loads from GET /api/v1/orderBooks. We replace / with _.
price_changenull—Null. Lighter sends only the percentage change.
price_change_percent0.08791013958504937spot_market_stats.2048.daily_price_changeCopied. Percent: -0.2 means −0.2 %.
weighted_average_pricenull—Null. Lighter does not send this value.
last_price2709.69spot_market_stats.2048.last_trade_priceCopied.
last_quantitynull—Null. Lighter does not send this value.
open_pricenull—Null. Lighter does not send this value.
high_price2751.24spot_market_stats.2048.daily_price_highCopied.
low_price2681.47spot_market_stats.2048.daily_price_lowCopied.
base_asset_volume80.6425spot_market_stats.2048.daily_base_token_volumeCopied. Base asset units.
quote_asset_volume218436.236399spot_market_stats.2048.daily_quote_token_volumeCopied. Quote asset units (USDC).
statistics_open_timenull—Null. Lighter does not send this value.
statistics_close_timenull—Null. Lighter does not send this value.
first_trade_idnull—Null. Lighter does not send this value.
last_trade_idnull—Null. Lighter does not send this value.
total_tradesnull—Null. Lighter does not send this value.

Notes

  • The market stats channels have no 24-hour window limits, open price, trade count or trade IDs. Those columns are null.
  • Files from before the October 2026 pipeline update have our receive time in nanoseconds as event_time instead of Lighter's publication time in milliseconds.

For the column types and descriptions, refer to the Ticker schema.

Mark Price

One row per perpetual market per market_stats/all frame that includes the market.

  • WebSocket market_stats/all

Shortened: This update/market_stats frame contained 99 of the 235 markets in the subscription snapshot. The example shows only BTC (market index 1). Each market becomes a separate row.

WebSocket message · market_stats/allreceived 2026-10-05 19:15:04.354191 UTC
{
"channel": "market_stats:all",
"market_stats": {
"1": {
"symbol": "BTC",
"market_id": 1,
"index_price": "85667.7",
"mark_price": "85635.1",
"mid_price": "85635.4",
"best_ask_price": "85635.5",
"best_bid_price": "85635.3",
"open_interest": "163238852.201930",
"open_interest_limit": "72057594037927936.000000",
"funding_clamp_small": "0.0500",
"funding_clamp_big": "4.0000",
"last_trade_price": "85631.6",
"current_funding_rate": "0.0012",
"funding_rate": "0.0012",
"funding_timestamp": 1791226800002,
"daily_base_token_volume": 9275.68025,
"daily_quote_token_volume": 797148325.667363,
"daily_price_low": 84940.2,
"daily_price_high": 86955.4,
"daily_price_change": -0.20010862040431965,
"base_interest_rate": "0.0100",
"premium": "-0.0277"
}
},
"timestamp": 1791227704229,
"type": "update/market_stats"
}

Published row

received_time1791227704354191000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
event_time1791227704229timestampCopied from the top-level timestamp of the frame. Milliseconds.
symbolBTCmarket_stats.1.market_idThe symbol of market_id in the market list that the collector loads from GET /api/v1/orderBooks.
mark_price85635.1market_stats.1.mark_priceCopied.
index_price85667.7market_stats.1.index_priceCopied.
estimated_settle_pricenull—Null. Lighter does not send this value.
funding_rate0.000012market_stats.1.current_funding_ratecurrent_funding_rate divided by 100. Lighter sends percent per hour (0.0012 is 0.0012 %). We publish a fraction for each hourly funding period (0.000012). current_funding_rate is Lighter's estimate of the next payment. We use funding_rate, the last payment, only when current_funding_rate is not in the message.
next_funding_time1791230400000market_stats.1.funding_timestampThe next full hour after funding_timestamp. Milliseconds. funding_timestamp is the time when Lighter applied the last funding, on the hour or a few milliseconds after it. Lighter settles funding every hour.

Notes

  • Spot markets publish no mark price rows.
  • Files from before the 2026-09 data-integrity release had funding_rate in percent. In these files, next_funding_time was the last funding time. We corrected these files on 2026-09-30.
  • Files from before the October 2026 pipeline update have our receive time in nanoseconds as event_time instead of Lighter's publication time in milliseconds.

For the column types and descriptions, refer to the Mark Price schema.

Open Interest

One row per perpetual market per market_stats/all frame that includes the market.

  • WebSocket market_stats/all

Shortened: This update/market_stats frame contained 99 of the 235 markets in the subscription snapshot. The example shows only BTC (market index 1). Each market becomes a separate row.

WebSocket message · market_stats/allreceived 2026-10-05 19:15:04.354191 UTC
{
"channel": "market_stats:all",
"market_stats": {
"1": {
"symbol": "BTC",
"market_id": 1,
"index_price": "85667.7",
"mark_price": "85635.1",
"mid_price": "85635.4",
"best_ask_price": "85635.5",
"best_bid_price": "85635.3",
"open_interest": "163238852.201930",
"open_interest_limit": "72057594037927936.000000",
"funding_clamp_small": "0.0500",
"funding_clamp_big": "4.0000",
"last_trade_price": "85631.6",
"current_funding_rate": "0.0012",
"funding_rate": "0.0012",
"funding_timestamp": 1791226800002,
"daily_base_token_volume": 9275.68025,
"daily_quote_token_volume": 797148325.667363,
"daily_price_low": 84940.2,
"daily_price_high": 86955.4,
"daily_price_change": -0.20010862040431965,
"base_interest_rate": "0.0100",
"premium": "-0.0277"
}
},
"timestamp": 1791227704229,
"type": "update/market_stats"
}

Published row

received_time1791227704354191000—Our collector's clock when it received the message, in nanoseconds since the Unix epoch. Lighter does not send this value.
symbolBTCmarket_stats.1.market_idThe symbol of market_id in the market list that the collector loads from GET /api/v1/orderBooks.
sum_open_interest1906.2143market_stats.1.open_interestmarket_stats.1.mark_priceopen_interest divided by mark_price. We round half-even to the size precision of the market (supported_size_decimals from GET /api/v1/orderBooks, 5 for BTC). Then we remove trailing zeros. For example, we publish 1906.21430 as 1906.2143. Base asset units.
sum_open_interest_value163238852.201930market_stats.1.open_interestCopied. USD notional. The stream sends open interest in base units multiplied by the mark price.
timestamp1791227704229timestampCopied from the top-level timestamp of the frame. Milliseconds.

Notes

  • Lighter's open_interest is the USD notional, not base units. The base open interest from GET /api/v1/orderBookDetails, multiplied by the mark price, gives the same value.
  • Spot markets publish no open interest rows.
  • Files from before the 2026-09 data-integrity release had the USD notional in sum_open_interest. We corrected these files on 2026-09-30.
  • Files from before the October 2026 pipeline update have our receive time in nanoseconds as timestamp instead of Lighter's publication time in milliseconds.

For the column types and descriptions, refer to the Open Interest schema.

Not published

  • Liquidations: Lighter has no separate liquidation stream. Liquidation fills come on the trade channel. We publish them as trades with order_type liquidation.

If you cannot find the information that you need, tell us. We also help with integrations.

Contact support