> 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/getting-started/environments.md).

# Environments & endpoints

Base URLs, chain IDs and contract addresses for mainnet and testnet.

| Item                   | Mainnet                                    | Testnet                                                    |
| ---------------------- | ------------------------------------------ | ---------------------------------------------------------- |
| REST base URL          | `https://mainnet.zklighter.elliot.ai`      | `https://testnet.zklighter.elliot.ai`                      |
| REST API prefix        | `/api/v1/`                                 | `/api/v1/`                                                 |
| WebSocket              | `wss://mainnet.zklighter.elliot.ai/stream` | `wss://testnet.zklighter.elliot.ai/stream`                 |
| Chain ID (for signing) | `304`                                      | `300`                                                      |
| Web app                | [app.lighter.xyz](https://app.lighter.xyz) | [testnet.app.lighter.xyz](https://testnet.app.lighter.xyz) |
| Explorer API           | `https://explorer.elliot.ai/api/`          | –                                                          |
| Deposit bridge API     | `https://bridge.lighter.xyz`               | –                                                          |

{% hint style="warning" %}
**Chain ID must match the environment**

The chain ID you pass to the signer must match the environment you send to. A transaction signed for `304` will be rejected by testnet, and vice versa.
{% endhint %}

{% hint style="info" %}
**Lighter on Robinhood Chain**

Lighter on Robinhood Chain is a separate exchange with its own endpoints (`api.rh.lighter.xyz`) and chain ID (`466324`). See [Lighter on Robinhood Chain](/developers/robinhood-chain/overview.md).
{% endhint %}

## Ethereum contract (mainnet)

Lighter's main contract on Ethereum holds platform collateral and handles deposits, secure withdrawals and priority transactions:

`0x3B4D794a66304F130a4Db8F2551B0070dfCf5ca7`

See [Priority Transactions](/developers/reference/priority-transactions.md) for its functions.

## Read-only WebSocket for restricted regions

Clients in restricted regions can still read market data:

```
wss://mainnet.zklighter.elliot.ai/stream?readonly=true
```

## Latency & colocation

For the lowest latency, run in **AWS Tokyo `ap-northeast-1`, AZ `apne1-az4`**. Premium/Advanced accounts on the top staking tier can request direct access that skips AWS CloudFront via the [#support](https://discord.com/channels/987399783985590322/1383469922943766608) Discord channel.

## Quick smoke test

```shell
# All markets with decimals and minimums
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBookDetails"

# System config (integrator fee caps, pool indexes)
curl "https://mainnet.zklighter.elliot.ai/api/v1/systemConfig"
```


---

# 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/getting-started/environments.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.
