@meteora-ag/dynamic-bonding-curve-sdk 1.4.8 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -5560,11 +5560,21 @@ type BuildCurveWithTwoSegmentsParams = BuildCurveBaseParams & {
5560
5560
  migrationMarketCap: number;
5561
5561
  percentageSupplyOnMigration: number;
5562
5562
  };
5563
+ type BuildCurveWithMidPriceParams = BuildCurveBaseParams & {
5564
+ initialMarketCap: number;
5565
+ migrationMarketCap: number;
5566
+ midPrice: number;
5567
+ percentageSupplyOnMigration: number;
5568
+ };
5563
5569
  type BuildCurveWithLiquidityWeightsParams = BuildCurveBaseParams & {
5564
5570
  initialMarketCap: number;
5565
5571
  migrationMarketCap: number;
5566
5572
  liquidityWeights: number[];
5567
5573
  };
5574
+ type BuildCurveWithCustomSqrtPricesParams = BuildCurveBaseParams & {
5575
+ sqrtPrices: BN[];
5576
+ liquidityWeights?: number[];
5577
+ };
5568
5578
  type InitializePoolBaseParams = {
5569
5579
  name: string;
5570
5580
  symbol: string;
@@ -6572,6 +6582,12 @@ declare function getPriceFromSqrtPrice(sqrtPrice: BN$1, tokenBaseDecimal: TokenD
6572
6582
  * price = (sqrtPrice >> 64)^2 * 10^(tokenADecimal - tokenBDecimal)
6573
6583
  */
6574
6584
  declare const getSqrtPriceFromPrice: (price: string, tokenADecimal: number, tokenBDecimal: number) => BN$1;
6585
+ /**
6586
+ * Create the sqrt prices from the prices
6587
+ * @param prices - The prices
6588
+ * @returns The sqrt prices
6589
+ */
6590
+ declare const createSqrtPrices: (prices: number[], tokenBaseDecimal: TokenDecimal, tokenQuoteDecimal: TokenDecimal) => BN$1[];
6575
6591
  /**
6576
6592
  * Get the sqrt price from the market cap
6577
6593
  * @param marketCap - The market cap
@@ -6662,6 +6678,19 @@ declare const getTotalSupplyFromCurve: (migrationQuoteThreshold: BN$1, sqrtStart
6662
6678
  * @returns The migration threshold price
6663
6679
  */
6664
6680
  declare const getMigrationThresholdPrice: (migrationThreshold: BN$1, sqrtStartPrice: BN$1, curve: Array<LiquidityDistributionParameters>) => BN$1;
6681
+ /**
6682
+ * Calculate the quote amount allocated to each curve segment
6683
+ * Formula: Δb = L * (√P_upper - √P_lower) for each segment
6684
+ * @param migrationQuoteThreshold - The total migration quote threshold
6685
+ * @param sqrtStartPrice - The start sqrt price
6686
+ * @param curve - The curve segments with sqrtPrice and liquidity
6687
+ * @returns Array of quote amounts for each segment and the final sqrt price reached
6688
+ */
6689
+ declare const getCurveBreakdown: (migrationQuoteThreshold: BN$1, sqrtStartPrice: BN$1, curve: Array<LiquidityDistributionParameters>) => {
6690
+ segmentAmounts: BN$1[];
6691
+ finalSqrtPrice: BN$1;
6692
+ totalAmount: BN$1;
6693
+ };
6665
6694
  /**
6666
6695
  * Get the swap amount with buffer
6667
6696
  * @param swapBaseAmount - The swap base amount
@@ -6680,6 +6709,22 @@ declare const getSwapAmountWithBuffer: (swapBaseAmount: BN$1, sqrtStartPrice: BN
6680
6709
  * @returns The percentage of supply for initial liquidity
6681
6710
  */
6682
6711
  declare const getPercentageSupplyOnMigration: (initialMarketCap: Decimal, migrationMarketCap: Decimal, lockedVesting: LockedVestingParameters, totalLeftover: BN$1, totalTokenSupply: BN$1) => number;
6712
+ /**
6713
+ * Calculate the adjusted percentageSupplyOnMigration that accounts for migrationFee
6714
+ *
6715
+ * Formula:
6716
+ * - D = desiredMarketCap
6717
+ * - M = migrationMarketCap
6718
+ * - f = migrationFee
6719
+ * - V = vesting percentage
6720
+ * - L = leftover percentage
6721
+ *
6722
+ * requiredRatio = sqrt(D / M)
6723
+ * percentageSupplyOnMigration = (requiredRatio * (1 - f) * (100 - V - L)) / (1 + requiredRatio * (1 - f))
6724
+ */
6725
+ declare function calculateAdjustedPercentageSupplyOnMigration(initialMarketCap: number, migrationMarketCap: number, migrationFee: {
6726
+ feePercentage: number;
6727
+ }, lockedVesting: LockedVestingParameters, totalLeftover: BN$1, totalTokenSupply: BN$1): number;
6683
6728
  /**
6684
6729
  * Get the migration quote amount
6685
6730
  * @param migrationMarketCap - The migration market cap
@@ -7244,12 +7289,44 @@ declare function buildCurveWithMarketCap(buildCurveWithMarketCapParam: BuildCurv
7244
7289
  * @returns The build custom constant product curve by market cap
7245
7290
  */
7246
7291
  declare function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam: BuildCurveWithTwoSegmentsParams): ConfigParameters;
7292
+ /**
7293
+ * Build a custom constant product curve with a mid price. This will create a two segment curve with a start price -> mid price, and a mid price -> migration price.
7294
+ * @param buildCurveWithMidPriceParam - The parameters for the custom constant product curve with a mid price
7295
+ * @returns The build custom constant product curve by mid price
7296
+ */
7297
+ declare function buildCurveWithMidPrice(buildCurveWithMidPriceParam: BuildCurveWithMidPriceParams): ConfigParameters;
7247
7298
  /**
7248
7299
  * Build a custom curve graph with liquidity weights, changing the curve shape based on the liquidity weights
7249
7300
  * @param buildCurveWithLiquidityWeightsParam - The parameters for the custom constant product curve with liquidity weights
7250
7301
  * @returns The build custom constant product curve with liquidity weights
7251
7302
  */
7252
7303
  declare function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam: BuildCurveWithLiquidityWeightsParams): ConfigParameters;
7304
+ /**
7305
+ * Build a custom curve with custom sqrt prices instead of liquidity weights.
7306
+ * This allows you to specify exactly what price points you want in your curve.
7307
+ *
7308
+ * @param buildCurveWithCustomSqrtPricesParam - The parameters for the custom curve with sqrt prices
7309
+ * @returns The build custom constant product curve with custom sqrt prices
7310
+ *
7311
+ * @remarks
7312
+ * The sqrtPrices array must:
7313
+ * - Be in ascending order
7314
+ * - Have at least 2 elements (start and end price)
7315
+ * - The first price will be the starting price (pMin)
7316
+ * - The last price will be the migration price (pMax)
7317
+ *
7318
+ * The liquidityWeights array (if provided):
7319
+ * - Must have length = sqrtPrices.length - 1
7320
+ * - Each weight determines how much liquidity is allocated to that price segment
7321
+ * - If not provided, liquidity is distributed evenly across all segments
7322
+ *
7323
+ * Example:
7324
+ * sqrtPrices = [p0, p1, p2, p3] creates 3 segments:
7325
+ * - Segment 0: p0 to p1 with weight[0]
7326
+ * - Segment 1: p1 to p2 with weight[1]
7327
+ * - Segment 2: p2 to p3 with weight[2]
7328
+ */
7329
+ declare function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam: BuildCurveWithCustomSqrtPricesParams): ConfigParameters;
7253
7330
 
7254
7331
  /**
7255
7332
  * Program IDL in camelCase format in order to be used in JS/TS.
@@ -21662,4 +21739,4 @@ var idl = {
21662
21739
  types: types
21663
21740
  };
21664
21741
 
21665
- export { ActivationType, BASE_ADDRESS, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeConfig, type BaseFeeHandler, BaseFeeMode, type BaseFeeParams, type BuildCurveBaseParams, type BuildCurveParams, type BuildCurveWithLiquidityWeightsParams, type BuildCurveWithMarketCapParams, type BuildCurveWithTwoSegmentsParams, type ClaimCreatorTradingFee2Params, type ClaimCreatorTradingFeeParams, type ClaimCreatorTradingFeeWithQuoteMintNotSolParams, type ClaimCreatorTradingFeeWithQuoteMintSolParams, type ClaimPartnerTradingFeeWithQuoteMintNotSolParams, type ClaimPartnerTradingFeeWithQuoteMintSolParams, type ClaimTradingFee2Params, type ClaimTradingFeeParams, CollectFeeMode, type ConfigParameters, type CreateConfigAccounts, type CreateConfigAndPoolParams, type CreateConfigAndPoolWithFirstBuyParams, type CreateConfigParams, type CreateDammV1MigrationMetadataParams, type CreateLockerParams, type CreatePartnerMetadataParameters, type CreatePartnerMetadataParams, type CreatePoolParams, type CreatePoolWithFirstBuyParams, type CreatePoolWithPartnerAndCreatorFirstBuyParams, type CreateVirtualPoolMetadataParams, type CreatorFirstBuyParams, CreatorService, type CreatorWithdrawSurplusParams, DAMM_V1_MIGRATION_FEE_ADDRESS, DAMM_V1_PROGRAM_ID, DAMM_V2_MIGRATION_FEE_ADDRESS, DAMM_V2_PROGRAM_ID, DYNAMIC_BONDING_CURVE_PROGRAM_ID, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DammLpTokenParams, DammV2DynamicFeeMode, DynamicBondingCurveClient, idl as DynamicBondingCurveIdl, DynamicBondingCurveProgram, type DynamicBondingCurve as DynamicBondingCurveTypes, type DynamicCurveProgram, type DynamicFeeConfig, type DynamicFeeParameters, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, type FeeResult, FeeScheduler, type FeeSchedulerParams, type FirstBuyParams, type InitializePoolBaseParams, type InitializePoolParameters, LOCKER_PROGRAM_ID, type LiquidityDistributionParameters, type LockEscrow, type LockedVestingParameters, type LockedVestingParams, MAX_CREATOR_MIGRATION_FEE_PERCENTAGE, MAX_CURVE_POINT, MAX_DYNAMIC_FEE_PERCENTAGE, MAX_FEE_BPS, MAX_FEE_NUMERATOR, MAX_MIGRATED_POOL_FEE_BPS, MAX_MIGRATION_FEE_PERCENTAGE, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, METAPLEX_PROGRAM_ID, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_MIGRATED_POOL_FEE_BPS, MIN_SQRT_PRICE, type MeteoraDammMigrationMetadata, type MigrateToDammV1Params, type MigrateToDammV2Params, type MigrateToDammV2Response, type MigratedPoolFee, MigrationFeeOption, MigrationOption, MigrationService, OFFSET, ONE_Q64, PARTNER_SURPLUS_SHARE, type PartnerFirstBuyParams, type PartnerMetadata, PartnerService, type PartnerWithdrawSurplusParams, type PoolConfig, type PoolFeeParameters, type PoolFees, type PoolFeesConfig, PoolService, type PreCreatePoolParams, type PrepareSwapParams, RESOLUTION, type RateLimiterParams, Rounding, SLOT_DURATION, SWAP_BUFFER_PERCENTAGE, SafeMath, StateService, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapQuote2Params, type SwapQuote2Result, type SwapQuoteParams, type SwapQuoteResult, type SwapResult, type SwapResult2, TIMESTAMP_DURATION, TokenDecimal, TokenType, TokenUpdateAuthorityOption, TradeDirection, type TransferPoolCreatorParams, U128_MAX, U16_MAX, U64_MAX, VAULT_PROGRAM_ID, type VirtualPool, type VirtualPoolMetadata, type VolatilityTracker, type WithdrawLeftoverParams, type WithdrawMigrationFeeParams, bpsToFeeNumerator, buildCurve, buildCurveWithLiquidityWeights, buildCurveWithMarketCap, buildCurveWithTwoSegments, calculateBaseToQuoteFromAmountIn, calculateBaseToQuoteFromAmountOut, calculateFeeSchedulerEndingBaseFeeBps, calculateQuoteToBaseFromAmountIn, calculateQuoteToBaseFromAmountOut, checkRateLimiterApplied, cleanUpTokenAccountTx, convertDecimalToBN, convertToLamports, createDammV1Program, createDammV2Program, createDbcProgram, createInitializePermissionlessDynamicVaultIx, createLockEscrowIx, createProgramAccountFilter, createVaultProgram, deriveBaseKeyForLocker, deriveDammV1EventAuthority, deriveDammV1LockEscrowAddress, deriveDammV1LpMintAddress, deriveDammV1MigrationMetadataAddress, deriveDammV1PoolAddress, deriveDammV1PoolAuthority, deriveDammV1ProtocolFeeAddress, deriveDammV1VaultLPAddress, deriveDammV2EventAuthority, deriveDammV2LockEscrowAddress, deriveDammV2MigrationMetadataAddress, deriveDammV2PoolAddress, deriveDammV2PoolAuthority, deriveDammV2TokenVaultAddress, deriveDbcEventAuthority, deriveDbcPoolAddress, deriveDbcPoolAuthority, deriveDbcPoolMetadata, deriveDbcTokenVaultAddress, deriveEscrow, deriveLockerEventAuthority, deriveMintMetadata, derivePartnerMetadata, derivePositionAddress, derivePositionNftAccount, deriveTokenVaultKey, deriveVaultAddress, deriveVaultLpMintAddress, deriveVaultPdas, feeNumeratorToBps, findAssociatedTokenAddress, fromDecimalToBN, getAccountCreationTimestamp, getAccountCreationTimestamps, getAccountData, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getBaseTokenForSwap, getCheckedAmounts, getCurrentPoint, getDeltaAmountBaseUnsigned, getDeltaAmountBaseUnsigned256, getDeltaAmountBaseUnsignedUnchecked, getDeltaAmountQuoteUnsigned, getDeltaAmountQuoteUnsigned256, getDeltaAmountQuoteUnsignedUnchecked, getDynamicFeeParams, getExcludedFeeAmount, getFeeMode, getFeeNumeratorFromExcludedAmount, getFeeNumeratorFromIncludedAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstCurve, getFirstKey, getIncludedFeeAmount, getInitialLiquidityFromDeltaBase, getInitialLiquidityFromDeltaQuote, getLiquidity, getLockedVestingParams, getMaxBaseFeeNumerator, getMaxIndex, getMaxOutAmountWithMinBaseFee, getMigratedPoolFeeParams, getMigrationBaseToken, getMigrationQuoteAmount, getMigrationQuoteAmountFromMigrationQuoteThreshold, getMigrationQuoteThresholdFromMigrationQuoteAmount, getMigrationThresholdPrice, getMinBaseFeeNumerator, getNextSqrtPriceFromBaseAmountInRoundingUp, getNextSqrtPriceFromBaseAmountOutRoundingUp, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getNextSqrtPriceFromQuoteAmountInRoundingDown, getNextSqrtPriceFromQuoteAmountOutRoundingDown, getOrCreateATAInstruction, getPercentageSupplyOnMigration, getPriceFromSqrtPrice, getQuoteReserveFromNextSqrtPrice, getRateLimiterExcludedFeeAmount, getRateLimiterParams, getSecondKey, getSqrtPriceFromMarketCap, getSqrtPriceFromPrice, getSwapAmountWithBuffer, getSwapResult, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTokenType, getTokenomics, getTotalFeeNumerator, getTotalFeeNumeratorFromExcludedFeeAmount, getTotalFeeNumeratorFromIncludedFeeAmount, getTotalSupplyFromCurve, getTotalTokenSupply, getTotalVestingAmount, getTwoCurve, getVariableFeeNumerator, isDefaultLockedVesting, isDynamicFeeEnabled, isNativeSol, isNonZeroRateLimiter, isRateLimiterApplied, isZeroRateLimiter, mulDiv, mulShr, pow, prepareSwapAmountParam, prepareTokenAccountTx, splitFees, sqrt, swapQuote, swapQuoteExactIn, swapQuoteExactOut, swapQuotePartialFill, toNumerator, unwrapSOLInstruction, validateActivationType, validateBalance, validateBaseTokenType, validateCollectFeeMode, validateConfigParameters, validateCurve, validateFeeRateLimiter, validateFeeScheduler, validateLPPercentages, validateMigratedPoolFee, validateMigrationAndTokenType, validateMigrationFee, validateMigrationFeeOption, validatePoolFees, validateSwapAmount, validateTokenDecimals, validateTokenSupply, validateTokenUpdateAuthorityOptions, wrapSOLInstruction };
21742
+ export { ActivationType, BASE_ADDRESS, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeConfig, type BaseFeeHandler, BaseFeeMode, type BaseFeeParams, type BuildCurveBaseParams, type BuildCurveParams, type BuildCurveWithCustomSqrtPricesParams, type BuildCurveWithLiquidityWeightsParams, type BuildCurveWithMarketCapParams, type BuildCurveWithMidPriceParams, type BuildCurveWithTwoSegmentsParams, type ClaimCreatorTradingFee2Params, type ClaimCreatorTradingFeeParams, type ClaimCreatorTradingFeeWithQuoteMintNotSolParams, type ClaimCreatorTradingFeeWithQuoteMintSolParams, type ClaimPartnerTradingFeeWithQuoteMintNotSolParams, type ClaimPartnerTradingFeeWithQuoteMintSolParams, type ClaimTradingFee2Params, type ClaimTradingFeeParams, CollectFeeMode, type ConfigParameters, type CreateConfigAccounts, type CreateConfigAndPoolParams, type CreateConfigAndPoolWithFirstBuyParams, type CreateConfigParams, type CreateDammV1MigrationMetadataParams, type CreateLockerParams, type CreatePartnerMetadataParameters, type CreatePartnerMetadataParams, type CreatePoolParams, type CreatePoolWithFirstBuyParams, type CreatePoolWithPartnerAndCreatorFirstBuyParams, type CreateVirtualPoolMetadataParams, type CreatorFirstBuyParams, CreatorService, type CreatorWithdrawSurplusParams, DAMM_V1_MIGRATION_FEE_ADDRESS, DAMM_V1_PROGRAM_ID, DAMM_V2_MIGRATION_FEE_ADDRESS, DAMM_V2_PROGRAM_ID, DYNAMIC_BONDING_CURVE_PROGRAM_ID, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DammLpTokenParams, DammV2DynamicFeeMode, DynamicBondingCurveClient, idl as DynamicBondingCurveIdl, DynamicBondingCurveProgram, type DynamicBondingCurve as DynamicBondingCurveTypes, type DynamicCurveProgram, type DynamicFeeConfig, type DynamicFeeParameters, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, type FeeResult, FeeScheduler, type FeeSchedulerParams, type FirstBuyParams, type InitializePoolBaseParams, type InitializePoolParameters, LOCKER_PROGRAM_ID, type LiquidityDistributionParameters, type LockEscrow, type LockedVestingParameters, type LockedVestingParams, MAX_CREATOR_MIGRATION_FEE_PERCENTAGE, MAX_CURVE_POINT, MAX_DYNAMIC_FEE_PERCENTAGE, MAX_FEE_BPS, MAX_FEE_NUMERATOR, MAX_MIGRATED_POOL_FEE_BPS, MAX_MIGRATION_FEE_PERCENTAGE, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, METAPLEX_PROGRAM_ID, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_MIGRATED_POOL_FEE_BPS, MIN_SQRT_PRICE, type MeteoraDammMigrationMetadata, type MigrateToDammV1Params, type MigrateToDammV2Params, type MigrateToDammV2Response, type MigratedPoolFee, MigrationFeeOption, MigrationOption, MigrationService, OFFSET, ONE_Q64, PARTNER_SURPLUS_SHARE, type PartnerFirstBuyParams, type PartnerMetadata, PartnerService, type PartnerWithdrawSurplusParams, type PoolConfig, type PoolFeeParameters, type PoolFees, type PoolFeesConfig, PoolService, type PreCreatePoolParams, type PrepareSwapParams, RESOLUTION, type RateLimiterParams, Rounding, SLOT_DURATION, SWAP_BUFFER_PERCENTAGE, SafeMath, StateService, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapQuote2Params, type SwapQuote2Result, type SwapQuoteParams, type SwapQuoteResult, type SwapResult, type SwapResult2, TIMESTAMP_DURATION, TokenDecimal, TokenType, TokenUpdateAuthorityOption, TradeDirection, type TransferPoolCreatorParams, U128_MAX, U16_MAX, U64_MAX, VAULT_PROGRAM_ID, type VirtualPool, type VirtualPoolMetadata, type VolatilityTracker, type WithdrawLeftoverParams, type WithdrawMigrationFeeParams, bpsToFeeNumerator, buildCurve, buildCurveWithCustomSqrtPrices, buildCurveWithLiquidityWeights, buildCurveWithMarketCap, buildCurveWithMidPrice, buildCurveWithTwoSegments, calculateAdjustedPercentageSupplyOnMigration, calculateBaseToQuoteFromAmountIn, calculateBaseToQuoteFromAmountOut, calculateFeeSchedulerEndingBaseFeeBps, calculateQuoteToBaseFromAmountIn, calculateQuoteToBaseFromAmountOut, checkRateLimiterApplied, cleanUpTokenAccountTx, convertDecimalToBN, convertToLamports, createDammV1Program, createDammV2Program, createDbcProgram, createInitializePermissionlessDynamicVaultIx, createLockEscrowIx, createProgramAccountFilter, createSqrtPrices, createVaultProgram, deriveBaseKeyForLocker, deriveDammV1EventAuthority, deriveDammV1LockEscrowAddress, deriveDammV1LpMintAddress, deriveDammV1MigrationMetadataAddress, deriveDammV1PoolAddress, deriveDammV1PoolAuthority, deriveDammV1ProtocolFeeAddress, deriveDammV1VaultLPAddress, deriveDammV2EventAuthority, deriveDammV2LockEscrowAddress, deriveDammV2MigrationMetadataAddress, deriveDammV2PoolAddress, deriveDammV2PoolAuthority, deriveDammV2TokenVaultAddress, deriveDbcEventAuthority, deriveDbcPoolAddress, deriveDbcPoolAuthority, deriveDbcPoolMetadata, deriveDbcTokenVaultAddress, deriveEscrow, deriveLockerEventAuthority, deriveMintMetadata, derivePartnerMetadata, derivePositionAddress, derivePositionNftAccount, deriveTokenVaultKey, deriveVaultAddress, deriveVaultLpMintAddress, deriveVaultPdas, feeNumeratorToBps, findAssociatedTokenAddress, fromDecimalToBN, getAccountCreationTimestamp, getAccountCreationTimestamps, getAccountData, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getBaseTokenForSwap, getCheckedAmounts, getCurrentPoint, getCurveBreakdown, getDeltaAmountBaseUnsigned, getDeltaAmountBaseUnsigned256, getDeltaAmountBaseUnsignedUnchecked, getDeltaAmountQuoteUnsigned, getDeltaAmountQuoteUnsigned256, getDeltaAmountQuoteUnsignedUnchecked, getDynamicFeeParams, getExcludedFeeAmount, getFeeMode, getFeeNumeratorFromExcludedAmount, getFeeNumeratorFromIncludedAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstCurve, getFirstKey, getIncludedFeeAmount, getInitialLiquidityFromDeltaBase, getInitialLiquidityFromDeltaQuote, getLiquidity, getLockedVestingParams, getMaxBaseFeeNumerator, getMaxIndex, getMaxOutAmountWithMinBaseFee, getMigratedPoolFeeParams, getMigrationBaseToken, getMigrationQuoteAmount, getMigrationQuoteAmountFromMigrationQuoteThreshold, getMigrationQuoteThresholdFromMigrationQuoteAmount, getMigrationThresholdPrice, getMinBaseFeeNumerator, getNextSqrtPriceFromBaseAmountInRoundingUp, getNextSqrtPriceFromBaseAmountOutRoundingUp, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getNextSqrtPriceFromQuoteAmountInRoundingDown, getNextSqrtPriceFromQuoteAmountOutRoundingDown, getOrCreateATAInstruction, getPercentageSupplyOnMigration, getPriceFromSqrtPrice, getQuoteReserveFromNextSqrtPrice, getRateLimiterExcludedFeeAmount, getRateLimiterParams, getSecondKey, getSqrtPriceFromMarketCap, getSqrtPriceFromPrice, getSwapAmountWithBuffer, getSwapResult, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTokenType, getTokenomics, getTotalFeeNumerator, getTotalFeeNumeratorFromExcludedFeeAmount, getTotalFeeNumeratorFromIncludedFeeAmount, getTotalSupplyFromCurve, getTotalTokenSupply, getTotalVestingAmount, getTwoCurve, getVariableFeeNumerator, isDefaultLockedVesting, isDynamicFeeEnabled, isNativeSol, isNonZeroRateLimiter, isRateLimiterApplied, isZeroRateLimiter, mulDiv, mulShr, pow, prepareSwapAmountParam, prepareTokenAccountTx, splitFees, sqrt, swapQuote, swapQuoteExactIn, swapQuoteExactOut, swapQuotePartialFill, toNumerator, unwrapSOLInstruction, validateActivationType, validateBalance, validateBaseTokenType, validateCollectFeeMode, validateConfigParameters, validateCurve, validateFeeRateLimiter, validateFeeScheduler, validateLPPercentages, validateMigratedPoolFee, validateMigrationAndTokenType, validateMigrationFee, validateMigrationFeeOption, validatePoolFees, validateSwapAmount, validateTokenDecimals, validateTokenSupply, validateTokenUpdateAuthorityOptions, wrapSOLInstruction };
package/dist/index.d.ts CHANGED
@@ -5560,11 +5560,21 @@ type BuildCurveWithTwoSegmentsParams = BuildCurveBaseParams & {
5560
5560
  migrationMarketCap: number;
5561
5561
  percentageSupplyOnMigration: number;
5562
5562
  };
5563
+ type BuildCurveWithMidPriceParams = BuildCurveBaseParams & {
5564
+ initialMarketCap: number;
5565
+ migrationMarketCap: number;
5566
+ midPrice: number;
5567
+ percentageSupplyOnMigration: number;
5568
+ };
5563
5569
  type BuildCurveWithLiquidityWeightsParams = BuildCurveBaseParams & {
5564
5570
  initialMarketCap: number;
5565
5571
  migrationMarketCap: number;
5566
5572
  liquidityWeights: number[];
5567
5573
  };
5574
+ type BuildCurveWithCustomSqrtPricesParams = BuildCurveBaseParams & {
5575
+ sqrtPrices: BN[];
5576
+ liquidityWeights?: number[];
5577
+ };
5568
5578
  type InitializePoolBaseParams = {
5569
5579
  name: string;
5570
5580
  symbol: string;
@@ -6572,6 +6582,12 @@ declare function getPriceFromSqrtPrice(sqrtPrice: BN$1, tokenBaseDecimal: TokenD
6572
6582
  * price = (sqrtPrice >> 64)^2 * 10^(tokenADecimal - tokenBDecimal)
6573
6583
  */
6574
6584
  declare const getSqrtPriceFromPrice: (price: string, tokenADecimal: number, tokenBDecimal: number) => BN$1;
6585
+ /**
6586
+ * Create the sqrt prices from the prices
6587
+ * @param prices - The prices
6588
+ * @returns The sqrt prices
6589
+ */
6590
+ declare const createSqrtPrices: (prices: number[], tokenBaseDecimal: TokenDecimal, tokenQuoteDecimal: TokenDecimal) => BN$1[];
6575
6591
  /**
6576
6592
  * Get the sqrt price from the market cap
6577
6593
  * @param marketCap - The market cap
@@ -6662,6 +6678,19 @@ declare const getTotalSupplyFromCurve: (migrationQuoteThreshold: BN$1, sqrtStart
6662
6678
  * @returns The migration threshold price
6663
6679
  */
6664
6680
  declare const getMigrationThresholdPrice: (migrationThreshold: BN$1, sqrtStartPrice: BN$1, curve: Array<LiquidityDistributionParameters>) => BN$1;
6681
+ /**
6682
+ * Calculate the quote amount allocated to each curve segment
6683
+ * Formula: Δb = L * (√P_upper - √P_lower) for each segment
6684
+ * @param migrationQuoteThreshold - The total migration quote threshold
6685
+ * @param sqrtStartPrice - The start sqrt price
6686
+ * @param curve - The curve segments with sqrtPrice and liquidity
6687
+ * @returns Array of quote amounts for each segment and the final sqrt price reached
6688
+ */
6689
+ declare const getCurveBreakdown: (migrationQuoteThreshold: BN$1, sqrtStartPrice: BN$1, curve: Array<LiquidityDistributionParameters>) => {
6690
+ segmentAmounts: BN$1[];
6691
+ finalSqrtPrice: BN$1;
6692
+ totalAmount: BN$1;
6693
+ };
6665
6694
  /**
6666
6695
  * Get the swap amount with buffer
6667
6696
  * @param swapBaseAmount - The swap base amount
@@ -6680,6 +6709,22 @@ declare const getSwapAmountWithBuffer: (swapBaseAmount: BN$1, sqrtStartPrice: BN
6680
6709
  * @returns The percentage of supply for initial liquidity
6681
6710
  */
6682
6711
  declare const getPercentageSupplyOnMigration: (initialMarketCap: Decimal, migrationMarketCap: Decimal, lockedVesting: LockedVestingParameters, totalLeftover: BN$1, totalTokenSupply: BN$1) => number;
6712
+ /**
6713
+ * Calculate the adjusted percentageSupplyOnMigration that accounts for migrationFee
6714
+ *
6715
+ * Formula:
6716
+ * - D = desiredMarketCap
6717
+ * - M = migrationMarketCap
6718
+ * - f = migrationFee
6719
+ * - V = vesting percentage
6720
+ * - L = leftover percentage
6721
+ *
6722
+ * requiredRatio = sqrt(D / M)
6723
+ * percentageSupplyOnMigration = (requiredRatio * (1 - f) * (100 - V - L)) / (1 + requiredRatio * (1 - f))
6724
+ */
6725
+ declare function calculateAdjustedPercentageSupplyOnMigration(initialMarketCap: number, migrationMarketCap: number, migrationFee: {
6726
+ feePercentage: number;
6727
+ }, lockedVesting: LockedVestingParameters, totalLeftover: BN$1, totalTokenSupply: BN$1): number;
6683
6728
  /**
6684
6729
  * Get the migration quote amount
6685
6730
  * @param migrationMarketCap - The migration market cap
@@ -7244,12 +7289,44 @@ declare function buildCurveWithMarketCap(buildCurveWithMarketCapParam: BuildCurv
7244
7289
  * @returns The build custom constant product curve by market cap
7245
7290
  */
7246
7291
  declare function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam: BuildCurveWithTwoSegmentsParams): ConfigParameters;
7292
+ /**
7293
+ * Build a custom constant product curve with a mid price. This will create a two segment curve with a start price -> mid price, and a mid price -> migration price.
7294
+ * @param buildCurveWithMidPriceParam - The parameters for the custom constant product curve with a mid price
7295
+ * @returns The build custom constant product curve by mid price
7296
+ */
7297
+ declare function buildCurveWithMidPrice(buildCurveWithMidPriceParam: BuildCurveWithMidPriceParams): ConfigParameters;
7247
7298
  /**
7248
7299
  * Build a custom curve graph with liquidity weights, changing the curve shape based on the liquidity weights
7249
7300
  * @param buildCurveWithLiquidityWeightsParam - The parameters for the custom constant product curve with liquidity weights
7250
7301
  * @returns The build custom constant product curve with liquidity weights
7251
7302
  */
7252
7303
  declare function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam: BuildCurveWithLiquidityWeightsParams): ConfigParameters;
7304
+ /**
7305
+ * Build a custom curve with custom sqrt prices instead of liquidity weights.
7306
+ * This allows you to specify exactly what price points you want in your curve.
7307
+ *
7308
+ * @param buildCurveWithCustomSqrtPricesParam - The parameters for the custom curve with sqrt prices
7309
+ * @returns The build custom constant product curve with custom sqrt prices
7310
+ *
7311
+ * @remarks
7312
+ * The sqrtPrices array must:
7313
+ * - Be in ascending order
7314
+ * - Have at least 2 elements (start and end price)
7315
+ * - The first price will be the starting price (pMin)
7316
+ * - The last price will be the migration price (pMax)
7317
+ *
7318
+ * The liquidityWeights array (if provided):
7319
+ * - Must have length = sqrtPrices.length - 1
7320
+ * - Each weight determines how much liquidity is allocated to that price segment
7321
+ * - If not provided, liquidity is distributed evenly across all segments
7322
+ *
7323
+ * Example:
7324
+ * sqrtPrices = [p0, p1, p2, p3] creates 3 segments:
7325
+ * - Segment 0: p0 to p1 with weight[0]
7326
+ * - Segment 1: p1 to p2 with weight[1]
7327
+ * - Segment 2: p2 to p3 with weight[2]
7328
+ */
7329
+ declare function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam: BuildCurveWithCustomSqrtPricesParams): ConfigParameters;
7253
7330
 
7254
7331
  /**
7255
7332
  * Program IDL in camelCase format in order to be used in JS/TS.
@@ -21662,4 +21739,4 @@ var idl = {
21662
21739
  types: types
21663
21740
  };
21664
21741
 
21665
- export { ActivationType, BASE_ADDRESS, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeConfig, type BaseFeeHandler, BaseFeeMode, type BaseFeeParams, type BuildCurveBaseParams, type BuildCurveParams, type BuildCurveWithLiquidityWeightsParams, type BuildCurveWithMarketCapParams, type BuildCurveWithTwoSegmentsParams, type ClaimCreatorTradingFee2Params, type ClaimCreatorTradingFeeParams, type ClaimCreatorTradingFeeWithQuoteMintNotSolParams, type ClaimCreatorTradingFeeWithQuoteMintSolParams, type ClaimPartnerTradingFeeWithQuoteMintNotSolParams, type ClaimPartnerTradingFeeWithQuoteMintSolParams, type ClaimTradingFee2Params, type ClaimTradingFeeParams, CollectFeeMode, type ConfigParameters, type CreateConfigAccounts, type CreateConfigAndPoolParams, type CreateConfigAndPoolWithFirstBuyParams, type CreateConfigParams, type CreateDammV1MigrationMetadataParams, type CreateLockerParams, type CreatePartnerMetadataParameters, type CreatePartnerMetadataParams, type CreatePoolParams, type CreatePoolWithFirstBuyParams, type CreatePoolWithPartnerAndCreatorFirstBuyParams, type CreateVirtualPoolMetadataParams, type CreatorFirstBuyParams, CreatorService, type CreatorWithdrawSurplusParams, DAMM_V1_MIGRATION_FEE_ADDRESS, DAMM_V1_PROGRAM_ID, DAMM_V2_MIGRATION_FEE_ADDRESS, DAMM_V2_PROGRAM_ID, DYNAMIC_BONDING_CURVE_PROGRAM_ID, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DammLpTokenParams, DammV2DynamicFeeMode, DynamicBondingCurveClient, idl as DynamicBondingCurveIdl, DynamicBondingCurveProgram, type DynamicBondingCurve as DynamicBondingCurveTypes, type DynamicCurveProgram, type DynamicFeeConfig, type DynamicFeeParameters, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, type FeeResult, FeeScheduler, type FeeSchedulerParams, type FirstBuyParams, type InitializePoolBaseParams, type InitializePoolParameters, LOCKER_PROGRAM_ID, type LiquidityDistributionParameters, type LockEscrow, type LockedVestingParameters, type LockedVestingParams, MAX_CREATOR_MIGRATION_FEE_PERCENTAGE, MAX_CURVE_POINT, MAX_DYNAMIC_FEE_PERCENTAGE, MAX_FEE_BPS, MAX_FEE_NUMERATOR, MAX_MIGRATED_POOL_FEE_BPS, MAX_MIGRATION_FEE_PERCENTAGE, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, METAPLEX_PROGRAM_ID, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_MIGRATED_POOL_FEE_BPS, MIN_SQRT_PRICE, type MeteoraDammMigrationMetadata, type MigrateToDammV1Params, type MigrateToDammV2Params, type MigrateToDammV2Response, type MigratedPoolFee, MigrationFeeOption, MigrationOption, MigrationService, OFFSET, ONE_Q64, PARTNER_SURPLUS_SHARE, type PartnerFirstBuyParams, type PartnerMetadata, PartnerService, type PartnerWithdrawSurplusParams, type PoolConfig, type PoolFeeParameters, type PoolFees, type PoolFeesConfig, PoolService, type PreCreatePoolParams, type PrepareSwapParams, RESOLUTION, type RateLimiterParams, Rounding, SLOT_DURATION, SWAP_BUFFER_PERCENTAGE, SafeMath, StateService, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapQuote2Params, type SwapQuote2Result, type SwapQuoteParams, type SwapQuoteResult, type SwapResult, type SwapResult2, TIMESTAMP_DURATION, TokenDecimal, TokenType, TokenUpdateAuthorityOption, TradeDirection, type TransferPoolCreatorParams, U128_MAX, U16_MAX, U64_MAX, VAULT_PROGRAM_ID, type VirtualPool, type VirtualPoolMetadata, type VolatilityTracker, type WithdrawLeftoverParams, type WithdrawMigrationFeeParams, bpsToFeeNumerator, buildCurve, buildCurveWithLiquidityWeights, buildCurveWithMarketCap, buildCurveWithTwoSegments, calculateBaseToQuoteFromAmountIn, calculateBaseToQuoteFromAmountOut, calculateFeeSchedulerEndingBaseFeeBps, calculateQuoteToBaseFromAmountIn, calculateQuoteToBaseFromAmountOut, checkRateLimiterApplied, cleanUpTokenAccountTx, convertDecimalToBN, convertToLamports, createDammV1Program, createDammV2Program, createDbcProgram, createInitializePermissionlessDynamicVaultIx, createLockEscrowIx, createProgramAccountFilter, createVaultProgram, deriveBaseKeyForLocker, deriveDammV1EventAuthority, deriveDammV1LockEscrowAddress, deriveDammV1LpMintAddress, deriveDammV1MigrationMetadataAddress, deriveDammV1PoolAddress, deriveDammV1PoolAuthority, deriveDammV1ProtocolFeeAddress, deriveDammV1VaultLPAddress, deriveDammV2EventAuthority, deriveDammV2LockEscrowAddress, deriveDammV2MigrationMetadataAddress, deriveDammV2PoolAddress, deriveDammV2PoolAuthority, deriveDammV2TokenVaultAddress, deriveDbcEventAuthority, deriveDbcPoolAddress, deriveDbcPoolAuthority, deriveDbcPoolMetadata, deriveDbcTokenVaultAddress, deriveEscrow, deriveLockerEventAuthority, deriveMintMetadata, derivePartnerMetadata, derivePositionAddress, derivePositionNftAccount, deriveTokenVaultKey, deriveVaultAddress, deriveVaultLpMintAddress, deriveVaultPdas, feeNumeratorToBps, findAssociatedTokenAddress, fromDecimalToBN, getAccountCreationTimestamp, getAccountCreationTimestamps, getAccountData, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getBaseTokenForSwap, getCheckedAmounts, getCurrentPoint, getDeltaAmountBaseUnsigned, getDeltaAmountBaseUnsigned256, getDeltaAmountBaseUnsignedUnchecked, getDeltaAmountQuoteUnsigned, getDeltaAmountQuoteUnsigned256, getDeltaAmountQuoteUnsignedUnchecked, getDynamicFeeParams, getExcludedFeeAmount, getFeeMode, getFeeNumeratorFromExcludedAmount, getFeeNumeratorFromIncludedAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstCurve, getFirstKey, getIncludedFeeAmount, getInitialLiquidityFromDeltaBase, getInitialLiquidityFromDeltaQuote, getLiquidity, getLockedVestingParams, getMaxBaseFeeNumerator, getMaxIndex, getMaxOutAmountWithMinBaseFee, getMigratedPoolFeeParams, getMigrationBaseToken, getMigrationQuoteAmount, getMigrationQuoteAmountFromMigrationQuoteThreshold, getMigrationQuoteThresholdFromMigrationQuoteAmount, getMigrationThresholdPrice, getMinBaseFeeNumerator, getNextSqrtPriceFromBaseAmountInRoundingUp, getNextSqrtPriceFromBaseAmountOutRoundingUp, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getNextSqrtPriceFromQuoteAmountInRoundingDown, getNextSqrtPriceFromQuoteAmountOutRoundingDown, getOrCreateATAInstruction, getPercentageSupplyOnMigration, getPriceFromSqrtPrice, getQuoteReserveFromNextSqrtPrice, getRateLimiterExcludedFeeAmount, getRateLimiterParams, getSecondKey, getSqrtPriceFromMarketCap, getSqrtPriceFromPrice, getSwapAmountWithBuffer, getSwapResult, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTokenType, getTokenomics, getTotalFeeNumerator, getTotalFeeNumeratorFromExcludedFeeAmount, getTotalFeeNumeratorFromIncludedFeeAmount, getTotalSupplyFromCurve, getTotalTokenSupply, getTotalVestingAmount, getTwoCurve, getVariableFeeNumerator, isDefaultLockedVesting, isDynamicFeeEnabled, isNativeSol, isNonZeroRateLimiter, isRateLimiterApplied, isZeroRateLimiter, mulDiv, mulShr, pow, prepareSwapAmountParam, prepareTokenAccountTx, splitFees, sqrt, swapQuote, swapQuoteExactIn, swapQuoteExactOut, swapQuotePartialFill, toNumerator, unwrapSOLInstruction, validateActivationType, validateBalance, validateBaseTokenType, validateCollectFeeMode, validateConfigParameters, validateCurve, validateFeeRateLimiter, validateFeeScheduler, validateLPPercentages, validateMigratedPoolFee, validateMigrationAndTokenType, validateMigrationFee, validateMigrationFeeOption, validatePoolFees, validateSwapAmount, validateTokenDecimals, validateTokenSupply, validateTokenUpdateAuthorityOptions, wrapSOLInstruction };
21742
+ export { ActivationType, BASE_ADDRESS, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeConfig, type BaseFeeHandler, BaseFeeMode, type BaseFeeParams, type BuildCurveBaseParams, type BuildCurveParams, type BuildCurveWithCustomSqrtPricesParams, type BuildCurveWithLiquidityWeightsParams, type BuildCurveWithMarketCapParams, type BuildCurveWithMidPriceParams, type BuildCurveWithTwoSegmentsParams, type ClaimCreatorTradingFee2Params, type ClaimCreatorTradingFeeParams, type ClaimCreatorTradingFeeWithQuoteMintNotSolParams, type ClaimCreatorTradingFeeWithQuoteMintSolParams, type ClaimPartnerTradingFeeWithQuoteMintNotSolParams, type ClaimPartnerTradingFeeWithQuoteMintSolParams, type ClaimTradingFee2Params, type ClaimTradingFeeParams, CollectFeeMode, type ConfigParameters, type CreateConfigAccounts, type CreateConfigAndPoolParams, type CreateConfigAndPoolWithFirstBuyParams, type CreateConfigParams, type CreateDammV1MigrationMetadataParams, type CreateLockerParams, type CreatePartnerMetadataParameters, type CreatePartnerMetadataParams, type CreatePoolParams, type CreatePoolWithFirstBuyParams, type CreatePoolWithPartnerAndCreatorFirstBuyParams, type CreateVirtualPoolMetadataParams, type CreatorFirstBuyParams, CreatorService, type CreatorWithdrawSurplusParams, DAMM_V1_MIGRATION_FEE_ADDRESS, DAMM_V1_PROGRAM_ID, DAMM_V2_MIGRATION_FEE_ADDRESS, DAMM_V2_PROGRAM_ID, DYNAMIC_BONDING_CURVE_PROGRAM_ID, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DammLpTokenParams, DammV2DynamicFeeMode, DynamicBondingCurveClient, idl as DynamicBondingCurveIdl, DynamicBondingCurveProgram, type DynamicBondingCurve as DynamicBondingCurveTypes, type DynamicCurveProgram, type DynamicFeeConfig, type DynamicFeeParameters, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, type FeeResult, FeeScheduler, type FeeSchedulerParams, type FirstBuyParams, type InitializePoolBaseParams, type InitializePoolParameters, LOCKER_PROGRAM_ID, type LiquidityDistributionParameters, type LockEscrow, type LockedVestingParameters, type LockedVestingParams, MAX_CREATOR_MIGRATION_FEE_PERCENTAGE, MAX_CURVE_POINT, MAX_DYNAMIC_FEE_PERCENTAGE, MAX_FEE_BPS, MAX_FEE_NUMERATOR, MAX_MIGRATED_POOL_FEE_BPS, MAX_MIGRATION_FEE_PERCENTAGE, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, METAPLEX_PROGRAM_ID, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_MIGRATED_POOL_FEE_BPS, MIN_SQRT_PRICE, type MeteoraDammMigrationMetadata, type MigrateToDammV1Params, type MigrateToDammV2Params, type MigrateToDammV2Response, type MigratedPoolFee, MigrationFeeOption, MigrationOption, MigrationService, OFFSET, ONE_Q64, PARTNER_SURPLUS_SHARE, type PartnerFirstBuyParams, type PartnerMetadata, PartnerService, type PartnerWithdrawSurplusParams, type PoolConfig, type PoolFeeParameters, type PoolFees, type PoolFeesConfig, PoolService, type PreCreatePoolParams, type PrepareSwapParams, RESOLUTION, type RateLimiterParams, Rounding, SLOT_DURATION, SWAP_BUFFER_PERCENTAGE, SafeMath, StateService, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapQuote2Params, type SwapQuote2Result, type SwapQuoteParams, type SwapQuoteResult, type SwapResult, type SwapResult2, TIMESTAMP_DURATION, TokenDecimal, TokenType, TokenUpdateAuthorityOption, TradeDirection, type TransferPoolCreatorParams, U128_MAX, U16_MAX, U64_MAX, VAULT_PROGRAM_ID, type VirtualPool, type VirtualPoolMetadata, type VolatilityTracker, type WithdrawLeftoverParams, type WithdrawMigrationFeeParams, bpsToFeeNumerator, buildCurve, buildCurveWithCustomSqrtPrices, buildCurveWithLiquidityWeights, buildCurveWithMarketCap, buildCurveWithMidPrice, buildCurveWithTwoSegments, calculateAdjustedPercentageSupplyOnMigration, calculateBaseToQuoteFromAmountIn, calculateBaseToQuoteFromAmountOut, calculateFeeSchedulerEndingBaseFeeBps, calculateQuoteToBaseFromAmountIn, calculateQuoteToBaseFromAmountOut, checkRateLimiterApplied, cleanUpTokenAccountTx, convertDecimalToBN, convertToLamports, createDammV1Program, createDammV2Program, createDbcProgram, createInitializePermissionlessDynamicVaultIx, createLockEscrowIx, createProgramAccountFilter, createSqrtPrices, createVaultProgram, deriveBaseKeyForLocker, deriveDammV1EventAuthority, deriveDammV1LockEscrowAddress, deriveDammV1LpMintAddress, deriveDammV1MigrationMetadataAddress, deriveDammV1PoolAddress, deriveDammV1PoolAuthority, deriveDammV1ProtocolFeeAddress, deriveDammV1VaultLPAddress, deriveDammV2EventAuthority, deriveDammV2LockEscrowAddress, deriveDammV2MigrationMetadataAddress, deriveDammV2PoolAddress, deriveDammV2PoolAuthority, deriveDammV2TokenVaultAddress, deriveDbcEventAuthority, deriveDbcPoolAddress, deriveDbcPoolAuthority, deriveDbcPoolMetadata, deriveDbcTokenVaultAddress, deriveEscrow, deriveLockerEventAuthority, deriveMintMetadata, derivePartnerMetadata, derivePositionAddress, derivePositionNftAccount, deriveTokenVaultKey, deriveVaultAddress, deriveVaultLpMintAddress, deriveVaultPdas, feeNumeratorToBps, findAssociatedTokenAddress, fromDecimalToBN, getAccountCreationTimestamp, getAccountCreationTimestamps, getAccountData, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getBaseTokenForSwap, getCheckedAmounts, getCurrentPoint, getCurveBreakdown, getDeltaAmountBaseUnsigned, getDeltaAmountBaseUnsigned256, getDeltaAmountBaseUnsignedUnchecked, getDeltaAmountQuoteUnsigned, getDeltaAmountQuoteUnsigned256, getDeltaAmountQuoteUnsignedUnchecked, getDynamicFeeParams, getExcludedFeeAmount, getFeeMode, getFeeNumeratorFromExcludedAmount, getFeeNumeratorFromIncludedAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstCurve, getFirstKey, getIncludedFeeAmount, getInitialLiquidityFromDeltaBase, getInitialLiquidityFromDeltaQuote, getLiquidity, getLockedVestingParams, getMaxBaseFeeNumerator, getMaxIndex, getMaxOutAmountWithMinBaseFee, getMigratedPoolFeeParams, getMigrationBaseToken, getMigrationQuoteAmount, getMigrationQuoteAmountFromMigrationQuoteThreshold, getMigrationQuoteThresholdFromMigrationQuoteAmount, getMigrationThresholdPrice, getMinBaseFeeNumerator, getNextSqrtPriceFromBaseAmountInRoundingUp, getNextSqrtPriceFromBaseAmountOutRoundingUp, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getNextSqrtPriceFromQuoteAmountInRoundingDown, getNextSqrtPriceFromQuoteAmountOutRoundingDown, getOrCreateATAInstruction, getPercentageSupplyOnMigration, getPriceFromSqrtPrice, getQuoteReserveFromNextSqrtPrice, getRateLimiterExcludedFeeAmount, getRateLimiterParams, getSecondKey, getSqrtPriceFromMarketCap, getSqrtPriceFromPrice, getSwapAmountWithBuffer, getSwapResult, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTokenType, getTokenomics, getTotalFeeNumerator, getTotalFeeNumeratorFromExcludedFeeAmount, getTotalFeeNumeratorFromIncludedFeeAmount, getTotalSupplyFromCurve, getTotalTokenSupply, getTotalVestingAmount, getTwoCurve, getVariableFeeNumerator, isDefaultLockedVesting, isDynamicFeeEnabled, isNativeSol, isNonZeroRateLimiter, isRateLimiterApplied, isZeroRateLimiter, mulDiv, mulShr, pow, prepareSwapAmountParam, prepareTokenAccountTx, splitFees, sqrt, swapQuote, swapQuoteExactIn, swapQuoteExactOut, swapQuotePartialFill, toNumerator, unwrapSOLInstruction, validateActivationType, validateBalance, validateBaseTokenType, validateCollectFeeMode, validateConfigParameters, validateCurve, validateFeeRateLimiter, validateFeeScheduler, validateLPPercentages, validateMigratedPoolFee, validateMigrationAndTokenType, validateMigrationFee, validateMigrationFeeOption, validatePoolFees, validateSwapAmount, validateTokenDecimals, validateTokenSupply, validateTokenUpdateAuthorityOptions, wrapSOLInstruction };