LP Range Config — side, amounts, bounds
Turn a chosen pool + capital_per_slot (in quote_asset) + base_pct into a valid lp_executor config. Current pool price = P.
Side + amounts from base_pct
| base_pct | side | base_amount | quote_amount | range vs P | swap first? |
|---|---|---|---|---|---|
0 |
1 BUY |
0 | capital |
below P | no |
100 |
2 SELL |
acquired base | 0 | above P | yes: quote→base for full slot |
0<β<100 |
3 RANGE |
base worth capital·β/100 |
capital·(1−β/100) |
centered on P | swap the base shortfall only |
- Swaps use
swap_provider="jupiter/router"(or an order_executor market buy of base). - Always
keep_position=false→ exit swaps back toquote_assetso PnL/TP/SL are in quote terms.
Bounds — width then CLAMP to venue cap
- Half-width
w: ifrange_width_pctset, use it; ifauto, derive from OHLCV — e.g.w ≈ k · ATR%overranking_window(k≈1–2). Tighter = denser fees but exits range sooner. - Provisional bounds:
- RANGE (β middle):
lower=P·(1−w),upper=P·(1+w). - BUY (β=0):
upper=P·(1−ε),lower=P·(1−ε−2w)(range below P). - SELL (β=100):
lower=P·(1+ε),upper=P·(1+ε+2w)(range above P).
- RANGE (β middle):
- Clamp to the venue cap (this prevents
SIMULATION_FAILED/ reallocate errors):- Meteora: bins
≈ ln(upper/lower)/ln(1+bin_step/10000)must be < 69. If over, shrink bounds until < ~60 (leave headroom).bin_step=4⇒ total width ≲ 2.7%. - Orca / Raydium: width bounded by
tick_spacing; smaller spacing ⇒ tighter cap. Pulltick_spacingfrom pool-info and keep the tick count within the connector's per-position limit.
- Meteora: bins
- Meteora only:
extra_params={"strategyType":0}(0=Spot uniform, 1=Curve concentrated, 2=Bid-Ask). Default Spot.
Validate before create
capital_per_slot≥ venue minimum position size (else skip pool).- Enough SOL for rent (~0.057 SOL Meteora) + fees beyond
min_wallet_sol_reserve. - If open FAILS with reallocate/simulation error → range too wide → shrink bounds and retry once.