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.
Trade on Lighter - a zero-knowledge rollup orderbook DEX with millisecond latency and zero fees.
# Markets are public - no credentials needed
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBooks"
API Endpoint: https://mainnet.zklighter.elliot.ai Chain ID: 300
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:
Only proceed with external SDK if you:
| 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 |
Step 1: Get your L1 Address
0x1234...abcd)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
pip install lighter-pythonQuick test (read-only, no credentials):
curl "https://mainnet.zklighter.elliot.ai/api/v1/orderBooks"
# 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"
# 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"
See "Setting Up Your Credentials" table above for the quick curl command.
See "Setting Up Your Credentials" table above for the step-by-step guide.
"Restricted jurisdiction":
SDK signing issues:
| ID | Symbol |
|---|---|
| 1 | ETH-USD |
| 2 | BTC-USD |
| 3 | SOL-USD |
See USAGE.md in this skill folder for:
Disclaimer: Review all external code before running. Use dedicated wallets for trading.