Quote Token
(0) or Output Token
(1)feeClaimer
in the config key.
Function
ClaimTradingFeeParam
params.receiver
, the receiver is not required to sign the transaction, however, you must provide a tempWSolAcc
if the receiver != creato and if the quote mint is SOL.feeClaimer
in the config key.
Function
ClaimTradingFee2Param
params.feeClaimer
) in the config key.PartnerWithdrawSurplusParam
params.ConfigParameters
object.
Example
buildCurve
helps you to create a curve structure based on percentage of supply on migration and migration quote threshold.dynamicFeeEnabled
is true, the dynamic fee will be enabled and capped at 20% of minimum base fee.lockedVestingParam.totalVestingDuration
and lockedVestingParam.cliffDurationFromMigrationTime
are calculated in terms of seconds.feeSchedulerParam.totalDuration
is calculated based on your activationType
and activationTime
.ConfigParameters
object.
Example
buildCurveWithMarketCap
helps you to create a curve structure based on initial market cap and migration market cap.dynamicFeeEnabled
is true, the dynamic fee will be enabled and capped at 20% of minimum base fee.lockedVestingParam.totalVestingDuration
and lockedVestingParam.cliffDurationFromMigrationTime
are calculated in terms of seconds.feeSchedulerParam.totalDuration
is calculated based on your activationType
and activationTime
.ConfigParameters
object.
Example
buildCurveWithTwoSegments
helps you to create a curve structure based on initial market cap, migration market cap and percentage of supply on migration.dynamicFeeEnabled
is true, the dynamic fee will be enabled and capped at 20% of minimum base fee.lockedVestingParam.totalVestingDuration
and lockedVestingParam.cliffDurationFromMigrationTime
are calculated in terms of seconds.feeSchedulerParam.totalDuration
is calculated based on your activationType
and activationTime
.ConfigParameters
object.
Example
buildCurveWithLiquidityWeights
helps you to create a curve structure based on initial market cap, migration market cap and liquidity weights.liquidityWeights
is an array of numbers that determines how liquidity is distributed across the curve’s price ranges.16
.16
curve segments).i
is the liquidityWeight index).All liquidityWeights[i] === 1
: All segments have the same liquidity. The curve is linear.liquidityWeights[i] < liquidityWeights[i+1]
: Lower liquidity at lower prices.
liquidityWeights[i] > liquidityWeights[i+1]
: Higher liquidity at lower prices.
dynamicFeeEnabled
is true, the dynamic fee will be enabled and capped at 20% of minimum base fee.lockedVestingParam.totalVestingDuration
and lockedVestingParam.cliffDurationFromMigrationTime
are calculated in terms of seconds.feeSchedulerParam.totalDuration
is calculated based on your activationType
and activationTime
.CreatePoolParam
params.CreateConfigAndPoolParam
params.CreateConfigAndPoolWithFirstBuyParam
params.createConfigTx
requires the payer and config to sign the transaction.createPoolTx
requires the payer, poolCreator, and baseMint to sign the transaction.firstBuyParam
is not provided, the swapBuyTx
will be undefined.swapBuyTx
requires the buyer and payer to sign the transaction.poolCreator
is required to sign when creating the pool.buyer
is required to sign when buying the token.baseMint
token type must be the same as the config key’s token type.minimumAmountOut
parameter protects against slippage. Set it to a value slightly lower than the expected output.referralTokenAccount
parameter is an optional token account. If provided, the referral fee will be applied to the transaction.poolCreator
is required to sign when creating the pool.partner
is required to sign when buying the token.creator
is required to sign when buying the token.baseMint
token type must be the same as the config key’s token type.minimumAmountOut
parameter protects against slippage. Set it to a value slightly lower than the expected output.referralTokenAccount
parameter is an optional token account. If provided, the referral fee will be applied to the transaction.swapBaseForQuote
to false
.swapBaseForQuote
to true
.minimumAmountOut
parameter protects against slippage. Set it to a value slightly lower than the expected output.referralTokenAccount
parameter is an optional token account. If provided, the referral fee will be applied to the transaction.deriveDbcPoolAddress
.payer
parameter is optional. If not provided, the owner will be used as the payer to fund ATA creation.swapBaseForQuote
parameter determines the direction of the swap:
true
: Swap base tokens for quote tokensfalse
: Swap quote tokens for base tokensamountIn
is the amount of tokens you want to swap, denominated in the smallest unit and token decimals. (e.g., lamports for SOL).slippageBps
parameter is the slippage in basis points (optional). This will calculate the minimum amount out based on the slippage.hasReferral
parameter indicates whether a referral fee should be included in the calculation.currentPoint
parameter is typically used in cases where the config has applied a fee scheduler. If activationType == 0, then it is current slot. If activationType == 1, then it is the current block timestamp. You can fill in accordingly based on slot or timestamp.migrationQuoteThreshold
in the config key.currentPoint
parameter is typically used in cases where the config has applied a fee scheduler. If activationType == 0, then it is current slot. If activationType == 1, then it is the current block timestamp. You can fill in accordingly based on slot or timestamp.currentPoint
parameter is typically used in cases where the config has applied a fee scheduler. If activationType == 0, then it is current slot. If activationType == 1, then it is the current block timestamp. You can fill in accordingly based on slot or timestamp.createDammV1MigrationMetadata
createLocker
(if the token has locked vesting)migrateToDammV1
lockDammV1LpToken
(if creatorLockedLpPercentage
or partnerLockedLpPercentage
is >0)claimDammV1LpToken
(if creatorLpPercentage
or partnerLpPercentage
is >0)createDammV2MigrationMetadata
createLocker
(if the token has locked vesting)migrateToDammV2
lockedVestingParam
is enabled in the config key.
Function
lockedVesting
is enabled in the config key.leftoverReceiver
that was specified in the config key.migrateToDammV1
.MigrationFeeOption
must be a valid enum value with a valid base fee in basis pointsDAMM_V1_MIGRATION_FEE_ADDRESS[i]
to get the dammConfig key address.creatorLockedLpPercentage
or partnerLockedLpPercentage
is > 0.DAMM_V1_MIGRATION_FEE_ADDRESS[i]
to get the dammConfig key address.creatorLpPercentage
or partnerLpPercentage
is > 0.DAMM_V1_MIGRATION_FEE_ADDRESS[i]
to get the dammConfig key address.migrateToDammV2
.MigrationFeeOption
must be a valid enum value with a valid base fee in basis pointsDAMM_V2_MIGRATION_FEE_ADDRESS[i]
to get the dammConfig key address.creatorTradingFeePercentage
> 0, you can use this function to claim the trading fee for the pool creator.
Function
ClaimCreatorTradingFeeParam
params.receiver
, the receiver is not required to sign the transaction, however, you must provide a tempWSolAcc
if the receiver != creator and if the quote mint is SOL.creatorTradingFeePercentage
> 0, you can use this function to claim the trading fee for the pool creator.
Function
ClaimCreatorTradingFee2Param
params.CreatorWithdrawSurplusParam
params.poolCreator
) in the virtual pool.PoolConfig
object containing the config key details.
Example
VirtualPool
object containing the pool’s details, or null if not found.
Example
VirtualPool
object containing the pool’s details, or null if not found.
Example
BN
object representing the migration quote threshold.
Example
VirtualPoolMetadata
objects containing the pool’s metadata.
Example
PartnerMetadata
objects containing the partner’s metadata.
Example
LockEscrow
object containing the lock escrow details.
Example
BaseFee
object containing the calculated fee scheduler parameters.
Example
totalDuration
is the total duration of the fee scheduler. It must be calculated based on your activationType
. If you use ActivationType.Slot
, the totalDuration
is denominated in terms of 400ms (slot). If you use ActivationType.Timestamp
, the totalDuration
is denominated in terms of 1000ms (timestamp).startingFeeBps
must always be greater than or equal to endingFeeBps
.totalDuration
must always be greater than or equal to numberOfPeriod
.BaseFee
object containing the calculated rate limiter parameters.
Example
maxLimiterDuration
is the max duration of the rate limiter. It must be calculated based on your activationType
. If you use ActivationType.Slot
, the maxLimiterDuration
is denominated in terms of 400ms (slot). If you use ActivationType.Timestamp
, the maxLimiterDuration
is denominated in terms of 1000ms (timestamp).referenceAmount
must always be greater than 0. This parameter takes into account the quoteMint decimals. For example, if you use TokenDecimal.NINE
, the referenceAmount
must be 1 (1 SOL).maxLimiterDuration
must always be greater than 0.tokenQuoteDecimal
must always be greater than 0.activationType
must always be greater than 0.baseFeeBps
must always be greater than 0.DynamicFeeParams
object containing the calculated dynamic fee parameters.
Example
LockedVestingParams
object containing the calculated locked vesting parameters.
Example
totalVestingDuration
is the total duration of the vesting. It must be calculated in terms of seconds => 1000ms (timestamp).BN
object containing the calculated quote reserve.
Example
nextSqrtPrice
is the next sqrt price that you can fetch from swap cpi logs.config
is the pool config that the token pool used to launch.