DlmmProClient plus pure helpers for quoting, liquidity shapes, ticks, PDAs, fees and activation. Every builder returns an unsigned transaction with the fee payer set and no recent blockhash. You sign it and send it.
Each section starts with a summary table of what it contains. An entry for every function follows, with its signature, each parameter and its default, the return value, an example and notes on behaviour and thrown errors.
Dependencies
Program IDs
DLMM_PRO_PROGRAM_ID is the same on mainnet and devnet. For another deployment, pass its address as the programId argument of the DlmmProClient constructor. The SDK rewrites the IDL address and the pool authority PDA to match.
Creating a Client
Builder Conventions
- Builders return
{ tx, ... }.txis an unsignedTransactionwithfeePayerset and no recent blockhash.sendAndConfirmTransaction(connection, tx, signers)fills in the blockhash. - User token accounts are optional. Each defaults to the associated token account of the wallet its parameter names.
- The builder creates a missing associated token account, funded by the fee payer. An account you pass explicitly is used as is.
- For native SOL, the builder wraps the shortfall of the amount being paid from the owner’s lamports and closes the owner’s wrapped SOL account at the end, so the owner signs. A delegate withdrawing native SOL leaves that account open.
initializeLaunchPoolwraps 1 lamport when its SOL proof account is empty. - Token 2022 transfer-hook accounts are resolved from the mint for every transfer. Pass
transferHookX,transferHookY,transferHookReferralortransferHookRewardto override (openLimitOrdertakes a singletransferHook). An explicit array, including[], is sent as given. - Builders read the accounts they need (pool, mints, transfer-hook accounts) at the client’s commitment.
state.fetchTokenBadgealways readsACCESS_REGISTRY_PROGRAM_ID.- Operator and admin instructions are not wrapped. Build them with
client.program.methods.<instruction>(...).instruction()or.transaction(). The program has a read-only provider and cannot send.
createDlmmProProgram(connection, programId?) and createAccessRegistryProgram(connection) return the Anchor programs the client uses, each with a read-only provider.
DlmmProClient
Entry point. Holds the connection, the Anchor program, and one service per area. Function- Builders return
{ tx, ... }.txis an unsignedTransactionwithfeePayerset and no recent blockhash; each builder lists its signers.sendAndConfirmTransaction(connection, tx, signers)fills in the blockhash. - User token accounts are optional and default to the associated token
account of the wallet each parameter names. The builder creates a missing
associated token account, with the fee payer funding it. For native SOL it
also wraps the shortfall of the amount being paid from the owner’s lamports
and closes the owner’s wrapped-SOL account at the end, so the owner signs.
A delegate withdrawing native SOL leaves that account open. An account
passed explicitly is used as is.
initializeLaunchPoolwraps 1 lamport when its SOL proof account is empty. - Builders read the accounts they need (pool, mints, transfer-hook accounts) at the client’s commitment.
state.fetchTokenBadgealways readsACCESS_REGISTRY_PROGRAM_ID.- Operator and admin instructions are not wrapped. Build them with
client.program.methods.<instruction>(...).instruction()or.transaction(); the program has a read-only provider and cannot send.
createDlmmProProgram
FunctionProgram with a read-only provider.
Notes
- For another deployment, the IDL’s address and the pool-authority PDA it
embeds are rewritten to
programId.
createAccessRegistryProgram
FunctionProgram for ACCESS_REGISTRY_PROGRAM_ID with a read-only
provider.
Pool Service
client.pool.
The three initializers return
{ tx, pool, oracle, reserveX, reserveY, tickArrayBitmapExtension, tokenXProgram, tokenYProgram, tokenBadgeX, tokenBadgeY }. openPosition, expandPosition and openLimitOrder create the tick arrays they need, so call initializeTickArray only to create one ahead of time.
A mint needs a token badge from the access registry when it is a Token 2022 mint with an extension other than a transfer fee, metadata, or a transfer hook with neither a program nor an authority. Pass tokenBadgeX or tokenBadgeY from deriveTokenBadge. A config with DynamicConfigPermission.CreatePoolWithoutMintValidation skips the badge check. On an OnlyY pool, token Y must be wrapped SOL or USDC, or have a token badge. The three initializers throw InvalidTokenBadge when it is neither wrapped SOL nor USDC and no tokenBadgeY is passed.
Quote Then Swap
quoteExactIn returns the tick arrays the quote used. Pass them to swap only when quote.amountLeft is zero. Otherwise the program reverts with NotConsumingFullAmountIn. The dynamic fee and scheduled base fees can change before the swap lands, so set minimumOutputAmount below transferFeeExcludedOutAmount.
To pay the host fee to a referrer, pass referral to swap: a token account for the fee token, which is the output mint, or token Y on an OnlyY pool. Pass hasReferral: true to the quote to see the same fee split. The swapper’s output does not change.
Pool Parameters with a Dynamic Config
initializePoolWithDynamicConfig and initializeLaunchPool take InitializePoolWithDynamicParameters. The builder checks the fee schedule, dynamic fee, tick spacing, price, extensions and activation parameters before building, and throws a PoolError on the first violation. Mint and token badge rules are checked by the program, apart from the OnlyY rule above. With the ActivationAccess extension, poolActivation is required and activationPoint defaults to the current slot or timestamp. Without it, both must be null.
quoteExactIn
Quotes an exact-in swap from the current on-chain state and returns the accountsswap needs.
Function
quote.amountLeft > 0means the loaded tick arrays ran out of liquidity. A swap of that input reverts withNotConsumingFullAmountIn; raisemaxTickArraysor lowerinputAmount.- The quote uses the clock at read time. The dynamic fee and scheduled base
fees can change before the swap lands, so set
minimumOutputAmountbelowtransferFeeExcludedOutAmount. hasReferralchanges only how the protocol fee is split (hostFee,protocolFee,partnerFee), not what the swapper receives.- Throws
AmountIsZerofor a zero input,InvalidActivationAccesswhen swaps are disabled or the pool is not yet active forswapper, andLiquidityIsZerowhen no initialized tick array lies in the swap direction.
swap
Builds an exact-in swap. Function{ tx }. Signer: user.
Example
- Pass the
tickArraysandtickArrayBitmapExtensionof a quote whoseamountLeftis zero. The program reverts withNotConsumingFullAmountInunless the swap consumes all ofinputAmount. - The program takes the direction from the mint of
userTokenOut; the builder usesswapForYto pick the default accounts and resolve the transfer-hook accounts of each leg. referralmust hold the fee token: the output mint, or token Y on a pool withCollectFeeMode.OnlyY. It may be the swapper’s own account.- Throws
AmountIsZerofor a zeroinputAmount.
initializePoolWithStaticConfig
Creates a pool from a static config, which fixes the fees, tick spacing, collect-fee mode, activation type, and extensions. Functionpayer, and the config’s poolCreatorAuthority when it is not the
default key.
Example
- A mint needs a token badge from the access registry when it is a
Token 2022 mint with an extension other than a transfer fee, metadata, or a
transfer hook with neither a program nor an authority (
UnsupportedMintwithout it). Token Y also needs one on aCollectFeeMode.OnlyYpool unless it is inWHITELISTED_QUOTE_MINTS(InvalidTokenBadge). - The program creates the bitmap extension with the pool when the initial tick lies outside the inline bitmap.
- Throws
InvalidParametersfor identical mints or aninitialSqrtPriceoutsideMIN_SQRT_PRICE..=MAX_SQRT_PRICE, andInvalidTokenBadgeon anOnlyYconfig when token Y is not inWHITELISTED_QUOTE_MINTSandtokenBadgeYis not passed.
initializePoolWithDynamicConfig
Creates a pool from a dynamic config with caller-chosen fees, tick spacing, activation, and extensions. FunctionInitializePoolResult, as for initializePoolWithStaticConfig. Signers:
payer and poolCreatorAuthority.
Example
- The builder validates
parametersbefore building (fee schedule and bounds, dynamic fee, tick spacing, price, extensions, activation slots) and throws aPoolErroron the first violation. See Base Fee and Activation Builders and Dynamic Fee. With the ActivationAccess extension it reads the clock to check the activation points. - With the ActivationAccess extension,
poolActivationis required andactivationPointdefaults to the current slot or timestamp. Without it, both must benull. - Token badges as for
initializePoolWithStaticConfig; a config withDynamicConfigPermission.CreatePoolWithoutMintValidationskips the badge and Token 2022 extension checks; the Token 2022 native mint is still rejected andOnlyYstill needs a badge for token Y.
initializeLaunchPool
Creates a launch pool: a dynamic pool keyed by its mint pair, with no config. FunctionInitializePoolResult; pool is deriveLaunchPool(tokenXMint, tokenYMint). Signer: payer.
Notes
userTokenXanduserTokenYprove thatpayerholds both tokens; nothing is transferred. The program fails withInvalidTokenOwnerProofwhen either balance is zero.- The protocol takes
MM_LAUNCH_POOL_PROTOCOL_FEE_BPSof the market-maker fee on a launch pool instead ofMM_PROTOCOL_FEE_BPS. - Parameter validation and token badges as for
initializePoolWithDynamicConfig.
initializeTickArray
Creates the tick array account for one index. Function{ tx, tickArray }. Signer: funder.
Example
openPosition,expandPosition, andopenLimitOrdercreate the tick arrays they need; call this only to create one ahead of time.- The program rejects an index with no tick inside
MIN_TICK_ID..=MAX_TICK_ID(InvalidParameters).
initializeTickBitmapExtension
Creates the pool’s tick array bitmap extension. Function{ tx, tickArrayBitmapExtension }. Signer: funder.
Notes
- The inline bitmap tracks tick array indexes -512..511. Liquidity or limit
orders in an array outside that range need the extension; without it the
program fails with
TickArrayBitmapExtensionAccountIsNotProvided.
increaseOracleLength
Grows the pool’s oracle bylengthToAdd observations.
Function
{ tx, oracle }. Signer: payer.
Notes
- The program caps the oracle at
MAX_OBSERVATION_LENGTH(500) observations (InvalidParameters).
claimPartnerFee
Withdraws the pool partner’s accrued fees. Function{ tx }. Signer: signer.
Example
- The program transfers the lesser of the pending fee and the cap on each
side, and rejects a signer other than
poolState.poolPartner.partner(InvalidAuthority).
Position Service
client.position. A position is a Token 2022 NFT plus a position array of up to POSITION_MAX_RANGE (45) slots. Each slot is a TickRange ([tickLowerId, tickUpperId)) with its own liquidity, fees and rewards.
Slots, Bitmaps and Layout Version
Instructions that act on some slots take abitmap of slot indexes (liquidityBitmap) and the tickRanges of those slots. The builder passes the tick arrays of those ranges to the program. Slot i of a new position is tickRanges[i].
expandPosition and removePosition change the slot layout and increase the position’s layoutVersion. Instructions that take expectedLayoutVersion fail with InvalidLayoutVersion when it no longer matches. Pass the layoutVersion you read the slots with, or null to skip the check.
The owner can approve a delegate on the NFT account with a Token 2022 approve of amount 0, then grant permissions with updatePositionDelegatePermission. When a delegate signs an instruction that pays out tokens, each account receiving a non-zero amount must be the owner’s associated token account, or the program fails with IncorrectATA.
The liquidity builders share these account fields:
Deposit by Weight
buildLiquidityShape gives every tick column a weight and groups the columns into position ranges. multiplierFromAmounts sizes the deposit to your token budgets, and encodeAddLiquidityByWeight builds the parameters.
POSITION_MAX_RANGE (45) slots. Each slot is a TickRange
([tickLowerId, tickUpperId)) with its own liquidity, fees, and rewards.
Instructions that act on some slots take a bitmap of slot indexes
(liquidityBitmap) and the tickRanges of those slots, whose tick arrays the
builder passes to the program.
expandPosition and removePosition change the slot layout and increase the
position’s layoutVersion. Instructions that take expectedLayoutVersion
fail with InvalidLayoutVersion when it no longer matches; pass the
layoutVersion you read the slots with, or null to skip the check.
The owner can approve a delegate on the NFT account (a Token 2022 approve
of amount 0; the program rejects any other amount with
DelegatedAmountNonZero) and grant it permissions with
updatePositionDelegatePermission. When a delegate signs an instruction that
pays out tokens, each account receiving a non-zero amount must be the
owner’s associated token account (IncorrectATA).
The liquidity builders share these fields:
openPosition
Mints a position NFT and creates its position array with the given ranges. Function{ tx, position, nftAccount }, where position is derivePosition(nftMint).
Signers: payer and the nftMint keypair.
Example
- The position opens empty; deposit with
addLiquidity,addLiquidityByWeight, oraddLiquidityImbalance. - The program creates missing tick arrays of the range endpoints, paid by
payer. - Throws
InvalidParametersfor no ranges, more thanPOSITION_MAX_RANGE, a range withtickLowerId >= tickUpperId, or a tick that is not a usable tick of the pool’s spacing (isUsableTickId).
addLiquidity
Deposits explicit liquidity into selected slots. Function{ tx, position }. Signer: signer.
Example
- The program fails with
ExceededSlippagewhen a side’s deposit plus its transfer fee exceedsmaxAmountX/maxAmountY. - A delegate needs
PositionDelegatePermission.AddLiquidityand pays from its own token accounts. - Throws
InvalidParameterswhenliquiditiesdoes not have one entry per selected slot,LiquidityIsZerofor a zero entry, andLiquidityIsTooHighabovei128::MAX.
addLiquidityByWeight
Depositsmultiplier * weight liquidity into each selected slot.
Function
encodeAddLiquidityByWeight builds parameters from a liquidity shape.
Returns
{ tx, position }. Signer: signer.
Example
ExceededSlippageand delegate rules as foraddLiquidity.- Throws
LiquidityIsZerofor a zero multiplier or weight,InvalidParameterswhen the weight count differs from the selected slot count, andLiquidityIsTooHighwhenmultiplier * weightexceedsi128::MAX.
addLiquidityImbalance
Deposits into one slot from the wallet balances at execution, capped per side. FunctiontickRanges holds the range of slot index.
Returns
{ tx, position }. Signer: signer.
Example
- The program uses the lesser of each cap and the
userTokenX/userTokenYbalance, and deposits the largest liquidity both sides fund at the current price. - A
nullside fails withExceededSlippageunless the slot needs none of that token at the current price (the range lies entirely on the other side). The price band andminLiquidityalso fail withExceededSlippage. - Throws
InvalidParameterswhen both caps arenull, the price band is inverted or outsideMIN_SQRT_PRICE..=MAX_SQRT_PRICE, orindexis not belowPOSITION_MAX_RANGE, andAmountIsZerofor a zero cap.
removeLiquidity
Withdraws explicit liquidity from selected slots. Function{ tx, position }. Signer: signer.
Example
- Only unlocked liquidity can be withdrawn; permanently locked and unvested liquidity stays.
- The program fails with
ExceededSlippagewhen a side receives less than its minimum. - A delegate needs
PositionDelegatePermission.RemoveLiquidityand can only pay into the owner’s associated token accounts, the defaults. - Same
liquiditieschecks asaddLiquidity.
removeLiquidityByBps
Withdraws a share of the unlocked liquidity of selected slots. Function{ tx, position }. Signer: signer.
Example
tickRangesmust cover every selected slot that has unlocked liquidity; the ranges of all selected slots always do.- The program releases vested liquidity first, then withdraws
unlockedLiquidity * bps / 10000from each selected slot. - Slippage and delegate rules as for
removeLiquidity. - Throws
InvalidParametersforbpsoutside1..=10000.
claimFee
Refreshes the selected slots and transfers the position’s pending fees. FunctiontickRanges must cover every selected slot that holds liquidity; the refresh
skips the others.
Returns
{ tx } holding the refresh and the claim. Signer: signer.
Example
- Fees accrue to a slot when it is refreshed; select every slot whose fees you want. Unselected slots pay out only what is already pending.
- A delegate needs
PositionDelegatePermission.ClaimFeeand can only pay into the owner’s associated token accounts, the defaults.
getClaimableFees
Computes whatclaimFee would transfer for bitmap, from the current pool
and tick state.
Function
- Swaps that land after the read add fees the result does not include.
- Throws
InvalidParameterswhenbitmapselects a slot the position does not have, and anErrorwhen the position belongs to another pool.
compoundFees
Refreshes and claims fees, then redeposits them into one slot, in one transaction. Function{ tx, position, claimable, parameters }: claimable is the
getClaimableFees result the caps come from, and parameters the
addLiquidityImbalance input of the deposit. Signer: signer.
Example
- The deposit is
addLiquidityImbalanceinto slotindex. With the default caps it uses only what the claim delivers, leaving existing wallet balances alone. - A side that earned nothing defaults to
null, which fails withExceededSlippageunless the slot needs none of that token at the current price. To compound into a slot that needs both tokens, pass a wallet-funded cap for that side. - A delegate
signerneeds theClaimFeeandAddLiquiditypermissions and an SPL tokenapprovefrom the owner onuserTokenXanduserTokenY: the claim pays into the owner’s associated token accounts and the deposit spends from them withsigneras the transfer authority. Approve only the amount to compound. - Throws
InvalidParameterswhenindexis not a slot of the position, andAmountIsZerowhen neither cap is given and the claim delivers nothing.
expandPosition
Appends slots to a position. Function{ tx, position }. Signers: signer and payer.
Example
- New slots follow the existing ones. The program rejects a total above
POSITION_MAX_RANGEslots (InvalidParameters), creates missing tick arrays, paid bypayer, and increaseslayoutVersion. - Same range checks as
openPosition.
removePosition
Deletes empty slots from a position. Function{ tx, position }. Signer: signer.
Example
- The program fails with
PositionIsNotEmptyfor a slot with liquidity, pending fees, or pending rewards, and withInvalidParameterswhenbitmapselects every slot; useclosePositionfor that. It increaseslayoutVersion. - Throws
InvalidPermissionwhen a delegate names anyone but the owner asrentReceiver.
closePosition
Closes an empty position and burns its NFT. Function{ tx, position }. Signer: owner.
Example
- The program fails with
PositionIsNotEmptywhile any slot holds liquidity, pending fees, or pending rewards. Withdraw and claim first.
lockPermanentPosition
Permanently locks a share of the position’s unlocked liquidity. Locked liquidity keeps earning fees and rewards. Function{ tx }. Signer: owner.
Notes
- Owner only; delegates cannot lock.
- Throws
InvalidParametersforbpsoutside1..=10000.
lockVestingPosition
Locks a share of the position’s unlocked liquidity and releases it on a cliff-plus-periods schedule. Function{ tx }. Signer: owner.
Example
cliffUnlockBps + bpsPerPeriod * numberOfPeriodmust equal 10000, andperiodFrequency,bpsPerPeriod, andnumberOfPeriodare all set or all zero (InvalidParameters).- The program rejects a
cliffPointin the past, and a schedule whose cliff delay plusperiodFrequency * numberOfPeriodexceedsMAX_VESTING_DURATIONseconds, orMAX_VESTING_DURATION_SLOTslots on a slot-activated pool. - One schedule per position; a second fails with
PositionAlreadyHadVesting. Owner only.
refreshFeesAndRewards
Brings the fee and reward checkpoints of selected slots up to date without transferring anything. Function{ tx }. Signer: signer.
Example
claimFeeandclaimRewardinclude this refresh.- A delegate needs no specific permission.
updatePositionDelegatePermission
Sets the permissions of the position’s approved delegate. Function{ tx }. Signer: owner.
Example
- The delegate itself is set by a Token 2022
approveof amount 0 on the NFT account. - Throws
InvalidPermissionfor a mask aboveMAX_POSITION_DELEGATE_PERMISSION.
Limit Order Service
client.limitOrder.
A limit order is a Token 2022 NFT plus a limit-order account holding up to
LIMIT_ORDER_MAX_TICK (25) ticks, all on one side. An ask (isAskSide: true) sells token X at ticks strictly above the current tick. A bid buys token X with token Y at ticks at or below it. A swap fills the orders at a tick once the price reaches it. On cancel the owner receives the unfilled amount, the filled proceeds and the order’s share of the limit-order fee.
With relativeTick set, each ticks[].id is an offset, in tick-spacing units, from the current tick aligned down to the spacing at execution. The program rejects the order with ExceededSlippage when that aligned tick has left [spacingAlignedMinTickId, spacingAlignedMaxTickId]. Without relativeTick, ticks[].id are absolute tick ids. relativeTickFromSlippage builds the band and limitOrderTicksFromShape builds the ticks from a liquidity shape.
A limit order is a Token 2022 NFT plus a limit-order account holding up to
LIMIT_ORDER_MAX_TICK (25) ticks, all on one side. An ask sells token X at
ticks above the current tick; a bid buys token X with token Y at ticks at or
below it. A swap fills the orders at a tick once the price reaches it. On
cancel the owner receives the unfilled amount, the filled proceeds, and the
order’s share of the limit-order fee.
With relativeTick set, each ticks[].id is an offset, in tick-spacing
units, from the current tick aligned down to the spacing at execution, and
the program rejects the order with ExceededSlippage when that aligned tick
has left [spacingAlignedMinTickId, spacingAlignedMaxTickId]. Without it,
ticks[].id are absolute tick ids.
The owner can approve a delegate on the NFT account (a Token 2022 approve
of amount 0) and grant LimitOrderDelegatePermission.CancelLimitOrder with
updateLimitOrderDelegatePermission. A delegate canceling an order can only
pay into the owner’s associated token accounts, the defaults.
openLimitOrder
Mints a limit-order NFT and places the order. Function{ tx, limitOrder, nftAccount }, where limitOrder is
deriveLimitOrder(nftMint). Signers: payer, owner, and the nftMint
keypair.
Example
- Ask ticks must lie strictly above the current tick and bid ticks at or
below it, on usable ticks of the pool’s spacing (
InvalidParameters). The builder checks the tick list, the band, and the alignment before sending. - The program fails with
ExceededSlippagewhen the deposit plus its transfer fee exceedsmaxAmount. - The program creates missing tick arrays, paid by
payer. For a relative order the defaulttickArrayscover every array the band can resolve the ticks to.
cancelLimitOrder
Cancels the order at the given ticks and withdraws what they hold. Function{ tx }. Signer: signer.
Example
LIMIT_ORDER_REFERRAL_FEE_BPSof the order’s fee goes toreferralTokenwhen the order has a referral, the referral is not the NFT owner, andreferralTokenis owned by it; otherwise the owner keeps the whole fee.referralTokenmust hold the mint the fee is paid in.- When the builder reads the order to default
tickIds, it throwsInvalidParametersif nothing is left to cancel.
closeLimitOrder
Closes a fully canceled limit order and burns its NFT. Function{ tx, limitOrder }. Signer: owner.
Notes
- The program fails with
LimitOrderIsNotEmptyuntil every tick is canceled.
updateLimitOrderDelegatePermission
Sets the permissions of the limit order’s approved delegate. Function{ tx }. Signer: owner.
Example
- Throws
InvalidPermissionfor a mask aboveMAX_LIMIT_ORDER_DELEGATE_PERMISSION.
Reward Service
client.reward. Rewards need the PoolExtension.LiquidityMining extension. Without it the program fails with InvalidPoolType. A pool has NUM_REWARDS (2) reward slots. The pool creator initializes slot CREATOR_REWARD_INDEX (0) and assigns its reward authority. Operator-managed slots are set up with client.program.methods.
Rewards need the pool’s
PoolExtension.LiquidityMining extension; without it
the program fails with InvalidPoolType. A pool has NUM_REWARDS (2) reward
slots. The pool creator initializes slot CREATOR_REWARD_INDEX (0) and
assigns its reward authority; operator-managed slots are set up with
client.program.methods. A slot’s reward authority funds it with
setRewardEmission and withdraws its ineligible reward.
initializeReward
Initializes the creator’s reward slot with a mint and an authority. Function{ tx, rewardVault }, where rewardVault is
deriveRewardVault(pool, CREATOR_REWARD_INDEX). Signers: creator and
payer.
Example
- Without a
tokenBadgethe program rejects a reward mint with a freeze authority, or a Token 2022 mint with an extension other than a transfer fee, metadata, or a transfer hook with neither a program nor an authority (UnsupportedMint). Mints inWHITELISTED_QUOTE_MINTSare always accepted. - The program fails with
InvalidRewardStatewhen the slot is already initialized andInvalidPermissionwhencreatoris not the pool creator.
updateRewardAuthority
Replaces the authority of the creator’s reward slot. Function{ tx }. Signer: creator.
Notes
- The program fails with
RewardUninitializedfor an uninitialized slot andInvalidParameterswhennewAuthorityis the current authority.
setRewardEmission
Funds a reward slot and starts its emission. Function{ tx, rewardVault }. Signers: funder and authority.
Example
- The program transfers
calculateRewardAmount(endTime - openTime, emissionPerSecond, Rounding.Up)plus the mint’s transfer fee, and fails withExceededSlippagewhen that exceedsmaxAmount. For a transfer-fee mint, cap withcalculateTransferFeeIncludedAmount(mint, epoch, amount).amount. - The program requires
openTimebetween now and now plusMAX_REWARD_START_DELAY, andendTime - openTimewithinMIN_REWARD_DURATION..=MAX_REWARD_DURATION(InvalidParameters).openTime: nullstarts the emission when the transaction executes, so the duration shrinks by the time the transaction takes to land; pass an explicit futureopenTimewhen the duration is near the minimum. - The slot must be idle: never funded, or brought up to
endTimewith no ineligible reward left (InvalidRewardState). After an emission ends, callwithdrawIneligibleRewardsbefore funding the slot again; it does both. - The program fails with
InvalidPermissionwhenauthorityis not the slot’s reward authority.
claimReward
Refreshes the selected slots and transfers the position’s pending reward from one reward slot. Function{ tx } holding the refresh and the claim. Signer: signer.
Example
- Rewards accrue to a slot when it is refreshed, as with
claimFee. - A delegate can only pay into the owner’s associated token account, the
default
userTokenAccount(IncorrectATA).
withdrawIneligibleRewards
Withdraws the reward a slot emitted while the pool had no liquidity. Function{ tx }. Signer: authority.
Notes
- The program refreshes the slot and fails with
InvalidRewardStateuntil its emission has ended. It transferscalculateRewardAmount(cumulativeSecondsWithEmptyLiquidityReward, emissionPerSecond, Rounding.Down); a zero amount succeeds without a transfer. - The program fails with
InvalidPermissionwhenauthorityis not the slot’s reward authority.
State Service
client.state fetches and decodes program accounts at the client’s commitment. Each method throws an Error when the account does not exist or is not owned by the program. The fetch* methods return the Anchor-decoded account. Pool, position-array, tick-array, limit-order and oracle accounts also carry a variable tail that the *With* and decode* methods decode. withReward must match the pool’s liquidity mining extension, because it changes the size of each position and tick.
client.state fetches and decodes program accounts at the client’s
commitment. Each method throws an Error when the account does not exist or
is not owned by the program. The fetch* methods return the Anchor-decoded
account; pool, position-array, tick-array, limit-order, and oracle accounts
also carry a variable tail that the *With* and decode* methods decode.
withReward must match the pool’s liquidity-mining extension, because it
changes the size of each position and tick.
fetchPool
FunctionPool account: mints and token flags, reserves, tickSpacing,
tickCurrentId, sqrtPrice, liquidity, fee configuration and dynamic fee
state, poolStatus, extensions, the inline tick-array bitmap, and the
partner’s state.
Example
fetchPoolWithExtensions
FunctionfetchPositionArrayWithPositions
FunctionfetchTickArraysWithTicks
Fetches several tick arrays in one RPC call. Function- Throws an
Errorwhen any address is missing or not owned by the program.
decodeLimitOrderData
FunctiondecodeObservations
FunctionfetchTokenBadge
Fetches a token badge from the access-registry program. FunctionTokenBadge account: tokenMint and mintScore.
Example
- Throws an
Errorwhen the badge does not exist or is not owned by the access-registry program. Badges are created by access-registry operators.
Other State Methods
Each returns aPromise of the value shown.
Quote Helpers
client.pool.quoteExactIn reads the accounts for you. The pure quoteExactIn export runs the program’s exact-in swap over accounts you already hold, for example from a subscription. It applies dynamic and scheduled fees, market-maker and limit-order liquidity, the collect-fee mode, the protocol, host and partner fee split, and Token 2022 transfer fees. Nothing is fetched.
Pass the swap’s tick arrays in traversal order: descending indexes when
swapForY, ascending otherwise. tickArraysForSwap returns the first maxTickArrays (default 3) arrays with liquidity from the current tick onward. With amountLeft zero, the quoted input and output amounts match what swap produces against the same accounts and clock. The pure quote throws InvalidParameters when a Token 2022 side has no unpacked mint, and BitmapExtensionAccountIsNotProvided when the traversal leaves the inline bitmap without bitmapExtension.
QuoteExactInResult fields:
quoteExactIn (pure)
Runs the program’s exact-in swap over accounts you already hold: dynamic and scheduled fees, market-maker and limit-order liquidity, collect-fee mode, the protocol, host, and partner fee split, and Token 2022 transfer fees. Nothing is fetched. Functionclient.pool.quoteExactIndoes these reads for you. Call this directly when you already hold the accounts, for example from a subscription.- With
amountLeftzero, the amounts match whatswapproduces against the same accounts and clock. The inputs are not modified, so quote consecutive swaps from fresh account state. - Throws
InvalidParameterswhen a Token 2022 side has no unpacked mint, a mint does not match the pool, or an ActivationAccess pool has nopoolActivation, andBitmapExtensionAccountIsNotProvidedwhen the traversal leaves the inline bitmap withoutbitmapExtension. Other errors as forclient.pool.quoteExactIn.
tickArraysForSwap
Selects the initialized tick arrays a swap traverses, in the order the swap instruction reads them. FunctionmaxTickArrays tick arrays with liquidity, from the current
tick’s array onward in the swap direction: descending indexes when
swapForY, ascending otherwise. requiresBitmapExtension is true when the
pool has a bitmap extension, which the swap then needs as
tickArrayBitmapExtension.
Notes
- Throws
BitmapExtensionAccountIsNotProvidedwhen the pool has an extension andextensionStateis missing, andInvalidParametersfor amaxTickArraysbelow 1.
calculateTransferFeeExcludedAmount
FunctioncalculateTransferFeeIncludedAmount
FunctionTransferFeeAmount: the amount to send so that
transferFeeExcludedAmount arrives, and the fee.
Example
- Throws
MathOverflowwhen the result does not fit in au64.
Liquidity Shape Helpers
A liquidity shape gives every tick column[tickId, tickId + tickSpacing) an integer weight up to MAX_LIQUIDITY_WEIGHT (255) and groups the columns into position ranges. addLiquidityByWeight deposits multiplier * weight liquidity into each range, so the weights set the profile and the multiplier sets the size.
Spot weighs every column equally. Curve is heaviest at the column holding the current tick and BidAsk is lightest there. LiquidityLayout.Vertical (default) merges adjacent columns of equal weight into side-by-side ranges. Horizontal stacks overlapping ranges, which usually needs fewer ranges for Curve and BidAsk. maxRanges coarsens the weights until the ranges fit. A shape needing more than POSITION_MAX_RANGE ranges throws InvalidParameters.
limitOrderTicksFromShape takes unitAmount or totalAmount, not both. From totalAmount the unit is totalAmount / totalWeight rounded down, so up to totalWeight - 1 stays unspent. The returned amount excludes the transfer fee.
A liquidity shape gives every tick column [tickId, tickId + tickSpacing)
an integer weight up to MAX_LIQUIDITY_WEIGHT (255) and groups the columns
into position ranges. The columns run from minTickId to maxTickId, except
for StrategyType.Custom, where weights alone defines them.
addLiquidityByWeight deposits multiplier * weight liquidity into each
range, so the weights set the liquidity profile and the multiplier sets the
size. limitOrderTicksFromShape turns the same columns into limit-order
ticks.
buildLiquidityShape
FunctionSpotweighs every column equally.Curveis heaviest at the column holding the current tick and falls off away from it;BidAskis lightest there and rises away from it. With the current tick outside the range,Curveis heaviest andBidAsklightest at the nearest edge.Customtakesweightsfor usable tick ids, without duplicates; a zero weight leaves a gap. Weights above 255 are scaled down.Verticalmerges adjacent columns of equal weight into side-by-side ranges.Horizontalstacks overlapping ranges, one per run of columns at or above each weight level, which usually needs fewer ranges forCurveandBidAsk. Both give every column the same total weight.maxRangescoarsens the weights, in either layout, until the ranges fit;columnsthen show the reduced weights. Without it, a shape needing more thanPOSITION_MAX_RANGEranges throwsInvalidParameters, as does a shape that cannot fitmaxRanges.- Throws
InvalidParametersfor an unusable tick,minTickIdabovemaxTickId, missing or invalidCustomweights, all-zero weights, or a last column ending pastMAX_TICK_ID.
multiplierFromAmounts
Finds the largest multiplier whose deposit fits both token budgets. FunctionencodeAddLiquidityByWeight. Its deposit, from
amountsFromShape, plus transfer fees fits amountX and amountY.
Notes
- Also bounded by the program’s per-tick liquidity cap, assuming the range boundaries hold no liquidity yet; existing liquidity there lowers the cap.
- Throws
InvalidParametersfor a weight outside1..=255, an inverted or unusable range, or budgets too small to fund a multiplier of 1.
encodeAddLiquidityByWeight
Builds theparameters of addLiquidityByWeight from shape ranges.
Function
{ maxAmountX, maxAmountY, expectedLayoutVersion, bitmap, multiplier, liquidities }
with one weight byte per slot in ascending slot order.
Notes
- Pass
positionIndexeswhen the ranges go into existing slots other than0..ranges.length - 1, for example afterexpandPosition. - Throws
InvalidParametersfor no ranges or more thanPOSITION_MAX_RANGE, a non-positive multiplier, a weight outside1..=255, orpositionIndexesthat do not match the ranges, andLiquidityIsTooHighwhenmultiplier * weightexceedsi128::MAX.
amountsFromShape
Computes the deposit of each range for a multiplier. Function- Amounts exclude transfer fees. Throws
LiquidityIsTooHighwhen a range’s liquidity exceedsi128::MAX.
limitOrderTicksFromShape
Turns the columns of one side of a shape into limit-order ticks. Function- An ask takes the weighted columns above the current tick; a bid takes
those below the column holding the current tick, plus that column with
includeActiveTick. - Each tick gets
unitAmount * weight. FromtotalAmountthe unit istotalAmount / totalWeightrounded down, so up tototalWeight - 1stays unspent. amountexcludes the transfer fee. For a transfer-fee mint, setmaxAmounttocalculateTransferFeeIncludedAmount(mint, epoch, amount).amount.- Throws
InvalidParameterswhen both or neither amount is given, the unit rounds to zero, or the side has no columns or more thanLIMIT_ORDER_MAX_TICK.
relativeTickFromSlippage
Builds therelativeTick band of openLimitOrder.
Function
{ spacingAlignedMinTickId, spacingAlignedMaxTickId }: the current tick
aligned down to tickSpacing, minus and plus slippageTicks.
Notes
- Throws
InvalidParametersfor atickSpacingoutside1..=MAX_TICK_SPACINGor aslippageTicksthat is negative or not a multiple oftickSpacing.
tickPrice
Functiondecimal.js Decimal.
tickUiPrice
FunctiontickPrice(tickId) * 10^(decimalsX - decimalsY).
Example
Liquidity and Position Helpers
MAX_POSITION_DELEGATE_PERMISSION and MAX_LIMIT_ORDER_DELEGATE_PERMISSION are the masks of every permission. A larger mask throws InvalidPermission. For a transfer-fee mint, pass calculateTransferFeeExcludedAmount(...).amount as the budget to getLiquidityFromAmounts, because maxAmountX and maxAmountY of addLiquidity include the fee.
getLiquidityFromAmounts
Computes the largest liquidity two token budgets fund in a range at the current price. Function- The budgets are pool-side. For a transfer-fee mint, pass
calculateTransferFeeExcludedAmount(mint, epoch, budget).amount, becausemaxAmountX/maxAmountYofaddLiquidityinclude the fee. - Throws
LiquidityIsZerowhen the budgets fund no liquidity.
getAmountsFromLiquidity
Computes the token amounts a liquidity change moves in a range at the current price. FunctionliquidityBitmap
Function- Throws
InvalidParametersfor an empty list, a duplicate, or an index outside0..POSITION_MAX_RANGE - 1.
positionIndexesFromBitmap
Functionbitmap, ascending.
Notes
- Throws
InvalidParametersfor a zero or negative bitmap, or one with bits at or abovePOSITION_MAX_RANGE.
positionTotalLiquidity
FunctionunlockedLiquidity + permanentLockedLiquidity + vestingLiquidity, the
liquidity that earns fees.
positionDelegatePermissionMask
FunctionupdatePositionDelegatePermission. MAX_POSITION_DELEGATE_PERMISSION
is the mask of every permission.
Notes
- Throws
InvalidPermissionfor an unknown permission.
limitOrderDelegatePermissionMask
FunctionupdateLimitOrderDelegatePermission.
MAX_LIMIT_ORDER_DELEGATE_PERMISSION is the mask of every permission.
Notes
- Throws
InvalidPermissionfor an unknown permission.
calculateRewardAmount
FunctiontimeDelta * emissionPerSecond / 2^64, rounded as requested, as the program
computes reward amounts.
Notes
- Throws
TypeCastFailedwhen the result does not fit in au64.
Tick Helpers
Ticki has price 1.0001^i (token Y per token X, in atoms), stored as a Q64.64 sqrt price. A tick is usable by a pool when it is a multiple of the pool’s tick spacing within MIN_TICK_ID and MAX_TICK_ID. Tick array n covers the MAX_TICKS_PER_ARRAY (128) usable ticks starting at n * 128 * tickSpacing.
Tick
i has price 1.0001^i (token Y per token X, in atoms), stored as a
Q64.64 sqrt price. A tick is usable by a pool when it is a multiple of the
pool’s tick spacing within MIN_TICK_ID..=MAX_TICK_ID. Tick array n covers
the MAX_TICKS_PER_ARRAY (128) usable ticks starting at
n * 128 * tickSpacing.
getSqrtPriceFromTickId
Functionsqrt(1.0001^tickId) * 2^64.
Example
- Throws
InvalidParametersfor a tick id that is not an integer or lies outsideMIN_TICK_ID..=MAX_TICK_ID.
tickIdFromSqrtPrice
FunctionT with getSqrtPriceFromTickId(T) <= sqrtPrice < getSqrtPriceFromTickId(T + 1).
Notes
- Throws
InvalidParametersoutsideMIN_SQRT_PRICE..=MAX_SQRT_PRICE.
tickIndexFromId
FunctiontickId.
Example
- Throws
InvalidParametersfor a tick spacing outside1..=MAX_TICK_SPACING.
isUsableTickId
FunctiontickId is a multiple of tickSpacing within
MIN_TICK_ID..=MAX_TICK_ID.
tickArrayIndexesForTickIds
FunctiontickIds, deduplicated and
ascending.
tickArraysForTickIds
FunctiontickIds, deduplicated and ascending by index: the
tickArrays order of the limit-order builders.
tickArraysForRanges
FunctiontickArraysForSwap
instead.
PDA Helpers
Each helper returns the address only. The optional lastprogramId argument defaults to the program in the last column.
deriveStaticConfig and deriveDynamicConfig take the index as a BN or a number. deriveRewardVault throws InvalidRewardIndex for an index outside 0 to NUM_REWARDS - 1. For an access-registry operator, pass ACCESS_REGISTRY_PROGRAM_ID to deriveOperator.
Account Helpers
getExtraAccountMetasForTransferHook takes a TransferHookLeg with mint, source, destination and authority. The authority is the user, or derivePoolAuthority() for a transfer out of the pool. The accounts are resolved for a transfer amount of zero. For a hook whose extra accounts depend on the amount, pass the transferHook* array to the builder yourself.
findNftAccount
FunctionnftAccount of every builder.
getTokenProgram
FunctionTOKEN_PROGRAM_ID for TokenProgramFlags.TokenProgram, TOKEN_2022_PROGRAM_ID
for TokenProgramFlags.TokenProgram2022.
Example
- Throws
TypeCastFailedfor any other flag.
wrapSOLInstruction
Functionamount lamports and a sync-native instruction.
unwrapSOLInstruction
FunctionreadClock
FunctiongetExtraAccountMetasForTransferHook
Resolves the extra accounts a Token 2022 transfer-hook program needs for one transfer. The builders call it for every transfer whosetransferHook* array
you omit.
Function
transferChecked for this transfer, the slice the program reads
from the remaining accounts. Empty for an SPL Token mint or a Token 2022 mint
without a hook.
Example
- The accounts are resolved for a transfer amount of zero. For a hook whose
extra accounts depend on the amount, pass the
transferHookX,transferHookY,transferHookReferral, ortransferHookRewardarray to the builder yourself. - A builder sends an explicit array, including
[], as given.
Account Codec Helpers
The raw decoders read the variable tail of account data, for example from an
onAccountChange subscription. Each throws an Error when the data is not that account type.
encodePoolExtensions
Functionextensions bitmask for pool initialization.
Notes
- Throws
InvalidParametersfor an unknown extension.
isSupportExtension
Functionextension is set in extensions.
Example
Raw Account Decoders
These decode the variable tail of raw account data, for example from anonAccountChange subscription. Each throws an Error when the data is not
that account type.
Example
Base Fee and Activation Builders
A pool’s base fee is aBaseFeeMode plus 31 bytes of data. The builders take fees in basis points and return the whole baseFeeParameter. They reject schedules pool initialization would reject, with InvalidParameters. The raw encoders produce only data and check that each field fits its integer width. Fee numerators are over FEE_DENOMINATOR (1,000,000,000), so 1,000,000 is 0.1%. Pool initialization requires every fee the schedule can reach to lie within MIN_FEE_NUMERATOR and MAX_FEE_NUMERATOR (0.01% to 99%).
TimeSchedulerBpsParams and MarketCapSchedulerBpsParams need startingBaseFeeBps above endingBaseFeeBps, both integers from 1 to 9900, and a non-zero numberOfPeriod. The time scheduler adds totalDuration in slots or seconds per the pool’s activation type. The market cap scheduler adds priceMultiple above 1 and schedulerExpirationDuration. For a constant fee use fixedBaseFeeParameters.
A pool with the ActivationAccess extension has two activation slots and three whitelisted wallets (poolActivation). A swap, deposit or withdrawal is allowed only when both slots allow it, unless the swapper, or the position or order owner, is the matching whitelisted wallet. Pool initialization accepts these slot pairs, in this order:
Open + Open, Open + BondingCurve, Open + TimeBased, and BondingCurve + TimeBased.
Without a TimeBased slot, pass activationPoint: null. A BondingCurve slot needs a whitelistedAddLiquidity other than the default key, since nobody else can deposit before the target. Each TimeBased point must fall between now and now plus MAX_TIME_BUFFER seconds, or MAX_SLOT_BUFFER slots on a slot-activated pool.
A pool’s base fee is a BaseFeeMode plus 31 bytes of data. The builders
below take fees in basis points and return the whole baseFeeParameter
(mode and data); they reject schedules pool initialization would reject
(InvalidParameters). The raw encoders produce only data and check that
each field fits its integer width. Fee numerators are over FEE_DENOMINATOR
(1,000,000,000), so 1,000,000 is 0.1%. Pool initialization requires every
fee the schedule can reach to lie within MIN_FEE_NUMERATOR..=MAX_FEE_NUMERATOR
(0.01% to 99%).
A pool with the ActivationAccess extension has two activation slots and
three whitelisted wallets (poolActivation). A swap, deposit, or withdrawal
is allowed only when both slots allow it, unless the swapper, or the
position or order owner, is the matching whitelisted wallet. Pool
initialization accepts these slot pairs, in this order: Open + Open,
Open + BondingCurve, Open + TimeBased, BondingCurve + TimeBased. Without a
TimeBased slot, activationPoint must be the current point; pass null.
bpsToFeeNumerator
FunctionFEE_DENOMINATOR; 1 bps is 100,000.
baseFeeParameters
Picks the builder frombaseFeeMode. Equivalent of the damm-v2 SDK’s
getBaseFeeParams, with each mode’s fields at the top level instead of in a
per-mode sub-object.
Function
baseFeeParameter from fixedBaseFeeParameters,
timeSchedulerBaseFeeParameters or marketCapSchedulerBaseFeeParameters.
Example
- The params type is a union keyed on
baseFeeMode, so TypeScript requires the fields of the chosen mode. - Throws
InvalidBaseFeeModefor an unknown mode; other errors come from the chosen builder.
fixedBaseFeeParameters
FunctionbaseFeeParameter for BaseFeeMode.Fixed.
Example
timeSchedulerBaseFeeParameters
A fee that starts atstartingBaseFeeBps at the activation point and settles
at about endingBaseFeeBps after totalDuration. Equivalent of the damm-v2
SDK’s getFeeTimeSchedulerParams.
Function
baseFeeParameter for the chosen time scheduler mode.
Example
- The starting fee must be above the ending fee; for a constant fee use
fixedBaseFeeParameters. - The period length is
floor(totalDuration / numberOfPeriod), so the fee settles at or beforetotalDuration. - Linear reduction is floored, so the settled fee is at or above the ending
fee. Exponential
reductionFactoris whole basis points, so the settled fee is at or just aboveendingBaseFeeBps. - Throws
InvalidParametersifreductionFactorrounds to zero (too many periods for the fee range).
marketCapSchedulerBaseFeeParameters
A fee that falls as the spot price rises above the initial price, settling at aboutendingBaseFeeBps at priceMultiple or after
schedulerExpirationDuration, whichever comes first. Equivalent of the
damm-v2 SDK’s getFeeMarketCapSchedulerParams.
Function
baseFeeParameter for the chosen market cap scheduler mode.
Example
- The starting fee must be above the ending fee; for a constant fee use
fixedBaseFeeParameters. - The sqrt-price step is
floor((sqrt(priceMultiple) - 1) * 10000 / numberOfPeriod)bps, so the fee settles at or beforepriceMultiple. ThrowsInvalidParametersif the step rounds to zero. - Reduction rounding is as for
timeSchedulerBaseFeeParameters.
encodeFixedBaseFeeData
Functiondata for BaseFeeMode.Fixed.
encodeTimeSchedulerBaseFeeData
A fee that starts atcliffFeeNumerator at the activation point and steps
down every periodFrequency slots or seconds.
Function
data for BaseFeeMode.TimeSchedulerLinear or
BaseFeeMode.TimeSchedulerExponential.
Example
- After
nperiods the fee iscliffFeeNumerator - reductionFactor * n(linear) orcliffFeeNumerator * (1 - reductionFactor / 10000)^n(exponential), withncapped atnumberOfPeriod. Before the activation point the settled fee applies. - Pool initialization rejects a zero
periodFrequency,reductionFactor, ornumberOfPeriod.
encodeMarketCapSchedulerBaseFeeData
A fee that starts atcliffFeeNumerator and steps down as the sqrt price
rises above its initial value.
Function
data for BaseFeeMode.MarketCapSchedulerLinear or
BaseFeeMode.MarketCapSchedulerExponential.
Notes
- The step count is
(sqrtPrice - initSqrtPrice) * 10000 / initSqrtPrice / sqrtPriceStepBps, capped atnumberOfPeriod, and the fee per step follows the time scheduler’s formulas. Before activation and afteractivationPoint + schedulerExpirationDurationthe settled fee applies. - Pool initialization rejects a zero
reductionFactor,sqrtPriceStepBps,schedulerExpirationDuration, ornumberOfPeriod.
getBaseFeeNumerator
Evaluates a pool’s base fee the way the program does. FunctionFEE_DENOMINATOR. A swap adds the dynamic fee,
when enabled, and caps the total at MAX_FEE_NUMERATOR.
Example
- Throws
InvalidBaseFeeModefor an unknown mode.
openActivationParameters
FunctionbondingCurveActivationParameters
FunctioninitSqrtPrice * targetIncreaseBps / 10000. The slot stays open after that.
Example
- Pool initialization requires a
whitelistedAddLiquidityother than the default key, since nobody else can deposit before the target, and a target sqrt price no higher than that ofMAX_TICK_IDaligned to the tick spacing.
timeBasedActivationParameters
Function- Pool initialization requires each point between now and now plus
MAX_TIME_BUFFERseconds, orMAX_SLOT_BUFFERslots on a slot-activated pool. - Throws
InvalidParametersfor a negative point or one above2^40 - 1.
Dynamic Fee
getDynamicFeeParams(baseFeeBps, minDeltaTickForSignificantSwap, options?) returns the dynamicFeeParameter for pool initialization. The variable fee stays within 20% of baseFeeBps. Filter, decay and reduction use DYNAMIC_FEE_FILTER_PERIOD, DYNAMIC_FEE_DECAY_PERIOD and DYNAMIC_FEE_REDUCTION_FACTOR.
Pass
null as dynamicFeeParameter to disable the dynamic fee.
getDynamicFeeParams returns the dynamicFeeParameter for pool
initialization. The variable fee stays within 20% of baseFeeBps. The
volatility cap defaults to a 15% price move
(DYNAMIC_FEE_MAX_PRICE_CHANGE_BPS); filter, decay and reduction are
DYNAMIC_FEE_FILTER_PERIOD (10 s), DYNAMIC_FEE_DECAY_PERIOD (120 s) and
DYNAMIC_FEE_REDUCTION_FACTOR (5,000, 50%).
getDynamicFeeParams
FunctiondynamicFeeParameter for poolFees.
Example
variableFeeControlis the largest value whose fee at the volatility cap is still within 20% ofbaseFeeBps.- When
maxVolatilityAccumulatoris set,maxPriceChangeBpsis ignored. - Throws
InvalidParameterswhenbaseFeeBpsis outside0..=10000,minDeltaTickForSignificantSwapis not a non-zero u16,maxPriceChangeBpsis outside1..=10000, or the volatility cap orvariableFeeControldoes not fit in a u24.
Enums
Values are numbered from 0 in the order listed.Constants
Core Types
Account and instruction types derived from the IDL, such asPool, TickRange and SwapParameters, are exported from the package root.
Errors
PoolError for input they can reject before sending. The message names the argument that failed and its constraint. PoolErrorCode uses the program’s error numbering, so the custom error code of a failed transaction maps to the same name. See DLMM Pro program errors for the full list.
Examples
Runnable flows for pools, positions, swaps and limit orders.
Full Function Reference
Every function with all parameters, return types and thrown errors.

