@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 +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7440,19 +7440,21 @@ function getDynamicFeeNumerator(volatilityAccumulator, binStep, variableFeeContr
|
|
|
7440
7440
|
return vFee.add(new BN5(99999999999)).div(new BN5(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 BN5(currentPoint).lt(activationPoint)) {
|
|
7444
|
-
|
|
7445
|
+
feeNumerator = cliffFeeNumerator;
|
|
7446
|
+
} else {
|
|
7447
|
+
const period = BN5.min(
|
|
7448
|
+
new BN5(numberOfPeriod),
|
|
7449
|
+
new BN5(currentPoint).sub(activationPoint).div(periodFrequency)
|
|
7450
|
+
);
|
|
7451
|
+
feeNumerator = getBaseFeeNumerator(
|
|
7452
|
+
feeSchedulerMode,
|
|
7453
|
+
cliffFeeNumerator,
|
|
7454
|
+
period,
|
|
7455
|
+
reductionFactor
|
|
7456
|
+
);
|
|
7445
7457
|
}
|
|
7446
|
-
const period = BN5.min(
|
|
7447
|
-
new BN5(numberOfPeriod),
|
|
7448
|
-
new BN5(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(
|