Skip to main content
The LP Executor automates liquidity provision on Concentrated Liquidity Market Maker (CLMM) DEXs like Meteora, Raydium, Orca, and Uniswap V3.

Overview

PropertyValue
Position TypeLP
P&L CalculationFees earned - impermanent loss - tx fees
keep_positionConfigurable
Use CasesEarning LP fees, concentrated liquidity, range trading

Configuration

from hummingbot.strategy_v2.executors.lp_executor.data_types import LPExecutorConfig

config = LPExecutorConfig(
    controller_id="my-agent",
    connector_name="meteora",
    pool_address="5Q544fK...",
    trading_pair="SOL-USDC",
    lower_price=Decimal("140.0"),
    upper_price=Decimal("160.0"),
    base_amount=Decimal("1.0"),
    quote_amount=Decimal("150.0"),
    side=0,  # 0=both, 1=buy only, 2=sell only
    auto_close_above_range_seconds=3600,
    auto_close_below_range_seconds=3600,
    keep_position=True,
)

Parameters

ParameterDescription
connector_nameDEX connector (meteora, raydium, orca, uniswap)
pool_addressOn-chain pool address
trading_pairToken pair (e.g., SOL-USDC)
lower_pricePrice range lower bound
upper_pricePrice range upper bound
base_amountBase token to deposit
quote_amountQuote token to deposit
side0=both sides, 1=buy only, 2=sell only
auto_close_above_range_secondsClose if above range for N seconds
auto_close_below_range_secondsClose if below range for N seconds

Lifecycle States

StateDescription
NOT_ACTIVEInitial state
OPENINGAdding liquidity
IN_RANGEPosition active, price within range
OUT_OF_RANGEPrice moved outside range
CLOSINGRemoving liquidity
COMPLETEPosition closed
FAILEDFailed after retries

How It Works

  1. Open: Deploys liquidity at configured price range
  2. Monitor: Tracks if current price is within range
  3. Fees: Accumulates trading fees while in range
  4. Close: Removes liquidity when conditions met

P&L Tracking

The executor tracks:
MetricDescription
base_feeFees earned in base token
quote_feeFees earned in quote token
position_rentSolana rent for position NFT
tx_feeTransaction fees
impermanent_lossValue loss from price movement

Example: SOL-USDC LP

sol_lp = LPExecutorConfig(
    controller_id="sol-lp",
    connector_name="meteora",
    pool_address="5Q544fK...",
    trading_pair="SOL-USDC",
    lower_price=Decimal("130"),
    upper_price=Decimal("170"),
    base_amount=Decimal("5.0"),
    quote_amount=Decimal("750.0"),
    side=0,
    auto_close_above_range_seconds=7200,  # 2 hours
    auto_close_below_range_seconds=3600,  # 1 hour
)

Example: Single-Sided LP

# Only provide sell-side liquidity (sell SOL as price rises)
sell_side_lp = LPExecutorConfig(
    controller_id="sell-lp",
    connector_name="raydium",
    pool_address="...",
    trading_pair="SOL-USDC",
    lower_price=Decimal("150"),
    upper_price=Decimal("200"),
    base_amount=Decimal("10.0"),
    quote_amount=Decimal("0"),
    side=2,  # Sell only
)

Via API

POST /executors/create
{
  "type": "lp_executor",
  "connector_name": "meteora",
  "trading_pair": "SOL-USDC",
  "total_amount_quote": 0.30,
  "side": 2,
  "width_percent": 0.4
}

Position Handover

When keep_position=true and executor closes:
  1. LP position is always closed on-chain (liquidity withdrawn)
  2. Net token change tracked in Position Hold
  3. ADD events → SELL (tokens deposited)
  4. REMOVE events → BUY (tokens + fees returned)
This allows agents to track LP performance as standard trades.