name: meteora-sdks description: Helps developers build on Meteora's Solana DeFi protocols. Covers DLMM (Dynamic Liquidity Market Maker) concentrated liquidity pools and DAMM V2 dynamic AMM. Use when questions mention Meteora, DLMM, DAMM, concentrated liquidity, liquidity bins, bin step, LP positions, or @meteora-ag packages.
Meteora SDK Skill
This skill provides guidance for building with Meteora's Solana SDKs.
Available References
| SDK | Reference | Status |
|---|---|---|
| DLMM | references/dlmm.md |
Ready |
| DAMM V2 | references/damm-v2.md |
Ready |
How to Use
For DLMM Questions
- Read
references/dlmm.mdfor API documentation and examples - Reference
assets/dlmm-example.tsfor complete working code - Key package:
@meteora-ag/dlmm
For DAMM V2 Questions
- Read
references/damm-v2.mdfor API documentation and examples - Reference
assets/damm-v2-example.tsfor complete working code - Key package:
@meteora-ag/cp-amm-sdk
Code Style Guidelines
- Use TypeScript with strict typing
- Import from official packages (
@meteora-ag/dlmm,@meteora-ag/cp-amm-sdk) - Use
bn.jsfor all token amounts (never raw numbers) - Always handle transaction errors with try/catch
- Include slippage tolerance in swaps and liquidity operations
Important Reminders
- Always recommend devnet testing first before mainnet deployment
- Token amounts are in smallest units (lamports, not SOL)
- Some operations return multiple transactions that must be executed sequentially
- Refresh pool state with
refetchStates()after making changes
When to Use DLMM vs DAMM V2
| Factor | DLMM | DAMM V2 |
|---|---|---|
| Liquidity | Concentrated in bins | Full range (x*y=k) |
| Capital efficiency | Higher | Lower |
| Management | Active (rebalancing needed) | Passive (set and forget) |
| Best for | Volatile pairs, active LPs | Stable pairs, passive LPs |
| Fee structure | Dynamic per-bin | Per-pool configurable |
| Impermanent loss | Reduced with good positioning | Standard AMM IL |
Choose DLMM when:
- You want maximum capital efficiency
- You can actively manage positions as price moves
- Trading volatile pairs where concentration matters
- You want to provide liquidity at specific price ranges
Choose DAMM V2 when:
- You want a simple "deposit and forget" experience
- Trading stable or established pairs with predictable prices
- You prefer compounding fees back into liquidity
- You're building pools for long-tail tokens
Escalation
If you encounter questions about:
- Program internals or on-chain program addresses
- Edge cases not covered in the reference docs
Escalate to: @dannweeeee
Common Tasks
Create a DLMM position
- Initialize pool with
DLMM.create() - Get active bin with
getActiveBin() - Create position with
initializePositionAndAddLiquidityByStrategy()
Execute a swap
- Get bin arrays with
getBinArrayForSwap() - Get quote with
swapQuote() - Execute with
swap()
Claim fees
- Get positions with
getPositionsByUserAndLbPair() - Claim with
claimAllRewards()orclaimSwapFee()
Remove liquidity
- Get position bin data
- Call
removeLiquidity()withshouldClaimAndClose: trueto also close