Solana liquidity infrastructure offering Dynamic AMM v2 (DAMM v2, constant-product) and DLMM (Dynamic Liquidity Market Maker — discrete bin-based concentrated liquidity). Powers a large share of Solana DEX volume via Jupiter routing.
- 01Solana swaps via DLMM bins or DAMM pools
- 02single-sided concentrated liquidity (DLMM)
- 03memecoin pool launches with dynamic fees
- 04auto-compounding LP strategies
- 05vault-based market making
- pnpm add @meteora-ag/dlmm @meteora-ag/cp-amm-sdk @solana/web3.js bn.js
| Variable | Scope | Description |
|---|---|---|
| SOLANA_RPC_URL | Server | Solana mainnet RPC URL. DLMM bin-array reads are heavy — use a paid RPC. |
Use `@meteora-ag/dlmm` for DLMM (bin-based CLMM) and `@meteora-ag/cp-amm-sdk` for DAMM v2 (constant-product). For DLMM: `const dlmm = await DLMM.create(connection, poolPubkey)`; quote with `dlmm.swapQuote(amountIn, swapForY, allowedSlippage, binArrays)`, then `dlmm.swap({ inToken, outToken, inAmount, minOutAmount, lbPair, user, binArraysPubkey })`. For positions use `dlmm.initializePositionAndAddLiquidityByStrategy({ positionPubKey, user, totalXAmount, totalYAmount, strategy: { strategyType: StrategyType.SpotBalanced, minBinId, maxBinId } })`. For DAMM v2 use `CpAmm.create(connection)` and `cpAmm.swap()` / `cpAmm.addLiquidity()`. Always pass priority fees and set `skipPreflight: false` initially to surface bin-array misses.
- ⚑DLMM swaps require fetching `binArrays` covering the price range — fail to preload them and the swap reverts with `BinArrayNotFound`. Use `dlmm.getBinArrayForSwap(swapForY, count)`.
- ⚑DLMM positions earn rewards only in the bins where you have liquidity — when price moves out of range you stop earning and must reposition (no autocompounding without a vault).
- ⚑DAMM v2 (cp-amm-sdk) replaced legacy DAMM v1 in 2025 — pick the right SDK; v1 LP positions are NOT compatible with v2 pools.
- ⚑Set `computeUnitLimit` ≥ 600k and priority fees — DLMM bin crossings consume substantial CU and silently fail under defaults.
- ⚑Token-2022 with transfer hooks: DLMM supports it on newer pools, but check `lbPair.tokenMintXProgramId` before assuming SPL Token program.
- ⚑Pool oracle/observation slot lag means quotes can be stale during congestion — re-quote on user confirmation and respect `minOutAmount`.