Lighter Farming Module
Overview
The Lighter Farming module enables you to set up automated trading on Lighter, a decentralized perpetual exchange on zkSync.
Prerequisites
Before setting up the Lighter Farming module, ensure you have:
Lighter Account: A registered account on Lighter
Wallet Connection: Your wallet connected to Lighter platform
Minimum Balance: At least 5 USDC deposited in your Lighter account
API Key Generated: Follow the steps in Getting Your API Keys section
Getting Your API Keys
Step 1: Access API Keys Section
Navigate to Lighter application at https://app.lighter.xyz/
Connect your wallet
Click on Tools dropdown menu in the top navigation
Select API Keys from the menu

Step 2: Generate New API Key
On the API Keys page, click the "Generate API Key" button in the top right corner

Step 3: Set API Key Index
Enter an API Key Index number between 2-254
Important: Indexes 0 (Desktop) and 1 (Mobile) are reserved and cannot be used
You can create up to 253 keys per account using indexes 2-254
Example: Use "111" or any number between 2-254
Click "Generate" button

Step 4: Save Your Keys
After generation, you'll receive three pieces of information:
API Key Index: Your chosen index number (e.g., 111)
Public Key: Your public key
Private Key: Your private key

β οΈ CRITICAL: Save your Private Key immediately! It will not be accessible after closing this popup. Store it securely - you'll need it for the farming module configuration.
βοΈ Farming Module Configuration
Accessing the Module
Open DextraBot
Go to the Farming tab
Select Lighter from the module list
π Configuration Parameters
Basic Settings
Login Address
The wallet you used on Lighter
API Private Key
Paste the private key you saved earlier
API Key Index
The same index number you chose when creating the key
Select Pair
Choose which trading pair to farm
Trading Parameters
Trade Per Hour (n)
How many trades happen per hour. More orders = more activity
1-180
Leverage
Position multiplier. 3Γ means profit/loss Γ 3
1-20
Direction
LONG (buys only) β’ SHORT (sells only) β’ RANDOM (mix)
-
Take Profit %
Auto-close position when profit reaches this %
0-100
Stop Loss %
Auto-close position if loss reaches this %
0-100
π§ Order Types
Lighter gives you three "brains" for how your bot will open and close orders. Think of these as different strategies for trading behavior.
π’ MARKET Mode
Strategy: Fast entry, fast exit
1 hour split into n random time slots
Each slot: Market order β Wait β Market close
Best for: Volatile markets, quick trades
Timeline Example (n=10):
|--Market In--|-------Wait-------|--Market Out--|
5 min wait closeπ‘ LIMIT Mode
Strategy: Patient entry, smart exit
1 hour divided into n equal blocks
First half: Try limit orders every 10 seconds
Second half: Try limit exit, market if needed
Best for: Stable markets, fee optimization
Timeline Example (1 block):
|---Try Limit Entry---|---Try Limit Exit---|
(10s intervals) (10s intervals)π΅ RANDOM Mode
Strategy: Natural mixed pattern
Randomly chooses MARKET or LIMIT for each interval
Creates organic-looking trading patterns
Best for: Balanced approach, avoiding patterns
π Timing Formula Explained
How Time Intervals Work
Base Calculation:
average_interval = 3600 seconds Γ· n orders
Jitter Addition:
if n β€ 20: variation = 25%
if n > 20: variation = 35%
Final Range:
minimum = average - variation
maximum = average + variationπ Delta-Neutral Mode (Lighter-Lighter)
What is Delta-Neutral?
Uses two Lighter accounts with opposing positions:
Account A β Always LONG
Account B β Always SHORT
Result: Zero market exposure, pure farming rewards
Configuration
Set up two separate API keys (different wallets)
Configure both accounts in the module
Select "Lighter-Lighter Delta Mode"
Both accounts will mirror each other's timing
β οΈ IMPORTANT: Both wallets must use different API Key Index numbers! For example: Wallet A uses index 2, Wallet B uses index 3. If both wallets use the same index (e.g., both use 2), the system will NOT work!

Last updated