> ## 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 REST API

> Run Lighter REST routes for order books, L3 depth, trades, candles, funding, OI, freshness, and Lighter-specific history.

Pull Lighter mainnet market data under `/v1/lighter/*`: L2 order books, L3 individual-order books, trades, candles, funding, open interest, liquidations, and account positions. Lighter is its own venue with its own symbols, separate from Hyperliquid, and its individual-order depth is L3, not Hyperliquid L4. Find a market with [Lighter instruments](/api-reference/lighter--instruments/list-lighter-instruments), and check each data type's history start in [Venue coverage](/venue-coverage). For an overview of the venue, see [Lighter market data](https://0xarchive.io/lighter).

Lighter has two deployments: mainnet and Robinhood Chain. This page covers mainnet. The Robinhood Chain deployment is served under `/v1/rh-lighter/*` with the same routes except L3; see [Lighter on Robinhood Chain REST](/rest-api/rh-lighter).

## Route groups

| Family | Returns |
| - | - |
| Instruments | Lighter markets and symbol metadata |
| Order book | Current and historical L2 depth |
| L3 order book | Current and historical individual-order books, from March 5, 2026 |
| Trades | Canonical history, plus preliminary recent trades |
| Funding and open interest | Time series of market state |
| Liquidations | Liquidation events and volume buckets |
| Account positions | Positions by account index now or at any instant, hourly history, change logs, and market-wide positioning; see [Account positions](/rest-api/positions) |

## First request

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

```json theme={"theme":"github-dark"}
{
  "success": true,
  "data": {
    "coin": "BTC",
    "symbol": "BTC",
    "timestamp": "2026-06-05T17:09:50.450Z",
    "bids": [
      { "px": "61363.2", "sz": "0.41549", "n": 1 },
      { "px": "61363.1", "sz": "0.20367", "n": 1 }
    ],
    "asks": [
      { "px": "61363.3", "sz": "0.00014", "n": 1 },
      { "px": "61363.4", "sz": "0.0002", "n": 1 }
    ],
    "mid_price": "61363.25",
    "spread": "0.1",
    "spread_bps": "0.0163"
  },
  "meta": { "request_id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee" }
}
```

Lighter L2 has the same shape as the Hyperliquid order book: `px`, `sz`, and `n` as decimal strings; see the [field dictionary](/responses#field-dictionary).

## Choose a depth

Use the L2 order-book routes for price-level depth. Use `/v1/lighter/l3orderbook/{symbol}` when you need individual resting orders, for queue analysis or reconstruction. The current L3 route returns one book object; the history route returns an array of snapshots. History `granularity` defaults to `checkpoint` and also accepts `30s`, `10s`, `1s`, and `tick`, and each item holds up to 250 orders per side. L3 fields are numeric `order_index`, `owner_account_index`, `price`, `remaining_size`, and `original_size`, not L2 `px` and `sz` strings, and the two index fields are Lighter indexes, not wallet addresses. [Order books](/rest-api/order-books) compares L2 and L3 in more detail.

For long windows, start with one bounded request, page with the cursor, and store `meta.request_id` for each page. Check the window with [Data quality](/data-quality) before it feeds a backtest, model, alert, dashboard, or export, especially when reconstruction depends on depth continuity.

## Trades: canonical and preliminary

Lighter trade routes have two tiers. `/v1/lighter/trades/{symbol}` serves canonical per-fill history reconciled daily from the Lighter Foundation archive: rows marked `source: "bucket"`, enriched with fields such as `tx_hash`, `order_id`, `fee`, `realized_pnl`, and maker/taker attribution, with `end` clamped to the finalization watermark in `meta.finalized_through`. Per-fill rows begin January 17, 2025, with exact starts varying by market. `/v1/lighter/trades/{symbol}/recent` serves preliminary live rows marked `source: "ws"` without that enrichment. Identity fields such as `account_index` are Lighter account indexes, not wallet addresses.

Field sets and the clamp are documented on [Trades](/rest-api/trades) and in [Lighter Historical Data API](/lighter-historical-data-api). The generated contracts are [Lighter trades](/api-reference/lighter--trades/get-lighter-trades) and [current Lighter funding](/api-reference/lighter--funding/get-current-lighter-funding-rate).

## Live data over WebSocket

For continuing updates, subscribe to `lighter_orderbook`, `lighter_trades`, `lighter_open_interest`, or `lighter_funding` on `wss://api.0xarchive.io/ws` instead of polling these routes. Live messages use different payload shapes from the REST responses, and live trades are preliminary until the canonical trade route finalizes them. Current candles and L3 snapshots stay on REST. See [Lighter WebSocket channels](/websocket/lighter), and [WebSocket replay](/websocket/replay) when event order matters.

## Next step

Make a first Lighter request and confirm the response with the [Lighter quickstart](/lighter-api-quickstart).


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