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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "lighter" with this command: npx skills add aviclaw/lighter

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

VariableRequiredDescriptionWhere to Find
LIGHTER_API_KEYFor ordersAPI key from Lighter SDK setupSee "Getting an API Key" section below
LIGHTER_ACCOUNT_INDEXFor ordersYour Lighter subaccount index (0-252)See "Getting Your Account Index" section below
LIGHTER_L1_ADDRESSOptionalYour ETH address (0x...) used on LighterYour 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

IDSymbol
1ETH-USD
2BTC-USD
3SOL-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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

Hyperliquid DEX Integration

Query Hyperliquid DEX for account balances, positions, PnL, and margin data via ClawdBot API

Registry SourceRecently Updated
1.1K0Profile unavailable
Web3

Okx Strategy Factory

Agent Team 工厂:协调 5 个 AI Agent(Strategy/Backtest/Infra/Publish/Iteration)完成 OKX OnchainOS 链上交易策略的全生命周期——开发、回测、部署、发布、迭代。支持多策略并行,每个策略独立状态管理。触发词:策略开发、agent team、...

Registry SourceRecently Updated
2390Profile unavailable
Web3

Helius x DFlow

Build Solana trading applications combining DFlow trading APIs with Helius infrastructure. Covers spot swaps (imperative and declarative), prediction markets...

Registry SourceRecently Updated
2830Profile unavailable
Web3

Carbon DeFi

Use this skill when the user wants to create or manage on-chain maker trading strategies on Carbon DeFi. Triggers include: "place a limit order", "create a r...

Registry SourceRecently Updated
840Profile unavailable