Relay supports depositing and withdrawing to Lighter from any supported chain. You can try depositing today using the Relay App (note: withdrawing is not yet supported in the app). This document details how to integrate Lighter into your application.Documentation Index
Fetch the complete documentation index at: https://docs.relay.link/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you can bridge funds to Lighter, you must first set up an account on lighter.exchange. Once your account is created, you can retrieve your account index to use as the recipient for deposits.API Access
Lighter can be accessed using the standard Relay API flow. To get started, review the execution steps documentation. When you’re ready to execute deposits or withdrawals, refer to the Get Quote API endpoint.Lighter-specific API Parameters
| Parameter | Input | Description |
|---|---|---|
| toChainId / fromChainId | 3586256 | Lighter Chain ID. Use toChainId for deposits and fromChainId for withdrawals. |
| recipient | Lighter account index | The Lighter account index to credit — not a wallet address. |
| user | Lighter account index | On withdrawals, the Lighter account index to debit. |
Getting Your Lighter Account Index
To deposit to Lighter, you need to use your Lighter account index as therecipient parameter. You can retrieve this using the Lighter API’s accountsByL1Address endpoint:
YOUR_WALLET_ADDRESS with your Ethereum wallet address. The response will include your accountIndex, which you should use as the recipient in your quote request.
For more details, see the Lighter API documentation.
How to deposit
originChainId: 8453- Depositing from BasedestinationChainId: 3586256- Lighter chain IDrecipient: "509564"- Your Lighter account index (replace with your actual account index)
How to withdraw
data.action are:
| Property | Type | Description |
|---|---|---|
| type | string | The Lighter action to perform. For withdrawals this is always transfer. |
| toAccountIndex | number | The Lighter account index to transfer funds to (the relayer’s account that executes the fill). |
| assetIndex | number | Identifier of the asset being transferred on Lighter (e.g. 3 for USDC). |
| fromRouteType | number | The route type to debit from on the sender’s Lighter account. |
| toRouteType | number | The route type to credit on the recipient Lighter account. |
| amount | number | Amount of the asset to transfer, in the asset’s smallest unit. |
| usdcFee | number | Fee paid in USDC, in the asset’s smallest unit, covering Lighter execution costs. |
| memo | string | Hex-encoded Relay requestId used to correlate the Lighter transfer with the Relay order. |
SDK
To use the SDK with Lighter, install and configure the Lighter wallet adapter.accountApiKey, or storage paths), you also need the Lighter SDK: