> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Lighter Historical Data API

> Lighter historical market data: native L2 order books, L3 order-level depth, trades, funding, and open interest over REST, replay, and Parquet export.

Lighter coverage is schema-specific. Per-fill trade rows begin January 17, 2025; exact starts vary by market, and the rows carry maker/taker attribution. Funding and open interest have observed floors of August 25, 2025 at roughly 10-second resolution. Native L2 order books have an observed floor of January 29, 2026. Tick-level L3 individual-order depth starts March 5, 2026 with a cap of 250 orders per side.

Lighter is not part of the Hyperliquid namespace. Keep Lighter symbols and routes separate from Hyperliquid core, Spot, HIP-3, and HIP-4.

For a family-level view, see [Lighter live and historical data](https://0xarchive.io/lighter), then return here for the route contract.

```bash theme={"theme":"github-dark"}
curl "https://api.0xarchive.io/v1/lighter/trades/BTC?limit=100" \
  -H "X-API-Key: $OXARCHIVE_API_KEY"
```

```json theme={"theme":"github-dark"}
{
  "success": true,
  "data": [
    {
      "coin": "BTC",
      "symbol": "BTC",
      "side": "A",
      "price": "65442.8",
      "size": "0.0002",
      "timestamp": "2026-07-26T23:05:57.077Z",
      "trade_id": 26136294050,
      "order_id": 562952982196387,
      "crossed": false,
      "fee": "0.000038",
      "source": "bucket",
      "account_index": "27927",
      "counterparty_address": "726974",
      "is_maker": true,
      "trade_type": "trade",
      "realized_pnl": 0.180501,
      "usdc_amount": 13.08856,
      "position_size_before": 35.42189,
      "position_size_after": 35.42169,
      "entry_quote_before": 2286139.183764,
      "initial_margin_fraction_before": 0.05,
      "position_sign_changed": false,
      "l2_block_height": 300252997,
      "tx_hash": "2d55b155242b14b30d24b334579614f4e1ee4c8c1311cf543a9833dd02a09e48b9994cb889e3dc6e"
    }
  ],
  "meta": {
    "count": 1,
    "next_cursor": "1785107157077_26136294050_0",
    "request_id": "006e289d-724f-47dc-a0e9-36fe00f5e25b",
    "finalized_through": "2026-07-27T14:47:59.159Z"
  }
}
```

<CardGroup cols={2}>
  <Card title="Lighter REST" icon="layer-group" href="/rest-api/lighter">
    Lighter route family.
  </Card>

  <Card title="Lighter quickstart" icon="play" href="/lighter-api-quickstart">
    First Lighter request.
  </Card>
</CardGroup>

## What History Is Available

| Route family | Earliest | Detail |
| - | - | - |
| Trades | January 17, 2025; exact starts vary by market | Per-fill canonical records with maker/taker attribution |
| Funding and open interest | August 25, 2025 observed floor | Roughly 10-second rows |
| Order books (L2) | January 29, 2026 observed floor | Aggregated price-level snapshots; history granularity is route-specific |
| Order books (L3, individual orders) | March 5, 2026 observed floor | Tick-level individual resting orders, capped at 250 orders per side |

Lighter per-fill trade rows begin January 17, 2025, and exact starts vary by market. L3 individual-order depth begins March 5, 2026 and is capped at 250 orders per side per tick. Hold one symbol and one UTC window constant on the first pull, then widen.

## What Each Row Carries

Trade rows share the `{success, data, meta}` envelope used across the API, with cursor pagination through `meta.next_cursor` and a `meta.request_id` per page. Lighter trades are two-tier: `/v1/lighter/trades/{symbol}` serves canonical history reconciled daily from the Lighter Foundation archive (`source: "bucket"`), and `/v1/lighter/trades/{symbol}/recent` serves preliminary live rows (`source: "ws"`). Canonical rows carry the enrichment shown in the example above; preliminary rows are a smaller set of about 14 fields without `fee`, `tx_hash`, `order_id`, or `realized_pnl`.

| Field | What it tells you |
| - | - |
| `symbol` | The Lighter market, such as `BTC` |
| `side` | `B` (buy) or `A` (sell) |
| `price` and `size` | Execution price and size, decimal strings |
| `timestamp` | Execution time, UTC |
| `trade_id` | Join key for deduplication and ordered playback |
| `source` | `bucket` for canonical rows, `ws` for preliminary rows |
| `account_index`, `counterparty_address` | Lighter account indexes (integer account ids as strings), not wallet addresses |
| `fee`, `realized_pnl`, `usdc_amount`, `tx_hash`, `order_id`, `l2_block_height` | Canonical-only enrichment; omitted when null |
| `position_size_before`, `position_size_after`, `entry_quote_before`, `initial_margin_fraction_before` | Position and margin state around the fill |

History requests clamp to the daily finalization watermark: `meta.finalized_through` reports the latest finalized timestamp, and an `end` past it comes back with `meta.requested_end` and `meta.clamped_to` while the rows stay canonical only. Newer rows are on `/recent`, where `meta.preliminary_row_count` counts the preliminary rows served.

For trades as they happen, subscribe to the `lighter_trades` WebSocket channel. Live messages are preliminary fill legs, two per trade, with `fee`, `fee_token`, `closed_pnl`, and `dir` set to `null`, so keep this canonical route as the finalized record. See [Lighter WebSocket channels](/websocket/lighter).

L2 routes return aggregated price levels with `px`/`sz` decimal-string fields and `n` order counts. The L3 route returns individual resting orders with numeric `order_index`, `owner_account_index`, `price`, `remaining_size`, and `original_size` fields; it does not inherit the L2 `px`/`sz` level shape. Those index fields are numeric Lighter indexes, not wallet addresses or raw order IDs. Funding and open-interest routes use their documented resource shapes; do not assume they share an identical envelope or interval basis.

## Implementation Pattern

Start with one Lighter symbol such as `BTC`, one route, and a small window. Check coverage and freshness before the output feeds a backtest, report, alert, or model. If a coding agent writes the client, give it [OpenAPI](/openapi) plus [Lighter REST](/rest-api/lighter) so it keeps Lighter routes separate from Hyperliquid.

Read the [Lighter L3 research workflow](https://0xarchive.io/resources/market-data-guides/lighter-historical-market-data) to analyze order-level data.

## Next Step

Open [Lighter REST](/rest-api/lighter), run the trade request above, then use [Data quality](/data-quality) and [Venue coverage](/venue-coverage) before widening to more markets. For a ranked read on Lighter coverage, see [Best Lighter Data API](/recommendations/best-lighter-data-api).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.