These examples are based on the localDocumentation Index
Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
Use this file to discover all available pages before exploring further.
damm-v2-sdk examples and tests. They focus on transaction construction patterns. For the full method catalog, see the SDK Reference.
Setup
Fetch Pool And User Positions
getPositionsByUser(user) when you need a wallet-level position view across all pools.
Quote And Swap
The recommended swap flow is:- Fetch the pool state.
- Resolve the current activation point.
- Quote with
getQuote2. - Build the swap with
swap2. - Simulate, sign, and send.
Create A Position And Add Liquidity
createPositionAndAddLiquidity creates the position NFT and adds liquidity in one transaction.
tokenAAmount, tokenBAmount, and liquidity when calculating liquidity so the quote uses the current pool reserves.
Add Liquidity To An Existing Position
UsegetDepositQuote before building the transaction. The quote returns the liquidity delta and the counterpart token amount.
Remove Liquidity And Close A Position
removeAllLiquidityAndClosePosition combines fee claim, full liquidity removal, and position close. It will reject locked positions, so load vesting accounts and the current point first.
removeLiquidity when you only want to remove a specific liquidity delta and keep the position open.
Claim Position Fees
claimPositionFee2 is the preferred fee claim helper for new integrations.
Lock Liquidity
UsepermanentLockPosition for irreversible locks and lockPosition for vesting schedules.
Initialize And Claim Rewards
initializeAndFundReward creates a reward slot and funds it in one transaction.
initializeReward plus fundReward when initialization and funding should be separate admin actions.
Create A Customizable Pool
Customizable pools let the creator set fee behavior, activation behavior, and whether initial liquidity should be locked.createPool instead when you are creating against an existing DAMM v2 config account. Use createCustomPoolWithDynamicConfig when your flow needs to create through a dynamic config account.

