Lighter Wallet Operations

Developer tool for MetaMask-driven Lighter DEX operations · Backend: localhost:8889

Account Status

Subaccounts

View all accounts (master + subs) with balances and positions. Subaccount indexes encode the master index in the high bits.

Deposit — Direct (ETH Mainnet)

Deposits USDC directly to the Lighter contract on Ethereum Mainnet. Requires USDC approval first.

Deposit — Cross-Chain (CCTP)

Send USDC to an intent address from Arbitrum, Base, Avalanche, HyperEVM, or Solana.

API Key Setup

Generate key → Sign message with MetaMask (free) → Confirm. No gas fees — registration happens on Lighter L2.
L2 REGISTRATION (free — MetaMask signature only)
1
2
3
FALLBACK: ON-CHAIN (costs gas — L1 contract call)
A

Sub-Account Management

Transfers

Same-master transfers (no L1 signature needed). Works both directions: Master ↔ Sub.
Sub → Master requires an API key registered on the sub-account. Use "Register Key on Sub" in the Accounts section above.

Withdrawals

Secure Withdrawal: API key only. Waits for zk-proof settlement (minutes/hours). No fee.
Fast Withdrawal: Requires ETH private key. Instant via Arbitrum One bridge.
Min: 4 USDCFee: ~$3 USDC (waived when staking 100+ LIT)

Trading

Trade from any account (master or sub). Sub-accounts must have an API key registered first (see Sub-Account Management).
Quick select:
CREATE ORDER
MODIFY ORDER
CANCEL / VIEW
LEVERAGE

TP/SL Orders

Take Profit & Stop Loss orders. Trigger price activates the order; execution price is the worst fill price (market) or limit price (limit).
Uses the same Account/Market/Key from the Trading section above.

ETH Examples (you hold 0.1 ETH long, bought at $2000):
Take Profit: trigger=$2200, exec=$2180, sell 0.1 ETH — auto-sells when ETH hits $2200
Stop Loss: trigger=$1900, exec=$1880, sell 0.1 ETH — auto-sells when ETH drops to $1900
• TP Limit vs TP: limit fills at exact price only; market fills at best available price

Grouped Orders (OCO / OTO / OTOCO)

OCO (One Cancels Other): TP + SL bracket — one fills, other cancels.
OTO (One Triggers Other): First order triggers second.
OTOCO (One Triggers OCO): Entry triggers TP+SL bracket (3 orders).
Uses the same Account/Key from the Trading section above.

ETH OCO Example (bracket on 0.1 ETH long position):
• Order 1 (TP): Limit sell 0.1 ETH @ $2200 — take profit
• Order 2 (SL): Stop sell 0.1 ETH, trigger $1900 — stop loss
→ When TP fills at $2200, SL auto-cancels (and vice versa)

ETH OTOCO Example (entry + bracket):
• Order 1: Limit buy 0.05 ETH @ $2000 (entry)
• Order 2: Limit sell 0.05 ETH @ $2200 (TP, reduce-only)
• Order 3: Stop sell 0.05 ETH @ $1800 (SL, reduce-only)
→ Entry triggers the TP+SL bracket automatically
ORDER 1
ORDER 2

Market Order with Slippage Control

Limited Slippage: Fills up to max slippage (partial fill OK).
If Slippage OK: Only fills if entire order is within slippage limit (all-or-nothing).
Uses the same Account/Market/Key from the Trading section above.

ETH Example: Buy 0.1 ETH, max 1% slippage. Best ask = $2045.
Limited: fills partial amount up to $2045 × 1.01 = $2065.45
If OK: fills all 0.1 ETH only if entire fill ≤ $2065.45, else nothing

Margin Management

Add or remove isolated margin collateral for a specific market position. Uses the same Account/Market/Key from the Trading section above.

ETH Example: You have 0.5 ETH long on isolated margin with 100 USDC collateral.
Add 50 USDC: increases margin to 150 USDC, reduces liquidation risk
Remove 20 USDC: frees 20 USDC to available balance, increases liquidation risk

Account Data

Account-specific data: limits, metadata (P&L, equity, positions). Uses the same Account from the Trading section above.

Asset & Market Details

Console