@meteora-ag/cp-amm-sdk 1.2.4 → 1.2.6

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
@@ -11774,22 +11774,25 @@ var CpAmm = class {
11774
11774
  }
11775
11775
  let { poolState } = params;
11776
11776
  poolState = poolState != null ? poolState : yield this.fetchPoolState(pool);
11777
- const currentPoint = yield getCurrentPoint(
11778
- this._program.provider.connection,
11779
- poolState.activationType
11780
- );
11781
11777
  const { maxLimiterDuration, maxFeeBps } = parseRateLimiterSecondFactor(
11782
11778
  poolState.poolFees.baseFee.secondFactor
11783
11779
  );
11784
- const rateLimiterApplied = isRateLimiterApplied(
11785
- poolState.poolFees.baseFee.thirdFactor,
11786
- maxLimiterDuration,
11787
- maxFeeBps,
11788
- poolState.poolFees.baseFee.firstFactor,
11789
- currentPoint,
11790
- poolState.activationPoint,
11791
- tradeDirection
11792
- );
11780
+ let rateLimiterApplied = false;
11781
+ if (poolState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
11782
+ const currentPoint = yield getCurrentPoint(
11783
+ this._program.provider.connection,
11784
+ poolState.activationType
11785
+ );
11786
+ rateLimiterApplied = isRateLimiterApplied(
11787
+ poolState.poolFees.baseFee.thirdFactor,
11788
+ maxLimiterDuration,
11789
+ maxFeeBps,
11790
+ poolState.poolFees.baseFee.firstFactor,
11791
+ currentPoint,
11792
+ poolState.activationPoint,
11793
+ tradeDirection
11794
+ );
11795
+ }
11793
11796
  const remainingAccounts = rateLimiterApplied ? [
11794
11797
  {
11795
11798
  isSigner: false,
@@ -11881,22 +11884,25 @@ var CpAmm = class {
11881
11884
  }
11882
11885
  let { poolState } = params;
11883
11886
  poolState = poolState != null ? poolState : yield this.fetchPoolState(pool);
11884
- const currentPoint = yield getCurrentPoint(
11885
- this._program.provider.connection,
11886
- poolState.activationType
11887
- );
11888
11887
  const { maxLimiterDuration, maxFeeBps } = parseRateLimiterSecondFactor(
11889
11888
  poolState.poolFees.baseFee.secondFactor
11890
11889
  );
11891
- const rateLimiterApplied = isRateLimiterApplied(
11892
- poolState.poolFees.baseFee.thirdFactor,
11893
- maxLimiterDuration,
11894
- maxFeeBps,
11895
- poolState.poolFees.baseFee.firstFactor,
11896
- currentPoint,
11897
- poolState.activationPoint,
11898
- tradeDirection
11899
- );
11890
+ let rateLimiterApplied = false;
11891
+ if (poolState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
11892
+ const currentPoint = yield getCurrentPoint(
11893
+ this._program.provider.connection,
11894
+ poolState.activationType
11895
+ );
11896
+ rateLimiterApplied = isRateLimiterApplied(
11897
+ poolState.poolFees.baseFee.thirdFactor,
11898
+ maxLimiterDuration,
11899
+ maxFeeBps,
11900
+ poolState.poolFees.baseFee.firstFactor,
11901
+ currentPoint,
11902
+ poolState.activationPoint,
11903
+ tradeDirection
11904
+ );
11905
+ }
11900
11906
  const remainingAccounts = rateLimiterApplied ? [
11901
11907
  {
11902
11908
  isSigner: false,