### GET / Source: https://apidocs.lighter.xyz/reference/status Retrieves the current status of the ZkLighter service. ```APIDOC ## GET / ### Description Get status of zklighter ### Method GET ### Endpoint / ### Responses #### Success Response (200) - **status** (integer) - The current status of the service. - **network_id** (integer) - The ID of the network. - **timestamp** (integer) - The timestamp of the status update. #### Response Example ```json { "status": 1, "network_id": 1, "timestamp": 1717777777 } ``` #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - A message describing the error. #### Response Example ```json { "code": 400, "message": "Bad request" } ``` ``` -------------------------------- ### GET /api/v1/systemConfig Source: https://apidocs.lighter.xyz/reference Retrieves the system configuration settings for the ZKLighter mainnet environment. ```APIDOC ## GET /api/v1/systemConfig ### Description Retrieves the current system configuration settings from the ZKLighter mainnet API. ### Method GET ### Endpoint https://mainnet.zklighter.elliot.ai/api/v1/systemConfig ### Request Example curl --request GET \ --url https://mainnet.zklighter.elliot.ai/api/v1/systemConfig \ --header 'accept: application/json' ### Response #### Success Response (200) - Returns the system configuration object. #### Error Response (400) - Returns a bad request error if the parameters or request are invalid. ``` -------------------------------- ### GET /api/v1/announcement Source: https://apidocs.lighter.xyz/reference/announcement-1 Retrieves a list of system announcements. ```APIDOC ## GET /api/v1/announcement ### Description Get announcements from the system. ### Method GET ### Endpoint /api/v1/announcement ### Response #### Success Response (200) - **code** (integer) - Status code - **message** (string) - Response message - **announcements** (array) - List of announcement objects - **title** (string) - Title of the announcement - **content** (string) - Content of the announcement - **created_at** (integer) - Creation timestamp - **expired_at** (integer) - Expiration timestamp #### Response Example { "code": 200, "message": "success", "announcements": [ { "title": "System Update", "content": "Maintenance scheduled for tonight.", "created_at": 1672531200, "expired_at": 1672617600 } ] } ``` -------------------------------- ### GET /batches Source: https://apidocs.lighter.xyz/reference/get_batches Retrieves a list of recent batches from the Lighter Explorer. ```APIDOC ## GET /batches ### Description Retrieves a list of recent batches. ### Method GET ### Endpoint /batches ### Response #### Success Response (200) - **batch_details** (object | null) - Details about the batch transactions. - **batch_number** (integer) - The unique number of the batch. - **batch_size** (integer) - The number of items in the batch. - **batch_status** (string) - The current status of the batch (e.g., "committed", "verified", "executed"). - **updated_at** (string) - The timestamp when the batch was last updated. #### Response Example { "batch_details": { "commit_tx_hash": "0xabc123...", "execute_tx_hash": "0xdef456...", "verify_tx_hash": "0xghi789..." }, "batch_number": 100, "batch_size": 50, "batch_status": "committed", "updated_at": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### GET /api/v1/leaseOptions Source: https://apidocs.lighter.xyz/reference/leaseoptions Retrieves a list of available lease duration and rate tiers. ```APIDOC ## GET /api/v1/leaseOptions ### Description Returns available lease duration/rate tiers, sorted by duration descending. ### Method GET ### Endpoint /api/v1/leaseOptions ### Response #### Success Response (200) - **code** (integer) - Response status code - **message** (string) - Response message - **options** (array) - List of lease options - **duration_days** (integer) - Lease duration in days - **annual_rate** (number) - Annual rate as a percentage - **lit_incentives_account_index** (integer) - Account index that receives the leasing fee #### Error Response (400) - **code** (integer) - Error code - **message** (string) - Error message ``` -------------------------------- ### Get Asset Details Source: https://apidocs.lighter.xyz/reference/assetdetails Retrieves details for a specific asset or all assets. ```APIDOC ## GET /api/v1/assetDetails ### Description Get asset details for a specific asset or all assets. ### Method GET ### Endpoint /api/v1/assetDetails ### Parameters #### Query Parameters - **asset_id** (integer) - Optional - The ID of the asset to retrieve details for. Defaults to 0 for all assets. ### Response #### Success Response (200) - **code** (integer) - The status code of the response. - **message** (string) - A message indicating the status of the operation. - **asset_details** (array) - An array of asset objects, each containing detailed information about an asset. ##### Asset Object Structure - **asset_id** (integer) - The unique identifier for the asset. - **symbol** (string) - The trading symbol of the asset (e.g., ETH). - **l1_decimals** (integer) - The number of decimal places for the asset on Layer 1. - **decimals** (integer) - The number of decimal places for the asset on Layer 2. - **min_transfer_amount** (string) - The minimum amount that can be transferred. - **min_withdrawal_amount** (string) - The minimum amount that can be withdrawn. - **margin_mode** (string) - Indicates if margin trading is enabled or disabled for the asset. - **index_price** (string) - The current index price of the asset. - **l1_address** (string) - The contract address of the asset on Layer 1. - **global_supply_cap** (string) - The global supply cap for the asset. - **liquidation_fee** (string) - The fee charged for liquidation. - **liquidation_threshold** (string) - The threshold at which liquidation occurs. - **loan_to_value** (string) - The loan-to-value ratio for the asset. - **price_decimals** (integer) - The number of decimal places for the asset's price. - **total_supplied** (string) - The total amount of the asset supplied. - **user_supply_cap** (string) - The maximum amount of the asset a user can supply. #### Response Example ```json { "code": 200, "message": "Success", "asset_details": [ { "asset_id": 1, "symbol": "ETH", "l1_decimals": 18, "decimals": 18, "min_transfer_amount": "0.01", "min_withdrawal_amount": "0.01", "margin_mode": "enabled", "index_price": "3024.66", "l1_address": "0x0000000000000000000000000000000000000000", "global_supply_cap": "1000000", "liquidation_fee": "0.01", "liquidation_threshold": "0.8", "loan_to_value": "0.5", "price_decimals": 4, "total_supplied": "100", "user_supply_cap": "1000" } ] } ``` #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - A message describing the error. #### Response Example ```json { "code": 400, "message": "Bad request" } ``` ``` -------------------------------- ### GET /info Source: https://apidocs.lighter.xyz/reference/info-1 Retrieves general information about the ZkLighter project, specifically the contract address. ```APIDOC ## GET /info ### Description Get info of zklighter. ### Method GET ### Endpoint /info ### Response #### Success Response (200) - **contract_address** (string) - The contract address of the ZkLighter project. #### Response Example { "contract_address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" } #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - The error message. ``` -------------------------------- ### GET /api/v1/systemConfig Source: https://apidocs.lighter.xyz/reference/systemconfig Retrieves the current system configuration settings, including liquidity and staking pool indices, cooldown periods, and integrator fee limits. ```APIDOC ## GET /api/v1/systemConfig ### Description Retrieves the current system configuration settings, including liquidity and staking pool indices, cooldown periods, and integrator fee limits. ### Method GET ### Endpoint https://mainnet.zklighter.elliot.ai/api/v1/systemConfig ### Response #### Success Response (200) - **code** (integer) - Status code - **message** (string) - Status message - **liquidity_pool_index** (integer) - Index of the liquidity pool - **staking_pool_index** (integer) - Index of the staking pool - **funding_fee_rebate_account_index** (integer) - Index of the funding fee rebate account - **liquidity_pool_cooldown_period** (integer) - Cooldown period for liquidity pool - **staking_pool_lockup_period** (integer) - Lockup period for staking pool - **max_integrator_perps_maker_fee** (integer) - Max integrator perps maker fee - **max_integrator_perps_taker_fee** (integer) - Max integrator perps taker fee - **max_integrator_spot_maker_fee** (integer) - Max integrator spot maker fee - **max_integrator_spot_taker_fee** (integer) - Max integrator spot taker fee #### Response Example { "code": 200, "message": "success", "liquidity_pool_index": 1, "staking_pool_index": 1, "funding_fee_rebate_account_index": 1, "liquidity_pool_cooldown_period": 3600, "staking_pool_lockup_period": 86400, "max_integrator_perps_maker_fee": 10, "max_integrator_perps_taker_fee": 10, "max_integrator_spot_maker_fee": 10, "max_integrator_spot_taker_fee": 10 } ``` -------------------------------- ### Retrieve system configuration via cURL Source: https://apidocs.lighter.xyz/reference Use this cURL command to perform a GET request to the systemConfig endpoint. ```Shell curl --request GET \ --url https://mainnet.zklighter.elliot.ai/api/v1/systemConfig \ --header 'accept: application/json' ``` -------------------------------- ### GET /api/v1/liquidations Source: https://apidocs.lighter.xyz/reference/liquidations Retrieves liquidation information for a specific account. ```APIDOC ## GET /api/v1/liquidations ### Description Get liquidation infos for a specific account index. ### Method GET ### Endpoint /api/v1/liquidations ### Parameters #### Header Parameters - **authorization** (string) - Required - Authorization token #### Query Parameters - **account_index** (integer) - Required - The account index to query - **market_id** (integer) - Optional - The market ID (default: 255) - **cursor** (string) - Optional - Pagination cursor - **limit** (integer) - Required - Number of records to return (1-100) ### Response #### Success Response (200) - **LiquidationInfos** (object) - A successful response containing liquidation details. #### Error Response (400) - **ResultCode** (object) - Bad request error details. ``` -------------------------------- ### GET /pnl Source: https://apidocs.lighter.xyz/reference/pnl Retrieves the account PnL chart data. ```APIDOC ## GET /pnl ### Description Get account PnL chart. ### Method GET ### Endpoint /pnl ``` -------------------------------- ### GET /orderBookDetails Source: https://apidocs.lighter.xyz/reference/orderbookdetails Retrieves metadata information for order books. ```APIDOC ## GET /orderBookDetails ### Description Get order books metadata. ### Method GET ### Endpoint /orderBookDetails ``` -------------------------------- ### GET /api/v1/funding-rates Source: https://apidocs.lighter.xyz/reference/funding-rates Retrieves a list of current funding rates for supported markets. ```APIDOC ## GET /api/v1/funding-rates ### Description Get funding rates for various markets and exchanges. ### Method GET ### Endpoint /api/v1/funding-rates ### Response #### Success Response (200) - **code** (integer) - Status code - **message** (string) - Response message - **funding_rates** (array) - List of funding rate objects - **market_id** (integer) - Market identifier - **exchange** (string) - Exchange name (binance, bybit, hyperliquid, lighter) - **symbol** (string) - Trading symbol - **rate** (number) - Funding rate value #### Response Example { "code": 200, "message": "Success", "funding_rates": [ { "market_id": 1, "exchange": "lighter", "symbol": "ETH-USDC", "rate": 0.0001 } ] } ``` -------------------------------- ### GET /search Source: https://apidocs.lighter.xyz/reference/get_search Searches for blocks, batches, transactions, or accounts using a query parameter. ```APIDOC ## GET /search ### Description Search for blocks, batches, transactions, or accounts. ### Method GET ### Endpoint /search ### Parameters #### Query Parameters - **q** (string) - Required - Search query (block number, batch number, tx hash, account L1 address, or account index) ### Responses #### Success Response (200) - **type** (string) - Description of the search result type (e.g., account, block, batch, log). #### Response Example ```json [ { "type": "block", "block": { "batch_number": 12345, "block_number": 67890, "hash": "0xabc...", "parent_hash": "0xdef...", "timestamp": "2023-10-27T10:00:00Z", "state_root": "0xghi...", "transactions_root": "0xjkl...", "receipts_root": "0xmnp...", "l1_block_number": 1234567, "l1_tx_hash": "0xstu...", "sequencer_address": "0xvwx...", "global_state_root": "0xabc...", "protocol_version": 1 } } ] ``` ``` -------------------------------- ### GET /trades Source: https://apidocs.lighter.xyz/reference/trades Retrieves a list of trades with optional filtering and pagination. ```APIDOC ## GET /trades ### Description Retrieves a list of trades. This endpoint supports filtering by market ID and pagination using a cursor. ### Method GET ### Endpoint /trades ### Query Parameters - **market_id** (string) - Optional - The ID of the market to filter trades by. - **limit** (integer) - Optional - The maximum number of trades to return per page. Defaults to 100. - **cursor** (string) - Optional - A cursor for fetching the next page of results. ### Response #### Success Response (200) - **code** (integer) - The status code of the response. Example: 200. - **message** (string) - A message indicating the status of the request. Example: "OK". - **next_cursor** (string) - A cursor to fetch the next page of trades. This will be null if there are no more results. - **trades** (array) - An array of trade objects. - **trade_id** (string) - The unique identifier for the trade. - **tx_hash** (string) - The transaction hash associated with the trade. - **type** (string) - The type of trade (e.g., "BUY", "SELL"). - **market_id** (string) - The ID of the market where the trade occurred. - **size** (string) - The size of the trade. - **price** (string) - The price at which the trade was executed. - **usd_amount** (string) - The amount of the trade in USD. - **ask_id** (string) - The ID of the ask order. - **bid_id** (string) - The ID of the bid order. - **ask_account_id** (string) - The account ID of the ask order. - **bid_account_id** (string) - The account ID of the bid order. - **is_maker_ask** (boolean) - Indicates if the maker was the ask side of the trade. - **block_height** (integer) - The block height at which the trade was confirmed. - **timestamp** (string) - The timestamp of the trade. - **taker_position_size_before** (string) - The taker's position size before the trade. - **taker_entry_quote_before** (string) - The taker's entry quote before the trade. - **taker_initial_margin_fraction_before** (string) - The taker's initial margin fraction before the trade. - **maker_position_size_before** (string) - The maker's position size before the trade. - **maker_entry_quote_before** (string) - The maker's entry quote before the trade. - **maker_initial_margin_fraction_before** (string) - The maker's initial margin fraction before the trade. - **transaction_time** (string) - The timestamp of the transaction. - **ask_account_pnl** (string) - The PNL of the ask account. - **ask_client_id** (string) - The client ID of the ask order. - **bid_account_pnl** (string) - The PNL of the bid account. - **bid_client_id** (string) - The client ID of the bid order. - **maker_position_sign_changed** (boolean) - Indicates if the maker's position sign changed. - **taker_position_sign_changed** (boolean) - Indicates if the taker's position sign changed. - **ask_client_id_str** (string) - The string representation of the ask client ID. - **bid_client_id_str** (string) - The string representation of the bid client ID. - **trade_id_str** (string) - The string representation of the trade ID. - **integrator_maker_fee** (string) - The integrator's maker fee. - **integrator_maker_fee_collector_index** (integer) - The integrator's maker fee collector index. - **integrator_taker_fee** (string) - The integrator's taker fee. - **integrator_taker_fee_collector_index** (integer) - The integrator's taker fee collector index. #### Response Example ```json { "code": 200, "message": "OK", "next_cursor": "some_cursor_string", "trades": [ { "trade_id": "123", "tx_hash": "0xabc...", "type": "BUY", "market_id": "BTC-PERPETUAL", "size": "0.1", "price": "50000.0", "usd_amount": "5000.0", "ask_id": "ask_order_1", "bid_id": "bid_order_1", "ask_account_id": "acc_ask_1", "bid_account_id": "acc_bid_1", "is_maker_ask": false, "block_height": 123456, "timestamp": "2023-10-27T10:00:00Z", "taker_position_size_before": "0.5", "taker_entry_quote_before": "25000.0", "taker_initial_margin_fraction_before": "0.1", "maker_position_size_before": "0.2", "maker_entry_quote_before": "10000.0", "maker_initial_margin_fraction_before": "0.05", "transaction_time": "2023-10-27T10:00:05Z", "ask_account_pnl": "100.0", "ask_client_id": "client_ask_1", "bid_account_pnl": "-50.0", "bid_client_id": "client_bid_1", "maker_position_sign_changed": false, "taker_position_sign_changed": false, "ask_client_id_str": "client_ask_1_str", "bid_client_id_str": "client_bid_1_str", "trade_id_str": "123_str", "integrator_maker_fee": "0.001", "integrator_maker_fee_collector_index": 156, "integrator_taker_fee": "0.002", "integrator_taker_fee_collector_index": 50 } ] } ``` ``` -------------------------------- ### GET /api/v1/l1Metadata Source: https://apidocs.lighter.xyz/reference/l1metadata Retrieves L1 metadata for a given address. ```APIDOC ## GET /api/v1/l1Metadata ### Description Get L1 metadata ### Method GET ### Endpoint /api/v1/l1Metadata ### Parameters #### Header Parameters - **authorization** (string) - Required - Authorization token #### Query Parameters - **l1_address** (string) - Required - The L1 address to query metadata for. ### Response #### Success Response (200) - **l1_address** (string) - The L1 address. - **can_invite** (boolean) - Indicates if the user can invite others. - **referral_points_percentage** (string) - The percentage of referral points. #### Response Example ```json { "l1_address": "0x123...", "can_invite": true, "referral_points_percentage": "10%" } ``` #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - The error message. #### Response Example ```json { "code": 400, "message": "Bad request" } ``` ``` -------------------------------- ### GET /api/v1/getMakerOnlyApiKeys Source: https://apidocs.lighter.xyz/reference/getmakeronlyapikeys Retrieves a list of maker-only API key indexes for a specified account. ```APIDOC ## GET /api/v1/getMakerOnlyApiKeys ### Description Get maker-only API key indexes for the specified account. ### Method GET ### Endpoint /api/v1/getMakerOnlyApiKeys ### Parameters #### Header Parameters - **authorization** (string) - Required - Authentication token #### Query Parameters - **account_index** (integer) - Required - The index of the account to query ### Response #### Success Response (200) - **code** (integer) - Response status code - **message** (string) - Response message - **api_key_indexes** (array) - List of API key indexes #### Response Example { "code": 200, "message": "Success", "api_key_indexes": [1, 2, 3] } ``` -------------------------------- ### GET /api/v1/withdrawalDelay Source: https://apidocs.lighter.xyz/reference/withdrawaldelay Retrieves the current withdrawal delay setting in seconds. ```APIDOC ## GET /api/v1/withdrawalDelay ### Description Retrieves the current withdrawal delay setting in seconds. ### Method GET ### Endpoint /api/v1/withdrawalDelay ### Response #### Success Response (200) - **seconds** (integer) - The withdrawal delay in seconds. #### Response Example ```json { "seconds": 86400 } ``` #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - A description of the error. #### Response Example ```json { "code": 400, "message": "Bad request" } ``` ``` -------------------------------- ### GET /api/v1/apikeys Source: https://apidocs.lighter.xyz/reference/apikeys Retrieves account API keys. Set `api_key_index` to 255 to fetch all keys associated with the account. ```APIDOC ## GET /api/v1/apikeys ### Description Retrieves account API keys. Set `api_key_index` to 255 to retrieve all api keys associated with the account. ### Method GET ### Endpoint /api/v1/apikeys ### Parameters #### Query Parameters - **account_index** (integer) - Required - The index of the account. - **api_key_index** (integer) - Optional - The index of the API key. Defaults to 255 to retrieve all keys. ### Response #### Success Response (200) - **code** (integer) - The status code of the response. - **message** (string) - A message indicating the status of the operation. - **api_keys** (array) - A list of API key objects. - **account_index** (integer) - The index of the account. - **api_key_index** (integer) - The index of the API key. - **nonce** (integer) - The nonce associated with the API key. - **public_key** (string) - The public key. - **transaction_time** (integer) - The timestamp of the transaction. #### Response Example ```json { "code": 200, "message": "Success", "api_keys": [ { "account_index": 3, "api_key_index": 0, "nonce": 722, "public_key": "0x...", "transaction_time": 1678886400 } ] } ``` #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - A message describing the error. ``` -------------------------------- ### GET /total Source: https://apidocs.lighter.xyz/reference/get_total Retrieves the total counts for accounts, batches, blocks, and transactions on the network. ```APIDOC ## GET /total ### Description Returns the aggregate statistics for the network, including the total number of accounts, batches, blocks, and transactions. ### Method GET ### Endpoint /total ### Response #### Success Response (200) - **accounts** (integer) - Total number of accounts - **batches** (integer) - Total number of batches - **blocks** (integer) - Total number of blocks - **txs** (integer) - Total number of transactions #### Response Example { "accounts": 100, "batches": 50, "blocks": 200, "txs": 1000 } ``` -------------------------------- ### GET /tx Source: https://apidocs.lighter.xyz/reference/tx Retrieves a specific transaction using its hash or sequence index. ```APIDOC ## GET /tx ### Description Get transaction by hash or sequence index. ### Method GET ### Endpoint /tx ``` -------------------------------- ### GET /account Source: https://apidocs.lighter.xyz/reference/account-1 Retrieves account information by index or L1 address, including status, collateral, and position details. ```APIDOC ## GET /account ### Description Get account by an account's index, or L1 address. ### Method GET ### Endpoint /account ### Response #### Success Response (200) - **Status** (integer) - 1 is active, 0 is inactive. - **Collateral** (number) - The amount of collateral in the account. - **Position Details** (object) - Details for each market position: - **OOC** (integer) - Open order count in that market. - **Sign** (integer) - 1 for Long, -1 for Short. - **Position** (number) - The amount of position in that market. - **Avg Entry Price** (number) - The average entry price of the position. - **Position Value** (number) - The value of the position. - **Unrealized PnL** (number) - The unrealized profit and loss of the position. - **Realized PnL** (number) - The realized profit and loss of the position. ``` -------------------------------- ### GET /api/v1/deposit/networks Source: https://apidocs.lighter.xyz/reference/deposit_networks Retrieves a list of networks that support deposits via intent address. ```APIDOC ## GET /api/v1/deposit/networks ### Description Get networks that support deposits via intent address. ### Method GET ### Endpoint /api/v1/deposit/networks ### Response #### Success Response (200) - **code** (integer) - Status code - **message** (string) - Response message - **networks** (array) - List of supported networks - **name** (string) - Network name - **chain_id** (string) - Network chain ID - **explorer** (string) - Network explorer URL #### Response Example { "code": 200, "message": "Success", "networks": [ { "name": "Arbitrum", "chain_id": "4164", "explorer": "https://arbiscan.io/" } ] } ``` -------------------------------- ### GET /trades Source: https://apidocs.lighter.xyz/reference/trades Retrieves a list of trades for lighter accounts. Authentication is required for master and sub-accounts. ```APIDOC ## GET /trades ### Description Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts. ### Method GET ### Endpoint /trades ### Parameters #### Query Parameters - **auth** (string) - Required - Authentication token for master or sub accounts. ### Response #### Success Response (200) - **trades** (array) - A list of trade objects. - **trade_id** (string) - The unique identifier for the trade. - **timestamp** (string) - The time the trade occurred. - **symbol** (string) - The trading symbol. - **side** (string) - The side of the trade (e.g., 'buy' or 'sell'). - **quantity** (number) - The amount traded. - **price** (number) - The price at which the trade occurred. #### Response Example ```json { "trades": [ { "trade_id": "t123", "timestamp": "2023-10-27T10:00:00Z", "symbol": "BTC/USD", "side": "buy", "quantity": 0.5, "price": 30000.00 } ] } ``` ``` -------------------------------- ### Get Log by Hash Source: https://apidocs.lighter.xyz/reference/get_logs-hash Retrieves detailed information about a specific log entry using its unique hash. ```APIDOC ## GET /logs/{hash} ### Description Retrieves detailed information about a specific log entry using its unique hash. ### Method GET ### Endpoint /logs/{hash} ### Parameters #### Path Parameters - **hash** (string) - Required - The unique hash of the log entry to retrieve. ### Responses #### Success Response (200) - **TxDetailed** (object) - Detailed transaction information including log data. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /api/v1/referral/get Source: https://apidocs.lighter.xyz/reference/referral_get Retrieves a referral code and the remaining usage count for the specified account. ```APIDOC ## GET /api/v1/referral/get ### Description Get referral code ### Method GET ### Endpoint /api/v1/referral/get ### Parameters #### Query Parameters - **authorization** (string) - Optional - make required after integ is done - **auth** (string) - Optional - made optional to support header auth clients - **account_index** (integer) - Required - ### Response #### Success Response (200) - **code** (integer) - - **message** (string) - - **referral_code** (string) - - **remaining_usage** (integer) - #### Response Example ```json { "code": 200, "message": "Success", "referral_code": "5V24K3MJ", "remaining_usage": 3 } ``` #### Error Response (400) - **code** (integer) - - **message** (string) - #### Response Example ```json { "code": 400, "message": "Bad request" } ``` ``` -------------------------------- ### GET /api/v1/account Source: https://apidocs.lighter.xyz/reference/account-1 Retrieves detailed account information based on the provided index or L1 address. ```APIDOC ## GET /api/v1/account ### Description Get account by an account's index, or L1 address. ### Method GET ### Endpoint /api/v1/account ### Parameters #### Query Parameters - **by** (string) - Required - The method of identification, either 'index' or 'l1_address'. - **value** (string) - Required - The value corresponding to the 'by' parameter. - **active_only** (boolean) - Optional - Hide markets for which leverage and margin settings are present, but with no active position. Defaults to false. ### Response #### Success Response (200) - **DetailedAccounts** (object) - A successful response containing account details. #### Error Response (400) - **ResultCode** (object) - Bad request error response. ``` -------------------------------- ### GET /api/v1/positionFunding Source: https://apidocs.lighter.xyz/reference/positionfunding Retrieves a list of account position fundings. Supports filtering by market, cursor, limit, and side. ```APIDOC ## GET /api/v1/positionFunding ### Description Get accounts position fundings. ### Method GET ### Endpoint https://mainnet.zklighter.elliot.ai/api/v1/positionFunding ### Parameters #### Query Parameters - **account_index** (integer) - Required - The index of the account. - **market_id** (integer) - Optional - The ID of the market. Defaults to 255. - **cursor** (string) - Optional - A cursor for fetching the next page of results. - **limit** (integer) - Required - The maximum number of results to return. Must be between 1 and 100. - **side** (string) - Optional - The side of the position (long, short, or all). Defaults to 'all'. #### Header Parameters - **authorization** (string) - Optional - Bearer token for authentication. ### Response #### Success Response (200) - **code** (integer) - The status code of the response. - **message** (string) - A message indicating the success of the operation. - **position_fundings** (array) - An array of position funding objects. - **timestamp** (integer) - The timestamp of the funding event. - **market_id** (integer) - The ID of the market. - **funding_id** (integer) - The ID of the funding. - **change** (string) - The change in funding. - **discount** (string) - The discount applied. - **rate** (string) - The funding rate. - **position_size** (string) - The size of the position. - **position_side** (string) - The side of the position (long or short). - **next_cursor** (string) - A cursor for fetching the next page of results. #### Error Response (400) - **code** (integer) - The error code. - **message** (string) - A message describing the error. ### Request Example ```json { "example": "Not applicable for GET request" } ``` ### Response Example ```json { "code": 200, "message": "Success", "position_fundings": [ { "timestamp": 1640995200, "market_id": 1, "funding_id": 1, "change": "1", "discount": "1", "rate": "1", "position_size": "1", "position_side": "long" } ], "next_cursor": "some_cursor_string" } ``` ``` -------------------------------- ### OpenAPI Definition for leaseOptions Source: https://apidocs.lighter.xyz/reference/leaseoptions This OpenAPI 3.0.0 definition describes the leaseOptions GET endpoint. It specifies the request path, operation, tags, and detailed response schemas for successful requests and error conditions. ```json { "openapi": "3.0.0", "info": { "title": "", "version": "" }, "paths": { "/api/v1/leaseOptions": { "get": { "summary": "leaseOptions", "operationId": "leaseOptions", "tags": [ "account" ], "description": "Returns available lease duration/rate tiers, sorted by duration descending.", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RespGetLeaseOptions" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResultCode" } } } } } } } }, "servers": [ { "url": "https://mainnet.zklighter.elliot.ai" } ], "components": { "schemas": { "ResultCode": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "example": "200" }, "message": { "type": "string" } }, "title": "ResultCode", "required": [ "code" ] }, "LeaseOptionEntry": { "type": "object", "properties": { "duration_days": { "type": "integer", "description": "Lease duration in days" }, "annual_rate": { "type": "number", "format": "double", "description": "Annual rate as a percentage (e.g. 25.0 means 25%)" } } }, "RespGetLeaseOptions": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/LeaseOptionEntry" } }, "lit_incentives_account_index": { "type": "integer", "format": "int64", "description": "Account index that receives the leasing fee" } } } } } } ``` -------------------------------- ### GET /api/v1/txFromL1TxHash Source: https://apidocs.lighter.xyz/reference/txfroml1txhash Retrieves detailed information about an L1 transaction using its transaction hash. ```APIDOC ## GET /api/v1/txFromL1TxHash ### Description Get L1 transaction by L1 transaction hash. ### Method GET ### Endpoint /api/v1/txFromL1TxHash ### Parameters #### Query Parameters - **hash** (string) - Required - The L1 transaction hash to query. ### Response #### Success Response (200) - **code** (integer) - Response code - **message** (string) - Response message - **hash** (string) - Transaction hash - **type** (integer) - Transaction type - **info** (string) - Transaction info - **event_info** (string) - Event info - **status** (integer) - Transaction status - **transaction_index** (integer) - Transaction index - **l1_address** (string) - L1 address - **account_index** (integer) - Account index - **nonce** (integer) - Nonce - **expire_at** (integer) - Expiration timestamp - **block_height** (integer) - Block height - **queued_at** (integer) - Queued timestamp - **executed_at** (integer) - Execution timestamp - **sequence_index** (integer) - Sequence index - **parent_hash** (string) - Parent hash - **api_key_index** (integer) - API key index - **transaction_time** (integer) - Transaction time - **committed_at** (integer) - Committed timestamp - **verified_at** (integer) - Verified timestamp #### Response Example { "code": 200, "hash": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "type": 1, "info": "{}", "event_info": "{}", "status": 1, "transaction_index": 8761, "l1_address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "account_index": 1, "nonce": 722, "expire_at": 1640995200, "block_height": 45434, "queued_at": 1640995200, "executed_at": 1640995200, "sequence_index": 8761, "parent_hash": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "api_key_index": 0, "transaction_time": 1257894000000000, "committed_at": 1640995200, "verified_at": 1640995200 } ``` -------------------------------- ### GET /recentTrades Source: https://apidocs.lighter.xyz/reference/recenttrades Retrieves a list of the most recent trades. ```APIDOC ## GET /recentTrades ### Description Get recent trades ### Method GET ### Endpoint /recentTrades ``` -------------------------------- ### GET /api/v1/accountLimits Source: https://apidocs.lighter.xyz/reference/accountlimits Retrieves the account limits for a specific user account. Requires an authorization header and account index. ```APIDOC ## GET /api/v1/accountLimits ### Description Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types ### Method GET ### Endpoint /api/v1/accountLimits ### Parameters #### Query Parameters - **account_index** (integer) - Required - The index of the account to retrieve limits for. #### Headers - **authorization** (string) - Required - Authorization token. ### Response #### Success Response (200) - **code** (integer) - Status code. - **message** (string) - Response message. - **max_llp_percentage** (integer) - Maximum LLP percentage. - **user_tier** (string) - User tier identifier. - **can_create_public_pool** (boolean) - Whether the user can create a public pool. - **max_llp_amount** (string) - Maximum LLP amount. - **current_maker_fee_tick** (integer) - Current maker fee tick. - **current_taker_fee_tick** (integer) - Current taker fee tick. - **effective_lit_stakes** (string) - Effective staked LIT shares including active leases. - **leased_lit** (string) - Total actively leased LIT. - **user_tier_name** (string) - Human-readable user tier name. #### Response Example { "code": 200, "message": "success", "max_llp_percentage": 25, "user_tier": "std", "can_create_public_pool": true, "max_llp_amount": "1000000", "current_maker_fee_tick": 0, "current_taker_fee_tick": 0, "effective_lit_stakes": "100", "leased_lit": "50", "user_tier_name": "standard" } ``` -------------------------------- ### API Token Format and Usage Source: https://apidocs.lighter.xyz/reference/tokens_create Illustrates the structure of an API token and how to include it in HTTP headers for authentication. The token is only shown once upon creation. ```text Token Format: ro:{account_index}:{single|all}:{expiry_unix}:{random_hex} Usage (HTTP Header): Authorization: ro:6:all:1767139200:a1b2c3... ``` -------------------------------- ### GET /accounts/{param}/logs Source: https://apidocs.lighter.xyz/reference/get_accounts-param-logs Retrieves logs for a specific account identified by its address or index. ```APIDOC ## GET /accounts/{param}/logs ### Description Retrieves logs for a specific account identified by its address or index. ### Method GET ### Endpoint /accounts/{param}/logs ### Parameters #### Path Parameters - **param** (string) - Required - L1 Address or AccountIndex #### Query Parameters - **pub_data_type** (array) - Optional - Log Types - **limit** (integer) - Required - Limit (maximum 100) - **offset** (string) - Required - Offset ### Response #### Success Response (200) - **response.Tx** (array) - List of transaction objects ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.