> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/developers/integration-guides/historical-data.md).

# Historical Data

{% tabs %}
{% tab title="Lighter" %}
Users can fetch historical data using various REST endpoints, mainly:

* [accountInactiveOrders](https://docs.lighter.xyz/api/orders)
* [trades](https://docs.lighter.xyz/api/orders)
* [logs](https://docs.lighter.xyz/api/explorer-api/account)
* [tx](https://docs.lighter.xyz/api/transactions)
* [pnl](https://docs.lighter.xyz/api/account)
* [deposit\_history](https://docs.lighter.xyz/api/transactions), [transfer\_history](https://docs.lighter.xyz/api/transactions), [withdraw\_history](https://docs.lighter.xyz/api/transactions)
* [candles](https://docs.lighter.xyz/api/candlesticks)
* [fundings](https://docs.lighter.xyz/api/funding), [positionFunding](https://docs.lighter.xyz/api/account)
* [liquidations](https://docs.lighter.xyz/api/account)
* [exchangeMetrics](https://docs.lighter.xyz/api/info), [executeStats](https://docs.lighter.xyz/api/info)

Several of these are heavy (see the weights in [Rate Limits](/developers/reference/rate-limits.md)), so paginate and cache the results.

Alternatively, you can use [export](https://docs.lighter.xyz/api/orders) to obtain CSVs containing up to 12 months of trades, or up to 3 months of funding payments, for a specific account index.

### Historical Trade Events

For interested parties, you can access parquet files containing trade events (global), up to mainnet genesis (January 17th, 2025), using the [`historicalTrade`](https://docs.lighter.xyz/api/orders) endpoint. To obtain access, perform an in-app transfer of 100 LIT to `0x4FD058F25bE85E459ec552cA8e4C696FD1D34125`. On-chain transfers are not supported; you must transfer from within the exchange directly (`L2Transfer`).

### Historical Trade Events (Requester Pays)

For those that prefer to use their AWS account, and cover costs per each request themselves, `--request-payer requester` can be used.

Example request for Lighter Core:

```shell
aws s3 ls s3://lighter-historical-data/trade-daily/ --request-payer requester | tail -3
aws s3 cp s3://lighter-historical-data/trade-daily/date=2025-11-26/trades.parquet /tmp/trades.parquet --request-payer requester
```

### Hourly Open Interest (Requester Pays)

Hourly open interest for every perps market is published to the same bucket under `open-interest-hourly/`, as one Parquet file per UTC day. Each row is the end-of-hour snapshot of one market:

| Column              | Type            | Description                     |
| ------------------- | --------------- | ------------------------------- |
| `hour`              | timestamp (UTC) | Start of the hour               |
| `symbol`            | string          | Market symbol, e.g. `BTC`       |
| `open_interest`     | double          | Open interest in the base asset |
| `mark_price`        | double          | Mark price at the snapshot      |
| `open_interest_usd` | double          | `open_interest * mark_price`    |

Data starts at mainnet genesis (January 17th, 2025) and a new day is added every night.

Example request for Lighter Core:

```shell
aws s3 ls s3://lighter-historical-data/open-interest-hourly/ --request-payer requester | tail -3
aws s3 cp s3://lighter-historical-data/open-interest-hourly/date=2026-10-15/oi.parquet /tmp/oi.parquet --request-payer requester
```

{% endtab %}

{% tab title="Lighter on Robinhood Chain" %}
Users can fetch historical data using various REST endpoints, mainly:

* [accountInactiveOrders](https://docs.lighter.xyz/api/orders)
* [trades](https://docs.lighter.xyz/api/orders)
* [logs](https://docs.lighter.xyz/api/explorer-api/account)
* [tx](https://docs.lighter.xyz/api/transactions)
* [pnl](https://docs.lighter.xyz/api/account)
* [deposit\_history](https://docs.lighter.xyz/api/transactions), [transfer\_history](https://docs.lighter.xyz/api/transactions), [withdraw\_history](https://docs.lighter.xyz/api/transactions)
* [candles](https://docs.lighter.xyz/api/candlesticks)
* [fundings](https://docs.lighter.xyz/api/funding), [positionFunding](https://docs.lighter.xyz/api/account)
* [liquidations](https://docs.lighter.xyz/api/account)
* [exchangeMetrics](https://docs.lighter.xyz/api/info), [executeStats](https://docs.lighter.xyz/api/info)

Alternatively, you can use [export](https://docs.lighter.xyz/api/orders) to obtain CSVs containing up to 12 months of trades, or up to 3 months of funding payments, for a specific account index.

### Historical Trade Events

For interested parties, you can access parquet files containing trade events (global), up to mainnet genesis (June 26th, 2026), using the [`historicalTrade`](https://docs.lighter.xyz/api/orders) endpoint. To obtain access, perform an in-app transfer of 300 USDG to `0x4FD058F25bE85E459ec552cA8e4C696FD1D34125`. On-chain transfers are not supported; you must transfer from within the exchange directly (`L2Transfer`).

### Historical Trade Events (Requester Pays)

For those that prefer to use their AWS account, and cover costs per each request themselves, `--request-payer requester` can be used.

Example request for Lighter on Robinhood Chain:

```shell
aws s3 ls s3://rh-mainnet-historical-data-292832245117/trade-daily/ --request-payer requester | tail -3
aws s3 cp s3://rh-mainnet-historical-data-292832245117/trade-daily/date=2026-09-23/trades.parquet /tmp/trades.parquet --request-payer requester
```

### Hourly Open Interest (Requester Pays)

Hourly open interest for every perps market is published to the same bucket under `open-interest-hourly/`, as one Parquet file per UTC day. Each row is the end-of-hour snapshot of one market:

| Column              | Type            | Description                     |
| ------------------- | --------------- | ------------------------------- |
| `hour`              | timestamp (UTC) | Start of the hour               |
| `symbol`            | string          | Market symbol, e.g. `BTC`       |
| `open_interest`     | double          | Open interest in the base asset |
| `mark_price`        | double          | Mark price at the snapshot      |
| `open_interest_usd` | double          | `open_interest * mark_price`    |

Data starts at mainnet genesis (June 26th, 2026) and a new day is added every night.

Example request for Lighter on Robinhood Chain:

```shell
aws s3 ls s3://rh-mainnet-historical-data-292832245117/open-interest-hourly/ --request-payer requester | tail -3
aws s3 cp s3://rh-mainnet-historical-data-292832245117/open-interest-hourly/date=2026-10-15/oi.parquet /tmp/oi.parquet --request-payer requester
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/developers/integration-guides/historical-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
