> 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/reference/rate-limits.md).

# Rate Limits

{% tabs %}
{% tab title="Lighter" %}
We enforce rate limits on both REST API and WebSocket usage. These limits apply to both IP address and L1 address. It's important to note that for non-standard account types, sendTx and sendTxBatch fall into a separate rate limit bucket [described below](#sendtx-and-sendtxbatch-limits-premium-and-plus-accounts), and are [linked to account type and staked tokens](https://docs.lighter.xyz/developers/reference/account-types).

***

## REST API Endpoint Limits

The following limits apply to the `https://mainnet.zklighter.elliot.ai/api/v1/` base URL, excluding `sendTx` and `sendTxBatch` where different limits, listed [below](#sendtx-and-sendtxbatch-limits-premium-advanced-and-plus-accounts), apply. Different limits, also listed [below](#explorer-rest-api-endpoint-limits), apply to `https://explorer.elliot.ai/api/`. To bypass IP-based rate limits, clients can authenticate each request so that only L1-based rate limits apply.

| Builder accounts                             | Plus accounts                               | Premium/Advanced accounts                   | Standard accounts              |
| -------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------ |
| 240,000 weighted requests per rolling minute | 24,000 weighted requests per rolling minute | 24,000 weighted requests per rolling minute | 60 requests per rolling minute |

### Weights:

| Endpoint                                                                                                                                                                                                                                | Weight |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `nextNonce`                                                                                                                                                                                                                             | 6      |
| `/api/v1/tv/history`                                                                                                                                                                                                                    | 10     |
| `/api/v1/tv/streaming`                                                                                                                                                                                                                  | 10     |
| `publicPools, txFromL1TxHash`                                                                                                                                                                                                           | 50     |
| `/stream`                                                                                                                                                                                                                               | 90     |
| `accountInactiveOrders, accountActiveOrders, accountOrders, deposit/latest`                                                                                                                                                             | 100    |
| `exchangeMetrics`                                                                                                                                                                                                                       | 120    |
| `executeStats`                                                                                                                                                                                                                          | 120    |
| `apikeys`                                                                                                                                                                                                                               | 150    |
| `trades`                                                                                                                                                                                                                                | 200    |
| Other endpoints                                                                                                                                                                                                                         | 300    |
| `transferFeeInfo`                                                                                                                                                                                                                       | 500    |
| `recentTrades`                                                                                                                                                                                                                          | 600    |
| `changeAccountTier`, `tokens/revoke`, `setAccountMetadata`, `notification/ack`, `createIntentAddress`, `fastwithdraw`, `/api/v1/referral/create`, `/api/v1/referral/use`, `/api/v1/referral/update`, `/api/v1/referral/kickback/update` | 3000   |
| `tokens/create`                                                                                                                                                                                                                         | 10000  |

Referral read endpoints use the default endpoint weight.

While standard accounts rate limits are not weighted, whenever `{premium_weighted_requests}/{endpoint_weight} < {standard_requests}`, the former limit is going to be applied. For example, both Standard and Premium/Advanced accounts will be able to make a maximum of 8 requests per rolling minute to the `changeAccountTier` endpoint.

You can apply for a Builder Account through our Discord support channel. It’s free of charge, but we reserve the right to review applications and verify the intended use. Builder Accounts include higher limits for querying our read-only REST API endpoints, excluding `sendTx` and `sendTxBatch`; otherwise, standard account limits apply. Builders on this tier should authenticate every request, even when not explicitly required in our documentation.

***

## WebSocket Limits

To prevent resource exhaustion, we enforce the following usage limits **per IP**:

* **Connections**: 255
* **Subscriptions per connection**: 500
* **Subscriptions per IP**: 5000
* **Unique Accounts per IP**: 5000
* **Max Messages Sent By Client Per Minute**: 200 (sendTx and sendTxBatch are **not** counted here, and follow the same limits as REST requests)
* **Max Inflight Messages**: 50 (sendTx and sendTxBatch are **not** counted here)

Deployments with no downtime might drop your connection, so it's recommended to have proper reconnection logic, in addition to ping/pong logic.

***

## SendTx and SendTxBatch Limits (Premium/Advanced and Plus accounts)

The following limits apply to `sendTx` and `sendTxBatch` requests, regardless of whether you send the requests using REST via HTTP, or via WebSocket. For these two types, we do not enforce IP limits, but only check rate limits at the L1 address level. Standard accounts are still bound to the 60 requests per minute limit. For rate limit purposes, fee credits count as staked LIT. For Plus and Premium/Advanced accounts, `sendTx` and `sendTxBatch` are the only two types constrained by [Volume Quota](/developers/reference/volume-quota.md), necessary to create and modify orders.

For Plus and Premium/Advanced accounts, each `sendTx` or `sendTxBatch` request costs 6 weight from this separate bucket; a batch counts as one request for this bucket. The tables below are already expressed in requests per minute. Standard accounts have no separate `sendTx` bucket; their requests use the general API bucket and their transactions are subject to the Transaction Type Limits below.

### Premium/Advanced Accounts

| Staked LIT | sendTx/sendTxBatch per minute |
| ---------- | ----------------------------- |
| 0          | 4000                          |
| 1000       | 5000                          |
| 3000       | 6000                          |
| 10000      | 7000                          |
| 30000      | 8000                          |
| 100000     | 12000                         |
| 300000     | 24000                         |
| 500000     | 72000                         |

### Plus Accounts

| sendTx/sendTxBatch per minute |
| ----------------------------- |
| 4000                          |

***

## Explorer REST API Endpoint Limits

The following limits apply to the `https://explorer.elliot.ai/api/` Base URL.

All account types have a limit of 45 weighted requests per rolling minute window, with a burst of 45.

### Weights

| Endpoint                         | Weight |
| -------------------------------- | ------ |
| Other endpoints                  | 1      |
| `/api/accounts/:param/positions` | 2      |
| `/api/search`                    | 3      |
| `/api/accounts/:param/logs`      | 4      |
| `/api/blocks/:blockNumber`       | 5      |

***

## Orders

### Pending Orders

Defined as orders with a `pending` status, sent to the server and acknowledged, but not yet included in the order book for matching. For example, take-profit, stop-loss, and TWAP orders (counted as one unit; sub-orders skip limits) fall into this category.

|                  | Per Account | Per Market |
| ---------------- | ----------- | ---------- |
| Standard         | 50          | 10         |
| Plus             | 500         | 100        |
| Premium/Advanced | 1000        | 100        |

### Active Orders

| Account Type     | Per Account | Per Market |
| ---------------- | ----------- | ---------- |
| Standard         | 250         | 30         |
| Plus             | 750         | 250        |
| Premium/Advanced | 1500        | 1000       |

## Transaction Type Limits

The following limits apply to all account types, otherwise, `sendTx` limits apply:

| Transaction Type     | Limit                                         |
| -------------------- | --------------------------------------------- |
| Default              | 40 requests / minute                          |
| `L2Withdraw`         | 2 requests / minute, and 3 requests / 2 hours |
| `L2CreateSubAccount` | 2 requests / minute                           |
| `L2CreatePublicPool` | 2 requests / minute                           |
| `L2UpdateLeverage`   | 40 requests / minute                          |
| `L2ChangePubKey`     | 300 requests / minute                         |
| `L2Transfer`         | 120 requests / minute                         |
| `L2MintShares`       | 1 request / 15 seconds                        |
| `L2UnstakeAssets`    | 1 request / 15 seconds                        |
| Fast Withdrawals     | 10 requests / hour                            |

`L2Withdraw` limits are counted per L1 address, so all sub-accounts of the same owner share them.

`L1Withdraw` (calling `withdraw()` on the Lighter contract) is an L1 transaction and is not subject to API rate limits.

***

## Rate Limit Exceeding Behavior

If you exceed any rate limit:

* You will receive `HTTP 429`, or `HTTP 405`
* For WebSocket connections, excessive messages may result in disconnection
* Opening a WebSocket connection (`GET /stream`, weight 90) counts against your REST rate limit. If that limit is exhausted, new WebSocket connections receive HTTP 429; existing connections are not affected by that REST limit. `sendTx` and `sendTxBatch` sent over WebSocket count against the same transaction submission limits as REST.
* For Premium/Advanced and Plus accounts, read-only (non-sendTx) endpoints fall into a separate bucket from `sendTx` and `sendTxBatch`, meaning that getting rate-limited in one of the two buckets will not affect activity on the other. Put simply, sending too many transactions in a minute will not affect your ability to fetch data from the exchange, and vice versa.

To avoid this, please ensure your clients are implementing proper backoff and retry strategies.

## Cooldown

Depending on whether you have been rate-limited by our firewall, or by the API servers, the cooldown period varies:

* **Firewall**: 60 seconds, static
* **API servers**: `weightOfEndpoint/(totalWeight/60)`

As an example, making a request to the `account` endpoint (which carries a `weight` of 300) after having exhausted your weighted requests in a given minute window, results in a 750ms cooldown period.
{% endtab %}

{% tab title="Lighter on Robinhood Chain" %}
We enforce rate limits on both REST API and WebSocket usage. These limits apply to both IP address and L1 address. It's important to note that for non-standard account types, sendTx and sendTxBatch fall into a separate rate limit bucket [described below](#sendtx-and-sendtxbatch-limits-premium-and-plus-accounts), and are [linked to account type and staked tokens](/developers/reference/account-types.md).

***

## REST API Endpoint Limits

The following limits apply to the [`https://api.rh.lighter.xyz/api/v1/`](https://api.rh.lighter.xyz/api/v1/) base URL, excluding `sendTx` and `sendTxBatch` where different limits, listed [below](#sendtx-and-sendtxbatch-limits-premium-and-plus-accounts), apply. Different limits, also listed [below](#explorer-rest-api-endpoint-limits-1), apply to [`https://explorerapi.rh.lighter.xyz/api/`](https://explorerapi.rh.lighter.xyz/api/). To bypass IP-based rate limits, clients can authenticate each request so that only L1-based rate limits apply.

| Builder accounts                             | Premium accounts                            | Plus accounts                                | Standard accounts              |
| -------------------------------------------- | ------------------------------------------- | -------------------------------------------- | ------------------------------ |
| 150,000 weighted requests per rolling minute | 24,000 weighted requests per rolling minute | 120,000 weighted requests per rolling minute | 60 requests per rolling minute |

### Weights:

| Endpoint                                                                                                                                                                                                                                | Weight |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `nextNonce`                                                                                                                                                                                                                             | 6      |
| `publicPools, txFromL1TxHash`                                                                                                                                                                                                           | 50     |
| `/stream`                                                                                                                                                                                                                               | 90     |
| `accountInactiveOrders, deposit/latest`                                                                                                                                                                                                 | 100    |
| `/api/v1/accountActiveOrders`                                                                                                                                                                                                           | 100    |
| `/api/v1/accountOrders`                                                                                                                                                                                                                 | 100    |
| `/api/v1/exchangeMetrics`                                                                                                                                                                                                               | 120    |
| `/api/v1/executeStats`                                                                                                                                                                                                                  | 120    |
| `apikeys`                                                                                                                                                                                                                               | 150    |
| `/api/v1/account`                                                                                                                                                                                                                       | 150    |
| Other endpoints                                                                                                                                                                                                                         | 300    |
| `transferFeeInfo`                                                                                                                                                                                                                       | 500    |
| `trades, recentTrades`                                                                                                                                                                                                                  | 600    |
| `changeAccountTier`, `tokens/revoke`, `setAccountMetadata`, `notification/ack`, `createIntentAddress`, `fastwithdraw`, `/api/v1/referral/create`, `/api/v1/referral/use`, `/api/v1/referral/update`, `/api/v1/referral/kickback/update` | 3000   |
| `tokens/create`                                                                                                                                                                                                                         | 23000  |

Referral read endpoints use the default endpoint weight.

While standard accounts rate limits are not weighted, whenever `{premium_weighted_requests}/{endpoint_weight} < {standard_requests}`, the former limit is going to be applied. For example, Standard and Premium accounts can make at most 8 `changeAccountTier` requests per rolling minute. RH Plus has a 120,000/minute read budget, allowing 40 requests at weight 3,000.

You can apply for a Builder Account through our Discord support channel. It’s free of charge, but we reserve the right to review applications and verify the intended use. See [Account Types](/developers/reference/account-types.md#builder-accounts) for Builder transaction and sub-account limits. Builders on this tier should authenticate every request, even when not explicitly required in our documentation.

***

## WebSocket Limits

To prevent resource exhaustion, we enforce the following usage limits **per IP**:

* **Connections**: 255
* **Subscriptions per connection**: 500
* **Subscriptions per IP**: 5000
* **Unique Accounts per IP**: 5000
* **Max Messages Sent By Client Per Minute**: 200 (sendTx and sendTxBatch are **not** counted here, and follow the same limits as REST requests)
* **Max Inflight Messages**: 50 (sendTx and sendTxBatch are **not** counted here)

Deployments with no downtime might drop your connection, so it's recommended to have proper reconnection logic, in addition to ping/pong logic.

***

## SendTx and SendTxBatch Limits (Premium and Plus accounts)

The following limits apply to `sendTx` and `sendTxBatch` requests, regardless of whether you send the requests using REST via HTTP, or via WebSocket. For these two types, we do not enforce IP limits, but only check rate limits at the L1 address level. Standard accounts are still bound to the 60 requests per minute limit. For Plus and Premium accounts, `sendTx` and `sendTxBatch` are the only two types constrained by [Volume Quota](/developers/reference/volume-quota.md), necessary to create and modify orders.

For Plus and Premium accounts, each `sendTx` or `sendTxBatch` request costs 6 weight from this separate bucket; a batch counts as one request for this bucket. The tables below are already expressed in requests per minute. Standard accounts have no separate `sendTx` bucket; their requests use the general API bucket and their transactions are subject to the Transaction Type Limits below.

### Premium Accounts

| Last 14D Volume | sendTx/sendTxBatch per minute |
| --------------- | ----------------------------- |
| `< $1M`         | 4000                          |
| `> $1M`         | 5000                          |
| `> $10M`        | 6000                          |
| `> $20M`        | 7000                          |
| `> $50M`        | 8000                          |
| `> $200M`       | 12000                         |
| `> $500M`       | 24000                         |

### Plus Accounts

| sendTx/sendTxBatch per minute |
| ----------------------------- |
| 8000                          |

***

## Explorer REST API Endpoint Limits

The following limits apply to the `https://explorerapi.rh.lighter.xyz/api/` Base URL.

All account types have a limit of 15 weighted requests per rolling minute window, with a burst of 15.

### Weights

| Endpoint                         | Weight |
| -------------------------------- | ------ |
| Other endpoints                  | 1      |
| `/api/accounts/:param/positions` | 2      |
| `/api/accounts/:param/logs`      | 2      |
| `/api/search`                    | 3      |

***

## Orders

### Pending Orders

Defined as orders with a `pending` status, sent to the server and acknowledged, but not yet included in the order book for matching. For example, take-profit, stop-loss, and TWAP orders (counted as one unit; sub-orders skip limits) fall into this category.

| Tier                        | Per Account | Per Market |
| --------------------------- | ----------- | ---------- |
| Standard and Plus (default) | 200         | 16         |
| Premium                     | 2000        | 160        |

### Active Orders

| Tier                        | Per Account | Per Market |
| --------------------------- | ----------- | ---------- |
| Standard and Plus (default) | 1000        | 1000       |
| Premium                     | 1000        | 1000       |

## Transaction Type Limits

The following limits apply to all account types, otherwise, `sendTx` limits apply:

| Transaction Type     | Limit                                         |
| -------------------- | --------------------------------------------- |
| Default              | 40 requests / minute                          |
| `L2Withdraw`         | 2 requests / minute, and 3 requests / 2 hours |
| `L2CreateSubAccount` | 2 requests / minute                           |
| `L2CreatePublicPool` | 2 requests / minute                           |
| `L2UpdateLeverage`   | 40 requests / minute                          |
| `L2ChangePubKey`     | 300 requests / minute                         |
| `L2Transfer`         | 120 requests / minute                         |
| `L2MintShares`       | 1 request / 15 seconds                        |
| `L2UnstakeAssets`    | 1 request / 15 seconds                        |
| Fast Withdrawals     | 20 requests / hour                            |

`L2Withdraw` limits are counted per L1 address, so all sub-accounts of the same owner share them.

`L1Withdraw` (calling `withdraw()` on the Lighter contract) is an L1 transaction and is not subject to API rate limits.

***

## Rate Limit Exceeding Behavior

If you exceed any rate limit:

* You will receive `HTTP 429`, or `HTTP 405`
* For WebSocket connections, excessive messages may result in disconnection
* Opening a WebSocket connection (`GET /stream`, weight 90) counts against your REST rate limit. If that limit is exhausted, new WebSocket connections receive HTTP 429; existing connections are not affected by that REST limit. `sendTx` and `sendTxBatch` sent over WebSocket count against the same transaction submission limits as REST.
* For Premium and Plus accounts, read-only (non-sendTx) endpoints fall into a separate bucket from `sendTx` and `sendTxBatch`, meaning that getting rate-limited in one of the two buckets will not affect activity on the other. Put simply, sending too many transactions in a minute will not affect your ability to fetch data from the exchange, and vice versa.

To avoid this, please ensure your clients are implementing proper backoff and retry strategies.

## Cooldown

Depending on whether you have been rate-limited by our firewall, or by the API servers, the cooldown period varies:

* **Firewall**: 60 seconds, static
* **API servers**: `weightOfEndpoint/(totalWeight/60)`
  {% 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/reference/rate-limits.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.
