Choose your integration

Pick the integration pattern that fits your product before writing any code.

Most integrations are one of four patterns. They differ in who holds the keys and who signs transactions.

PatternWho owns the Lighter accountWho signs tradesTypical product
A. Self-custodial frontendEnd user (their L1 wallet)End user's API key, generated in their browser/appWallets, trading UIs, super-apps
B. Server-side on behalf of usersEnd userYour backend, with an API key the user approvedCopy trading, managed strategies, agents
C. Your own accountYouYour backendMarket makers, bots, funds
D. Read-only–Nobody (no signing)Dashboards, analytics, portfolio trackers

A. Self-custodial frontend (most wallets and apps)

  1. User connects their Ethereum wallet (the L1 address).
  2. User deposits → Lighter creates an account index for them. See Deposits, Transfers and Withdrawals.
  3. Your app generates an API key pair locally (WASM GenerateAPIKey), then the user signs a one-time ChangePubKey with their wallet to register it. See Create accounts programmatically.
  4. From then on your app signs orders locally with that API key – no wallet pop-ups per trade.
  5. Optionally, the user approves you as an integrator so you earn a fee on their trades. See Partner Attribution.

The API private key never leaves the user's device.

B. Server-side on behalf of users

Same as A, but the API key used for trading lives on your server. The user still registers the key with a one-time L1 signature. Treat these keys as highly sensitive: an API key can trade and can request secure withdrawals (which only go back to the user's own L1 address).

C. Your own account

Create an account by depositing, register API keys, sign and send from your backend. Consider the Premium tier for low latency and higher limits. See Account Types.

D. Read-only

No keys needed for public market data. For a specific account's private data use a read-only auth token (valid up to 10 years). See API keys.

Checklist of what you'll need

NeedSelf-custodial frontendServer-side for usersYour own accountRead-only
WASM (or Go/Python) signer✅✅✅–
User's L1 signature (once per API key)✅✅––
Builder API key for bridge.lighter.xyz depositsoptionaloptional––
Plus or Premium tier (for partner fees)if charging feesif charging feesoptional–
Auth tokenfor private datafor private datafor private dataread-only token

Did this page help you?