@meteora-ag/cp-amm-sdk 1.1.8 → 1.1.9-rc.0

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
@@ -8664,11 +8664,11 @@ import BN8 from "bn.js";
8664
8664
  function getMaxBaseFeeNumerator(cliffFeeNumerator) {
8665
8665
  return cliffFeeNumerator;
8666
8666
  }
8667
- function getMinBaseFeeNumerator(cliffFeeNumerator, numberOfPeriod, periodFrequency, reductionFactor, feeSchedulerMode) {
8667
+ function getMinBaseFeeNumerator(cliffFeeNumerator, numberOfPeriod, reductionFactor, feeSchedulerMode) {
8668
8668
  return getBaseFeeNumeratorByPeriod(
8669
8669
  cliffFeeNumerator,
8670
8670
  numberOfPeriod,
8671
- periodFrequency,
8671
+ new BN8(numberOfPeriod),
8672
8672
  reductionFactor,
8673
8673
  feeSchedulerMode
8674
8674
  );
@@ -8718,7 +8718,15 @@ function getBaseFeeNumerator(cliffFeeNumerator, numberOfPeriod, periodFrequency,
8718
8718
  if (periodFrequency.isZero()) {
8719
8719
  return cliffFeeNumerator;
8720
8720
  }
8721
- const period = currentPoint.sub(activationPoint).div(periodFrequency);
8721
+ let period;
8722
+ if (currentPoint.lt(activationPoint)) {
8723
+ period = new BN8(numberOfPeriod);
8724
+ } else {
8725
+ period = currentPoint.sub(activationPoint).div(periodFrequency);
8726
+ if (period.gt(new BN8(numberOfPeriod))) {
8727
+ period = new BN8(numberOfPeriod);
8728
+ }
8729
+ }
8722
8730
  return getBaseFeeNumeratorByPeriod(
8723
8731
  cliffFeeNumerator,
8724
8732
  numberOfPeriod,
@@ -9626,7 +9634,6 @@ function validateFeeScheduler(numberOfPeriod, periodFrequency, reductionFactor,
9626
9634
  const minFeeNumerator = getMinBaseFeeNumerator(
9627
9635
  cliffFeeNumerator,
9628
9636
  numberOfPeriod,
9629
- periodFrequency,
9630
9637
  reductionFactor,
9631
9638
  baseFeeMode
9632
9639
  );
@@ -12465,9 +12472,6 @@ var CpAmm = class {
12465
12472
  });
12466
12473
  }
12467
12474
  };
12468
-
12469
- // src/index.ts
12470
- var index_default = cp_amm_default;
12471
12475
  export {
12472
12476
  ActivationPoint,
12473
12477
  ActivationType,
@@ -12479,6 +12483,7 @@ export {
12479
12483
  CURRENT_POOL_VERSION,
12480
12484
  CollectFeeMode,
12481
12485
  CpAmm,
12486
+ cp_amm_default as CpAmmIdl,
12482
12487
  DYNAMIC_FEE_DECAY_PERIOD_DEFAULT,
12483
12488
  DYNAMIC_FEE_FILTER_PERIOD_DEFAULT,
12484
12489
  DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT,
@@ -12528,7 +12533,6 @@ export {
12528
12533
  convertToLamports,
12529
12534
  convertToRateLimiterSecondFactor,
12530
12535
  decimalToQ64,
12531
- index_default as default,
12532
12536
  deriveClaimFeeOperatorAddress,
12533
12537
  deriveConfigAddress,
12534
12538
  deriveCustomizablePoolAddress,