@meteora-ag/cp-amm-sdk 1.4.0 → 1.4.2

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.mjs CHANGED
@@ -11356,15 +11356,15 @@ function validateFeeRateLimiter(cliffFeeNumerator, feeIncrementBps, maxFeeBps, m
11356
11356
  }
11357
11357
  const minFeeNumerator = getFeeNumeratorFromIncludedFeeAmount(
11358
11358
  new BN17(0),
11359
- cliffFeeNumerator,
11360
11359
  referenceAmount,
11360
+ cliffFeeNumerator,
11361
11361
  maxFeeBps,
11362
11362
  feeIncrementBps
11363
11363
  );
11364
11364
  const maxFeeNumeratorFromAmount = getFeeNumeratorFromIncludedFeeAmount(
11365
11365
  U64_MAX,
11366
- cliffFeeNumerator,
11367
11366
  referenceAmount,
11367
+ cliffFeeNumerator,
11368
11368
  maxFeeBps,
11369
11369
  feeIncrementBps
11370
11370
  );
@@ -11848,12 +11848,12 @@ function computeSqrtPriceStepBps(priceMultiple, numberOfPeriod) {
11848
11848
  }
11849
11849
  return sqrtPriceStepBps;
11850
11850
  }
11851
- function getFeeMarketCapSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, baseFeeMode, numberOfPeriod, startingMarketCap, endingMarketCap, schedulerExpirationDuration) {
11851
+ function getFeeMarketCapSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, baseFeeMode, numberOfPeriod, priceMultiple, schedulerExpirationDuration) {
11852
11852
  if (numberOfPeriod <= 0) {
11853
11853
  throw new Error("Total periods must be greater than zero");
11854
11854
  }
11855
- if (endingMarketCap <= startingMarketCap) {
11856
- throw new Error("endingMarketCap must be greater than startingMarketCap");
11855
+ if (priceMultiple <= 1) {
11856
+ throw new Error("priceMultiple must be greater than 1");
11857
11857
  }
11858
11858
  const poolMaxFeeBps = getMaxFeeBps(CURRENT_POOL_VERSION);
11859
11859
  if (startingBaseFeeBps <= endingBaseFeeBps) {
@@ -11869,7 +11869,6 @@ function getFeeMarketCapSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, ba
11869
11869
  if (schedulerExpirationDuration == 0) {
11870
11870
  throw new Error("schedulerExpirationDuration must be greater than zero");
11871
11871
  }
11872
- const priceMultiple = endingMarketCap / startingMarketCap;
11873
11872
  const sqrtPriceStepBps = computeSqrtPriceStepBps(
11874
11873
  priceMultiple,
11875
11874
  numberOfPeriod
@@ -12006,8 +12005,7 @@ function getBaseFeeParams(baseFeeParams, tokenBDecimal, activationType) {
12006
12005
  startingFeeBps,
12007
12006
  endingFeeBps,
12008
12007
  numberOfPeriod,
12009
- startingMarketCap,
12010
- endingMarketCap,
12008
+ priceMultiple,
12011
12009
  schedulerExpirationDuration
12012
12010
  } = baseFeeParams.feeMarketCapSchedulerParam;
12013
12011
  return getFeeMarketCapSchedulerParams(
@@ -12015,8 +12013,7 @@ function getBaseFeeParams(baseFeeParams, tokenBDecimal, activationType) {
12015
12013
  endingFeeBps,
12016
12014
  baseFeeParams.baseFeeMode,
12017
12015
  numberOfPeriod,
12018
- startingMarketCap,
12019
- endingMarketCap,
12016
+ priceMultiple,
12020
12017
  schedulerExpirationDuration
12021
12018
  );
12022
12019
  }