@meteora-ag/cp-amm-sdk 1.1.3 → 1.1.4

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.js CHANGED
@@ -7440,19 +7440,21 @@ function getDynamicFeeNumerator(volatilityAccumulator, binStep, variableFeeContr
7440
7440
  return vFee.add(new (0, _anchor.BN)(99999999999)).div(new (0, _anchor.BN)(1e11));
7441
7441
  }
7442
7442
  function getFeeNumerator(currentPoint, activationPoint, numberOfPeriod, periodFrequency, feeSchedulerMode, cliffFeeNumerator, reductionFactor, dynamicFeeParams) {
7443
+ let feeNumerator;
7443
7444
  if (Number(periodFrequency) == 0 || new (0, _anchor.BN)(currentPoint).lt(activationPoint)) {
7444
- return cliffFeeNumerator;
7445
+ feeNumerator = cliffFeeNumerator;
7446
+ } else {
7447
+ const period = _anchor.BN.min(
7448
+ new (0, _anchor.BN)(numberOfPeriod),
7449
+ new (0, _anchor.BN)(currentPoint).sub(activationPoint).div(periodFrequency)
7450
+ );
7451
+ feeNumerator = getBaseFeeNumerator(
7452
+ feeSchedulerMode,
7453
+ cliffFeeNumerator,
7454
+ period,
7455
+ reductionFactor
7456
+ );
7445
7457
  }
7446
- const period = _anchor.BN.min(
7447
- new (0, _anchor.BN)(numberOfPeriod),
7448
- new (0, _anchor.BN)(currentPoint).sub(activationPoint).div(periodFrequency)
7449
- );
7450
- let feeNumerator = getBaseFeeNumerator(
7451
- feeSchedulerMode,
7452
- cliffFeeNumerator,
7453
- period,
7454
- reductionFactor
7455
- );
7456
7458
  if (dynamicFeeParams) {
7457
7459
  const { volatilityAccumulator, binStep, variableFeeControl } = dynamicFeeParams;
7458
7460
  const dynamicFeeNumberator = getDynamicFeeNumerator(