opt
parameter is optional and can be used to specify the cluster and program ID.opt
parameter is optional and can be used to specify the cluster and program ID.initialize{Prorata|Fcfs}Vault
method to create the alpha vault.positionPubKey
: The public key of the position account. (usually use new Keypair()
)totalXAmount
: The total amount of token X to be added to the liquidity pool.totalYAmount
: The total amount of token Y to be added to the liquidity pool.strategy
: The strategy parameters to be used for the liquidity pool (Can use calculateStrategyParameter
to calculate).user
: The public key of the user account.slippage
: The slippage percentage to be used for the liquidity pool.positionPubKey
: The public key of the position account. (usually use new Keypair()
)totalXAmount
: The total amount of token X to be added to the liquidity pool.totalYAmount
: The total amount of token Y to be added to the liquidity pool.strategy
: The strategy parameters to be used for the liquidity pool (Can use calculateStrategyParameter
to calculate).user
: The public key of the user account.slippage
: The slippage percentage to be used for the liquidity pool.user
: The public key of the user account.position
: The public key of the position account.fromBinId
: The ID of the starting bin to remove liquidity from. Must within position range.toBinId
: The ID of the ending bin to remove liquidity from. Must within position range.liquiditiesBpsToRemove
: An array of numbers (percentage) that represent the liquidity to remove from each bin.shouldClaimAndClose
: A boolean flag that indicates whether to claim rewards and close the position.inAmount
: Amount of lamport to swap inswapForY
: Swap token X to Y when it is true, else reversed.allowedSlippage
: Allowed slippage for the swap. Expressed in BPS. To convert from slippage percentage to BPS unit: SLIPPAGE_PERCENTAGE * 100binArrays
: binArrays for swapQuote.isPartialFill
: Flag to check whether the the swapQuote is partial fill, default = false.maxExtraBinArrays
: Maximum number of extra binArrays to returnoutAmount
: Amount of lamport to swap outswapForY
: Swap token X to Y when it is true, else reversed.allowedSlippage
: Allowed slippage for the swap. Expressed in BPS. To convert from slippage percentage to BPS unit: SLIPPAGE_PERCENTAGE * 100binArrays
: binArrays for swapQuote.maxExtraBinArrays
: Maximum number of extra binArrays to returninToken
: The public key of the input token mint.outToken
: The public key of the output token mint.outAmount
: The exact amount of output token to receive.maxInAmount
: The maximum amount of input token to spend.lbPair
: The public key of the liquidity pool.user
: The public key of the user account.binArraysPubkey
: The public key of the bin arrays involved in the swap.inToken
: The public key of the token to be swapped in.outToken
: The public key of the token to be swapped out.inAmount
: The amount of token to be swapped in.priceImpact
: Accepted price impact bps.lbPair
: The public key of the liquidity pool.user
: The public key of the user account.binArraysPubkey
: Array of bin arrays involved in the swapinToken
: The public key of the token to be swapped in.outToken
: The public key of the token to be swapped out.inAmount
: The amount of token to be swapped in.minOutAmount
: The minimum amount of token to be swapped out.lbPair
: The public key of the liquidity pool.user
: The public key of the user account.binArraysPubkey
: Array of bin arrays involved in the swapclaimSwapFee
is used to claim swap fees for a specific position owned by a specific owner.claimAllSwapFee
function to claim swap fees for multiple positions owned by a specific owner.claimAllRewards
function to claim swap fees and LM rewards for multiple positions owned by a specific owner.claimAllRewardsByPosition
allows a user to claim all rewards for a specificclosePosition
is used to close a position owned by a specific owner.closePositionIfEmpty
is used to close a position owned by a specific owner if it is empty.quoteCreatePosition
is used to quote the cost of creating a position with a given strategy.createEmptyPosition
is used to create an empty position with specified min/max bin IDs.owner
: The public key of the positions owner.seedAmount
: Lamport amount to be seeded to the pool.minPrice
: Start price in UI formatmaxPrice
: End price in UI formatbase
: Base keytxPayer
: Account rental fee payerfeeOwner
: Fee owner key. Default to position owneroperator
: Operator keylockReleasePoint
: Timelock. Point (slot/timestamp) the position can withdraw the liquidity,shouldSeedPositionOwner
(optional): Whether to send 1 lamport amount of token X to the position owner to prove ownership.payer
: The public key of the tx payer.base
: Base keyseedAmount
: Token X lamport amount to be seeded to the pool.price
: TokenX/TokenY Price in UI formatroundingUp
: Whether to round up the pricepositionOwner
: The owner of the positionfeeOwner
: Position fee owneroperator
: Operator of the position. Operator able to manage the position on behalf of the position owner. However, liquidity withdrawal issue by the operator can only send to the position owner.lockReleasePoint
: The lock release point of the position.shouldSeedPositionOwner
(optional): Whether to send 1 lamport amount of token X to the position owner to prove ownership.initializeBinArrays
is used to initialize bin arrays for the given bin array indexes if they weren’t initialized.lowerBinId
: Lower bin ID of the position. This represent the lowest price of the positionpositionWidth
: Width of the position. This will decide the upper bin id of the position, which represents the highest price of the position. UpperBinId = lowerBinId + positionWidthowner
: Owner of the position.operator
: Operator of the position. Operator able to manage the position on behalf of the position owner. However, liquidity withdrawal issue by the operator can only send to the position owner.base
: Base keyfeeOwner
: Owner of the fees earned by the position.payer
: Payer for the position account rental.lockReleasePoint
: The lock release point of the position.creator_pool_on_off_control
to be true and type CustomizablePermissionless
setActivationPoint
is used to set the activation point for the LB pair.setPairStatus
is used to set the pair status for admin-controlled pairs.getLbPairs
is used to retrieve all LB pair accounts for the DLMM program.getPosition
retrieves position information for a given public key and processes it using various data to return a LbPosition
object.getAllPresetParameters
is used to retrieve all preset parameter accounts for the DLMM program.getAllLbPairPositionsByUser
is used to retrieve all LB pair positions for a given user.refetchStates
is used to refetch and update the current state of the DLMM instance.getBinArrays
is used to retrieve all bin arrays for the current LB pair.getBinArrayAroundActiveBin
retrieves a specified number of BinArrayAccount
objects from the blockchain, based on the active bin and its surrounding bin arrays.getFeeInfo
calculates and returns the base fee rate percentage, maximum fee rate percentage, and protocol fee percentage.getDynamicFee
retrieves the current dynamic fee for the pool.getEmissionRate
retrieves the emission rates for LM rewards.getBinsAroundActiveBin
retrieves a specified number of bins to the left and right of the active bin and returns them along with the active bin ID.getBinsBetweenMinAndMaxPrice
retrieves a list of bins within a specified price range.getBinsBetweenLowerAndUpperBound
retrieves a list of bins between a lower and upper bin ID and returns the active bin ID and the list of bins.getPositionsByUserAndLbPair
retrieves positions by user and LB pair, including active bin and user positions.getPairPubkeyIfExists
retrieves the public key of an LB pair if it exists.getMaxPriceInBinArrays
retrieves the maximum price from the provided bin arrays.getLbPairLockInfo
retrieves all pair positions that have locked liquidity.canSyncWithMarketPrice
checks if the pool can sync with a given market price.syncWithMarketPrice
function is used to sync the liquidity pool with the market price.toPricePerLamport
function is used to convert a real price of bin to a lamport value.fromPricePerLamport
function is used to convert a price per lamport value to a real price of bin.