Logo Lighter

Lighter

Tổ chức
Starchild-ai-agent
lighter

Lighter.xyz (zklighter) perpetual and spot DEX — order placement, cancellation, modification, close-all positions, leverage, margin, withdrawals, fund transfers, orderbook depth, market data, candles, funding rates, account positions, balances, PnL, and trade history. Supports symbol resolution (BTC, ETH/USDC) and human-unit auto-scaling for prices and amounts. Triggers on: "lighter", "zklighter", "elliot", perpetual futures trading on lighter, lighter orderbook, lighter funding, lighter positions, lighter margin, "robinhood chain", "lighter on robinhood", robinhoodchain.lighter.xyz. Supports two separate deployments: Lighter on Ethereum and Lighter on Robinhood Chain — the user must pick one (LIGHTER_NETWORK). Do NOT use for CoinGecko price data, Hyperliquid, or general CEX trading.

Tổng quan

Nhà phát hànhStarchild-ai-agent
Kho mãofficial-skills
Tên kỹ nănglighter
Sao
32
Bản fork
13
Tệp đi kèm
5
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Starchild-ai-agent công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Lighter trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Starchild-ai-agent/official-skills/tree/main/lighter
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Starchild-ai-agent/official-skills.git /tmp/official-skills
mkdir -p .claude/skills
cp -r /tmp/official-skills/lighter .claude/skills/lighter
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Lighter trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Lighter ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Lighter với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Lighter.xyz (zklighter)

Lighter is a high-performance ZK-rollup DEX offering perpetual futures and spot trading with sub-second finality. It supports 220+ markets (perpetuals for crypto, stocks, forex, commodities; spot pairs like ETH/USDC). All orders are signed L2 transactions settled on the deployment's L1.

Networks — the user MUST pick one

Lighter runs as two independent deployments. They share the same API shape but have different hosts, accounts, API keys, contracts, markets and quote assets. Credentials from one do not work on the other.

LIGHTER_NETWORKAppREST base URLSigning chain IDL1Quote
ethereumhttps://app.lighter.xyzhttps://mainnet.zklighter.elliot.ai304Ethereum (1)USDC
robinhoodhttps://robinhoodchain.lighter.xyzhttps://api.rh.lighter.xyz466324Robinhood Chain (4663)USDG

Testnets: ethereum-testnet (https://testnet.zklighter.elliot.ai) and robinhood-testnet (https://api.rh-testnet.lighter.xyz).

Before the first Lighter call in a session, run lighter_get_network().

  • If selected is false, stop and ask the user: "Are you on Lighter (app.lighter.xyz) or Lighter on Robinhood Chain (robinhoodchain.lighter.xyz)?" Do not guess — the wrong choice means wrong markets and failed signatures.
  • Then have them set LIGHTER_NETWORK=ethereum or LIGHTER_NETWORK=robinhood (env var or credentials file). Aliases accepted: eth, mainnet, rh, robinhoodchain.
  • Every tool errors with a clear message until a network is selected. An explicit LIGHTER_API_URL also counts as a selection and takes precedence.

Network-specific notes:

  • Robinhood Chain spot pairs are quoted in USDG (e.g. META/USDG), not USDC. It also lists tokenized stocks (HOOD, SPY, QQQ) and fewer markets overall. Always check lighter_get_markets() rather than assuming a symbol exists.
  • Accounts are created by depositing in the respective app. Look up the account index against the selected network — an Ethereum wallet address may have an account on one deployment and not the other.
  • Paper trading keeps a separate state file per network.

When to Use Lighter

  • Market data — orderbook depth, recent trades, OHLCV candles, funding rates
  • Exchange overview — 24h volume, open interest, mark/index prices
  • Account queries — positions, balances, active orders, PnL, trade history
  • Order management — place limit/market/stop/TP orders, cancel, modify, close-all
  • Position management — set leverage, adjust isolated margin
  • Fund management — withdraw assets, transfer between perp/spot buckets
  • Funding analysis — compare funding rates across Binance, Bybit, Hyperliquid, Lighter

Symbol Convention

  • Perp markets use bare tickers: BTC, ETH, SOL, LIT
  • Spot markets use quote-qualified pairs: ETH/USDC, LIT/USDC, LINK/USDC
  • The / is the discriminator — no --market_type flag needed
  • Numeric market_id is also accepted as an escape hatch
  • Symbol resolution is automatic with a 5-minute cache

Human-Unit Auto-Scaling

Trading tools accept human-readable prices and amounts (e.g. amount=0.1, price=3200.50). The tools automatically fetch market metadata and scale to integer ticks/lots. Response includes effective_amount and effective_price showing what actually landed after rounding.

Account Setup Flow

Setting up Lighter trading requires two different values from different places:

Step 0: Pick the network

Ask which deployment they trade on and set LIGHTER_NETWORK accordingly (see Networks above). Everything below is per network.

Step 1: Get your Account Index

LIGHTER_ACCOUNT_INDEX is a number (e.g. 12345), not a key.

Ask the user for their Ethereum L1 wallet address (public address, e.g. 0xabc...), then look it up:

lighter_get_account(l1_address="0xabc...")

The response will contain the account index — that's the LIGHTER_ACCOUNT_INDEX.

If no account is found, the user needs to create one first by connecting their wallet and depositing in the app for the selected network (https://app.lighter.xyz or https://robinhoodchain.lighter.xyz).

Step 2: Get API Keys

LIGHTER_PRIVATE_KEY is a hex string — the L2 API private key.

The user generates this on the API keys page of the selected network's app (https://app.lighter.xyz/apikeys or https://robinhoodchain.lighter.xyz/apikeys):

  1. Go to the API keys page
  2. If using a sub-account, switch to it first
  3. Generate a new API key — the private key is shown only once
  4. Note the API key index number (this becomes LIGHTER_API_KEY_INDEX)

See the lighter-python setup example for programmatic key generation (requires L1 wallet signature).

Step 3: Configure Credentials

Sanity check before saving:

  • LIGHTER_ACCOUNT_INDEX = numeric only (e.g. 12345)
  • LIGHTER_PRIVATE_KEY = long hex key string
  • LIGHTER_API_KEY_INDEX = small integer key slot (e.g. 4)

Credentials can be set via environment variables OR a credentials file.

Option 1: Environment Variables
env
LIGHTER_NETWORK=ethereum            # or: robinhood
LIGHTER_PRIVATE_KEY=your_lighter_api_private_key_here
LIGHTER_ACCOUNT_INDEX=your_account_index_here
LIGHTER_API_KEY_INDEX=2
Option 2: Credentials File

~/.lighter/lighter-agent-kit/credentials:

text
LIGHTER_API_PRIVATE_KEY=...
LIGHTER_ACCOUNT_INDEX=...
LIGHTER_API_KEY_INDEX=...
LIGHTER_NETWORK=robinhood

Environment variables take precedence. Both LIGHTER_PRIVATE_KEY and LIGHTER_API_PRIVATE_KEY are accepted.

VariableRequiredDescription
LIGHTER_NETWORKYes (unless LIGHTER_API_URL set)ethereum or robinhood (also ethereum-testnet, robinhood-testnet). No default — the user must choose.
LIGHTER_API_URLNoExplicit base URL; overrides LIGHTER_NETWORK. LIGHTER_HOST is accepted as an alias.
LIGHTER_PRIVATE_KEYFor tradingLighter L2 API private key (hex). Not your wallet key.
LIGHTER_ACCOUNT_INDEXFor tradingYour numeric account index on Lighter
LIGHTER_API_KEY_INDEXNoWhich API key slot to use (default 2, range 2-254)

Note: Read-only tools (market data, orderbook, candles, funding rates) work without any keys, but still need LIGHTER_NETWORK. Trading tools require LIGHTER_PRIVATE_KEY and LIGHTER_ACCOUNT_INDEX.

Common Workflows

Check / choose network

lighter_get_network()      # shows selected network, base URL, and the available options

Check Market Info

lighter_get_markets()                        # all markets
lighter_get_markets(filter="perp")           # perps only
lighter_get_markets(market_id=0)             # specific market

Get Orderbook

lighter_get_orderbook(symbol="BTC", limit=20)
lighter_get_orderbook(symbol="ETH/USDC", limit=10)

Get OHLCV Candles

lighter_get_candles(symbol="ETH", resolution="1h", count_back=100)

Check Positions & Balances

lighter_get_account()                        # uses configured account
lighter_get_active_orders(symbol="BTC")
lighter_get_pnl(resolution="1d", count_back=30)

Place Orders (human units, auto-scaled)

# Market buy 0.1 BTC
lighter_create_order(symbol="BTC", side="long", amount=0.1, order_type="market")

# Limit sell 1 ETH at $3200
lighter_create_order(symbol="ETH", side="short", amount=1.0, price=3200, order_type="limit")

# Stop-loss at $2800
lighter_create_order(symbol="ETH", side="short", amount=1.0, price=2800,
                     order_type="stop_loss", trigger_price=2800, reduce_only=true)

Modify / Cancel

lighter_modify_order(symbol="BTC", order_index=12345, amount=0.2, price=61000)
lighter_cancel_order(symbol="BTC", order_index=12345)
lighter_cancel_all_orders()

Close All Positions

# ALWAYS preview first
lighter_close_all_positions(preview=true)
# Then execute after user confirms
lighter_close_all_positions(preview=false)

Leverage & Margin

lighter_set_leverage(symbol="BTC", leverage=10)
lighter_set_leverage(symbol="ETH", leverage=5, margin_mode="isolated")
lighter_adjust_margin(symbol="ETH", amount=100, direction="add")

Withdraw & Transfer

lighter_withdraw(asset="usdc", amount=100)
lighter_transfer_funds(asset="usdc", amount=250, from_route="perp", to_route="spot")

Compare Funding Rates

lighter_get_funding_rates()   # Returns rates from Binance, Bybit, Hyperliquid, Lighter

Paper Trading

Simulate trades against real Lighter order book snapshots — no credentials, no broadcast, no risk. All state is local.

Perp markets only. No spot, no resting limits, no funding accrual. Market orders only (taker fills).

Quick Start

# 1. Create account (once)
lighter_paper_init(collateral=10000, tier="premium")

# 2. Place trades
lighter_paper_order(symbol="BTC", side="long", amount=0.1)
lighter_paper_order(symbol="ETH", side="short", amount=1.0)

# 3. Check status
lighter_paper_status()
lighter_paper_positions()
lighter_paper_health()
lighter_paper_trades(limit=10)

# 4. Reset when done
lighter_paper_reset()

Paper vs Live Caveats

These cause paper-to-live PnL divergence:

  1. Maker fills never occur — every fill is charged taker fee
  2. No order-impact model — paper orders walk the book but don't move it
  3. No latency / partial-fill modeling — fills instantly in full
  4. No funding accrual — dominant PnL drag/credit for longer holds
  5. Cross-margin only — no isolated margin simulation

Fee Tiers

TierTaker bpsMaker bps
standard0.00.0
premium (default)2.80.4
premium_12.730.39
premium_22.660.38
premium_32.520.36
premium_42.380.34
premium_52.240.32
premium_62.10.3
premium_71.960.28

State file: ~/.lighter/lighter-agent-kit/paper-state.json for ethereum, paper-state-<network>.json for others (override with LIGHTER_PAPER_STATE_PATH env var).

Safety Notes

  • lighter_close_all_positions is high-risk. ALWAYS run preview=true first, show the plan to the user, and get explicit confirmation before executing. Never infer intent from vague prompts.
  • lighter_withdraw creates a withdrawal request; funds may go through a pending/claim flow.
  • Write commands sign and broadcast immediately.
  • Private keys are wrapped in SecretValue objects — never attempt to read or display them.

Decision Tree

User WantsToolKey Params
Which deployment am I on / optionslighter_get_network—
List available marketslighter_get_marketsfilter, market_id
Orderbook snapshotlighter_get_orderbooksymbol, limit
Recent trade printslighter_get_recent_tradessymbol, limit
OHLCV chart datalighter_get_candlessymbol, resolution, count_back
24h volume/OI/priceslighter_get_exchange_stats—
Cross-exchange fundinglighter_get_funding_rates—
Asset info (decimals, caps)lighter_get_asset_detailsasset_id
Account info/balanceslighter_get_accountaccount_index
Open orderslighter_get_active_orderssymbol
Filled/canceled orderslighter_get_order_historysymbol, limit
Trade historylighter_get_trade_historysymbol, limit
PnL over timelighter_get_pnlresolution, count_back
Place an orderlighter_create_ordersymbol, side, amount, price
Cancel one orderlighter_cancel_ordersymbol, order_index
Cancel all orderslighter_cancel_all_orders—
Modify existing orderlighter_modify_ordersymbol, order_index, amount, price
Close all positionslighter_close_all_positionspreview, slippage
Set leveragelighter_set_leveragesymbol, leverage, margin_mode
Adjust marginlighter_adjust_marginsymbol, amount, direction
Withdraw assetslighter_withdrawasset, amount, route
Transfer perp/spotlighter_transfer_fundsasset, amount, from_route, to_route
Paper: create accountlighter_paper_initcollateral, tier
Paper: reset accountlighter_paper_resetcollateral, tier
Paper: account summarylighter_paper_status—
Paper: open positionslighter_paper_positionssymbol
Paper: place tradelighter_paper_ordersymbol, side, amount
Paper: trade historylighter_paper_tradessymbol, limit
Paper: margin/healthlighter_paper_health—

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Lighter làm được gì?

Lighter.xyz (zklighter) perpetual and spot DEX — order placement, cancellation, modification, close-all positions, leverage, margin, withdrawals, fund transfers, orderbook depth, market data, candles, funding rates, account positions, balances, PnL, and trade history. Supports symbol resolution (BTC, ETH/USDC) and human-unit auto-scaling for prices and amounts. Triggers on: "lighter", "zklighter", "elliot", perpetual futures trading on lighter, lighter orderbook, lighter funding, lighter positions, lighter margin, "robinhood chain", "lighter on robinhood", robinhoodchain.lighter.xyz. Suppor...

Vì sao nên dùng Lighter trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Lighter là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Lighter trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Starchild-ai-agent/official-skills/tree/main/lighter. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Lighter?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Lighter với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Lighter với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Lighter có miễn phí không?

Kỹ năng này được Starchild-ai-agent phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇