← 返回 Skills 市场
aviclaw

Lighter

作者 aviclaw · GitHub ↗ · v2.0.1
cross-platform ✓ 安全检测通过
698
总下载
1
收藏
2
当前安装
13
版本数
在 OpenClaw 中安装
/install lighter
功能描述
Interact with Lighter protocol - a ZK rollup orderbook DEX. Use when you need to trade on Lighter, check prices, manage positions, or query account data.
使用说明 (SKILL.md)

Lighter Protocol

Trade on Lighter - a zero-knowledge rollup orderbook DEX with millisecond latency and zero fees.

Quick Start (Read-Only)

# Markets are public - no credentials needed
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBooks"

What is Lighter?

  • Zero fees for retail traders
  • Millisecond latency
  • ZK proofs of all operations
  • Backed by Founders Fund, Robinhood, Coinbase Ventures

API Endpoint: https://mainnet.zklighter.elliot.ai Chain ID: 300

⚠️ Security Considerations

Third-Party Dependencies

This skill can work with just requests library for read-only operations. For signing orders, you have two options:

Option A: Minimal (Read-Only)

pip install requests

Only for public data (markets, order books, prices).

Option B: Full Trading Requires the official Lighter SDK. Review and verify before installing:

External Code

Only proceed with external SDK if you:

  1. Have reviewed the GitHub repository
  2. Understand what the code does
  3. Use a dedicated burner wallet, not your main wallet

Environment Variables

Variable Required Description Where to Find
LIGHTER_API_KEY For orders API key from Lighter SDK setup See "Getting an API Key" section below
LIGHTER_ACCOUNT_INDEX For orders Your Lighter subaccount index (0-252) See "Getting Your Account Index" section below
LIGHTER_L1_ADDRESS Optional Your ETH address (0x...) used on Lighter Your MetaMask/Wallet address

Setting Up Your Credentials

Step 1: Get your L1 Address

  • This is your Ethereum address (e.g., 0x1234...abcd)
  • Use the same wallet you connect to Lighter dashboard

Step 2: Get your Account Index

curl "https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=YOUR_ETH_ADDRESS"

Response returns sub_accounts[].index — that's your account index (typically 0 for main account).

Step 3: Get your API Key

  1. Install Lighter Python SDK: pip install lighter-python
  2. Follow the setup guide: https://github.com/elliottech/lighter-python/blob/main/examples/system_setup.py
  3. The SDK generates API keys tied to your account
  4. Store the private key securely — never commit to git

Quick test (read-only, no credentials):

curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBooks"

API Usage

Public Endpoints (No Auth)

# List all markets
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBooks"

# Get order book
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBook?market_id=1"

# Get recent trades
curl "https://mainnet.zklighter.elliot.ai/api/v1/trades?market_id=1"

Authenticated Endpoints

# Account balance (requires API key in header)
curl -H "x-api-key: $LIGHTER_API_KEY" \
  "https://mainnet.zklighter.elliot.ai/api/v1/account?by=index&value=$LIGHTER_ACCOUNT_INDEX"

Getting Your Account Index

See "Setting Up Your Credentials" table above for the quick curl command.

Getting an API Key

See "Setting Up Your Credentials" table above for the step-by-step guide.

Common Issues

"Restricted jurisdiction":

  • Lighter has geographic restrictions - ensure compliance with their terms

SDK signing issues:

  • Use create_market_order() instead of create_order() for more reliable execution

Market IDs

ID Symbol
1 ETH-USD
2 BTC-USD
3 SOL-USD

Links


Additional Examples

See USAGE.md in this skill folder for:

  • Detailed curl commands for all endpoints
  • Order book and trade queries
  • Account and position checks
  • Signed transaction flow (nonce → sign → broadcast)

Disclaimer: Review all external code before running. Use dedicated wallets for trading.

安全使用建议
This skill appears to be a straightforward Lighter protocol client. Before installing or using it with real funds: 1) Verify the SDK repository (https://github.com/elliottech/lighter-python) and confirm the package you install matches that repo; 2) Use a burner/dedicated trading key or account (do not use your main wallet); 3) Confirm what the Lighter API key actually is/permits (API key vs private signing key) and never paste private keys into public places; 4) Note the metadata inconsistency: the skill's manifest omitted required env vars even though SKILL.md and the scripts require LIGHTER_API_KEY and LIGHTER_ACCOUNT_INDEX — make sure you only provide those secrets to this skill if you trust it; 5) If you only need read-only data, avoid installing the SDK and only run the read-only scripts that use requests.
功能分析
Type: OpenClaw Skill Name: lighter Version: 2.0.1 The OpenClaw skill bundle for Lighter Protocol is classified as benign. All code and documentation align with the stated purpose of interacting with a ZK rollup orderbook DEX for trading and querying. Sensitive environment variables (API keys, account index) are handled as expected for authenticated API calls and are not exfiltrated to unauthorized endpoints. The `SKILL.md` and `USAGE.md` files contain explicit security warnings and best practices for users, such as reviewing external SDKs and securely storing credentials, which indicates a responsible approach rather than malicious intent or prompt injection. All network communications are directed to the official Lighter API endpoint (`https://mainnet.zklighter.elliot.ai`).
能力评估
Purpose & Capability
The name/description (Lighter DEX client) aligns with the included scripts (market queries, account, positions, order placement). However, the registry metadata states 'required env vars: none' while SKILL.md and the scripts require LIGHTER_API_KEY and LIGHTER_ACCOUNT_INDEX; this mismatch should be resolved.
Instruction Scope
SKILL.md and USAGE.md limit actions to the Lighter API and optional official SDK signing. The instructions are explicit about which endpoints are used and warn about reviewing external SDK code and using burner wallets. No instructions request unrelated system files or unrelated credentials.
Install Mechanism
There is no install spec (instruction-only), which reduces install-time risk. The package includes scripts and a requirements.txt that lists requests and comments the lighter-sdk as optional — but scripts/order.py imports 'lighter' (the SDK) and will fail if the SDK isn't installed. The skill correctly warns to review the external SDK on GitHub before installing it.
Credentials
The only secrets the skill uses are LIGHTER_API_KEY and LIGHTER_ACCOUNT_INDEX (plus optional LIGHTER_L1_ADDRESS), which are proportionate to trading/account queries. The inconsistency is that the registry metadata listed no required env vars while SKILL.md and the scripts require them. USAGE.md suggests storing keys in ~/.openclaw/secrets.env — a convenience but not enforced by the code; consider secure storage advice.
Persistence & Privilege
The skill does not request persistent/always-on privileges (always:false) and does not modify other skills or system-wide settings. Autonomous invocation is allowed (platform default) but not excessive by itself.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install lighter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /lighter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.1
- Added a new USAGE.md file with detailed usage examples. - Expanded SKILL.md with clearer credential setup instructions, including environment variable guidance and step-by-step API key/account index retrieval. - Referenced USAGE.md in SKILL.md for further examples. - Improved environment variable documentation with a dedicated table and clearer descriptions.
v3.0.0
**v3.0.0 — Major update with improved security, simplified usage, and clearer separation between public and authenticated actions** - SKILL.md significantly rewritten: now emphasizes security, minimal dependencies for read-only access, and instructions for safe trading with external SDK. - Environment variables clearly defined with required/optional split; account connection steps clarified. - requirements.txt and scripts updated for lightweight (requests-based) read-only operations and optional full trading via SDK. - Account and market scripts refactored for clarity and safer credential handling. - Documentation now prioritizes public API usage and security best practices for sensitive actions.
v2.6.0
- Added a dedicated security and best practices section highlighting secret handling and credential risks. - Simplified and reorganized the setup instructions for better clarity and safer onboarding. - Included explicit warnings about never sharing private/API keys and using burner wallets. - Updated CLI command examples and expanded read-only and account command notes. - Clarified SDK usage notes, credential requirements, and linked to relevant documentation and terms. - Added a disclaimer about risk and reviewing code before running.
v2.5.1
- Updated "Common Issues" section to clarify that lighter-sdk Go signer has a bug with order_expiry for create_order(). - Added workaround instructions: use create_market_order() (with code example) to bypass the issue. - Documented "Restricted jurisdiction" error and advised using a VPN or relay if blocked. - No functional or API changes; documentation-only update.
v2.5.0
- SKILL.md rewritten for clarity, conciseness, and improved onboarding. - Adds explicit critical usage notes for the Python SDK (order_type/time_in_force as integers, atomic units, client_order_index hints). - Streamlines environment setup and account key retrieval instructions. - Removes redundant/advanced instruction blocks for brevity. - Expands "Common Issues" and troubleshooting guidance. - Reformats examples for greater accessibility and ease of use.
v2.4.0
- Updated scripts/order.py. - No user-facing documentation changes.
v2.3.0
- Account index setup is now clarified in documentation: added a new section explaining how to retrieve your LIGHTER_ACCOUNT_INDEX via API or helper script. - Added scripts/get_account_index.py for programmatically fetching the account index from an Ethereum address. - Updated environment variable instructions: clearly separates API key generation and account index retrieval. - Improved onboarding by giving copy-paste examples and API endpoints for new users.
v2.2.0
- Clarified API key generation and environment variable setup instructions in SKILL.md - Updated documentation to distinguish API key/private key from Ethereum private key - Added direct reference to mainnet API endpoint and usage notes - No changes to CLI commands or user-facing script behavior
v2.1.0
**Major update: Improved usability, clearer split between public and private API access.** - Read-only functionality (markets, order books, trades) now requires no API key or credentials. - Updated install instructions to require `requests` package and clarified dependencies. - Added clear setup instructions for generating and configuring API keys and account index for signing transactions. - CLI usage examples now distinguish between public (no credentials) and private (API key required) operations. - SKILL.md reorganized for easier onboarding and expanded explanations for market IDs and environment variables.
v2.0.0
Big change: Migrated the codebase from Node.js/JavaScript to Python. - Replaced all JavaScript scripts with Python equivalents (e.g., scripts/account.js → scripts/account.py). - Added requirements.txt for Python dependencies. - Updated documentation and usage instructions to use Python commands instead of Node.js. - Removed Node.js-specific files (package.json, package-lock.json). - Architecture and feature descriptions updated to reflect the Python migration.
v1.0.4
- Updated information on Lighter protocol backers: now lists Founders Fund, Robinhood, Coinbase Ventures, Dragonfly, and more. - Added link to the official Lighter SDK: https://github.com/LiquidLogic-Tech/lighter-ts-sdk.
v1.0.3
- Added detailed instructions for obtaining required credentials: PRIVATE_KEY, LIGHTER_API_KEY, and LIGHTER_ACCOUNT_INDEX. - Expanded the Environment Variables section with retrieval instructions. - Clarified how to export a private key from MetaMask and how to generate an API key from the Lighter dashboard. - Updated Notes to mention testnet usage and chain ID. - No functional code or interface changes; documentation only.
v1.0.2
- Expanded SKILL.md with detailed quick start instructions, usage examples, and installation steps. - Added comprehensive documentation for account operations, trading, and market data commands. - Included architecture overview and environment variable requirements. - Listed protocol features and backed investors.
元数据
Slug lighter
版本 2.0.1
许可证
累计安装 2
当前安装数 2
历史版本数 13
常见问题

Lighter 是什么?

Interact with Lighter protocol - a ZK rollup orderbook DEX. Use when you need to trade on Lighter, check prices, manage positions, or query account data. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 698 次。

如何安装 Lighter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install lighter」即可一键安装,无需额外配置。

Lighter 是免费的吗?

是的,Lighter 完全免费(开源免费),可自由下载、安装和使用。

Lighter 支持哪些平台?

Lighter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Lighter?

由 aviclaw(@aviclaw)开发并维护,当前版本 v2.0.1。

💬 留言讨论