lighter-data
Pull Lighter (zkLighter) market data into Parquet: funding history, candles, historical L2 book + trades — plus a live WebSocket recorder for the data no archive sells yet. Everything is free: public REST / WebSocket, no API key, no account.
Lighter is a young zk CLOB venue with 0%/0% maker/taker fees, perps and a small set of USDC spot markets. There is no official historical-data tooling: symbols are numeric market indices, history endpoints silently cap a single response (~750 funding rows, 500 candles), and the funding rate arrives as an unsigned percent-per-hour magnitude with the sign in a separate field. This package deals with all of that and writes tidy, manifest-checked Parquet.
Install
pip install lighter-data
# or, from a checkout:
pip install -e .
Python ≥3.10. Dependencies: pyarrow, websocket-client (the recorder);
all HTTP is stdlib.
Quickstart
# full hourly funding history, per coin, paginated to the floor date
lighter-data funding --coins ETH SOL --root data
# hourly candles for the perp and the (young) USDC spot market
lighter-data candles --coins ETH --kinds perp spot --root data
# historical L2 + trades: Tardis.dev free first-of-month samples, no key
lighter-data tardis --coins XPL,EIGEN,JTO --dates 2026-05-01,2026-06-01 --root data
# live recorder: sampled top-20 book every 500ms + every trade
lighter-data record --coins WLD,ONDO,LINK --root data
--coins (and tardis --dates) accept space- and comma-separated lists
interchangeably on every subcommand.
Datasets
| command | source | output | notes |
|---|---|---|---|
funding |
REST /api/v1/fundings |
funding/lighter/<coin>_perp/funding.parquet |
signed hourly fraction, HL-comparable |
candles |
REST /api/v1/candles |
candles/lighter/<coin>_<kind>/<tf>/candles.parquet |
perp + spot, 500-bar cap windowed |
tardis |
datasets.tardis.dev | l2book/…/date=…/l2book.parquet, trades/…/trades.parquet |
first day of each month is free |
record |
WebSocket /stream |
l2book/…/date=…/part-*.parquet, trades/…/part-*.parquet |
top-20 @ 500ms, counterparty account ids |
Candle/funding partitions get a manifest.json sidecar (row count, bounds,
cadence, duplicate timestamps, largest gaps), so a half-month hole from a
broken resume shows up at download time, not as a silent bias in a backtest.
The funding sign, pinned
A Lighter funding row is {timestamp, value, rate, direction} where rate
is a non-negative percent-per-hour magnitude and the sign lives in
direction ("long" = longs pay shorts). The written rate column is the
signed hourly fraction:
rate = rate_pct / 100 * (+1 if direction == "long" else -1)
verified live against value / index_price, and on the same scale as
Hyperliquid's fundingRate — so cross-venue carry math needs no adapter.
(Sister package: hyperliquid-data;
the candle and funding schemas are identical across the two.)
Caps and pagination
A single wide request against Lighter's history endpoints does not error — it
silently returns the most-recent slice (~750 funding rows, 500 candles),
which looks like the venue's whole history. The pullers paginate fixed
overlapping windows from a floor date (default 2025-01-01, before the first
mainnet perp listing) and collapse the seam duplicates, so the written series
reaches the true listing date.
The recorder
lighter-data record maintains each subscribed book from snapshot + deltas
and samples the top-20 every 500 ms (~20x smaller than storing every delta,
and the shape a fill-sim wants), records every trade with both counterparty
account ids (Lighter's public feed exposes them — enough to build
maker/taker cohorts offline), flushes Parquet parts every 10 min, and
survives disconnects with backoff. It is a long-running service: run it under
docker-compose/systemd with restart, not from a terminal you plan to close.
data/l2book/lighter/wld_perp/date=20260506/part-123005-000100.parquet
data/trades/lighter/wld_perp/date=20260506/part-123005-000100.parquet
Library use
from pathlib import Path
from lighter_data import resolve_perp_ids, fetch_all_funding, funding_rows, write_funding
mid = resolve_perp_ids()["ETH"]
pairs = fetch_all_funding(mid, start_s=1735689600, end_s=1754377200)
write_funding(funding_rows("ETH", pairs), root=Path("data"), instrument="ETH-PERP")
The supported surface is lighter_data.__all__ (pinned by
tests/test_public_api.py); schemas are typed in lighter_data.types and
pinned as pyarrow schemas in lighter_data.parquet.
License
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lighter_data-0.1.0.tar.gz.
File metadata
- Download URL: lighter_data-0.1.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d08531617a826b50ffaa0424b187fe385e0e2bb88193683f29ac1855d5b42be
|
|
| MD5 |
cb15b76367ebc16df68cfce259bf89fe
|
|
| BLAKE2b-256 |
f5afff489c9fa5fdb5ac1693b391faefc9a68893d02981cbecf5c081882bffca
|
Provenance
The following attestation bundles were made for lighter_data-0.1.0.tar.gz:
Publisher:
release.yml on bond-labs-dev/lighter-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lighter_data-0.1.0.tar.gz -
Subject digest:
5d08531617a826b50ffaa0424b187fe385e0e2bb88193683f29ac1855d5b42be - Sigstore transparency entry: 2369115407
- Sigstore integration time:
-
Permalink:
bond-labs-dev/lighter-data@fbfb63011fec6845999a577ea33731c92027ff27 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bond-labs-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fbfb63011fec6845999a577ea33731c92027ff27 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lighter_data-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lighter_data-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38929df371f6c3c2d54f4873c3c8b70ae72f1c60ef4c7a713163286f52adda92
|
|
| MD5 |
85aec2fdce9eaa8b0eabea3a795e8f47
|
|
| BLAKE2b-256 |
a7b6e272b2b1db97b21ec72573d5ffdbfbbd8730d7c1193fe2cc2a247369ce91
|
Provenance
The following attestation bundles were made for lighter_data-0.1.0-py3-none-any.whl:
Publisher:
release.yml on bond-labs-dev/lighter-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lighter_data-0.1.0-py3-none-any.whl -
Subject digest:
38929df371f6c3c2d54f4873c3c8b70ae72f1c60ef4c7a713163286f52adda92 - Sigstore transparency entry: 2369115505
- Sigstore integration time:
-
Permalink:
bond-labs-dev/lighter-data@fbfb63011fec6845999a577ea33731c92027ff27 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bond-labs-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fbfb63011fec6845999a577ea33731c92027ff27 -
Trigger Event:
release
-
Statement type: