> ## 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 on Robinhood Chain API Quickstart

> Make a first request to Lighter on Robinhood Chain, served under /v1/rh-lighter, for USDG-quoted perp and spot order books, trades, funding, OI, and freshness.

Create a key, call the Robinhood Chain order-book route, and confirm the response shape. Lighter has two deployments: mainnet and Robinhood Chain. This page covers the Robinhood Chain deployment, served under `/v1/rh-lighter/*`. For Lighter mainnet, start with the [Lighter API Quickstart](/lighter-api-quickstart).

<Steps>
  <Step title="Create a key">
    Open the [dashboard](https://0xarchive.io/dashboard?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=rh_lighter_create_key) and create an API key.
  </Step>

  <Step title="Set it in your shell">
    ```bash theme={"theme":"github-dark"}
    export OXARCHIVE_API_KEY="0xa_your_api_key"
    ```
  </Step>

  <Step title="List the markets">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/rh-lighter/instruments" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```
  </Step>

  <Step title="Call the order book">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/rh-lighter/orderbook/BTC?depth=1" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```
  </Step>

  <Step title="Confirm the result">
    Continue when the request returns HTTP `200`, `success: true`, an order-book object in `data`, and `meta.request_id`.
  </Step>
</Steps>

## Expected response

The Robinhood Chain L2 route returns the same shape as Lighter mainnet: aggregated price levels with decimal-string `px` and `sz` fields and an order count in `n`. Prices are in USDG. The values below show the shape only:

```json theme={"theme":"github-dark"}
{
  "success": true,
  "data": {
    "coin": "BTC",
    "symbol": "BTC",
    "timestamp": "2026-09-25T12:00:00.000Z",
    "bids": [{ "px": "<price>", "sz": "<size>", "n": 1 }],
    "asks": [{ "px": "<price>", "sz": "<size>", "n": 1 }],
    "mid_price": "<price>"
  },
  "meta": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
```

Keep the deployment, namespace, symbol, response timestamp, and request ID with the result. A `BTC` result from `/v1/rh-lighter/*` is a different market from `BTC` on `/v1/lighter/*`.

## Symbols

Perpetual markets use uppercase base symbols such as `BTC` and `ETH`. Spot markets use the base and the USDG quote joined by a dash, such as `AAPL-USDG`:

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

Funding, open interest, and liquidations exist only for perpetual markets. There is no L3 route on this deployment; the `l3orderbook` paths return `404` and point to the L2 route.

## If the call fails

| Code | Means | Do |
| - | - | - |
| `400` | The symbol is not a Robinhood Chain market, a depth, window, or other parameter is invalid, or candles are requested before they are enabled for this deployment | Check the route, the parameter value, and the message text before retrying |
| `401` | The API key is missing or invalid | Check `X-API-Key` and key status |
| `404` | The route does not exist on this deployment, such as `l3orderbook`, or a positions route names a spot market | Check the namespace and `/v1/rh-lighter/instruments` |
| `429` | Rate, concurrency, or credit limit reached | Honor `Retry-After`, otherwise back off and reduce concurrency |

Keep `meta.request_id` or the `x-request-id` response header with the failed request. Use [Errors and request IDs](/errors) for retry decisions and [Rate limits](/rate-limits) for capacity controls.

## Check coverage before widening

Trades and liquidations start at the deployment's first trade, 2026-06-26 20:10:26 UTC. Liquidations from before live capture began on 2026-08-22 carry `source: "bucket"` and an empty `raw_json`: they were backfilled from the venue's finalized export. Order-book, open-interest, and funding history start 2026-08-22 18:43 UTC. Finalized trades trail the present by about a day; `meta.finalized_through` reports the boundary, and `/v1/rh-lighter/trades/{symbol}/recent` serves the preliminary rows after it. Check the exact symbol with `/v1/data-quality/coverage/rh-lighter/{symbol}` and `/v1/rh-lighter/freshness/{symbol}` before relying on a window.

## Request checklist

| Field | Starter value |
| - | - |
| Venue | Lighter |
| Deployment | Robinhood Chain |
| Namespace | `/v1/rh-lighter/*` |
| First route | `/v1/rh-lighter/orderbook/BTC` |
| First fields to log | route, symbol, response timestamp, `meta.request_id`, status code |
| Next branch | trades, candles, funding, OI, liquidations, account positions, live WebSocket streams, replay, or exports |

Keep this checklist separate from Lighter mainnet and from Hyperliquid. A `BTC` string is not enough context for logs or generated clients.

## Next branches

<CardGroup cols={2}>
  <Card title="Lighter on Robinhood Chain REST" icon="zap" href="/rest-api/rh-lighter">
    Routes, coverage, and the finalized and preliminary trade tiers.
  </Card>

  <Card title="Account positions" icon="wallet" href="/rest-api/positions">
    Positions by account index, now or at any instant from 2026-06-26.
  </Card>
</CardGroup>

Use [Lighter on Robinhood Chain channels](/websocket/lighter#lighter-on-robinhood-chain) for live order books, trades, open interest, and funding, [WebSocket replay](/websocket/replay) when event ordering matters, [Export schemas](/export-schemas) for Parquet files, and [Data quality](/data-quality) before an output feeds a backtest, alert, export, or model.

## Common mistakes

Do not send Robinhood Chain symbols to `/v1/lighter/*` or mainnet symbols to `/v1/rh-lighter/*`. Do not join account indexes across the two deployments. Do not assume spot markets carry funding or open interest. Keep the deployment in logs, storage, and generated code so later joins distinguish sources.
