@meteora-ag/cp-amm-sdk 1.4.1 → 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.d.mts CHANGED
@@ -8479,18 +8479,18 @@ declare function getFeeTimeSchedulerParams(startingBaseFeeBps: number, endingBas
8479
8479
  declare function computeSqrtPriceStepBps(priceMultiple: number, numberOfPeriod: number): number;
8480
8480
  /**
8481
8481
  * Gets the fee market cap scheduler parameters. Derives sqrtPriceStepBps
8482
- * automatically from starting/ending market cap so the fee schedule is
8483
- * fully exhausted when the token grows from startingMarketCap to endingMarketCap.
8482
+ * automatically from `priceMultiple` so the fee schedule is fully exhausted
8483
+ * when the spot price grows by that multiple from the initial price.
8484
+ *
8484
8485
  * @param startingBaseFeeBps - Starting (max) fee in basis points
8485
8486
  * @param endingBaseFeeBps - Ending (min) fee in basis points
8486
8487
  * @param baseFeeMode - Linear or exponential decay
8487
8488
  * @param numberOfPeriod - Number of fee reduction periods
8488
- * @param startingMarketCap - Initial market cap (e.g. 20_000 for $20k)
8489
- * @param endingMarketCap - Target market cap (e.g. 20_000_000 for $20M)
8489
+ * @param priceMultiple - Target spot-price multiple from the initial price (e.g. 1000 for 1000x). Must be > 1.
8490
8490
  * @param schedulerExpirationDuration - Seconds after which the schedule expires to the ending fee regardless of price
8491
8491
  * @returns BaseFee with the computed sqrtPriceStepBps encoded
8492
8492
  */
8493
- declare function getFeeMarketCapSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, startingMarketCap: number, endingMarketCap: number, schedulerExpirationDuration: number): BaseFee;
8493
+ declare function getFeeMarketCapSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, priceMultiple: number, schedulerExpirationDuration: number): BaseFee;
8494
8494
  /**
8495
8495
  * Gets the rate limiter parameters
8496
8496
  * @param baseFeeBps - The base fee in basis points
@@ -8531,8 +8531,7 @@ declare function getBaseFeeParams(baseFeeParams: {
8531
8531
  startingFeeBps: number;
8532
8532
  endingFeeBps: number;
8533
8533
  numberOfPeriod: number;
8534
- startingMarketCap: number;
8535
- endingMarketCap: number;
8534
+ priceMultiple: number;
8536
8535
  schedulerExpirationDuration: number;
8537
8536
  };
8538
8537
  }, tokenBDecimal: number, activationType: ActivationType): BaseFee;
package/dist/index.d.ts CHANGED
@@ -8479,18 +8479,18 @@ declare function getFeeTimeSchedulerParams(startingBaseFeeBps: number, endingBas
8479
8479
  declare function computeSqrtPriceStepBps(priceMultiple: number, numberOfPeriod: number): number;
8480
8480
  /**
8481
8481
  * Gets the fee market cap scheduler parameters. Derives sqrtPriceStepBps
8482
- * automatically from starting/ending market cap so the fee schedule is
8483
- * fully exhausted when the token grows from startingMarketCap to endingMarketCap.
8482
+ * automatically from `priceMultiple` so the fee schedule is fully exhausted
8483
+ * when the spot price grows by that multiple from the initial price.
8484
+ *
8484
8485
  * @param startingBaseFeeBps - Starting (max) fee in basis points
8485
8486
  * @param endingBaseFeeBps - Ending (min) fee in basis points
8486
8487
  * @param baseFeeMode - Linear or exponential decay
8487
8488
  * @param numberOfPeriod - Number of fee reduction periods
8488
- * @param startingMarketCap - Initial market cap (e.g. 20_000 for $20k)
8489
- * @param endingMarketCap - Target market cap (e.g. 20_000_000 for $20M)
8489
+ * @param priceMultiple - Target spot-price multiple from the initial price (e.g. 1000 for 1000x). Must be > 1.
8490
8490
  * @param schedulerExpirationDuration - Seconds after which the schedule expires to the ending fee regardless of price
8491
8491
  * @returns BaseFee with the computed sqrtPriceStepBps encoded
8492
8492
  */
8493
- declare function getFeeMarketCapSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, startingMarketCap: number, endingMarketCap: number, schedulerExpirationDuration: number): BaseFee;
8493
+ declare function getFeeMarketCapSchedulerParams(startingBaseFeeBps: number, endingBaseFeeBps: number, baseFeeMode: BaseFeeMode, numberOfPeriod: number, priceMultiple: number, schedulerExpirationDuration: number): BaseFee;
8494
8494
  /**
8495
8495
  * Gets the rate limiter parameters
8496
8496
  * @param baseFeeBps - The base fee in basis points
@@ -8531,8 +8531,7 @@ declare function getBaseFeeParams(baseFeeParams: {
8531
8531
  startingFeeBps: number;
8532
8532
  endingFeeBps: number;
8533
8533
  numberOfPeriod: number;
8534
- startingMarketCap: number;
8535
- endingMarketCap: number;
8534
+ priceMultiple: number;
8536
8535
  schedulerExpirationDuration: number;
8537
8536
  };
8538
8537
  }, tokenBDecimal: number, activationType: ActivationType): BaseFee;
package/dist/index.js CHANGED
@@ -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
  }