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:

  1. Lighter Account: A registered account on Lighter

  2. Wallet Connection: Your wallet connected to Lighter platform

  3. Minimum Balance: At least 5 USDC deposited in your Lighter account

  4. API Key Generated: Follow the steps in Getting Your API Keys section


Getting Your API Keys

Step 1: Access API Keys Section

  1. Navigate to Lighter application at https://app.lighter.xyz/

  2. Connect your wallet

  3. Click on Tools dropdown menu in the top navigation

  4. Select API Keys from the menu

Step 2: Generate New API Key

  1. On the API Keys page, click the "Generate API Key" button in the top right corner

Step 3: Set API Key Index

  1. 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

  2. Click "Generate" button

Step 4: Save Your Keys

After generation, you'll receive three pieces of information:

  1. API Key Index: Your chosen index number (e.g., 111)

  2. Public Key: Your public key

  3. 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

  1. Open DextraBot application

  2. Navigate to the Farming section

  3. Select Lighter from the available farming modules

Configuration Parameters

Basic Settings

Login Address

  • Your wallet address used to log in to Lighter

  • This is the wallet address you used to generate the API key

  • Example format: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0

API Private Key

  • The private key generated in Step 4 of Getting Your API Keys

  • Keep this secure and never share it

  • Format: Long alphanumeric string starting with lowercase letters

  • Click the eye icon to show/hide the key

API Key Index

  • The index number you chose when generating the API key (between 2-254)

  • Must match the index from your key generation

  • Example: 111

Select Pair

  • Choose the trading pair for farming

  • Available pairs depend on Lighter's supported markets

  • Example pairs: BTC/USDC, ETH/USDC, etc.

Trading Parameters

Order Per Hour

  • Number of orders to execute per hour

  • Range: 1 - 180 orders

  • Determines farming intensity

  • Higher values = more active farming

  • Placeholder: e.g. 10 (max 180)

Leverage

  • Multiplier for your trading position

  • Amplifies both potential gains and losses

  • Use carefully based on your risk tolerance

  • Placeholder: e.g. 3

Direction

  • Three options available:

    • LONG: Buy positions (bullish strategy)

    • SHORT: Sell positions (bearish strategy)

    • RANDOM: Alternates between long and short positions

Risk Management

Take Profit %

  • Percentage gain at which positions automatically close

  • Locks in profits when target is reached

  • Format: Percentage value

  • Placeholder: e.g. 0.5 (0.5% profit target)

Stop Loss %

  • Percentage loss at which positions automatically close

  • Limits potential losses

  • Format: Percentage value

  • Placeholder: e.g. 0.2 (0.2% maximum loss)

Mode Selection

Standard Mode

  • Free tier with zero trading fees

  • Higher latency (200-300ms)

  • Default selection

Premium Mode

  • Paid tier with minimal trading fees (0.002% maker, 0.02% taker)

  • Ultra-low latency (0-150ms)

  • Requires opt-in and fee payment

Switching Modes:

  • Select your preferred mode using the toggle at the top

  • Standard Mode is pre-selected by default

  • Premium Mode offers better performance for active traders

Starting the Farm

  1. Fill in all required fields

  2. Review your configuration:

    • Verify API credentials are correct

    • Confirm trading parameters match your strategy

    • Ensure risk management settings are appropriate

  3. Click "Connect" button to initiate the farming module

To cancel setup, click the "Cancel" button.

Last updated