@meteora-ag/dynamic-bonding-curve-sdk 1.4.8 → 1.4.10

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.cjs CHANGED
@@ -737,8 +737,17 @@ var getSqrtPriceFromPrice = (price, tokenADecimal, tokenBDecimal) => {
737
737
  const sqrtValueQ64 = sqrtValue.mul(_decimaljs2.default.pow(2, 64));
738
738
  return new (0, _bnjs2.default)(sqrtValueQ64.floor().toFixed());
739
739
  };
740
+ var createSqrtPrices = (prices, tokenBaseDecimal, tokenQuoteDecimal) => {
741
+ return prices.map(
742
+ (price) => getSqrtPriceFromPrice(
743
+ price.toString(),
744
+ tokenBaseDecimal,
745
+ tokenQuoteDecimal
746
+ )
747
+ );
748
+ };
740
749
  var getSqrtPriceFromMarketCap = (marketCap, totalSupply, tokenBaseDecimal, tokenQuoteDecimal) => {
741
- let price = new (0, _decimaljs2.default)(marketCap).div(new (0, _decimaljs2.default)(totalSupply));
750
+ const price = new (0, _decimaljs2.default)(marketCap).div(new (0, _decimaljs2.default)(totalSupply));
742
751
  return getSqrtPriceFromPrice(
743
752
  price.toString(),
744
753
  tokenBaseDecimal,
@@ -924,8 +933,8 @@ var getMigrationThresholdPrice = (migrationThreshold, sqrtStartPrice, curve) =>
924
933
  }
925
934
  }
926
935
  if (!amountLeft.isZero()) {
927
- let migrationThresholdStr = migrationThreshold.toString();
928
- let amountLeftStr = amountLeft.toString();
936
+ const migrationThresholdStr = migrationThreshold.toString();
937
+ const amountLeftStr = amountLeft.toString();
929
938
  throw Error(
930
939
  `Not enough liquidity, migrationThreshold: ${migrationThresholdStr} amountLeft: ${amountLeftStr}`
931
940
  );
@@ -933,6 +942,56 @@ var getMigrationThresholdPrice = (migrationThreshold, sqrtStartPrice, curve) =>
933
942
  }
934
943
  return nextSqrtPrice;
935
944
  };
945
+ var getCurveBreakdown = (migrationQuoteThreshold, sqrtStartPrice, curve) => {
946
+ if (curve.length === 0) {
947
+ throw Error("Curve is empty");
948
+ }
949
+ const segmentAmounts = [];
950
+ let totalAllocated = new (0, _bnjs2.default)(0);
951
+ let currentSqrtPrice = sqrtStartPrice;
952
+ let finalSqrtPrice = sqrtStartPrice;
953
+ for (let i = 0; i < curve.length; i++) {
954
+ const lowerSqrtPrice = currentSqrtPrice;
955
+ const upperSqrtPrice = curve[i].sqrtPrice;
956
+ const liquidity = curve[i].liquidity;
957
+ const maxSegmentAmount = getDeltaAmountQuoteUnsigned(
958
+ lowerSqrtPrice,
959
+ upperSqrtPrice,
960
+ liquidity,
961
+ 0 /* Up */
962
+ );
963
+ if (maxSegmentAmount.gte(migrationQuoteThreshold)) {
964
+ segmentAmounts.push(migrationQuoteThreshold);
965
+ totalAllocated = totalAllocated.add(migrationQuoteThreshold);
966
+ finalSqrtPrice = getNextSqrtPriceFromInput(
967
+ lowerSqrtPrice,
968
+ liquidity,
969
+ migrationQuoteThreshold,
970
+ false
971
+ );
972
+ for (let j = i + 1; j < curve.length; j++) {
973
+ segmentAmounts.push(new (0, _bnjs2.default)(0));
974
+ }
975
+ break;
976
+ } else {
977
+ segmentAmounts.push(maxSegmentAmount);
978
+ totalAllocated = totalAllocated.add(maxSegmentAmount);
979
+ currentSqrtPrice = upperSqrtPrice;
980
+ finalSqrtPrice = upperSqrtPrice;
981
+ if (i === curve.length - 1 && totalAllocated.lt(migrationQuoteThreshold)) {
982
+ const shortfall = migrationQuoteThreshold.sub(totalAllocated);
983
+ throw Error(
984
+ `Not enough liquidity in curve. Total allocated: ${totalAllocated.toString()}, Required: ${migrationQuoteThreshold.toString()}, Shortfall: ${shortfall.toString()}`
985
+ );
986
+ }
987
+ }
988
+ }
989
+ return {
990
+ segmentAmounts,
991
+ finalSqrtPrice,
992
+ totalAmount: totalAllocated
993
+ };
994
+ };
936
995
  var getSwapAmountWithBuffer = (swapBaseAmount, sqrtStartPrice, curve) => {
937
996
  const swapAmountBuffer = swapBaseAmount.add(
938
997
  swapBaseAmount.mul(new (0, _bnjs2.default)(SWAP_BUFFER_PERCENTAGE)).div(new (0, _bnjs2.default)(100))
@@ -954,6 +1013,21 @@ var getPercentageSupplyOnMigration = (initialMarketCap, migrationMarketCap, lock
954
1013
  const denominator = new (0, _decimaljs2.default)(1).add(sqrtRatio);
955
1014
  return numerator.div(denominator).toNumber();
956
1015
  };
1016
+ function calculateAdjustedPercentageSupplyOnMigration(initialMarketCap, migrationMarketCap, migrationFee, lockedVesting, totalLeftover, totalTokenSupply) {
1017
+ const D = new (0, _decimaljs2.default)(initialMarketCap);
1018
+ const M = new (0, _decimaljs2.default)(migrationMarketCap);
1019
+ const f = new (0, _decimaljs2.default)(migrationFee.feePercentage).div(100);
1020
+ const totalVestingAmount = getTotalVestingAmount(lockedVesting);
1021
+ const V = new (0, _decimaljs2.default)(totalVestingAmount.toString()).mul(100).div(new (0, _decimaljs2.default)(totalTokenSupply.toString()));
1022
+ const L = new (0, _decimaljs2.default)(totalLeftover.toString()).mul(100).div(new (0, _decimaljs2.default)(totalTokenSupply.toString()));
1023
+ const requiredRatio = _decimaljs2.default.sqrt(D.div(M));
1024
+ const oneMinusF = new (0, _decimaljs2.default)(1).sub(f);
1025
+ const availablePercentage = new (0, _decimaljs2.default)(100).sub(V).sub(L);
1026
+ const numerator = requiredRatio.mul(oneMinusF).mul(availablePercentage);
1027
+ const denominator = new (0, _decimaljs2.default)(1).add(requiredRatio.mul(oneMinusF));
1028
+ const percentageSupplyOnMigration = numerator.div(denominator).toNumber();
1029
+ return percentageSupplyOnMigration;
1030
+ }
957
1031
  var getMigrationQuoteAmount = (migrationMarketCap, percentageSupplyOnMigration) => {
958
1032
  return migrationMarketCap.mul(percentageSupplyOnMigration).div(new (0, _decimaljs2.default)(100));
959
1033
  };
@@ -1155,19 +1229,19 @@ function getLockedVestingParams(totalLockedVestingAmount, numberOfVestingPeriod,
1155
1229
  };
1156
1230
  }
1157
1231
  var getTwoCurve = (migrationSqrtPrice, midSqrtPrice, initialSqrtPrice, swapAmount, migrationQuoteThreshold) => {
1158
- let p0 = new (0, _decimaljs2.default)(initialSqrtPrice.toString());
1159
- let p1 = new (0, _decimaljs2.default)(midSqrtPrice.toString());
1160
- let p2 = new (0, _decimaljs2.default)(migrationSqrtPrice.toString());
1161
- let a1 = new (0, _decimaljs2.default)(1).div(p0).sub(new (0, _decimaljs2.default)(1).div(p1));
1162
- let b1 = new (0, _decimaljs2.default)(1).div(p1).sub(new (0, _decimaljs2.default)(1).div(p2));
1163
- let c1 = new (0, _decimaljs2.default)(swapAmount.toString());
1164
- let a2 = p1.sub(p0);
1165
- let b2 = p2.sub(p1);
1166
- let c2 = new (0, _decimaljs2.default)(migrationQuoteThreshold.toString()).mul(
1232
+ const p0 = new (0, _decimaljs2.default)(initialSqrtPrice.toString());
1233
+ const p1 = new (0, _decimaljs2.default)(midSqrtPrice.toString());
1234
+ const p2 = new (0, _decimaljs2.default)(migrationSqrtPrice.toString());
1235
+ const a1 = new (0, _decimaljs2.default)(1).div(p0).sub(new (0, _decimaljs2.default)(1).div(p1));
1236
+ const b1 = new (0, _decimaljs2.default)(1).div(p1).sub(new (0, _decimaljs2.default)(1).div(p2));
1237
+ const c1 = new (0, _decimaljs2.default)(swapAmount.toString());
1238
+ const a2 = p1.sub(p0);
1239
+ const b2 = p2.sub(p1);
1240
+ const c2 = new (0, _decimaljs2.default)(migrationQuoteThreshold.toString()).mul(
1167
1241
  _decimaljs2.default.pow(2, 128)
1168
1242
  );
1169
- let l0 = c1.mul(b2).sub(c2.mul(b1)).div(a1.mul(b2).sub(a2.mul(b1)));
1170
- let l1 = c1.mul(a2).sub(c2.mul(a1)).div(b1.mul(a2).sub(b2.mul(a1)));
1243
+ const l0 = c1.mul(b2).sub(c2.mul(b1)).div(a1.mul(b2).sub(a2.mul(b1)));
1244
+ const l1 = c1.mul(a2).sub(c2.mul(a1)).div(b1.mul(a2).sub(b2.mul(a1)));
1171
1245
  if (l0.isNeg() || l1.isNeg()) {
1172
1246
  return {
1173
1247
  isOk: false,
@@ -3241,7 +3315,7 @@ function validateMigrationFee(migrationFee) {
3241
3315
 
3242
3316
 
3243
3317
  function buildCurve(buildCurveParam) {
3244
- let {
3318
+ const {
3245
3319
  totalTokenSupply,
3246
3320
  percentageSupplyOnMigration,
3247
3321
  migrationQuoteThreshold,
@@ -3298,7 +3372,7 @@ function buildCurve(buildCurveParam) {
3298
3372
  const migrationPrice = new (0, _decimaljs2.default)(migrationQuoteAmount.toString()).div(
3299
3373
  new (0, _decimaljs2.default)(migrationBaseSupply.toString())
3300
3374
  );
3301
- let migrationQuoteThresholdInLamport = convertToLamports(
3375
+ const migrationQuoteThresholdInLamport = convertToLamports(
3302
3376
  migrationQuoteThreshold,
3303
3377
  tokenQuoteDecimal
3304
3378
  );
@@ -3308,7 +3382,7 @@ function buildCurve(buildCurveParam) {
3308
3382
  tokenBaseDecimal,
3309
3383
  tokenQuoteDecimal
3310
3384
  );
3311
- let migrationQuoteAmountInLamport = fromDecimalToBN(
3385
+ const migrationQuoteAmountInLamport = fromDecimalToBN(
3312
3386
  migrationQuoteAmount.mul(new (0, _decimaljs2.default)(10 ** tokenQuoteDecimal))
3313
3387
  );
3314
3388
  const migrationBaseAmount = getMigrationBaseToken(
@@ -3411,7 +3485,14 @@ function buildCurveWithMarketCap(buildCurveWithMarketCapParam) {
3411
3485
  );
3412
3486
  const totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3413
3487
  const totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3414
- const percentageSupplyOnMigration = getPercentageSupplyOnMigration(
3488
+ const percentageSupplyOnMigration = migrationFee.feePercentage > 0 ? calculateAdjustedPercentageSupplyOnMigration(
3489
+ initialMarketCap,
3490
+ migrationMarketCap,
3491
+ migrationFee,
3492
+ lockedVesting,
3493
+ totalLeftover,
3494
+ totalSupply
3495
+ ) : getPercentageSupplyOnMigration(
3415
3496
  new (0, _decimaljs2.default)(initialMarketCap),
3416
3497
  new (0, _decimaljs2.default)(migrationMarketCap),
3417
3498
  lockedVesting,
@@ -3482,57 +3563,57 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3482
3563
  migrationFeeOption,
3483
3564
  migratedPoolFee
3484
3565
  );
3485
- let migrationBaseSupply = new (0, _bnjs2.default)(totalTokenSupply).mul(new (0, _bnjs2.default)(percentageSupplyOnMigration)).div(new (0, _bnjs2.default)(100));
3486
- let totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3487
- let migrationQuoteAmount = getMigrationQuoteAmount(
3566
+ const migrationBaseSupply = new (0, _bnjs2.default)(totalTokenSupply).mul(new (0, _bnjs2.default)(percentageSupplyOnMigration)).div(new (0, _bnjs2.default)(100));
3567
+ const totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3568
+ const migrationQuoteAmount = getMigrationQuoteAmount(
3488
3569
  new (0, _decimaljs2.default)(migrationMarketCap),
3489
3570
  new (0, _decimaljs2.default)(percentageSupplyOnMigration)
3490
3571
  );
3491
- let migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
3572
+ const migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
3492
3573
  migrationQuoteAmount,
3493
3574
  new (0, _decimaljs2.default)(migrationFee.feePercentage)
3494
3575
  );
3495
- let migrationPrice = migrationQuoteAmount.div(
3576
+ const migrationPrice = migrationQuoteAmount.div(
3496
3577
  new (0, _decimaljs2.default)(migrationBaseSupply.toString())
3497
3578
  );
3498
- let migrationQuoteThresholdInLamport = fromDecimalToBN(
3579
+ const migrationQuoteThresholdInLamport = fromDecimalToBN(
3499
3580
  migrationQuoteThreshold.mul(new (0, _decimaljs2.default)(10 ** tokenQuoteDecimal))
3500
3581
  );
3501
- let migrationQuoteAmountInLamport = fromDecimalToBN(
3582
+ const migrationQuoteAmountInLamport = fromDecimalToBN(
3502
3583
  migrationQuoteAmount.mul(new (0, _decimaljs2.default)(10 ** tokenQuoteDecimal))
3503
3584
  );
3504
- let migrateSqrtPrice = getSqrtPriceFromPrice(
3585
+ const migrateSqrtPrice = getSqrtPriceFromPrice(
3505
3586
  migrationPrice.toString(),
3506
3587
  tokenBaseDecimal,
3507
3588
  tokenQuoteDecimal
3508
3589
  );
3509
- let migrationBaseAmount = getMigrationBaseToken(
3590
+ const migrationBaseAmount = getMigrationBaseToken(
3510
3591
  migrationQuoteAmountInLamport,
3511
3592
  migrateSqrtPrice,
3512
3593
  migrationOption
3513
3594
  );
3514
- let totalVestingAmount = getTotalVestingAmount(lockedVesting);
3515
- let totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3516
- let swapAmount = totalSupply.sub(migrationBaseAmount).sub(totalVestingAmount).sub(totalLeftover);
3517
- let initialSqrtPrice = getSqrtPriceFromMarketCap(
3595
+ const totalVestingAmount = getTotalVestingAmount(lockedVesting);
3596
+ const totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3597
+ const swapAmount = totalSupply.sub(migrationBaseAmount).sub(totalVestingAmount).sub(totalLeftover);
3598
+ const initialSqrtPrice = getSqrtPriceFromMarketCap(
3518
3599
  initialMarketCap,
3519
3600
  totalTokenSupply,
3520
3601
  tokenBaseDecimal,
3521
3602
  tokenQuoteDecimal
3522
3603
  );
3523
- let midSqrtPriceDecimal1 = new (0, _decimaljs2.default)(migrateSqrtPrice.toString()).mul(new (0, _decimaljs2.default)(initialSqrtPrice.toString())).sqrt();
3524
- let midSqrtPrice1 = new (0, _bnjs2.default)(midSqrtPriceDecimal1.floor().toFixed());
3525
- let numerator1 = new (0, _decimaljs2.default)(initialSqrtPrice.toString());
3526
- let numerator2 = _decimaljs2.default.pow(migrateSqrtPrice.toString(), 3);
3527
- let product1 = numerator1.mul(numerator2);
3528
- let midSqrtPriceDecimal2 = _decimaljs2.default.pow(product1, 0.25);
3529
- let midSqrtPrice2 = new (0, _bnjs2.default)(midSqrtPriceDecimal2.floor().toFixed());
3530
- let numerator3 = _decimaljs2.default.pow(initialSqrtPrice.toString(), 3);
3531
- let numerator4 = new (0, _decimaljs2.default)(migrateSqrtPrice.toString());
3532
- let product2 = numerator3.mul(numerator4);
3533
- let midSqrtPriceDecimal3 = _decimaljs2.default.pow(product2, 0.25);
3534
- let midSqrtPrice3 = new (0, _bnjs2.default)(midSqrtPriceDecimal3.floor().toFixed());
3535
- let midPrices = [midSqrtPrice1, midSqrtPrice2, midSqrtPrice3];
3604
+ const midSqrtPriceDecimal1 = new (0, _decimaljs2.default)(migrateSqrtPrice.toString()).mul(new (0, _decimaljs2.default)(initialSqrtPrice.toString())).sqrt();
3605
+ const midSqrtPrice1 = new (0, _bnjs2.default)(midSqrtPriceDecimal1.floor().toFixed());
3606
+ const numerator1 = new (0, _decimaljs2.default)(initialSqrtPrice.toString());
3607
+ const numerator2 = _decimaljs2.default.pow(migrateSqrtPrice.toString(), 3);
3608
+ const product1 = numerator1.mul(numerator2);
3609
+ const midSqrtPriceDecimal2 = _decimaljs2.default.pow(product1, 0.25);
3610
+ const midSqrtPrice2 = new (0, _bnjs2.default)(midSqrtPriceDecimal2.floor().toFixed());
3611
+ const numerator3 = _decimaljs2.default.pow(initialSqrtPrice.toString(), 3);
3612
+ const numerator4 = new (0, _decimaljs2.default)(migrateSqrtPrice.toString());
3613
+ const product2 = numerator3.mul(numerator4);
3614
+ const midSqrtPriceDecimal3 = _decimaljs2.default.pow(product2, 0.25);
3615
+ const midSqrtPrice3 = new (0, _bnjs2.default)(midSqrtPriceDecimal3.floor().toFixed());
3616
+ const midPrices = [midSqrtPrice3, midSqrtPrice2, midSqrtPrice1];
3536
3617
  let sqrtStartPrice = new (0, _bnjs2.default)(0);
3537
3618
  let curve = [];
3538
3619
  for (let i = 0; i < midPrices.length; i++) {
@@ -3549,7 +3630,7 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3549
3630
  break;
3550
3631
  }
3551
3632
  }
3552
- let totalDynamicSupply = getTotalSupplyFromCurve(
3633
+ const totalDynamicSupply = getTotalSupplyFromCurve(
3553
3634
  migrationQuoteThresholdInLamport,
3554
3635
  sqrtStartPrice,
3555
3636
  curve,
@@ -3559,7 +3640,166 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3559
3640
  migrationFee.feePercentage
3560
3641
  );
3561
3642
  if (totalDynamicSupply.gt(totalSupply)) {
3562
- let leftOverDelta = totalDynamicSupply.sub(totalSupply);
3643
+ const leftOverDelta = totalDynamicSupply.sub(totalSupply);
3644
+ if (!leftOverDelta.lt(totalLeftover)) {
3645
+ throw new Error("leftOverDelta must be less than totalLeftover");
3646
+ }
3647
+ }
3648
+ const instructionParams = {
3649
+ poolFees: {
3650
+ baseFee: {
3651
+ ...baseFee
3652
+ },
3653
+ dynamicFee: dynamicFeeEnabled ? getDynamicFeeParams(
3654
+ baseFeeParams.baseFeeMode === 2 /* RateLimiter */ ? baseFeeParams.rateLimiterParam.baseFeeBps : baseFeeParams.feeSchedulerParam.endingFeeBps
3655
+ ) : null
3656
+ },
3657
+ activationType,
3658
+ collectFeeMode,
3659
+ migrationOption,
3660
+ tokenType,
3661
+ tokenDecimal: tokenBaseDecimal,
3662
+ migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3663
+ partnerLpPercentage,
3664
+ creatorLpPercentage,
3665
+ partnerLockedLpPercentage,
3666
+ creatorLockedLpPercentage,
3667
+ sqrtStartPrice,
3668
+ lockedVesting,
3669
+ migrationFeeOption,
3670
+ tokenSupply: {
3671
+ preMigrationTokenSupply: totalSupply,
3672
+ postMigrationTokenSupply: totalSupply
3673
+ },
3674
+ creatorTradingFeePercentage,
3675
+ migratedPoolFee: {
3676
+ collectFeeMode: migratedPoolFeeParams.collectFeeMode,
3677
+ dynamicFee: migratedPoolFeeParams.dynamicFee,
3678
+ poolFeeBps: migratedPoolFeeParams.poolFeeBps
3679
+ },
3680
+ padding: [],
3681
+ curve,
3682
+ tokenUpdateAuthority,
3683
+ migrationFee
3684
+ };
3685
+ return instructionParams;
3686
+ }
3687
+ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3688
+ const {
3689
+ totalTokenSupply,
3690
+ initialMarketCap,
3691
+ migrationMarketCap,
3692
+ midPrice,
3693
+ percentageSupplyOnMigration,
3694
+ migrationOption,
3695
+ tokenBaseDecimal,
3696
+ tokenQuoteDecimal,
3697
+ creatorTradingFeePercentage,
3698
+ collectFeeMode,
3699
+ leftover,
3700
+ tokenType,
3701
+ partnerLpPercentage,
3702
+ creatorLpPercentage,
3703
+ partnerLockedLpPercentage,
3704
+ creatorLockedLpPercentage,
3705
+ activationType,
3706
+ dynamicFeeEnabled,
3707
+ migrationFeeOption,
3708
+ migrationFee,
3709
+ tokenUpdateAuthority,
3710
+ baseFeeParams,
3711
+ migratedPoolFee
3712
+ } = buildCurveWithMidPriceParam;
3713
+ const baseFee = getBaseFeeParams(
3714
+ baseFeeParams,
3715
+ tokenQuoteDecimal,
3716
+ activationType
3717
+ );
3718
+ const {
3719
+ totalLockedVestingAmount,
3720
+ numberOfVestingPeriod,
3721
+ cliffUnlockAmount,
3722
+ totalVestingDuration,
3723
+ cliffDurationFromMigrationTime
3724
+ } = buildCurveWithMidPriceParam.lockedVestingParam;
3725
+ const lockedVesting = getLockedVestingParams(
3726
+ totalLockedVestingAmount,
3727
+ numberOfVestingPeriod,
3728
+ cliffUnlockAmount,
3729
+ totalVestingDuration,
3730
+ cliffDurationFromMigrationTime,
3731
+ tokenBaseDecimal
3732
+ );
3733
+ const migratedPoolFeeParams = getMigratedPoolFeeParams(
3734
+ migrationOption,
3735
+ migrationFeeOption,
3736
+ migratedPoolFee
3737
+ );
3738
+ const migrationBaseSupply = new (0, _bnjs2.default)(totalTokenSupply).mul(new (0, _bnjs2.default)(percentageSupplyOnMigration)).div(new (0, _bnjs2.default)(100));
3739
+ const totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3740
+ const migrationQuoteAmount = getMigrationQuoteAmount(
3741
+ new (0, _decimaljs2.default)(migrationMarketCap),
3742
+ new (0, _decimaljs2.default)(percentageSupplyOnMigration)
3743
+ );
3744
+ const migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
3745
+ migrationQuoteAmount,
3746
+ new (0, _decimaljs2.default)(migrationFee.feePercentage)
3747
+ );
3748
+ const migrationPrice = migrationQuoteAmount.div(
3749
+ new (0, _decimaljs2.default)(migrationBaseSupply.toString())
3750
+ );
3751
+ const migrationQuoteThresholdInLamport = fromDecimalToBN(
3752
+ migrationQuoteThreshold.mul(new (0, _decimaljs2.default)(10 ** tokenQuoteDecimal))
3753
+ );
3754
+ const migrationQuoteAmountInLamport = fromDecimalToBN(
3755
+ migrationQuoteAmount.mul(new (0, _decimaljs2.default)(10 ** tokenQuoteDecimal))
3756
+ );
3757
+ const migrateSqrtPrice = getSqrtPriceFromPrice(
3758
+ migrationPrice.toString(),
3759
+ tokenBaseDecimal,
3760
+ tokenQuoteDecimal
3761
+ );
3762
+ const migrationBaseAmount = getMigrationBaseToken(
3763
+ migrationQuoteAmountInLamport,
3764
+ migrateSqrtPrice,
3765
+ migrationOption
3766
+ );
3767
+ const totalVestingAmount = getTotalVestingAmount(lockedVesting);
3768
+ const totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3769
+ const swapAmount = totalSupply.sub(migrationBaseAmount).sub(totalVestingAmount).sub(totalLeftover);
3770
+ const initialSqrtPrice = getSqrtPriceFromMarketCap(
3771
+ initialMarketCap,
3772
+ totalTokenSupply,
3773
+ tokenBaseDecimal,
3774
+ tokenQuoteDecimal
3775
+ );
3776
+ const midSqrtPrice = getSqrtPriceFromPrice(
3777
+ midPrice.toString(),
3778
+ tokenBaseDecimal,
3779
+ tokenQuoteDecimal
3780
+ );
3781
+ let sqrtStartPrice = new (0, _bnjs2.default)(0);
3782
+ let curve = [];
3783
+ const result = getTwoCurve(
3784
+ migrateSqrtPrice,
3785
+ midSqrtPrice,
3786
+ initialSqrtPrice,
3787
+ swapAmount,
3788
+ migrationQuoteThresholdInLamport
3789
+ );
3790
+ curve = result.curve;
3791
+ sqrtStartPrice = result.sqrtStartPrice;
3792
+ const totalDynamicSupply = getTotalSupplyFromCurve(
3793
+ migrationQuoteThresholdInLamport,
3794
+ sqrtStartPrice,
3795
+ curve,
3796
+ lockedVesting,
3797
+ migrationOption,
3798
+ totalLeftover,
3799
+ migrationFee.feePercentage
3800
+ );
3801
+ if (totalDynamicSupply.gt(totalSupply)) {
3802
+ const leftOverDelta = totalDynamicSupply.sub(totalSupply);
3563
3803
  if (!leftOverDelta.lt(totalLeftover)) {
3564
3804
  throw new Error("leftOverDelta must be less than totalLeftover");
3565
3805
  }
@@ -3604,7 +3844,7 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3604
3844
  return instructionParams;
3605
3845
  }
3606
3846
  function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3607
- let {
3847
+ const {
3608
3848
  totalTokenSupply,
3609
3849
  migrationOption,
3610
3850
  tokenBaseDecimal,
@@ -3653,23 +3893,23 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3653
3893
  migrationFeeOption,
3654
3894
  migratedPoolFee
3655
3895
  );
3656
- let pMin = getSqrtPriceFromMarketCap(
3896
+ const pMin = getSqrtPriceFromMarketCap(
3657
3897
  initialMarketCap,
3658
3898
  totalTokenSupply,
3659
3899
  tokenBaseDecimal,
3660
3900
  tokenQuoteDecimal
3661
3901
  );
3662
- let pMax = getSqrtPriceFromMarketCap(
3902
+ const pMax = getSqrtPriceFromMarketCap(
3663
3903
  migrationMarketCap,
3664
3904
  totalTokenSupply,
3665
3905
  tokenBaseDecimal,
3666
3906
  tokenQuoteDecimal
3667
3907
  );
3668
- let priceRatio = new (0, _decimaljs2.default)(pMax.toString()).div(
3908
+ const priceRatio = new (0, _decimaljs2.default)(pMax.toString()).div(
3669
3909
  new (0, _decimaljs2.default)(pMin.toString())
3670
3910
  );
3671
- let qDecimal = priceRatio.pow(new (0, _decimaljs2.default)(1).div(new (0, _decimaljs2.default)(16)));
3672
- let sqrtPrices = [];
3911
+ const qDecimal = priceRatio.pow(new (0, _decimaljs2.default)(1).div(new (0, _decimaljs2.default)(16)));
3912
+ const sqrtPrices = [];
3673
3913
  let currentPrice = pMin;
3674
3914
  for (let i = 0; i < 17; i++) {
3675
3915
  sqrtPrices.push(currentPrice);
@@ -3677,49 +3917,217 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3677
3917
  qDecimal.mul(new (0, _decimaljs2.default)(currentPrice.toString()))
3678
3918
  );
3679
3919
  }
3680
- let totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3681
- let totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3682
- let totalVestingAmount = getTotalVestingAmount(lockedVesting);
3683
- let totalSwapAndMigrationAmount = totalSupply.sub(totalVestingAmount).sub(totalLeftover);
3920
+ const totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
3921
+ const totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
3922
+ const totalVestingAmount = getTotalVestingAmount(lockedVesting);
3923
+ const totalSwapAndMigrationAmount = totalSupply.sub(totalVestingAmount).sub(totalLeftover);
3684
3924
  let sumFactor = new (0, _decimaljs2.default)(0);
3685
- let pmaxWeight = new (0, _decimaljs2.default)(pMax.toString());
3686
- let migrationFeeFactor = new (0, _decimaljs2.default)(100).sub(new (0, _decimaljs2.default)(migrationFee.feePercentage)).div(new (0, _decimaljs2.default)(100));
3925
+ const pmaxWeight = new (0, _decimaljs2.default)(pMax.toString());
3926
+ const migrationFeeFactor = new (0, _decimaljs2.default)(100).sub(new (0, _decimaljs2.default)(migrationFee.feePercentage)).div(new (0, _decimaljs2.default)(100));
3687
3927
  for (let i = 1; i < 17; i++) {
3688
- let pi = new (0, _decimaljs2.default)(sqrtPrices[i].toString());
3689
- let piMinus = new (0, _decimaljs2.default)(sqrtPrices[i - 1].toString());
3690
- let k = new (0, _decimaljs2.default)(liquidityWeights[i - 1]);
3691
- let w1 = pi.sub(piMinus).div(pi.mul(piMinus));
3692
- let w2 = pi.sub(piMinus).mul(migrationFeeFactor).div(pmaxWeight.mul(pmaxWeight));
3693
- let weight = k.mul(w1.add(w2));
3928
+ const pi = new (0, _decimaljs2.default)(sqrtPrices[i].toString());
3929
+ const piMinus = new (0, _decimaljs2.default)(sqrtPrices[i - 1].toString());
3930
+ const k = new (0, _decimaljs2.default)(liquidityWeights[i - 1]);
3931
+ const w1 = pi.sub(piMinus).div(pi.mul(piMinus));
3932
+ const w2 = pi.sub(piMinus).mul(migrationFeeFactor).div(pmaxWeight.mul(pmaxWeight));
3933
+ const weight = k.mul(w1.add(w2));
3694
3934
  sumFactor = sumFactor.add(weight);
3695
3935
  }
3696
- let l1 = new (0, _decimaljs2.default)(totalSwapAndMigrationAmount.toString()).div(sumFactor);
3697
- let curve = [];
3936
+ const l1 = new (0, _decimaljs2.default)(totalSwapAndMigrationAmount.toString()).div(
3937
+ sumFactor
3938
+ );
3939
+ const curve = [];
3698
3940
  for (let i = 0; i < 16; i++) {
3699
- let k = new (0, _decimaljs2.default)(liquidityWeights[i]);
3700
- let liquidity = convertDecimalToBN(l1.mul(k));
3701
- let sqrtPrice = i < 15 ? sqrtPrices[i + 1] : pMax;
3941
+ const k = new (0, _decimaljs2.default)(liquidityWeights[i]);
3942
+ const liquidity = convertDecimalToBN(l1.mul(k));
3943
+ const sqrtPrice = i < 15 ? sqrtPrices[i + 1] : pMax;
3944
+ curve.push({
3945
+ sqrtPrice,
3946
+ liquidity
3947
+ });
3948
+ }
3949
+ const swapBaseAmount = getBaseTokenForSwap(pMin, pMax, curve);
3950
+ const swapBaseAmountBuffer = getSwapAmountWithBuffer(
3951
+ swapBaseAmount,
3952
+ pMin,
3953
+ curve
3954
+ );
3955
+ const migrationAmount = totalSwapAndMigrationAmount.sub(swapBaseAmountBuffer);
3956
+ const migrationQuoteAmount = migrationAmount.mul(pMax).mul(pMax).shrn(128);
3957
+ const migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
3958
+ new (0, _decimaljs2.default)(migrationQuoteAmount.toString()),
3959
+ new (0, _decimaljs2.default)(migrationFee.feePercentage)
3960
+ );
3961
+ const migrationQuoteThresholdInLamport = fromDecimalToBN(
3962
+ migrationQuoteThreshold
3963
+ );
3964
+ const totalDynamicSupply = getTotalSupplyFromCurve(
3965
+ migrationQuoteThresholdInLamport,
3966
+ pMin,
3967
+ curve,
3968
+ lockedVesting,
3969
+ migrationOption,
3970
+ totalLeftover,
3971
+ migrationFee.feePercentage
3972
+ );
3973
+ if (totalDynamicSupply.gt(totalSupply)) {
3974
+ const leftOverDelta = totalDynamicSupply.sub(totalSupply);
3975
+ if (!leftOverDelta.lt(totalLeftover)) {
3976
+ throw new Error("leftOverDelta must be less than totalLeftover");
3977
+ }
3978
+ }
3979
+ const instructionParams = {
3980
+ poolFees: {
3981
+ baseFee: {
3982
+ ...baseFee
3983
+ },
3984
+ dynamicFee: dynamicFeeEnabled ? getDynamicFeeParams(
3985
+ baseFeeParams.baseFeeMode === 2 /* RateLimiter */ ? baseFeeParams.rateLimiterParam.baseFeeBps : baseFeeParams.feeSchedulerParam.endingFeeBps
3986
+ ) : null
3987
+ },
3988
+ activationType,
3989
+ collectFeeMode,
3990
+ migrationOption,
3991
+ tokenType,
3992
+ tokenDecimal: tokenBaseDecimal,
3993
+ migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3994
+ partnerLpPercentage,
3995
+ creatorLpPercentage,
3996
+ partnerLockedLpPercentage,
3997
+ creatorLockedLpPercentage,
3998
+ sqrtStartPrice: pMin,
3999
+ lockedVesting,
4000
+ migrationFeeOption,
4001
+ tokenSupply: {
4002
+ preMigrationTokenSupply: totalSupply,
4003
+ postMigrationTokenSupply: totalSupply
4004
+ },
4005
+ creatorTradingFeePercentage,
4006
+ migratedPoolFee: {
4007
+ collectFeeMode: migratedPoolFeeParams.collectFeeMode,
4008
+ dynamicFee: migratedPoolFeeParams.dynamicFee,
4009
+ poolFeeBps: migratedPoolFeeParams.poolFeeBps
4010
+ },
4011
+ padding: [],
4012
+ curve,
4013
+ migrationFee,
4014
+ tokenUpdateAuthority
4015
+ };
4016
+ return instructionParams;
4017
+ }
4018
+ function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4019
+ const {
4020
+ totalTokenSupply,
4021
+ migrationOption,
4022
+ tokenBaseDecimal,
4023
+ tokenQuoteDecimal,
4024
+ dynamicFeeEnabled,
4025
+ activationType,
4026
+ collectFeeMode,
4027
+ migrationFeeOption,
4028
+ tokenType,
4029
+ partnerLpPercentage,
4030
+ creatorLpPercentage,
4031
+ partnerLockedLpPercentage,
4032
+ creatorLockedLpPercentage,
4033
+ creatorTradingFeePercentage,
4034
+ leftover,
4035
+ sqrtPrices,
4036
+ migrationFee,
4037
+ tokenUpdateAuthority,
4038
+ baseFeeParams,
4039
+ migratedPoolFee
4040
+ } = buildCurveWithCustomSqrtPricesParam;
4041
+ let { liquidityWeights } = buildCurveWithCustomSqrtPricesParam;
4042
+ if (sqrtPrices.length < 2) {
4043
+ throw new Error("sqrtPrices array must have at least 2 elements");
4044
+ }
4045
+ for (let i = 1; i < sqrtPrices.length; i++) {
4046
+ if (sqrtPrices[i].lte(sqrtPrices[i - 1])) {
4047
+ throw new Error("sqrtPrices must be in ascending order");
4048
+ }
4049
+ }
4050
+ if (!liquidityWeights) {
4051
+ const numSegments2 = sqrtPrices.length - 1;
4052
+ liquidityWeights = Array(numSegments2).fill(1);
4053
+ } else if (liquidityWeights.length !== sqrtPrices.length - 1) {
4054
+ throw new Error(
4055
+ "liquidityWeights length must equal sqrtPrices.length - 1"
4056
+ );
4057
+ }
4058
+ const baseFee = getBaseFeeParams(
4059
+ baseFeeParams,
4060
+ tokenQuoteDecimal,
4061
+ activationType
4062
+ );
4063
+ const {
4064
+ totalLockedVestingAmount,
4065
+ numberOfVestingPeriod,
4066
+ cliffUnlockAmount,
4067
+ totalVestingDuration,
4068
+ cliffDurationFromMigrationTime
4069
+ } = buildCurveWithCustomSqrtPricesParam.lockedVestingParam;
4070
+ const lockedVesting = getLockedVestingParams(
4071
+ totalLockedVestingAmount,
4072
+ numberOfVestingPeriod,
4073
+ cliffUnlockAmount,
4074
+ totalVestingDuration,
4075
+ cliffDurationFromMigrationTime,
4076
+ tokenBaseDecimal
4077
+ );
4078
+ const migratedPoolFeeParams = getMigratedPoolFeeParams(
4079
+ migrationOption,
4080
+ migrationFeeOption,
4081
+ migratedPoolFee
4082
+ );
4083
+ const pMin = sqrtPrices[0];
4084
+ const pMax = sqrtPrices[sqrtPrices.length - 1];
4085
+ const totalSupply = convertToLamports(totalTokenSupply, tokenBaseDecimal);
4086
+ const totalLeftover = convertToLamports(leftover, tokenBaseDecimal);
4087
+ const totalVestingAmount = getTotalVestingAmount(lockedVesting);
4088
+ const totalSwapAndMigrationAmount = totalSupply.sub(totalVestingAmount).sub(totalLeftover);
4089
+ let sumFactor = new (0, _decimaljs2.default)(0);
4090
+ const pmaxWeight = new (0, _decimaljs2.default)(pMax.toString());
4091
+ const migrationFeeFactor = new (0, _decimaljs2.default)(100).sub(new (0, _decimaljs2.default)(migrationFee.feePercentage)).div(new (0, _decimaljs2.default)(100));
4092
+ const numSegments = sqrtPrices.length - 1;
4093
+ for (let i = 0; i < numSegments; i++) {
4094
+ const pi = new (0, _decimaljs2.default)(sqrtPrices[i + 1].toString());
4095
+ const piMinus = new (0, _decimaljs2.default)(sqrtPrices[i].toString());
4096
+ const k = new (0, _decimaljs2.default)(liquidityWeights[i]);
4097
+ const w1 = pi.sub(piMinus).div(pi.mul(piMinus));
4098
+ const w2 = pi.sub(piMinus).mul(migrationFeeFactor).div(pmaxWeight.mul(pmaxWeight));
4099
+ const weight = k.mul(w1.add(w2));
4100
+ sumFactor = sumFactor.add(weight);
4101
+ }
4102
+ const l1 = new (0, _decimaljs2.default)(totalSwapAndMigrationAmount.toString()).div(
4103
+ sumFactor
4104
+ );
4105
+ const curve = [];
4106
+ for (let i = 0; i < numSegments; i++) {
4107
+ const k = new (0, _decimaljs2.default)(liquidityWeights[i]);
4108
+ const liquidity = convertDecimalToBN(l1.mul(k));
4109
+ const sqrtPrice = sqrtPrices[i + 1];
3702
4110
  curve.push({
3703
4111
  sqrtPrice,
3704
4112
  liquidity
3705
4113
  });
3706
4114
  }
3707
- let swapBaseAmount = getBaseTokenForSwap(pMin, pMax, curve);
3708
- let swapBaseAmountBuffer = getSwapAmountWithBuffer(
4115
+ const swapBaseAmount = getBaseTokenForSwap(pMin, pMax, curve);
4116
+ const swapBaseAmountBuffer = getSwapAmountWithBuffer(
3709
4117
  swapBaseAmount,
3710
4118
  pMin,
3711
4119
  curve
3712
4120
  );
3713
- let migrationAmount = totalSwapAndMigrationAmount.sub(swapBaseAmountBuffer);
3714
- let migrationQuoteAmount = migrationAmount.mul(pMax).mul(pMax).shrn(128);
3715
- let migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
4121
+ const migrationAmount = totalSwapAndMigrationAmount.sub(swapBaseAmountBuffer);
4122
+ const migrationQuoteAmount = migrationAmount.mul(pMax).mul(pMax).shrn(128);
4123
+ const migrationQuoteThreshold = getMigrationQuoteThresholdFromMigrationQuoteAmount(
3716
4124
  new (0, _decimaljs2.default)(migrationQuoteAmount.toString()),
3717
4125
  new (0, _decimaljs2.default)(migrationFee.feePercentage)
3718
4126
  );
3719
- let migrationQuoteThresholdInLamport = fromDecimalToBN(
4127
+ const migrationQuoteThresholdInLamport = fromDecimalToBN(
3720
4128
  migrationQuoteThreshold
3721
4129
  );
3722
- let totalDynamicSupply = getTotalSupplyFromCurve(
4130
+ const totalDynamicSupply = getTotalSupplyFromCurve(
3723
4131
  migrationQuoteThresholdInLamport,
3724
4132
  pMin,
3725
4133
  curve,
@@ -3729,7 +4137,7 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3729
4137
  migrationFee.feePercentage
3730
4138
  );
3731
4139
  if (totalDynamicSupply.gt(totalSupply)) {
3732
- let leftOverDelta = totalDynamicSupply.sub(totalSupply);
4140
+ const leftOverDelta = totalDynamicSupply.sub(totalSupply);
3733
4141
  if (!leftOverDelta.lt(totalLeftover)) {
3734
4142
  throw new Error("leftOverDelta must be less than totalLeftover");
3735
4143
  }
@@ -26512,5 +26920,10 @@ var DynamicBondingCurveClient = class _DynamicBondingCurveClient {
26512
26920
 
26513
26921
 
26514
26922
 
26515
- exports.ActivationType = ActivationType; exports.BASE_ADDRESS = BASE_ADDRESS; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_STEP_BPS_DEFAULT = BIN_STEP_BPS_DEFAULT; exports.BIN_STEP_BPS_U128_DEFAULT = BIN_STEP_BPS_U128_DEFAULT; exports.BaseFeeMode = BaseFeeMode; exports.CollectFeeMode = CollectFeeMode; exports.CreatorService = CreatorService; exports.DAMM_V1_MIGRATION_FEE_ADDRESS = DAMM_V1_MIGRATION_FEE_ADDRESS; exports.DAMM_V1_PROGRAM_ID = DAMM_V1_PROGRAM_ID; exports.DAMM_V2_MIGRATION_FEE_ADDRESS = DAMM_V2_MIGRATION_FEE_ADDRESS; exports.DAMM_V2_PROGRAM_ID = DAMM_V2_PROGRAM_ID; exports.DYNAMIC_BONDING_CURVE_PROGRAM_ID = DYNAMIC_BONDING_CURVE_PROGRAM_ID; exports.DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = DYNAMIC_FEE_DECAY_PERIOD_DEFAULT; exports.DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = DYNAMIC_FEE_FILTER_PERIOD_DEFAULT; exports.DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT; exports.DYNAMIC_FEE_ROUNDING_OFFSET = DYNAMIC_FEE_ROUNDING_OFFSET; exports.DYNAMIC_FEE_SCALING_FACTOR = DYNAMIC_FEE_SCALING_FACTOR; exports.DammV2DynamicFeeMode = DammV2DynamicFeeMode; exports.DynamicBondingCurveClient = DynamicBondingCurveClient; exports.DynamicBondingCurveIdl = idl_default; exports.DynamicBondingCurveProgram = DynamicBondingCurveProgram; exports.FEE_DENOMINATOR = FEE_DENOMINATOR; exports.FeeRateLimiter = FeeRateLimiter; exports.FeeScheduler = FeeScheduler; exports.LOCKER_PROGRAM_ID = LOCKER_PROGRAM_ID; exports.MAX_CREATOR_MIGRATION_FEE_PERCENTAGE = MAX_CREATOR_MIGRATION_FEE_PERCENTAGE; exports.MAX_CURVE_POINT = MAX_CURVE_POINT; exports.MAX_DYNAMIC_FEE_PERCENTAGE = MAX_DYNAMIC_FEE_PERCENTAGE; exports.MAX_FEE_BPS = MAX_FEE_BPS; exports.MAX_FEE_NUMERATOR = MAX_FEE_NUMERATOR; exports.MAX_MIGRATED_POOL_FEE_BPS = MAX_MIGRATED_POOL_FEE_BPS; exports.MAX_MIGRATION_FEE_PERCENTAGE = MAX_MIGRATION_FEE_PERCENTAGE; exports.MAX_PRICE_CHANGE_BPS_DEFAULT = MAX_PRICE_CHANGE_BPS_DEFAULT; exports.MAX_RATE_LIMITER_DURATION_IN_SECONDS = MAX_RATE_LIMITER_DURATION_IN_SECONDS; exports.MAX_RATE_LIMITER_DURATION_IN_SLOTS = MAX_RATE_LIMITER_DURATION_IN_SLOTS; exports.MAX_SQRT_PRICE = MAX_SQRT_PRICE; exports.METAPLEX_PROGRAM_ID = METAPLEX_PROGRAM_ID; exports.MIN_FEE_BPS = MIN_FEE_BPS; exports.MIN_FEE_NUMERATOR = MIN_FEE_NUMERATOR; exports.MIN_MIGRATED_POOL_FEE_BPS = MIN_MIGRATED_POOL_FEE_BPS; exports.MIN_SQRT_PRICE = MIN_SQRT_PRICE; exports.MigrationFeeOption = MigrationFeeOption; exports.MigrationOption = MigrationOption; exports.MigrationService = MigrationService; exports.OFFSET = OFFSET; exports.ONE_Q64 = ONE_Q64; exports.PARTNER_SURPLUS_SHARE = PARTNER_SURPLUS_SHARE; exports.PartnerService = PartnerService; exports.PoolService = PoolService; exports.RESOLUTION = RESOLUTION; exports.Rounding = Rounding; exports.SLOT_DURATION = SLOT_DURATION; exports.SWAP_BUFFER_PERCENTAGE = SWAP_BUFFER_PERCENTAGE; exports.SafeMath = SafeMath; exports.StateService = StateService; exports.SwapMode = SwapMode; exports.TIMESTAMP_DURATION = TIMESTAMP_DURATION; exports.TokenDecimal = TokenDecimal; exports.TokenType = TokenType; exports.TokenUpdateAuthorityOption = TokenUpdateAuthorityOption; exports.TradeDirection = TradeDirection; exports.U128_MAX = U128_MAX; exports.U16_MAX = U16_MAX; exports.U64_MAX = U64_MAX; exports.VAULT_PROGRAM_ID = VAULT_PROGRAM_ID; exports.bpsToFeeNumerator = bpsToFeeNumerator; exports.buildCurve = buildCurve; exports.buildCurveWithLiquidityWeights = buildCurveWithLiquidityWeights; exports.buildCurveWithMarketCap = buildCurveWithMarketCap; exports.buildCurveWithTwoSegments = buildCurveWithTwoSegments; exports.calculateBaseToQuoteFromAmountIn = calculateBaseToQuoteFromAmountIn; exports.calculateBaseToQuoteFromAmountOut = calculateBaseToQuoteFromAmountOut; exports.calculateFeeSchedulerEndingBaseFeeBps = calculateFeeSchedulerEndingBaseFeeBps; exports.calculateQuoteToBaseFromAmountIn = calculateQuoteToBaseFromAmountIn; exports.calculateQuoteToBaseFromAmountOut = calculateQuoteToBaseFromAmountOut; exports.checkRateLimiterApplied = checkRateLimiterApplied; exports.cleanUpTokenAccountTx = cleanUpTokenAccountTx; exports.convertDecimalToBN = convertDecimalToBN; exports.convertToLamports = convertToLamports; exports.createDammV1Program = createDammV1Program; exports.createDammV2Program = createDammV2Program; exports.createDbcProgram = createDbcProgram; exports.createInitializePermissionlessDynamicVaultIx = createInitializePermissionlessDynamicVaultIx; exports.createLockEscrowIx = createLockEscrowIx; exports.createProgramAccountFilter = createProgramAccountFilter; exports.createVaultProgram = createVaultProgram; exports.deriveBaseKeyForLocker = deriveBaseKeyForLocker; exports.deriveDammV1EventAuthority = deriveDammV1EventAuthority; exports.deriveDammV1LockEscrowAddress = deriveDammV1LockEscrowAddress; exports.deriveDammV1LpMintAddress = deriveDammV1LpMintAddress; exports.deriveDammV1MigrationMetadataAddress = deriveDammV1MigrationMetadataAddress; exports.deriveDammV1PoolAddress = deriveDammV1PoolAddress; exports.deriveDammV1PoolAuthority = deriveDammV1PoolAuthority; exports.deriveDammV1ProtocolFeeAddress = deriveDammV1ProtocolFeeAddress; exports.deriveDammV1VaultLPAddress = deriveDammV1VaultLPAddress; exports.deriveDammV2EventAuthority = deriveDammV2EventAuthority; exports.deriveDammV2LockEscrowAddress = deriveDammV2LockEscrowAddress; exports.deriveDammV2MigrationMetadataAddress = deriveDammV2MigrationMetadataAddress; exports.deriveDammV2PoolAddress = deriveDammV2PoolAddress; exports.deriveDammV2PoolAuthority = deriveDammV2PoolAuthority; exports.deriveDammV2TokenVaultAddress = deriveDammV2TokenVaultAddress; exports.deriveDbcEventAuthority = deriveDbcEventAuthority; exports.deriveDbcPoolAddress = deriveDbcPoolAddress; exports.deriveDbcPoolAuthority = deriveDbcPoolAuthority; exports.deriveDbcPoolMetadata = deriveDbcPoolMetadata; exports.deriveDbcTokenVaultAddress = deriveDbcTokenVaultAddress; exports.deriveEscrow = deriveEscrow; exports.deriveLockerEventAuthority = deriveLockerEventAuthority; exports.deriveMintMetadata = deriveMintMetadata; exports.derivePartnerMetadata = derivePartnerMetadata; exports.derivePositionAddress = derivePositionAddress; exports.derivePositionNftAccount = derivePositionNftAccount; exports.deriveTokenVaultKey = deriveTokenVaultKey; exports.deriveVaultAddress = deriveVaultAddress; exports.deriveVaultLpMintAddress = deriveVaultLpMintAddress; exports.deriveVaultPdas = deriveVaultPdas; exports.feeNumeratorToBps = feeNumeratorToBps; exports.findAssociatedTokenAddress = findAssociatedTokenAddress; exports.fromDecimalToBN = fromDecimalToBN; exports.getAccountCreationTimestamp = getAccountCreationTimestamp; exports.getAccountCreationTimestamps = getAccountCreationTimestamps; exports.getAccountData = getAccountData; exports.getBaseFeeHandler = getBaseFeeHandler; exports.getBaseFeeNumerator = getBaseFeeNumerator; exports.getBaseFeeNumeratorByPeriod = getBaseFeeNumeratorByPeriod; exports.getBaseFeeParams = getBaseFeeParams; exports.getBaseTokenForSwap = getBaseTokenForSwap; exports.getCheckedAmounts = getCheckedAmounts; exports.getCurrentPoint = getCurrentPoint; exports.getDeltaAmountBaseUnsigned = getDeltaAmountBaseUnsigned; exports.getDeltaAmountBaseUnsigned256 = getDeltaAmountBaseUnsigned256; exports.getDeltaAmountBaseUnsignedUnchecked = getDeltaAmountBaseUnsignedUnchecked; exports.getDeltaAmountQuoteUnsigned = getDeltaAmountQuoteUnsigned; exports.getDeltaAmountQuoteUnsigned256 = getDeltaAmountQuoteUnsigned256; exports.getDeltaAmountQuoteUnsignedUnchecked = getDeltaAmountQuoteUnsignedUnchecked; exports.getDynamicFeeParams = getDynamicFeeParams; exports.getExcludedFeeAmount = getExcludedFeeAmount; exports.getFeeMode = getFeeMode; exports.getFeeNumeratorFromExcludedAmount = getFeeNumeratorFromExcludedAmount; exports.getFeeNumeratorFromIncludedAmount = getFeeNumeratorFromIncludedAmount; exports.getFeeNumeratorOnExponentialFeeScheduler = getFeeNumeratorOnExponentialFeeScheduler; exports.getFeeNumeratorOnLinearFeeScheduler = getFeeNumeratorOnLinearFeeScheduler; exports.getFeeOnAmount = getFeeOnAmount; exports.getFeeSchedulerParams = getFeeSchedulerParams; exports.getFirstCurve = getFirstCurve; exports.getFirstKey = getFirstKey; exports.getIncludedFeeAmount = getIncludedFeeAmount; exports.getInitialLiquidityFromDeltaBase = getInitialLiquidityFromDeltaBase; exports.getInitialLiquidityFromDeltaQuote = getInitialLiquidityFromDeltaQuote; exports.getLiquidity = getLiquidity; exports.getLockedVestingParams = getLockedVestingParams; exports.getMaxBaseFeeNumerator = getMaxBaseFeeNumerator; exports.getMaxIndex = getMaxIndex; exports.getMaxOutAmountWithMinBaseFee = getMaxOutAmountWithMinBaseFee; exports.getMigratedPoolFeeParams = getMigratedPoolFeeParams; exports.getMigrationBaseToken = getMigrationBaseToken; exports.getMigrationQuoteAmount = getMigrationQuoteAmount; exports.getMigrationQuoteAmountFromMigrationQuoteThreshold = getMigrationQuoteAmountFromMigrationQuoteThreshold; exports.getMigrationQuoteThresholdFromMigrationQuoteAmount = getMigrationQuoteThresholdFromMigrationQuoteAmount; exports.getMigrationThresholdPrice = getMigrationThresholdPrice; exports.getMinBaseFeeNumerator = getMinBaseFeeNumerator; exports.getNextSqrtPriceFromBaseAmountInRoundingUp = getNextSqrtPriceFromBaseAmountInRoundingUp; exports.getNextSqrtPriceFromBaseAmountOutRoundingUp = getNextSqrtPriceFromBaseAmountOutRoundingUp; exports.getNextSqrtPriceFromInput = getNextSqrtPriceFromInput; exports.getNextSqrtPriceFromOutput = getNextSqrtPriceFromOutput; exports.getNextSqrtPriceFromQuoteAmountInRoundingDown = getNextSqrtPriceFromQuoteAmountInRoundingDown; exports.getNextSqrtPriceFromQuoteAmountOutRoundingDown = getNextSqrtPriceFromQuoteAmountOutRoundingDown; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getPercentageSupplyOnMigration = getPercentageSupplyOnMigration; exports.getPriceFromSqrtPrice = getPriceFromSqrtPrice; exports.getQuoteReserveFromNextSqrtPrice = getQuoteReserveFromNextSqrtPrice; exports.getRateLimiterExcludedFeeAmount = getRateLimiterExcludedFeeAmount; exports.getRateLimiterParams = getRateLimiterParams; exports.getSecondKey = getSecondKey; exports.getSqrtPriceFromMarketCap = getSqrtPriceFromMarketCap; exports.getSqrtPriceFromPrice = getSqrtPriceFromPrice; exports.getSwapAmountWithBuffer = getSwapAmountWithBuffer; exports.getSwapResult = getSwapResult; exports.getSwapResultFromExactInput = getSwapResultFromExactInput; exports.getSwapResultFromExactOutput = getSwapResultFromExactOutput; exports.getSwapResultFromPartialInput = getSwapResultFromPartialInput; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgram = getTokenProgram; exports.getTokenType = getTokenType; exports.getTokenomics = getTokenomics; exports.getTotalFeeNumerator = getTotalFeeNumerator; exports.getTotalFeeNumeratorFromExcludedFeeAmount = getTotalFeeNumeratorFromExcludedFeeAmount; exports.getTotalFeeNumeratorFromIncludedFeeAmount = getTotalFeeNumeratorFromIncludedFeeAmount; exports.getTotalSupplyFromCurve = getTotalSupplyFromCurve; exports.getTotalTokenSupply = getTotalTokenSupply; exports.getTotalVestingAmount = getTotalVestingAmount; exports.getTwoCurve = getTwoCurve; exports.getVariableFeeNumerator = getVariableFeeNumerator; exports.isDefaultLockedVesting = isDefaultLockedVesting; exports.isDynamicFeeEnabled = isDynamicFeeEnabled; exports.isNativeSol = isNativeSol; exports.isNonZeroRateLimiter = isNonZeroRateLimiter; exports.isRateLimiterApplied = isRateLimiterApplied; exports.isZeroRateLimiter = isZeroRateLimiter; exports.mulDiv = mulDiv; exports.mulShr = mulShr; exports.pow = pow; exports.prepareSwapAmountParam = prepareSwapAmountParam; exports.prepareTokenAccountTx = prepareTokenAccountTx; exports.splitFees = splitFees; exports.sqrt = sqrt; exports.swapQuote = swapQuote; exports.swapQuoteExactIn = swapQuoteExactIn; exports.swapQuoteExactOut = swapQuoteExactOut; exports.swapQuotePartialFill = swapQuotePartialFill; exports.toNumerator = toNumerator; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.validateActivationType = validateActivationType; exports.validateBalance = validateBalance; exports.validateBaseTokenType = validateBaseTokenType; exports.validateCollectFeeMode = validateCollectFeeMode; exports.validateConfigParameters = validateConfigParameters; exports.validateCurve = validateCurve; exports.validateFeeRateLimiter = validateFeeRateLimiter; exports.validateFeeScheduler = validateFeeScheduler; exports.validateLPPercentages = validateLPPercentages; exports.validateMigratedPoolFee = validateMigratedPoolFee; exports.validateMigrationAndTokenType = validateMigrationAndTokenType; exports.validateMigrationFee = validateMigrationFee; exports.validateMigrationFeeOption = validateMigrationFeeOption; exports.validatePoolFees = validatePoolFees; exports.validateSwapAmount = validateSwapAmount; exports.validateTokenDecimals = validateTokenDecimals; exports.validateTokenSupply = validateTokenSupply; exports.validateTokenUpdateAuthorityOptions = validateTokenUpdateAuthorityOptions; exports.wrapSOLInstruction = wrapSOLInstruction;
26923
+
26924
+
26925
+
26926
+
26927
+
26928
+ exports.ActivationType = ActivationType; exports.BASE_ADDRESS = BASE_ADDRESS; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_STEP_BPS_DEFAULT = BIN_STEP_BPS_DEFAULT; exports.BIN_STEP_BPS_U128_DEFAULT = BIN_STEP_BPS_U128_DEFAULT; exports.BaseFeeMode = BaseFeeMode; exports.CollectFeeMode = CollectFeeMode; exports.CreatorService = CreatorService; exports.DAMM_V1_MIGRATION_FEE_ADDRESS = DAMM_V1_MIGRATION_FEE_ADDRESS; exports.DAMM_V1_PROGRAM_ID = DAMM_V1_PROGRAM_ID; exports.DAMM_V2_MIGRATION_FEE_ADDRESS = DAMM_V2_MIGRATION_FEE_ADDRESS; exports.DAMM_V2_PROGRAM_ID = DAMM_V2_PROGRAM_ID; exports.DYNAMIC_BONDING_CURVE_PROGRAM_ID = DYNAMIC_BONDING_CURVE_PROGRAM_ID; exports.DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = DYNAMIC_FEE_DECAY_PERIOD_DEFAULT; exports.DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = DYNAMIC_FEE_FILTER_PERIOD_DEFAULT; exports.DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT; exports.DYNAMIC_FEE_ROUNDING_OFFSET = DYNAMIC_FEE_ROUNDING_OFFSET; exports.DYNAMIC_FEE_SCALING_FACTOR = DYNAMIC_FEE_SCALING_FACTOR; exports.DammV2DynamicFeeMode = DammV2DynamicFeeMode; exports.DynamicBondingCurveClient = DynamicBondingCurveClient; exports.DynamicBondingCurveIdl = idl_default; exports.DynamicBondingCurveProgram = DynamicBondingCurveProgram; exports.FEE_DENOMINATOR = FEE_DENOMINATOR; exports.FeeRateLimiter = FeeRateLimiter; exports.FeeScheduler = FeeScheduler; exports.LOCKER_PROGRAM_ID = LOCKER_PROGRAM_ID; exports.MAX_CREATOR_MIGRATION_FEE_PERCENTAGE = MAX_CREATOR_MIGRATION_FEE_PERCENTAGE; exports.MAX_CURVE_POINT = MAX_CURVE_POINT; exports.MAX_DYNAMIC_FEE_PERCENTAGE = MAX_DYNAMIC_FEE_PERCENTAGE; exports.MAX_FEE_BPS = MAX_FEE_BPS; exports.MAX_FEE_NUMERATOR = MAX_FEE_NUMERATOR; exports.MAX_MIGRATED_POOL_FEE_BPS = MAX_MIGRATED_POOL_FEE_BPS; exports.MAX_MIGRATION_FEE_PERCENTAGE = MAX_MIGRATION_FEE_PERCENTAGE; exports.MAX_PRICE_CHANGE_BPS_DEFAULT = MAX_PRICE_CHANGE_BPS_DEFAULT; exports.MAX_RATE_LIMITER_DURATION_IN_SECONDS = MAX_RATE_LIMITER_DURATION_IN_SECONDS; exports.MAX_RATE_LIMITER_DURATION_IN_SLOTS = MAX_RATE_LIMITER_DURATION_IN_SLOTS; exports.MAX_SQRT_PRICE = MAX_SQRT_PRICE; exports.METAPLEX_PROGRAM_ID = METAPLEX_PROGRAM_ID; exports.MIN_FEE_BPS = MIN_FEE_BPS; exports.MIN_FEE_NUMERATOR = MIN_FEE_NUMERATOR; exports.MIN_MIGRATED_POOL_FEE_BPS = MIN_MIGRATED_POOL_FEE_BPS; exports.MIN_SQRT_PRICE = MIN_SQRT_PRICE; exports.MigrationFeeOption = MigrationFeeOption; exports.MigrationOption = MigrationOption; exports.MigrationService = MigrationService; exports.OFFSET = OFFSET; exports.ONE_Q64 = ONE_Q64; exports.PARTNER_SURPLUS_SHARE = PARTNER_SURPLUS_SHARE; exports.PartnerService = PartnerService; exports.PoolService = PoolService; exports.RESOLUTION = RESOLUTION; exports.Rounding = Rounding; exports.SLOT_DURATION = SLOT_DURATION; exports.SWAP_BUFFER_PERCENTAGE = SWAP_BUFFER_PERCENTAGE; exports.SafeMath = SafeMath; exports.StateService = StateService; exports.SwapMode = SwapMode; exports.TIMESTAMP_DURATION = TIMESTAMP_DURATION; exports.TokenDecimal = TokenDecimal; exports.TokenType = TokenType; exports.TokenUpdateAuthorityOption = TokenUpdateAuthorityOption; exports.TradeDirection = TradeDirection; exports.U128_MAX = U128_MAX; exports.U16_MAX = U16_MAX; exports.U64_MAX = U64_MAX; exports.VAULT_PROGRAM_ID = VAULT_PROGRAM_ID; exports.bpsToFeeNumerator = bpsToFeeNumerator; exports.buildCurve = buildCurve; exports.buildCurveWithCustomSqrtPrices = buildCurveWithCustomSqrtPrices; exports.buildCurveWithLiquidityWeights = buildCurveWithLiquidityWeights; exports.buildCurveWithMarketCap = buildCurveWithMarketCap; exports.buildCurveWithMidPrice = buildCurveWithMidPrice; exports.buildCurveWithTwoSegments = buildCurveWithTwoSegments; exports.calculateAdjustedPercentageSupplyOnMigration = calculateAdjustedPercentageSupplyOnMigration; exports.calculateBaseToQuoteFromAmountIn = calculateBaseToQuoteFromAmountIn; exports.calculateBaseToQuoteFromAmountOut = calculateBaseToQuoteFromAmountOut; exports.calculateFeeSchedulerEndingBaseFeeBps = calculateFeeSchedulerEndingBaseFeeBps; exports.calculateQuoteToBaseFromAmountIn = calculateQuoteToBaseFromAmountIn; exports.calculateQuoteToBaseFromAmountOut = calculateQuoteToBaseFromAmountOut; exports.checkRateLimiterApplied = checkRateLimiterApplied; exports.cleanUpTokenAccountTx = cleanUpTokenAccountTx; exports.convertDecimalToBN = convertDecimalToBN; exports.convertToLamports = convertToLamports; exports.createDammV1Program = createDammV1Program; exports.createDammV2Program = createDammV2Program; exports.createDbcProgram = createDbcProgram; exports.createInitializePermissionlessDynamicVaultIx = createInitializePermissionlessDynamicVaultIx; exports.createLockEscrowIx = createLockEscrowIx; exports.createProgramAccountFilter = createProgramAccountFilter; exports.createSqrtPrices = createSqrtPrices; exports.createVaultProgram = createVaultProgram; exports.deriveBaseKeyForLocker = deriveBaseKeyForLocker; exports.deriveDammV1EventAuthority = deriveDammV1EventAuthority; exports.deriveDammV1LockEscrowAddress = deriveDammV1LockEscrowAddress; exports.deriveDammV1LpMintAddress = deriveDammV1LpMintAddress; exports.deriveDammV1MigrationMetadataAddress = deriveDammV1MigrationMetadataAddress; exports.deriveDammV1PoolAddress = deriveDammV1PoolAddress; exports.deriveDammV1PoolAuthority = deriveDammV1PoolAuthority; exports.deriveDammV1ProtocolFeeAddress = deriveDammV1ProtocolFeeAddress; exports.deriveDammV1VaultLPAddress = deriveDammV1VaultLPAddress; exports.deriveDammV2EventAuthority = deriveDammV2EventAuthority; exports.deriveDammV2LockEscrowAddress = deriveDammV2LockEscrowAddress; exports.deriveDammV2MigrationMetadataAddress = deriveDammV2MigrationMetadataAddress; exports.deriveDammV2PoolAddress = deriveDammV2PoolAddress; exports.deriveDammV2PoolAuthority = deriveDammV2PoolAuthority; exports.deriveDammV2TokenVaultAddress = deriveDammV2TokenVaultAddress; exports.deriveDbcEventAuthority = deriveDbcEventAuthority; exports.deriveDbcPoolAddress = deriveDbcPoolAddress; exports.deriveDbcPoolAuthority = deriveDbcPoolAuthority; exports.deriveDbcPoolMetadata = deriveDbcPoolMetadata; exports.deriveDbcTokenVaultAddress = deriveDbcTokenVaultAddress; exports.deriveEscrow = deriveEscrow; exports.deriveLockerEventAuthority = deriveLockerEventAuthority; exports.deriveMintMetadata = deriveMintMetadata; exports.derivePartnerMetadata = derivePartnerMetadata; exports.derivePositionAddress = derivePositionAddress; exports.derivePositionNftAccount = derivePositionNftAccount; exports.deriveTokenVaultKey = deriveTokenVaultKey; exports.deriveVaultAddress = deriveVaultAddress; exports.deriveVaultLpMintAddress = deriveVaultLpMintAddress; exports.deriveVaultPdas = deriveVaultPdas; exports.feeNumeratorToBps = feeNumeratorToBps; exports.findAssociatedTokenAddress = findAssociatedTokenAddress; exports.fromDecimalToBN = fromDecimalToBN; exports.getAccountCreationTimestamp = getAccountCreationTimestamp; exports.getAccountCreationTimestamps = getAccountCreationTimestamps; exports.getAccountData = getAccountData; exports.getBaseFeeHandler = getBaseFeeHandler; exports.getBaseFeeNumerator = getBaseFeeNumerator; exports.getBaseFeeNumeratorByPeriod = getBaseFeeNumeratorByPeriod; exports.getBaseFeeParams = getBaseFeeParams; exports.getBaseTokenForSwap = getBaseTokenForSwap; exports.getCheckedAmounts = getCheckedAmounts; exports.getCurrentPoint = getCurrentPoint; exports.getCurveBreakdown = getCurveBreakdown; exports.getDeltaAmountBaseUnsigned = getDeltaAmountBaseUnsigned; exports.getDeltaAmountBaseUnsigned256 = getDeltaAmountBaseUnsigned256; exports.getDeltaAmountBaseUnsignedUnchecked = getDeltaAmountBaseUnsignedUnchecked; exports.getDeltaAmountQuoteUnsigned = getDeltaAmountQuoteUnsigned; exports.getDeltaAmountQuoteUnsigned256 = getDeltaAmountQuoteUnsigned256; exports.getDeltaAmountQuoteUnsignedUnchecked = getDeltaAmountQuoteUnsignedUnchecked; exports.getDynamicFeeParams = getDynamicFeeParams; exports.getExcludedFeeAmount = getExcludedFeeAmount; exports.getFeeMode = getFeeMode; exports.getFeeNumeratorFromExcludedAmount = getFeeNumeratorFromExcludedAmount; exports.getFeeNumeratorFromIncludedAmount = getFeeNumeratorFromIncludedAmount; exports.getFeeNumeratorOnExponentialFeeScheduler = getFeeNumeratorOnExponentialFeeScheduler; exports.getFeeNumeratorOnLinearFeeScheduler = getFeeNumeratorOnLinearFeeScheduler; exports.getFeeOnAmount = getFeeOnAmount; exports.getFeeSchedulerParams = getFeeSchedulerParams; exports.getFirstCurve = getFirstCurve; exports.getFirstKey = getFirstKey; exports.getIncludedFeeAmount = getIncludedFeeAmount; exports.getInitialLiquidityFromDeltaBase = getInitialLiquidityFromDeltaBase; exports.getInitialLiquidityFromDeltaQuote = getInitialLiquidityFromDeltaQuote; exports.getLiquidity = getLiquidity; exports.getLockedVestingParams = getLockedVestingParams; exports.getMaxBaseFeeNumerator = getMaxBaseFeeNumerator; exports.getMaxIndex = getMaxIndex; exports.getMaxOutAmountWithMinBaseFee = getMaxOutAmountWithMinBaseFee; exports.getMigratedPoolFeeParams = getMigratedPoolFeeParams; exports.getMigrationBaseToken = getMigrationBaseToken; exports.getMigrationQuoteAmount = getMigrationQuoteAmount; exports.getMigrationQuoteAmountFromMigrationQuoteThreshold = getMigrationQuoteAmountFromMigrationQuoteThreshold; exports.getMigrationQuoteThresholdFromMigrationQuoteAmount = getMigrationQuoteThresholdFromMigrationQuoteAmount; exports.getMigrationThresholdPrice = getMigrationThresholdPrice; exports.getMinBaseFeeNumerator = getMinBaseFeeNumerator; exports.getNextSqrtPriceFromBaseAmountInRoundingUp = getNextSqrtPriceFromBaseAmountInRoundingUp; exports.getNextSqrtPriceFromBaseAmountOutRoundingUp = getNextSqrtPriceFromBaseAmountOutRoundingUp; exports.getNextSqrtPriceFromInput = getNextSqrtPriceFromInput; exports.getNextSqrtPriceFromOutput = getNextSqrtPriceFromOutput; exports.getNextSqrtPriceFromQuoteAmountInRoundingDown = getNextSqrtPriceFromQuoteAmountInRoundingDown; exports.getNextSqrtPriceFromQuoteAmountOutRoundingDown = getNextSqrtPriceFromQuoteAmountOutRoundingDown; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getPercentageSupplyOnMigration = getPercentageSupplyOnMigration; exports.getPriceFromSqrtPrice = getPriceFromSqrtPrice; exports.getQuoteReserveFromNextSqrtPrice = getQuoteReserveFromNextSqrtPrice; exports.getRateLimiterExcludedFeeAmount = getRateLimiterExcludedFeeAmount; exports.getRateLimiterParams = getRateLimiterParams; exports.getSecondKey = getSecondKey; exports.getSqrtPriceFromMarketCap = getSqrtPriceFromMarketCap; exports.getSqrtPriceFromPrice = getSqrtPriceFromPrice; exports.getSwapAmountWithBuffer = getSwapAmountWithBuffer; exports.getSwapResult = getSwapResult; exports.getSwapResultFromExactInput = getSwapResultFromExactInput; exports.getSwapResultFromExactOutput = getSwapResultFromExactOutput; exports.getSwapResultFromPartialInput = getSwapResultFromPartialInput; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgram = getTokenProgram; exports.getTokenType = getTokenType; exports.getTokenomics = getTokenomics; exports.getTotalFeeNumerator = getTotalFeeNumerator; exports.getTotalFeeNumeratorFromExcludedFeeAmount = getTotalFeeNumeratorFromExcludedFeeAmount; exports.getTotalFeeNumeratorFromIncludedFeeAmount = getTotalFeeNumeratorFromIncludedFeeAmount; exports.getTotalSupplyFromCurve = getTotalSupplyFromCurve; exports.getTotalTokenSupply = getTotalTokenSupply; exports.getTotalVestingAmount = getTotalVestingAmount; exports.getTwoCurve = getTwoCurve; exports.getVariableFeeNumerator = getVariableFeeNumerator; exports.isDefaultLockedVesting = isDefaultLockedVesting; exports.isDynamicFeeEnabled = isDynamicFeeEnabled; exports.isNativeSol = isNativeSol; exports.isNonZeroRateLimiter = isNonZeroRateLimiter; exports.isRateLimiterApplied = isRateLimiterApplied; exports.isZeroRateLimiter = isZeroRateLimiter; exports.mulDiv = mulDiv; exports.mulShr = mulShr; exports.pow = pow; exports.prepareSwapAmountParam = prepareSwapAmountParam; exports.prepareTokenAccountTx = prepareTokenAccountTx; exports.splitFees = splitFees; exports.sqrt = sqrt; exports.swapQuote = swapQuote; exports.swapQuoteExactIn = swapQuoteExactIn; exports.swapQuoteExactOut = swapQuoteExactOut; exports.swapQuotePartialFill = swapQuotePartialFill; exports.toNumerator = toNumerator; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.validateActivationType = validateActivationType; exports.validateBalance = validateBalance; exports.validateBaseTokenType = validateBaseTokenType; exports.validateCollectFeeMode = validateCollectFeeMode; exports.validateConfigParameters = validateConfigParameters; exports.validateCurve = validateCurve; exports.validateFeeRateLimiter = validateFeeRateLimiter; exports.validateFeeScheduler = validateFeeScheduler; exports.validateLPPercentages = validateLPPercentages; exports.validateMigratedPoolFee = validateMigratedPoolFee; exports.validateMigrationAndTokenType = validateMigrationAndTokenType; exports.validateMigrationFee = validateMigrationFee; exports.validateMigrationFeeOption = validateMigrationFeeOption; exports.validatePoolFees = validatePoolFees; exports.validateSwapAmount = validateSwapAmount; exports.validateTokenDecimals = validateTokenDecimals; exports.validateTokenSupply = validateTokenSupply; exports.validateTokenUpdateAuthorityOptions = validateTokenUpdateAuthorityOptions; exports.wrapSOLInstruction = wrapSOLInstruction;
26516
26929
  //# sourceMappingURL=index.cjs.map