Skip to main content
This section covers Lighter-specific behavior that goes beyond the generic SDK documentation. For general concepts, see the Concepts section. Lighter is a ZK-rollup perpetuals exchange. It signs every trade with a per-account API key — a Schnorr-style keypair generated and held client-side by the SDK and registered on-chain via a one-time REGISTER_API_KEY (ChangePubKey) transaction. Trading actions are signed by that API key inside a Go WASM signer (see Signing Model).

Topics

  • Signing Model — WASM-blob signing, the API key vs L1 wallet, and the dual-signed REGISTER_API_KEY flow
  • Deposits — Funding your Lighter account from Ethereum mainnet
  • Setup — Registering the trading API key before placing orders
  • Trading — All trading and account actions with parameters
  • Withdrawals — Withdrawing USDC, including the opportunistic fastwithdraw path
  • WebSocket Protocol — Native WebSocket protocol, channel mapping, and authenticated channels

Defaults & assumptions

  • Default margin mode: CROSS when marginMode is omitted on placeOrder / updateLeverage.
  • Trade signing: all trading actions — including withdrawals — are signed by the registered API key (no per-trade wallet popup).
  • Order fields: price is required.
  • Withdrawals: must go to the account owner address — third-party destinations are rejected.
  • Deposits: only from Ethereum mainnet (chain ID 1); for other source chains, bridge USDC to Ethereum first via LI.FI routes.

Notes

  • Trading uses a single API key slot per account (slot index 42 by default). Re-registering overwrites the prior key.
  • Concepts — The action pattern, streaming, and multi-provider support
  • SDK / Streaming — Subscribe to live market data and user events via WebSocket
  • SDK / Account — Fetch account balances, positions, and fills
  • SDK / Trading — Place orders, cancel orders, and query order status
  • SDK / Actions — The create -> sign -> execute pattern for all operations