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

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
@@ -83,29 +83,44 @@ var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
83
83
  // src/constants.ts
84
84
  var _bnjs = require('bn.js'); var _bnjs2 = _interopRequireDefault(_bnjs);
85
85
 
86
+ var MAX_CURVE_POINT = 16;
86
87
  var OFFSET = 64;
87
- var U128_MAX = new (0, _bnjs2.default)("340282366920938463463374607431768211455");
88
- var U64_MAX = new (0, _bnjs2.default)("18446744073709551615");
89
- var U16_MAX = 65535;
90
- var MIN_SQRT_PRICE = new (0, _bnjs2.default)("4295048016");
91
- var MAX_SQRT_PRICE = new (0, _bnjs2.default)("79226673521066979257578248091");
92
88
  var RESOLUTION = 64;
93
89
  var ONE_Q64 = new (0, _bnjs2.default)(1).shln(RESOLUTION);
94
90
  var FEE_DENOMINATOR = 1e9;
91
+ var MAX_BASIS_POINT = 1e4;
92
+ var U16_MAX = 65535;
93
+ var U64_MAX = new (0, _bnjs2.default)("18446744073709551615");
94
+ var U128_MAX = new (0, _bnjs2.default)("340282366920938463463374607431768211455");
95
+ var MIN_SQRT_PRICE = new (0, _bnjs2.default)("4295048016");
96
+ var MAX_SQRT_PRICE = new (0, _bnjs2.default)("79226673521066979257578248091");
95
97
  var MIN_FEE_BPS = 25;
96
98
  var MAX_FEE_BPS = 9900;
97
99
  var MIN_FEE_NUMERATOR = 25e5;
98
100
  var MAX_FEE_NUMERATOR = 99e7;
99
- var BASIS_POINT_MAX = 1e4;
100
- var MAX_CURVE_POINT = 16;
101
- var PARTNER_SURPLUS_SHARE = 80;
101
+ var MAX_RATE_LIMITER_DURATION_IN_SECONDS = 43200;
102
+ var MAX_RATE_LIMITER_DURATION_IN_SLOTS = 108e3;
103
+ var DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = 10;
104
+ var DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = 120;
105
+ var DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = 5e3;
106
+ var DYNAMIC_FEE_SCALING_FACTOR = new (0, _bnjs2.default)(1e11);
107
+ var DYNAMIC_FEE_ROUNDING_OFFSET = new (0, _bnjs2.default)(99999999999);
108
+ var BIN_STEP_BPS_DEFAULT = 1;
109
+ var BIN_STEP_BPS_U128_DEFAULT = new (0, _bnjs2.default)("1844674407370955");
110
+ var MAX_PRICE_CHANGE_PERCENTAGE_DEFAULT = 20;
111
+ var PROTOCOL_FEE_PERCENT = 20;
112
+ var HOST_FEE_PERCENT = 20;
102
113
  var SWAP_BUFFER_PERCENTAGE = 25;
103
114
  var MAX_MIGRATION_FEE_PERCENTAGE = 99;
104
115
  var MAX_CREATOR_MIGRATION_FEE_PERCENTAGE = 100;
105
- var MAX_RATE_LIMITER_DURATION_IN_SECONDS = 43200;
106
- var MAX_RATE_LIMITER_DURATION_IN_SLOTS = 108e3;
107
- var SLOT_DURATION = 400;
108
- var TIMESTAMP_DURATION = 1e3;
116
+ var MIN_LOCKED_LIQUIDITY_BPS = 1e3;
117
+ var SECONDS_PER_DAY = 86400;
118
+ var MAX_LOCK_DURATION_IN_SECONDS = 63072e3;
119
+ var PROTOCOL_POOL_CREATION_FEE_PERCENT = 10;
120
+ var MIN_POOL_CREATION_FEE = 1e6;
121
+ var MAX_POOL_CREATION_FEE = 1e11;
122
+ var MIN_MIGRATED_POOL_FEE_BPS = 10;
123
+ var MAX_MIGRATED_POOL_FEE_BPS = 1e3;
109
124
  var DYNAMIC_BONDING_CURVE_PROGRAM_ID = new (0, _web3js.PublicKey)(
110
125
  "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"
111
126
  );
@@ -127,17 +142,6 @@ var LOCKER_PROGRAM_ID = new (0, _web3js.PublicKey)(
127
142
  var BASE_ADDRESS = new (0, _web3js.PublicKey)(
128
143
  "HWzXGcGHy4tcpYfaRDCyLNzXqBTv3E6BttpCH2vJxArv"
129
144
  );
130
- var DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = 10;
131
- var DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = 120;
132
- var DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = 5e3;
133
- var MAX_DYNAMIC_FEE_PERCENTAGE = 20;
134
- var DYNAMIC_FEE_SCALING_FACTOR = new (0, _bnjs2.default)(1e11);
135
- var DYNAMIC_FEE_ROUNDING_OFFSET = new (0, _bnjs2.default)(99999999999);
136
- var BIN_STEP_BPS_DEFAULT = 1;
137
- var BIN_STEP_BPS_U128_DEFAULT = new (0, _bnjs2.default)("1844674407370955");
138
- var MAX_PRICE_CHANGE_BPS_DEFAULT = 1500;
139
- var MIN_MIGRATED_POOL_FEE_BPS = 10;
140
- var MAX_MIGRATED_POOL_FEE_BPS = 1e3;
141
145
  var DAMM_V1_MIGRATION_FEE_ADDRESS = [
142
146
  new (0, _web3js.PublicKey)("8f848CEy8eY6PhJ3VcemtBDzPPSD4Vq7aJczLZ3o8MmX"),
143
147
  // FixedBps25
@@ -168,6 +172,13 @@ var DAMM_V2_MIGRATION_FEE_ADDRESS = [
168
172
  new (0, _web3js.PublicKey)("A8gMrEPJkacWkcb3DGwtJwTe16HktSEfvwtuDh2MCtck")
169
173
  // Customizable
170
174
  ];
175
+ var DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS = {
176
+ vestingPercentage: 0,
177
+ bpsPerPeriod: 0,
178
+ numberOfPeriods: 0,
179
+ cliffDurationFromMigrationTime: 0,
180
+ totalDuration: 0
181
+ };
171
182
 
172
183
  // src/helpers/common.ts
173
184
 
@@ -512,10 +523,10 @@ function convertDecimalToBN(value) {
512
523
  return new (0, _bnjs2.default)(value.floor().toFixed());
513
524
  }
514
525
  function bpsToFeeNumerator(bps) {
515
- return new (0, _bnjs2.default)(bps * FEE_DENOMINATOR).divn(BASIS_POINT_MAX);
526
+ return new (0, _bnjs2.default)(bps * FEE_DENOMINATOR).divn(MAX_BASIS_POINT);
516
527
  }
517
528
  function feeNumeratorToBps(feeNumerator) {
518
- return feeNumerator.muln(BASIS_POINT_MAX).div(new (0, _bnjs2.default)(FEE_DENOMINATOR)).toNumber();
529
+ return feeNumerator.muln(MAX_BASIS_POINT).div(new (0, _bnjs2.default)(FEE_DENOMINATOR)).toNumber();
519
530
  }
520
531
 
521
532
  // src/helpers/token.ts
@@ -717,7 +728,7 @@ function getTotalTokenSupply(swapBaseAmount, migrationBaseThreshold, lockedVesti
717
728
  }
718
729
  return totalAmount;
719
730
  } catch (error) {
720
- throw new Error("Math overflow");
731
+ throw new Error(`Math overflow: ${error}`);
721
732
  }
722
733
  }
723
734
  function getPriceFromSqrtPrice(sqrtPrice, tokenBaseDecimal, tokenQuoteDecimal) {
@@ -1054,6 +1065,11 @@ function getFeeSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, baseFeeMode
1054
1065
  `startingBaseFeeBps (${startingBaseFeeBps} bps) exceeds maximum allowed value of ${MAX_FEE_BPS} bps`
1055
1066
  );
1056
1067
  }
1068
+ if (endingBaseFeeBps < MIN_FEE_BPS) {
1069
+ throw new Error(
1070
+ `endingBaseFeeBps (${endingBaseFeeBps} bps) is less than minimum allowed value of ${MIN_FEE_BPS} bps`
1071
+ );
1072
+ }
1057
1073
  if (endingBaseFeeBps > startingBaseFeeBps) {
1058
1074
  throw new Error(
1059
1075
  "endingBaseFeeBps bps must be less than or equal to startingBaseFeeBps bps"
@@ -1074,7 +1090,7 @@ function getFeeSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, baseFeeMode
1074
1090
  } else {
1075
1091
  const ratio = minBaseFeeNumerator.toNumber() / maxBaseFeeNumerator.toNumber();
1076
1092
  const decayBase = Math.pow(ratio, 1 / numberOfPeriod);
1077
- reductionFactor = new (0, _bnjs2.default)(BASIS_POINT_MAX * (1 - decayBase));
1093
+ reductionFactor = new (0, _bnjs2.default)(MAX_BASIS_POINT * (1 - decayBase));
1078
1094
  }
1079
1095
  return {
1080
1096
  cliffFeeNumerator: maxBaseFeeNumerator,
@@ -1086,16 +1102,16 @@ function getFeeSchedulerParams(startingBaseFeeBps, endingBaseFeeBps, baseFeeMode
1086
1102
  }
1087
1103
  function calculateFeeSchedulerEndingBaseFeeBps(cliffFeeNumerator, numberOfPeriod, periodFrequency, reductionFactor, baseFeeMode) {
1088
1104
  if (numberOfPeriod === 0 || periodFrequency === 0) {
1089
- return cliffFeeNumerator / FEE_DENOMINATOR * BASIS_POINT_MAX;
1105
+ return cliffFeeNumerator / FEE_DENOMINATOR * MAX_BASIS_POINT;
1090
1106
  }
1091
1107
  let baseFeeNumerator;
1092
1108
  if (baseFeeMode == 0 /* FeeSchedulerLinear */) {
1093
1109
  baseFeeNumerator = cliffFeeNumerator - numberOfPeriod * reductionFactor;
1094
1110
  } else {
1095
- const decayRate = 1 - reductionFactor / BASIS_POINT_MAX;
1111
+ const decayRate = 1 - reductionFactor / MAX_BASIS_POINT;
1096
1112
  baseFeeNumerator = cliffFeeNumerator * Math.pow(decayRate, numberOfPeriod);
1097
1113
  }
1098
- return Math.max(0, baseFeeNumerator / FEE_DENOMINATOR * BASIS_POINT_MAX);
1114
+ return Math.max(0, baseFeeNumerator / FEE_DENOMINATOR * MAX_BASIS_POINT);
1099
1115
  }
1100
1116
  function getRateLimiterParams(baseFeeBps, feeIncrementBps, referenceAmount, maxLimiterDuration, tokenQuoteDecimal, activationType) {
1101
1117
  const cliffFeeNumerator = bpsToFeeNumerator(baseFeeBps);
@@ -1108,6 +1124,11 @@ function getRateLimiterParams(baseFeeBps, feeIncrementBps, referenceAmount, maxL
1108
1124
  `Base fee (${baseFeeBps} bps) exceeds maximum allowed value of ${MAX_FEE_BPS} bps`
1109
1125
  );
1110
1126
  }
1127
+ if (baseFeeBps < MIN_FEE_BPS) {
1128
+ throw new Error(
1129
+ `Base fee (${baseFeeBps} bps) is less than minimum allowed value of ${MIN_FEE_BPS} bps`
1130
+ );
1131
+ }
1111
1132
  if (feeIncrementBps > MAX_FEE_BPS) {
1112
1133
  throw new Error(
1113
1134
  `Fee increment (${feeIncrementBps} bps) exceeds maximum allowed value of ${MAX_FEE_BPS} bps`
@@ -1144,21 +1165,21 @@ function getRateLimiterParams(baseFeeBps, feeIncrementBps, referenceAmount, maxL
1144
1165
  baseFeeMode: 2 /* RateLimiter */
1145
1166
  };
1146
1167
  }
1147
- function getDynamicFeeParams(baseFeeBps, maxPriceChangeBps = MAX_PRICE_CHANGE_BPS_DEFAULT) {
1148
- if (maxPriceChangeBps > MAX_PRICE_CHANGE_BPS_DEFAULT) {
1168
+ function getDynamicFeeParams(baseFeeBps, maxPriceChangePercentage = MAX_PRICE_CHANGE_PERCENTAGE_DEFAULT) {
1169
+ if (maxPriceChangePercentage > MAX_PRICE_CHANGE_PERCENTAGE_DEFAULT) {
1149
1170
  throw new Error(
1150
- `maxPriceChangeBps (${maxPriceChangeBps} bps) must be less than or equal to ${MAX_PRICE_CHANGE_BPS_DEFAULT}`
1171
+ `maxPriceChangePercentage (${maxPriceChangePercentage}%) must be less than or equal to ${MAX_PRICE_CHANGE_PERCENTAGE_DEFAULT}`
1151
1172
  );
1152
1173
  }
1153
- const priceRatio = maxPriceChangeBps / BASIS_POINT_MAX + 1;
1174
+ const priceRatio = maxPriceChangePercentage / MAX_BASIS_POINT + 1;
1154
1175
  const sqrtPriceRatioQ64 = new (0, _bnjs2.default)(
1155
1176
  _decimaljs2.default.sqrt(priceRatio.toString()).mul(_decimaljs2.default.pow(2, 64)).floor().toFixed()
1156
1177
  );
1157
1178
  const deltaBinId = sqrtPriceRatioQ64.sub(ONE_Q64).div(BIN_STEP_BPS_U128_DEFAULT).muln(2);
1158
- const maxVolatilityAccumulator = new (0, _bnjs2.default)(deltaBinId.muln(BASIS_POINT_MAX));
1179
+ const maxVolatilityAccumulator = new (0, _bnjs2.default)(deltaBinId.muln(MAX_BASIS_POINT));
1159
1180
  const squareVfaBin = maxVolatilityAccumulator.mul(new (0, _bnjs2.default)(BIN_STEP_BPS_DEFAULT)).pow(new (0, _bnjs2.default)(2));
1160
1181
  const baseFeeNumerator = new (0, _bnjs2.default)(bpsToFeeNumerator(baseFeeBps));
1161
- const maxDynamicFeeNumerator = baseFeeNumerator.muln(20).divn(100);
1182
+ const maxDynamicFeeNumerator = baseFeeNumerator.muln(maxPriceChangePercentage).divn(100);
1162
1183
  const vFee = maxDynamicFeeNumerator.mul(new (0, _bnjs2.default)(1e11)).sub(new (0, _bnjs2.default)(99999999999));
1163
1184
  const variableFeeControl = vFee.div(squareVfaBin);
1164
1185
  return {
@@ -1228,6 +1249,69 @@ function getLockedVestingParams(totalLockedVestingAmount, numberOfVestingPeriod,
1228
1249
  )
1229
1250
  };
1230
1251
  }
1252
+ var getLiquidityVestingInfoParams = (vestingPercentage, bpsPerPeriod, numberOfPeriods, cliffDurationFromMigrationTime, totalDuration) => {
1253
+ if (vestingPercentage < 0 || vestingPercentage > 100) {
1254
+ throw new Error("vestingPercentage must be between 0 and 100");
1255
+ }
1256
+ if (vestingPercentage === 0) {
1257
+ if (bpsPerPeriod !== 0 || numberOfPeriods !== 0 || cliffDurationFromMigrationTime !== 0 || totalDuration !== 0) {
1258
+ throw new Error(
1259
+ "If vestingPercentage is 0, all other parameters must be 0"
1260
+ );
1261
+ }
1262
+ return {
1263
+ vestingPercentage: 0,
1264
+ bpsPerPeriod: 0,
1265
+ numberOfPeriods: 0,
1266
+ cliffDurationFromMigrationTime: 0,
1267
+ frequency: 0
1268
+ };
1269
+ }
1270
+ if (bpsPerPeriod < 0 || bpsPerPeriod > MAX_BASIS_POINT) {
1271
+ throw new Error(`bpsPerPeriod must be between 0 and ${MAX_BASIS_POINT}`);
1272
+ }
1273
+ if (numberOfPeriods <= 0) {
1274
+ throw new Error(
1275
+ "numberOfPeriods must be greater than zero when vestingPercentage > 0"
1276
+ );
1277
+ }
1278
+ if (cliffDurationFromMigrationTime < 0) {
1279
+ throw new Error("cliffDurationFromMigrationTime must be >= 0");
1280
+ }
1281
+ if (totalDuration <= 0) {
1282
+ throw new Error("totalDuration must be greater than zero");
1283
+ }
1284
+ const frequency = totalDuration / numberOfPeriods;
1285
+ if (frequency <= 0) {
1286
+ throw new Error(
1287
+ "frequency must be greater than zero (totalDuration / numberOfPeriods must be > 0)"
1288
+ );
1289
+ }
1290
+ const totalBps = bpsPerPeriod * numberOfPeriods;
1291
+ if (totalBps > MAX_BASIS_POINT) {
1292
+ throw new Error(
1293
+ `Total BPS (bpsPerPeriod * numberOfPeriods = ${totalBps}) must not exceed ${MAX_BASIS_POINT}`
1294
+ );
1295
+ }
1296
+ const totalVestingDuration = cliffDurationFromMigrationTime + numberOfPeriods * frequency;
1297
+ if (totalVestingDuration > MAX_LOCK_DURATION_IN_SECONDS) {
1298
+ throw new Error(
1299
+ `Total vesting duration (${totalVestingDuration}s) must not exceed ${MAX_LOCK_DURATION_IN_SECONDS}s (2 years)`
1300
+ );
1301
+ }
1302
+ if (cliffDurationFromMigrationTime === 0 && numberOfPeriods === 0) {
1303
+ throw new Error(
1304
+ "If cliffDurationFromMigrationTime is 0, numberOfPeriods must be > 0"
1305
+ );
1306
+ }
1307
+ return {
1308
+ vestingPercentage,
1309
+ bpsPerPeriod,
1310
+ numberOfPeriods,
1311
+ cliffDurationFromMigrationTime,
1312
+ frequency: Math.round(frequency)
1313
+ };
1314
+ };
1231
1315
  var getTwoCurve = (migrationSqrtPrice, midSqrtPrice, initialSqrtPrice, swapAmount, migrationQuoteThreshold) => {
1232
1316
  const p0 = new (0, _decimaljs2.default)(initialSqrtPrice.toString());
1233
1317
  const p1 = new (0, _decimaljs2.default)(midSqrtPrice.toString());
@@ -1368,8 +1452,72 @@ async function prepareSwapAmountParam(amount, mintAddress, connection) {
1368
1452
  const mintTokenDecimals = await getTokenDecimals(connection, mintAddress);
1369
1453
  return convertToLamports(amount, mintTokenDecimals);
1370
1454
  }
1455
+ function getVestingLockedLiquidityBpsAtNSeconds(vestingInfo, nSeconds) {
1456
+ if (!vestingInfo || vestingInfo.vestingPercentage === 0) {
1457
+ return 0;
1458
+ }
1459
+ const totalLiquidity = U128_MAX;
1460
+ const totalVestedLiquidity = totalLiquidity.mul(new (0, _bnjs2.default)(vestingInfo.vestingPercentage)).div(new (0, _bnjs2.default)(100));
1461
+ const bpsPerPeriod = vestingInfo.bpsPerPeriod;
1462
+ const numberOfPeriods = vestingInfo.numberOfPeriods;
1463
+ const frequency = vestingInfo.frequency;
1464
+ const cliffDuration = vestingInfo.cliffDurationFromMigrationTime;
1465
+ const totalBpsAfterCliff = bpsPerPeriod * numberOfPeriods;
1466
+ const totalVestingLiquidityAfterCliff = totalVestedLiquidity.mul(new (0, _bnjs2.default)(totalBpsAfterCliff)).div(new (0, _bnjs2.default)(MAX_BASIS_POINT));
1467
+ let liquidityPerPeriod = new (0, _bnjs2.default)(0);
1468
+ let adjustedFrequency = frequency;
1469
+ let adjustedNumberOfPeriods = numberOfPeriods;
1470
+ let adjustedCliffDuration = cliffDuration;
1471
+ if (numberOfPeriods > 0) {
1472
+ liquidityPerPeriod = totalVestingLiquidityAfterCliff.div(
1473
+ new (0, _bnjs2.default)(numberOfPeriods)
1474
+ );
1475
+ }
1476
+ if (liquidityPerPeriod.isZero()) {
1477
+ adjustedNumberOfPeriods = 0;
1478
+ adjustedFrequency = 0;
1479
+ adjustedCliffDuration = Math.max(cliffDuration, 1);
1480
+ }
1481
+ const cliffUnlockLiquidity = totalVestedLiquidity.sub(
1482
+ liquidityPerPeriod.mul(new (0, _bnjs2.default)(adjustedNumberOfPeriods))
1483
+ );
1484
+ const cliffPoint = new (0, _bnjs2.default)(adjustedCliffDuration);
1485
+ const currentPoint = new (0, _bnjs2.default)(nSeconds);
1486
+ let unlockedLiquidity = new (0, _bnjs2.default)(0);
1487
+ if (currentPoint.gte(cliffPoint)) {
1488
+ unlockedLiquidity = cliffUnlockLiquidity;
1489
+ if (adjustedFrequency > 0 && adjustedNumberOfPeriods > 0) {
1490
+ const timeAfterCliff = currentPoint.sub(cliffPoint);
1491
+ const periodsElapsed = timeAfterCliff.div(new (0, _bnjs2.default)(adjustedFrequency)).toNumber();
1492
+ const actualPeriodsElapsed = Math.min(
1493
+ periodsElapsed,
1494
+ adjustedNumberOfPeriods
1495
+ );
1496
+ unlockedLiquidity = unlockedLiquidity.add(
1497
+ liquidityPerPeriod.mul(new (0, _bnjs2.default)(actualPeriodsElapsed))
1498
+ );
1499
+ }
1500
+ }
1501
+ const lockedLiquidity = totalVestedLiquidity.sub(unlockedLiquidity);
1502
+ const liquidityLockedBps = lockedLiquidity.mul(new (0, _bnjs2.default)(MAX_BASIS_POINT)).div(totalLiquidity);
1503
+ return liquidityLockedBps.toNumber();
1504
+ }
1505
+ function calculateLockedLiquidityBpsAtTime(partnerPermanentLockedLiquidityPercentage, creatorPermanentLockedLiquidityPercentage, partnerLiquidityVestingInfo, creatorLiquidityVestingInfo, elapsedSeconds) {
1506
+ const partnerVestedLockedLiquidityBps = getVestingLockedLiquidityBpsAtNSeconds(
1507
+ partnerLiquidityVestingInfo,
1508
+ elapsedSeconds
1509
+ );
1510
+ const creatorVestedLockedLiquidityBps = getVestingLockedLiquidityBpsAtNSeconds(
1511
+ creatorLiquidityVestingInfo,
1512
+ elapsedSeconds
1513
+ );
1514
+ const partnerPermanentLockedLiquidityBps = partnerPermanentLockedLiquidityPercentage * 100;
1515
+ const creatorPermanentLockedLiquidityBps = creatorPermanentLockedLiquidityPercentage * 100;
1516
+ const totalLockedLiquidityBpsAtNSeconds = partnerVestedLockedLiquidityBps + partnerPermanentLockedLiquidityBps + creatorVestedLockedLiquidityBps + creatorPermanentLockedLiquidityBps;
1517
+ return totalLockedLiquidityBpsAtNSeconds;
1518
+ }
1371
1519
 
1372
- // src/helpers/accounts.ts
1520
+ // src/helpers/pda.ts
1373
1521
 
1374
1522
  var SEED = Object.freeze({
1375
1523
  POOL_AUTHORITY: "pool_authority",
@@ -1628,6 +1776,12 @@ function deriveBaseKeyForLocker(virtualPool) {
1628
1776
  DYNAMIC_BONDING_CURVE_PROGRAM_ID
1629
1777
  )[0];
1630
1778
  }
1779
+ function deriveDammV2PositionVestingAccount(position) {
1780
+ return _web3js.PublicKey.findProgramAddressSync(
1781
+ [Buffer.from("position_vesting"), position.toBuffer()],
1782
+ DYNAMIC_BONDING_CURVE_PROGRAM_ID
1783
+ )[0];
1784
+ }
1631
1785
 
1632
1786
  // src/helpers/validation.ts
1633
1787
 
@@ -1893,7 +2047,7 @@ function getFeeNumeratorOnExponentialFeeScheduler(cliffFeeNumerator, reductionFa
1893
2047
  if (period === 0) {
1894
2048
  return cliffFeeNumerator;
1895
2049
  }
1896
- const basisPointMax = new (0, _bnjs2.default)(BASIS_POINT_MAX);
2050
+ const basisPointMax = new (0, _bnjs2.default)(MAX_BASIS_POINT);
1897
2051
  const ONE_Q642 = new (0, _bnjs2.default)(1).shln(64);
1898
2052
  const bps = SafeMath.div(SafeMath.shl(reductionFactor, 64), basisPointMax);
1899
2053
  const base = SafeMath.sub(ONE_Q642, bps);
@@ -1979,7 +2133,7 @@ var FeeScheduler = class {
1979
2133
  this.reductionFactor = reductionFactor;
1980
2134
  this.feeSchedulerMode = feeSchedulerMode;
1981
2135
  }
1982
- validate(collectFeeMode, activationType) {
2136
+ validate() {
1983
2137
  return validateFeeScheduler(
1984
2138
  this.numberOfPeriod,
1985
2139
  this.periodFrequency,
@@ -2072,13 +2226,13 @@ function toNumerator(bps, feeDenominator) {
2072
2226
  const numerator = mulDiv(
2073
2227
  bps,
2074
2228
  feeDenominator,
2075
- new (0, _bnjs2.default)(BASIS_POINT_MAX),
2229
+ new (0, _bnjs2.default)(MAX_BASIS_POINT),
2076
2230
  1 /* Down */
2077
2231
  );
2078
2232
  return numerator;
2079
2233
  } catch (error) {
2080
2234
  throw new Error(
2081
- "Type cast failed or calculation overflow in toNumerator"
2235
+ `Type cast failed or calculation overflow in toNumerator ${error}`
2082
2236
  );
2083
2237
  }
2084
2238
  }
@@ -2168,14 +2322,14 @@ function getFeeOnAmount(tradeFeeNumerator, amount, poolFees, hasReferral) {
2168
2322
  );
2169
2323
  const protocolFee = mulDiv(
2170
2324
  tradingFee,
2171
- new (0, _bnjs2.default)(poolFees.protocolFeePercent),
2325
+ new (0, _bnjs2.default)(PROTOCOL_FEE_PERCENT),
2172
2326
  new (0, _bnjs2.default)(100),
2173
2327
  1 /* Down */
2174
2328
  );
2175
2329
  const updatedTradingFee = SafeMath.sub(tradingFee, protocolFee);
2176
2330
  const referralFee = hasReferral ? mulDiv(
2177
2331
  protocolFee,
2178
- new (0, _bnjs2.default)(poolFees.referralFeePercent),
2332
+ new (0, _bnjs2.default)(HOST_FEE_PERCENT),
2179
2333
  new (0, _bnjs2.default)(100),
2180
2334
  1 /* Down */
2181
2335
  ) : new (0, _bnjs2.default)(0);
@@ -2210,14 +2364,14 @@ function getIncludedFeeAmount(tradeFeeNumerator, excludedFeeAmount) {
2210
2364
  function splitFees(poolFees, feeAmount, hasReferral) {
2211
2365
  const protocolFee = mulDiv(
2212
2366
  feeAmount,
2213
- new (0, _bnjs2.default)(poolFees.protocolFeePercent),
2367
+ new (0, _bnjs2.default)(PROTOCOL_FEE_PERCENT),
2214
2368
  new (0, _bnjs2.default)(100),
2215
2369
  1 /* Down */
2216
2370
  );
2217
2371
  const tradingFee = SafeMath.sub(feeAmount, protocolFee);
2218
2372
  const referralFee = hasReferral ? mulDiv(
2219
2373
  protocolFee,
2220
- new (0, _bnjs2.default)(poolFees.referralFeePercent),
2374
+ new (0, _bnjs2.default)(HOST_FEE_PERCENT),
2221
2375
  new (0, _bnjs2.default)(100),
2222
2376
  1 /* Down */
2223
2377
  ) : new (0, _bnjs2.default)(0);
@@ -3051,8 +3205,8 @@ function validateMigrationFeeOption(migrationFeeOption, migrationOption) {
3051
3205
  function validateTokenDecimals(tokenDecimal) {
3052
3206
  return tokenDecimal >= 6 /* SIX */ && tokenDecimal <= 9 /* NINE */;
3053
3207
  }
3054
- function validateLPPercentages(partnerLpPercentage, partnerLockedLpPercentage, creatorLpPercentage, creatorLockedLpPercentage) {
3055
- const totalLPPercentage = partnerLpPercentage + partnerLockedLpPercentage + creatorLpPercentage + creatorLockedLpPercentage;
3208
+ function validateLPPercentages(partnerLiquidityPercentage, partnerPermanentLockedLiquidityPercentage, creatorLiquidityPercentage, creatorPermanentLockedLiquidityPercentage, partnerVestingPercentage, creatorVestingPercentage) {
3209
+ const totalLPPercentage = partnerLiquidityPercentage + partnerPermanentLockedLiquidityPercentage + creatorLiquidityPercentage + creatorPermanentLockedLiquidityPercentage + partnerVestingPercentage + creatorVestingPercentage;
3056
3210
  return totalLPPercentage === 100;
3057
3211
  }
3058
3212
  function validateCurve(curve, sqrtStartPrice) {
@@ -3112,6 +3266,35 @@ function validateTokenUpdateAuthorityOptions(option) {
3112
3266
  4 /* PartnerUpdateAndMintAuthority */
3113
3267
  ].includes(option);
3114
3268
  }
3269
+ function validatePoolCreationFee(poolCreationFee) {
3270
+ if (poolCreationFee.eq(new (0, _bnjs2.default)(0))) {
3271
+ return true;
3272
+ }
3273
+ return poolCreationFee.gte(new (0, _bnjs2.default)(MIN_POOL_CREATION_FEE)) && poolCreationFee.lte(new (0, _bnjs2.default)(MAX_POOL_CREATION_FEE));
3274
+ }
3275
+ function validateLiquidityVestingInfo(vestingInfo) {
3276
+ const isZero = vestingInfo.vestingPercentage === 0 && vestingInfo.bpsPerPeriod === 0 && vestingInfo.numberOfPeriods === 0 && vestingInfo.cliffDurationFromMigrationTime === 0 && vestingInfo.frequency === 0;
3277
+ if (isZero) {
3278
+ return true;
3279
+ }
3280
+ if (vestingInfo.vestingPercentage < 0 || vestingInfo.vestingPercentage > 100) {
3281
+ return false;
3282
+ }
3283
+ if (vestingInfo.vestingPercentage > 0 && vestingInfo.frequency === 0) {
3284
+ return false;
3285
+ }
3286
+ return true;
3287
+ }
3288
+ function validateMinimumLockedLiquidity(partnerPermanentLockedLiquidityPercentage, creatorPermanentLockedLiquidityPercentage, partnerLiquidityVestingInfo, creatorLiquidityVestingInfo) {
3289
+ const lockedBpsAtDay1 = calculateLockedLiquidityBpsAtTime(
3290
+ partnerPermanentLockedLiquidityPercentage,
3291
+ creatorPermanentLockedLiquidityPercentage,
3292
+ partnerLiquidityVestingInfo,
3293
+ creatorLiquidityVestingInfo,
3294
+ SECONDS_PER_DAY
3295
+ );
3296
+ return lockedBpsAtDay1 >= MIN_LOCKED_LIQUIDITY_BPS;
3297
+ }
3115
3298
  function validateMigratedPoolFee(migratedPoolFee, migrationOption, migrationFeeOption) {
3116
3299
  const isEmpty = () => {
3117
3300
  return migratedPoolFee.collectFeeMode === 0 && migratedPoolFee.dynamicFee === 0 && migratedPoolFee.poolFeeBps === 0;
@@ -3175,17 +3358,72 @@ function validateConfigParameters(configParam) {
3175
3358
  if (!validateMigrationFee(configParam.migrationFee)) {
3176
3359
  throw new Error("Invalid migration fee");
3177
3360
  }
3361
+ if (configParam.creatorTradingFeePercentage < 0 || configParam.creatorTradingFeePercentage > 100) {
3362
+ throw new Error(
3363
+ "Creator trading fee percentage must be between 0 and 100"
3364
+ );
3365
+ }
3178
3366
  if (!validateTokenDecimals(configParam.tokenDecimal)) {
3179
3367
  throw new Error("Token decimal must be between 6 and 9");
3180
3368
  }
3369
+ const partnerVestingPercentage = _nullishCoalesce(_optionalChain([configParam, 'access', _19 => _19.partnerLiquidityVestingInfo, 'optionalAccess', _20 => _20.vestingPercentage]), () => ( 0));
3370
+ const creatorVestingPercentage = _nullishCoalesce(_optionalChain([configParam, 'access', _21 => _21.creatorLiquidityVestingInfo, 'optionalAccess', _22 => _22.vestingPercentage]), () => ( 0));
3181
3371
  if (!validateLPPercentages(
3182
- configParam.partnerLpPercentage,
3183
- configParam.partnerLockedLpPercentage,
3184
- configParam.creatorLpPercentage,
3185
- configParam.creatorLockedLpPercentage
3372
+ configParam.partnerLiquidityPercentage,
3373
+ configParam.partnerPermanentLockedLiquidityPercentage,
3374
+ configParam.creatorLiquidityPercentage,
3375
+ configParam.creatorPermanentLockedLiquidityPercentage,
3376
+ partnerVestingPercentage,
3377
+ creatorVestingPercentage
3186
3378
  )) {
3187
3379
  throw new Error("Sum of LP percentages must equal 100");
3188
3380
  }
3381
+ if (!validatePoolCreationFee(configParam.poolCreationFee)) {
3382
+ throw new Error(
3383
+ `Pool creation fee must be 0 or between ${MIN_POOL_CREATION_FEE} and ${MAX_POOL_CREATION_FEE} lamports`
3384
+ );
3385
+ }
3386
+ if (configParam.migrationOption === 0 /* MET_DAMM */) {
3387
+ const isPartnerVestingZero = !configParam.partnerLiquidityVestingInfo || configParam.partnerLiquidityVestingInfo.vestingPercentage === 0 && configParam.partnerLiquidityVestingInfo.bpsPerPeriod === 0 && configParam.partnerLiquidityVestingInfo.numberOfPeriods === 0 && configParam.partnerLiquidityVestingInfo.cliffDurationFromMigrationTime === 0 && configParam.partnerLiquidityVestingInfo.frequency === 0;
3388
+ const isCreatorVestingZero = !configParam.creatorLiquidityVestingInfo || configParam.creatorLiquidityVestingInfo.vestingPercentage === 0 && configParam.creatorLiquidityVestingInfo.bpsPerPeriod === 0 && configParam.creatorLiquidityVestingInfo.numberOfPeriods === 0 && configParam.creatorLiquidityVestingInfo.cliffDurationFromMigrationTime === 0 && configParam.creatorLiquidityVestingInfo.frequency === 0;
3389
+ if (!isPartnerVestingZero || !isCreatorVestingZero) {
3390
+ throw new Error(
3391
+ "Liquidity vesting is not supported for MeteoraDamm migration"
3392
+ );
3393
+ }
3394
+ } else if (configParam.migrationOption === 1 /* MET_DAMM_V2 */) {
3395
+ if (configParam.partnerLiquidityVestingInfo) {
3396
+ if (!validateLiquidityVestingInfo(
3397
+ configParam.partnerLiquidityVestingInfo
3398
+ )) {
3399
+ throw new Error("Invalid partner liquidity vesting info");
3400
+ }
3401
+ }
3402
+ if (configParam.creatorLiquidityVestingInfo) {
3403
+ if (!validateLiquidityVestingInfo(
3404
+ configParam.creatorLiquidityVestingInfo
3405
+ )) {
3406
+ throw new Error("Invalid creator liquidity vesting info");
3407
+ }
3408
+ }
3409
+ }
3410
+ if (!validateMinimumLockedLiquidity(
3411
+ configParam.partnerPermanentLockedLiquidityPercentage,
3412
+ configParam.creatorPermanentLockedLiquidityPercentage,
3413
+ configParam.partnerLiquidityVestingInfo,
3414
+ configParam.creatorLiquidityVestingInfo
3415
+ )) {
3416
+ const lockedBpsAtDay1 = calculateLockedLiquidityBpsAtTime(
3417
+ configParam.partnerPermanentLockedLiquidityPercentage,
3418
+ configParam.creatorPermanentLockedLiquidityPercentage,
3419
+ configParam.partnerLiquidityVestingInfo,
3420
+ configParam.creatorLiquidityVestingInfo,
3421
+ SECONDS_PER_DAY
3422
+ );
3423
+ throw new Error(
3424
+ `Invalid migration locked liquidity. At least ${MIN_LOCKED_LIQUIDITY_BPS} BPS (10%) must be locked at day 1. Current locked liquidity at day 1: ${lockedBpsAtDay1} BPS. Consider increasing permanent locked liquidity percentage or extending vesting duration/cliff.`
3425
+ );
3426
+ }
3189
3427
  if (configParam.migrationQuoteThreshold.lte(new (0, _bnjs2.default)(0))) {
3190
3428
  throw new Error("Migration quote threshold must be greater than 0");
3191
3429
  }
@@ -3215,7 +3453,7 @@ function validateConfigParameters(configParam) {
3215
3453
  throw new Error("Invalid vesting parameters");
3216
3454
  }
3217
3455
  } catch (error) {
3218
- throw new Error("Invalid vesting parameters");
3456
+ throw new Error(`Invalid vesting parameters ${error}`);
3219
3457
  }
3220
3458
  }
3221
3459
  if (configParam.tokenSupply) {
@@ -3280,7 +3518,7 @@ async function validateBalance(connection, owner, inputMint, amountIn, inputToke
3280
3518
  }
3281
3519
  } catch (error) {
3282
3520
  throw new Error(
3283
- `Failed to fetch token balance or token account doesn't exist`
3521
+ `Failed to fetch token balance or token account doesn't exist ${error}`
3284
3522
  );
3285
3523
  }
3286
3524
  }
@@ -3317,26 +3555,30 @@ function validateMigrationFee(migrationFee) {
3317
3555
  function buildCurve(buildCurveParam) {
3318
3556
  const {
3319
3557
  totalTokenSupply,
3320
- percentageSupplyOnMigration,
3321
- migrationQuoteThreshold,
3322
- migrationOption,
3558
+ tokenType,
3323
3559
  tokenBaseDecimal,
3324
3560
  tokenQuoteDecimal,
3561
+ tokenUpdateAuthority,
3562
+ lockedVestingParams,
3563
+ leftover,
3564
+ baseFeeParams,
3325
3565
  dynamicFeeEnabled,
3326
3566
  activationType,
3327
3567
  collectFeeMode,
3328
- migrationFeeOption,
3329
- tokenType,
3330
- partnerLpPercentage,
3331
- creatorLpPercentage,
3332
- partnerLockedLpPercentage,
3333
- creatorLockedLpPercentage,
3334
3568
  creatorTradingFeePercentage,
3335
- leftover,
3336
- tokenUpdateAuthority,
3569
+ poolCreationFee,
3570
+ migrationOption,
3571
+ migrationFeeOption,
3337
3572
  migrationFee,
3338
- baseFeeParams,
3339
- migratedPoolFee
3573
+ partnerPermanentLockedLiquidityPercentage,
3574
+ partnerLiquidityPercentage,
3575
+ creatorPermanentLockedLiquidityPercentage,
3576
+ creatorLiquidityPercentage,
3577
+ partnerLiquidityVestingInfoParams,
3578
+ creatorLiquidityVestingInfoParams,
3579
+ migratedPoolFee,
3580
+ percentageSupplyOnMigration,
3581
+ migrationQuoteThreshold
3340
3582
  } = buildCurveParam;
3341
3583
  const baseFee = getBaseFeeParams(
3342
3584
  baseFeeParams,
@@ -3349,7 +3591,7 @@ function buildCurve(buildCurveParam) {
3349
3591
  cliffUnlockAmount,
3350
3592
  totalVestingDuration,
3351
3593
  cliffDurationFromMigrationTime
3352
- } = buildCurveParam.lockedVestingParam;
3594
+ } = lockedVestingParams;
3353
3595
  const lockedVesting = getLockedVestingParams(
3354
3596
  totalLockedVestingAmount,
3355
3597
  numberOfVestingPeriod,
@@ -3358,6 +3600,40 @@ function buildCurve(buildCurveParam) {
3358
3600
  cliffDurationFromMigrationTime,
3359
3601
  tokenBaseDecimal
3360
3602
  );
3603
+ const partnerVestingParams = _nullishCoalesce(partnerLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
3604
+ const {
3605
+ vestingPercentage: partnerVestingPercentage,
3606
+ bpsPerPeriod: partnerBpsPerPeriod,
3607
+ numberOfPeriods: partnerNumberOfPeriods,
3608
+ cliffDurationFromMigrationTime: partnerCliffDurationFromMigrationTime,
3609
+ totalDuration: partnerTotalDuration
3610
+ } = partnerVestingParams;
3611
+ const partnerLiquidityVestingInfo = getLiquidityVestingInfoParams(
3612
+ partnerVestingPercentage,
3613
+ partnerBpsPerPeriod,
3614
+ partnerNumberOfPeriods,
3615
+ partnerCliffDurationFromMigrationTime,
3616
+ partnerTotalDuration
3617
+ );
3618
+ const creatorVestingParams = _nullishCoalesce(creatorLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
3619
+ const {
3620
+ vestingPercentage: creatorVestingPercentage,
3621
+ bpsPerPeriod: creatorBpsPerPeriod,
3622
+ numberOfPeriods: creatorNumberOfPeriods,
3623
+ cliffDurationFromMigrationTime: creatorCliffDurationFromMigrationTime,
3624
+ totalDuration: creatorTotalDuration
3625
+ } = creatorVestingParams;
3626
+ const creatorLiquidityVestingInfo = getLiquidityVestingInfoParams(
3627
+ creatorVestingPercentage,
3628
+ creatorBpsPerPeriod,
3629
+ creatorNumberOfPeriods,
3630
+ creatorCliffDurationFromMigrationTime,
3631
+ creatorTotalDuration
3632
+ );
3633
+ const poolCreationFeeInLamports = convertToLamports(
3634
+ poolCreationFee,
3635
+ 9 /* NINE */
3636
+ );
3361
3637
  const migratedPoolFeeParams = getMigratedPoolFeeParams(
3362
3638
  migrationOption,
3363
3639
  migrationFeeOption,
@@ -3429,16 +3705,16 @@ function buildCurve(buildCurveParam) {
3429
3705
  baseFeeParams.baseFeeMode === 2 /* RateLimiter */ ? baseFeeParams.rateLimiterParam.baseFeeBps : baseFeeParams.feeSchedulerParam.endingFeeBps
3430
3706
  ) : null
3431
3707
  },
3432
- activationType,
3433
3708
  collectFeeMode,
3434
3709
  migrationOption,
3710
+ activationType,
3435
3711
  tokenType,
3436
3712
  tokenDecimal: tokenBaseDecimal,
3713
+ partnerLiquidityPercentage,
3714
+ partnerPermanentLockedLiquidityPercentage,
3715
+ creatorLiquidityPercentage,
3716
+ creatorPermanentLockedLiquidityPercentage,
3437
3717
  migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3438
- partnerLpPercentage,
3439
- creatorLpPercentage,
3440
- partnerLockedLpPercentage,
3441
- creatorLockedLpPercentage,
3442
3718
  sqrtStartPrice,
3443
3719
  lockedVesting,
3444
3720
  migrationFeeOption,
@@ -3454,6 +3730,9 @@ function buildCurve(buildCurveParam) {
3454
3730
  dynamicFee: migratedPoolFeeParams.dynamicFee,
3455
3731
  poolFeeBps: migratedPoolFeeParams.poolFeeBps
3456
3732
  },
3733
+ poolCreationFee: poolCreationFeeInLamports,
3734
+ partnerLiquidityVestingInfo,
3735
+ creatorLiquidityVestingInfo,
3457
3736
  padding: [],
3458
3737
  curve
3459
3738
  };
@@ -3461,12 +3740,13 @@ function buildCurve(buildCurveParam) {
3461
3740
  }
3462
3741
  function buildCurveWithMarketCap(buildCurveWithMarketCapParam) {
3463
3742
  const {
3464
- initialMarketCap,
3465
- migrationMarketCap,
3466
3743
  totalTokenSupply,
3467
3744
  tokenBaseDecimal,
3745
+ lockedVestingParams,
3746
+ leftover,
3468
3747
  migrationFee,
3469
- leftover
3748
+ initialMarketCap,
3749
+ migrationMarketCap
3470
3750
  } = buildCurveWithMarketCapParam;
3471
3751
  const {
3472
3752
  totalLockedVestingAmount,
@@ -3474,7 +3754,7 @@ function buildCurveWithMarketCap(buildCurveWithMarketCapParam) {
3474
3754
  cliffUnlockAmount,
3475
3755
  totalVestingDuration,
3476
3756
  cliffDurationFromMigrationTime
3477
- } = buildCurveWithMarketCapParam.lockedVestingParam;
3757
+ } = lockedVestingParams;
3478
3758
  const lockedVesting = getLockedVestingParams(
3479
3759
  totalLockedVestingAmount,
3480
3760
  numberOfVestingPeriod,
@@ -3516,27 +3796,31 @@ function buildCurveWithMarketCap(buildCurveWithMarketCapParam) {
3516
3796
  function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3517
3797
  const {
3518
3798
  totalTokenSupply,
3519
- initialMarketCap,
3520
- migrationMarketCap,
3521
- percentageSupplyOnMigration,
3522
- migrationOption,
3799
+ tokenType,
3523
3800
  tokenBaseDecimal,
3524
3801
  tokenQuoteDecimal,
3525
- creatorTradingFeePercentage,
3526
- collectFeeMode,
3802
+ tokenUpdateAuthority,
3527
3803
  leftover,
3528
- tokenType,
3529
- partnerLpPercentage,
3530
- creatorLpPercentage,
3531
- partnerLockedLpPercentage,
3532
- creatorLockedLpPercentage,
3533
- activationType,
3804
+ lockedVestingParams,
3805
+ baseFeeParams,
3534
3806
  dynamicFeeEnabled,
3807
+ activationType,
3808
+ collectFeeMode,
3809
+ creatorTradingFeePercentage,
3810
+ poolCreationFee,
3811
+ migrationOption,
3535
3812
  migrationFeeOption,
3536
3813
  migrationFee,
3537
- tokenUpdateAuthority,
3538
- baseFeeParams,
3539
- migratedPoolFee
3814
+ partnerPermanentLockedLiquidityPercentage,
3815
+ partnerLiquidityPercentage,
3816
+ creatorPermanentLockedLiquidityPercentage,
3817
+ creatorLiquidityPercentage,
3818
+ partnerLiquidityVestingInfoParams,
3819
+ creatorLiquidityVestingInfoParams,
3820
+ migratedPoolFee,
3821
+ initialMarketCap,
3822
+ migrationMarketCap,
3823
+ percentageSupplyOnMigration
3540
3824
  } = buildCurveWithTwoSegmentsParam;
3541
3825
  const baseFee = getBaseFeeParams(
3542
3826
  baseFeeParams,
@@ -3549,7 +3833,7 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3549
3833
  cliffUnlockAmount,
3550
3834
  totalVestingDuration,
3551
3835
  cliffDurationFromMigrationTime
3552
- } = buildCurveWithTwoSegmentsParam.lockedVestingParam;
3836
+ } = lockedVestingParams;
3553
3837
  const lockedVesting = getLockedVestingParams(
3554
3838
  totalLockedVestingAmount,
3555
3839
  numberOfVestingPeriod,
@@ -3558,6 +3842,40 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3558
3842
  cliffDurationFromMigrationTime,
3559
3843
  tokenBaseDecimal
3560
3844
  );
3845
+ const partnerVestingParams = _nullishCoalesce(partnerLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
3846
+ const {
3847
+ vestingPercentage: partnerVestingPercentage,
3848
+ bpsPerPeriod: partnerBpsPerPeriod,
3849
+ numberOfPeriods: partnerNumberOfPeriods,
3850
+ cliffDurationFromMigrationTime: partnerCliffDurationFromMigrationTime,
3851
+ totalDuration: partnerTotalDuration
3852
+ } = partnerVestingParams;
3853
+ const partnerLiquidityVestingInfo = getLiquidityVestingInfoParams(
3854
+ partnerVestingPercentage,
3855
+ partnerBpsPerPeriod,
3856
+ partnerNumberOfPeriods,
3857
+ partnerCliffDurationFromMigrationTime,
3858
+ partnerTotalDuration
3859
+ );
3860
+ const creatorVestingParams = _nullishCoalesce(creatorLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
3861
+ const {
3862
+ vestingPercentage: creatorVestingPercentage,
3863
+ bpsPerPeriod: creatorBpsPerPeriod,
3864
+ numberOfPeriods: creatorNumberOfPeriods,
3865
+ cliffDurationFromMigrationTime: creatorCliffDurationFromMigrationTime,
3866
+ totalDuration: creatorTotalDuration
3867
+ } = creatorVestingParams;
3868
+ const creatorLiquidityVestingInfo = getLiquidityVestingInfoParams(
3869
+ creatorVestingPercentage,
3870
+ creatorBpsPerPeriod,
3871
+ creatorNumberOfPeriods,
3872
+ creatorCliffDurationFromMigrationTime,
3873
+ creatorTotalDuration
3874
+ );
3875
+ const poolCreationFeeInLamports = convertToLamports(
3876
+ poolCreationFee,
3877
+ 9 /* NINE */
3878
+ );
3561
3879
  const migratedPoolFeeParams = getMigratedPoolFeeParams(
3562
3880
  migrationOption,
3563
3881
  migrationFeeOption,
@@ -3660,10 +3978,10 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3660
3978
  tokenType,
3661
3979
  tokenDecimal: tokenBaseDecimal,
3662
3980
  migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3663
- partnerLpPercentage,
3664
- creatorLpPercentage,
3665
- partnerLockedLpPercentage,
3666
- creatorLockedLpPercentage,
3981
+ partnerLiquidityPercentage,
3982
+ partnerPermanentLockedLiquidityPercentage,
3983
+ creatorLiquidityPercentage,
3984
+ creatorPermanentLockedLiquidityPercentage,
3667
3985
  sqrtStartPrice,
3668
3986
  lockedVesting,
3669
3987
  migrationFeeOption,
@@ -3677,6 +3995,9 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3677
3995
  dynamicFee: migratedPoolFeeParams.dynamicFee,
3678
3996
  poolFeeBps: migratedPoolFeeParams.poolFeeBps
3679
3997
  },
3998
+ poolCreationFee: poolCreationFeeInLamports,
3999
+ partnerLiquidityVestingInfo,
4000
+ creatorLiquidityVestingInfo,
3680
4001
  padding: [],
3681
4002
  curve,
3682
4003
  tokenUpdateAuthority,
@@ -3687,28 +4008,32 @@ function buildCurveWithTwoSegments(buildCurveWithTwoSegmentsParam) {
3687
4008
  function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3688
4009
  const {
3689
4010
  totalTokenSupply,
3690
- initialMarketCap,
3691
- migrationMarketCap,
3692
- midPrice,
3693
- percentageSupplyOnMigration,
3694
- migrationOption,
4011
+ tokenType,
3695
4012
  tokenBaseDecimal,
3696
4013
  tokenQuoteDecimal,
3697
- creatorTradingFeePercentage,
3698
- collectFeeMode,
4014
+ tokenUpdateAuthority,
4015
+ lockedVestingParams,
3699
4016
  leftover,
3700
- tokenType,
3701
- partnerLpPercentage,
3702
- creatorLpPercentage,
3703
- partnerLockedLpPercentage,
3704
- creatorLockedLpPercentage,
3705
- activationType,
4017
+ baseFeeParams,
3706
4018
  dynamicFeeEnabled,
4019
+ activationType,
4020
+ collectFeeMode,
4021
+ creatorTradingFeePercentage,
4022
+ poolCreationFee,
4023
+ migrationOption,
3707
4024
  migrationFeeOption,
3708
4025
  migrationFee,
3709
- tokenUpdateAuthority,
3710
- baseFeeParams,
3711
- migratedPoolFee
4026
+ partnerPermanentLockedLiquidityPercentage,
4027
+ partnerLiquidityPercentage,
4028
+ creatorPermanentLockedLiquidityPercentage,
4029
+ creatorLiquidityPercentage,
4030
+ partnerLiquidityVestingInfoParams,
4031
+ creatorLiquidityVestingInfoParams,
4032
+ migratedPoolFee,
4033
+ initialMarketCap,
4034
+ migrationMarketCap,
4035
+ midPrice,
4036
+ percentageSupplyOnMigration
3712
4037
  } = buildCurveWithMidPriceParam;
3713
4038
  const baseFee = getBaseFeeParams(
3714
4039
  baseFeeParams,
@@ -3721,7 +4046,7 @@ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3721
4046
  cliffUnlockAmount,
3722
4047
  totalVestingDuration,
3723
4048
  cliffDurationFromMigrationTime
3724
- } = buildCurveWithMidPriceParam.lockedVestingParam;
4049
+ } = lockedVestingParams;
3725
4050
  const lockedVesting = getLockedVestingParams(
3726
4051
  totalLockedVestingAmount,
3727
4052
  numberOfVestingPeriod,
@@ -3730,6 +4055,40 @@ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3730
4055
  cliffDurationFromMigrationTime,
3731
4056
  tokenBaseDecimal
3732
4057
  );
4058
+ const partnerVestingParams = _nullishCoalesce(partnerLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4059
+ const {
4060
+ vestingPercentage: partnerVestingPercentage,
4061
+ bpsPerPeriod: partnerBpsPerPeriod,
4062
+ numberOfPeriods: partnerNumberOfPeriods,
4063
+ cliffDurationFromMigrationTime: partnerCliffDurationFromMigrationTime,
4064
+ totalDuration: partnerTotalDuration
4065
+ } = partnerVestingParams;
4066
+ const partnerLiquidityVestingInfo = getLiquidityVestingInfoParams(
4067
+ partnerVestingPercentage,
4068
+ partnerBpsPerPeriod,
4069
+ partnerNumberOfPeriods,
4070
+ partnerCliffDurationFromMigrationTime,
4071
+ partnerTotalDuration
4072
+ );
4073
+ const creatorVestingParams = _nullishCoalesce(creatorLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4074
+ const {
4075
+ vestingPercentage: creatorVestingPercentage,
4076
+ bpsPerPeriod: creatorBpsPerPeriod,
4077
+ numberOfPeriods: creatorNumberOfPeriods,
4078
+ cliffDurationFromMigrationTime: creatorCliffDurationFromMigrationTime,
4079
+ totalDuration: creatorTotalDuration
4080
+ } = creatorVestingParams;
4081
+ const creatorLiquidityVestingInfo = getLiquidityVestingInfoParams(
4082
+ creatorVestingPercentage,
4083
+ creatorBpsPerPeriod,
4084
+ creatorNumberOfPeriods,
4085
+ creatorCliffDurationFromMigrationTime,
4086
+ creatorTotalDuration
4087
+ );
4088
+ const poolCreationFeeInLamports = convertToLamports(
4089
+ poolCreationFee,
4090
+ 9 /* NINE */
4091
+ );
3733
4092
  const migratedPoolFeeParams = getMigratedPoolFeeParams(
3734
4093
  migrationOption,
3735
4094
  migrationFeeOption,
@@ -3819,10 +4178,10 @@ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3819
4178
  tokenType,
3820
4179
  tokenDecimal: tokenBaseDecimal,
3821
4180
  migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3822
- partnerLpPercentage,
3823
- creatorLpPercentage,
3824
- partnerLockedLpPercentage,
3825
- creatorLockedLpPercentage,
4181
+ partnerLiquidityPercentage,
4182
+ partnerPermanentLockedLiquidityPercentage,
4183
+ creatorLiquidityPercentage,
4184
+ creatorPermanentLockedLiquidityPercentage,
3826
4185
  sqrtStartPrice,
3827
4186
  lockedVesting,
3828
4187
  migrationFeeOption,
@@ -3836,6 +4195,9 @@ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3836
4195
  dynamicFee: migratedPoolFeeParams.dynamicFee,
3837
4196
  poolFeeBps: migratedPoolFeeParams.poolFeeBps
3838
4197
  },
4198
+ poolCreationFee: poolCreationFeeInLamports,
4199
+ partnerLiquidityVestingInfo,
4200
+ creatorLiquidityVestingInfo,
3839
4201
  padding: [],
3840
4202
  curve,
3841
4203
  tokenUpdateAuthority,
@@ -3846,27 +4208,31 @@ function buildCurveWithMidPrice(buildCurveWithMidPriceParam) {
3846
4208
  function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3847
4209
  const {
3848
4210
  totalTokenSupply,
3849
- migrationOption,
4211
+ tokenType,
3850
4212
  tokenBaseDecimal,
3851
4213
  tokenQuoteDecimal,
4214
+ tokenUpdateAuthority,
4215
+ lockedVestingParams,
4216
+ leftover,
4217
+ baseFeeParams,
3852
4218
  dynamicFeeEnabled,
3853
4219
  activationType,
3854
4220
  collectFeeMode,
3855
- migrationFeeOption,
3856
- tokenType,
3857
- partnerLpPercentage,
3858
- creatorLpPercentage,
3859
- partnerLockedLpPercentage,
3860
- creatorLockedLpPercentage,
3861
4221
  creatorTradingFeePercentage,
3862
- leftover,
4222
+ poolCreationFee,
4223
+ migrationOption,
4224
+ migrationFeeOption,
4225
+ migrationFee,
4226
+ partnerPermanentLockedLiquidityPercentage,
4227
+ partnerLiquidityPercentage,
4228
+ creatorPermanentLockedLiquidityPercentage,
4229
+ creatorLiquidityPercentage,
4230
+ partnerLiquidityVestingInfoParams,
4231
+ creatorLiquidityVestingInfoParams,
4232
+ migratedPoolFee,
3863
4233
  initialMarketCap,
3864
4234
  migrationMarketCap,
3865
- liquidityWeights,
3866
- migrationFee,
3867
- tokenUpdateAuthority,
3868
- baseFeeParams,
3869
- migratedPoolFee
4235
+ liquidityWeights
3870
4236
  } = buildCurveWithLiquidityWeightsParam;
3871
4237
  const baseFee = getBaseFeeParams(
3872
4238
  baseFeeParams,
@@ -3879,7 +4245,7 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3879
4245
  cliffUnlockAmount,
3880
4246
  totalVestingDuration,
3881
4247
  cliffDurationFromMigrationTime
3882
- } = buildCurveWithLiquidityWeightsParam.lockedVestingParam;
4248
+ } = lockedVestingParams;
3883
4249
  const lockedVesting = getLockedVestingParams(
3884
4250
  totalLockedVestingAmount,
3885
4251
  numberOfVestingPeriod,
@@ -3888,6 +4254,40 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3888
4254
  cliffDurationFromMigrationTime,
3889
4255
  tokenBaseDecimal
3890
4256
  );
4257
+ const partnerVestingParams = _nullishCoalesce(partnerLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4258
+ const {
4259
+ vestingPercentage: partnerVestingPercentage,
4260
+ bpsPerPeriod: partnerBpsPerPeriod,
4261
+ numberOfPeriods: partnerNumberOfPeriods,
4262
+ cliffDurationFromMigrationTime: partnerCliffDurationFromMigrationTime,
4263
+ totalDuration: partnerTotalDuration
4264
+ } = partnerVestingParams;
4265
+ const partnerLiquidityVestingInfo = getLiquidityVestingInfoParams(
4266
+ partnerVestingPercentage,
4267
+ partnerBpsPerPeriod,
4268
+ partnerNumberOfPeriods,
4269
+ partnerCliffDurationFromMigrationTime,
4270
+ partnerTotalDuration
4271
+ );
4272
+ const creatorVestingParams = _nullishCoalesce(creatorLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4273
+ const {
4274
+ vestingPercentage: creatorVestingPercentage,
4275
+ bpsPerPeriod: creatorBpsPerPeriod,
4276
+ numberOfPeriods: creatorNumberOfPeriods,
4277
+ cliffDurationFromMigrationTime: creatorCliffDurationFromMigrationTime,
4278
+ totalDuration: creatorTotalDuration
4279
+ } = creatorVestingParams;
4280
+ const creatorLiquidityVestingInfo = getLiquidityVestingInfoParams(
4281
+ creatorVestingPercentage,
4282
+ creatorBpsPerPeriod,
4283
+ creatorNumberOfPeriods,
4284
+ creatorCliffDurationFromMigrationTime,
4285
+ creatorTotalDuration
4286
+ );
4287
+ const poolCreationFeeInLamports = convertToLamports(
4288
+ poolCreationFee,
4289
+ 9 /* NINE */
4290
+ );
3891
4291
  const migratedPoolFeeParams = getMigratedPoolFeeParams(
3892
4292
  migrationOption,
3893
4293
  migrationFeeOption,
@@ -3991,10 +4391,10 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
3991
4391
  tokenType,
3992
4392
  tokenDecimal: tokenBaseDecimal,
3993
4393
  migrationQuoteThreshold: migrationQuoteThresholdInLamport,
3994
- partnerLpPercentage,
3995
- creatorLpPercentage,
3996
- partnerLockedLpPercentage,
3997
- creatorLockedLpPercentage,
4394
+ partnerLiquidityPercentage,
4395
+ partnerPermanentLockedLiquidityPercentage,
4396
+ creatorLiquidityPercentage,
4397
+ creatorPermanentLockedLiquidityPercentage,
3998
4398
  sqrtStartPrice: pMin,
3999
4399
  lockedVesting,
4000
4400
  migrationFeeOption,
@@ -4008,6 +4408,9 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
4008
4408
  dynamicFee: migratedPoolFeeParams.dynamicFee,
4009
4409
  poolFeeBps: migratedPoolFeeParams.poolFeeBps
4010
4410
  },
4411
+ poolCreationFee: poolCreationFeeInLamports,
4412
+ partnerLiquidityVestingInfo,
4413
+ creatorLiquidityVestingInfo,
4011
4414
  padding: [],
4012
4415
  curve,
4013
4416
  migrationFee,
@@ -4018,25 +4421,29 @@ function buildCurveWithLiquidityWeights(buildCurveWithLiquidityWeightsParam) {
4018
4421
  function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4019
4422
  const {
4020
4423
  totalTokenSupply,
4021
- migrationOption,
4424
+ tokenType,
4022
4425
  tokenBaseDecimal,
4023
4426
  tokenQuoteDecimal,
4427
+ tokenUpdateAuthority,
4428
+ lockedVestingParams,
4429
+ leftover,
4430
+ baseFeeParams,
4024
4431
  dynamicFeeEnabled,
4025
4432
  activationType,
4026
4433
  collectFeeMode,
4027
- migrationFeeOption,
4028
- tokenType,
4029
- partnerLpPercentage,
4030
- creatorLpPercentage,
4031
- partnerLockedLpPercentage,
4032
- creatorLockedLpPercentage,
4033
4434
  creatorTradingFeePercentage,
4034
- leftover,
4035
- sqrtPrices,
4435
+ poolCreationFee,
4436
+ migrationOption,
4437
+ migrationFeeOption,
4036
4438
  migrationFee,
4037
- tokenUpdateAuthority,
4038
- baseFeeParams,
4039
- migratedPoolFee
4439
+ partnerPermanentLockedLiquidityPercentage,
4440
+ partnerLiquidityPercentage,
4441
+ creatorPermanentLockedLiquidityPercentage,
4442
+ creatorLiquidityPercentage,
4443
+ partnerLiquidityVestingInfoParams,
4444
+ creatorLiquidityVestingInfoParams,
4445
+ migratedPoolFee,
4446
+ sqrtPrices
4040
4447
  } = buildCurveWithCustomSqrtPricesParam;
4041
4448
  let { liquidityWeights } = buildCurveWithCustomSqrtPricesParam;
4042
4449
  if (sqrtPrices.length < 2) {
@@ -4066,7 +4473,7 @@ function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4066
4473
  cliffUnlockAmount,
4067
4474
  totalVestingDuration,
4068
4475
  cliffDurationFromMigrationTime
4069
- } = buildCurveWithCustomSqrtPricesParam.lockedVestingParam;
4476
+ } = lockedVestingParams;
4070
4477
  const lockedVesting = getLockedVestingParams(
4071
4478
  totalLockedVestingAmount,
4072
4479
  numberOfVestingPeriod,
@@ -4075,6 +4482,40 @@ function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4075
4482
  cliffDurationFromMigrationTime,
4076
4483
  tokenBaseDecimal
4077
4484
  );
4485
+ const partnerVestingParams = _nullishCoalesce(partnerLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4486
+ const {
4487
+ vestingPercentage: partnerVestingPercentage,
4488
+ bpsPerPeriod: partnerBpsPerPeriod,
4489
+ numberOfPeriods: partnerNumberOfPeriods,
4490
+ cliffDurationFromMigrationTime: partnerCliffDurationFromMigrationTime,
4491
+ totalDuration: partnerTotalDuration
4492
+ } = partnerVestingParams;
4493
+ const partnerLiquidityVestingInfo = getLiquidityVestingInfoParams(
4494
+ partnerVestingPercentage,
4495
+ partnerBpsPerPeriod,
4496
+ partnerNumberOfPeriods,
4497
+ partnerCliffDurationFromMigrationTime,
4498
+ partnerTotalDuration
4499
+ );
4500
+ const creatorVestingParams = _nullishCoalesce(creatorLiquidityVestingInfoParams, () => ( DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS));
4501
+ const {
4502
+ vestingPercentage: creatorVestingPercentage,
4503
+ bpsPerPeriod: creatorBpsPerPeriod,
4504
+ numberOfPeriods: creatorNumberOfPeriods,
4505
+ cliffDurationFromMigrationTime: creatorCliffDurationFromMigrationTime,
4506
+ totalDuration: creatorTotalDuration
4507
+ } = creatorVestingParams;
4508
+ const creatorLiquidityVestingInfo = getLiquidityVestingInfoParams(
4509
+ creatorVestingPercentage,
4510
+ creatorBpsPerPeriod,
4511
+ creatorNumberOfPeriods,
4512
+ creatorCliffDurationFromMigrationTime,
4513
+ creatorTotalDuration
4514
+ );
4515
+ const poolCreationFeeInLamports = convertToLamports(
4516
+ poolCreationFee,
4517
+ 9 /* NINE */
4518
+ );
4078
4519
  const migratedPoolFeeParams = getMigratedPoolFeeParams(
4079
4520
  migrationOption,
4080
4521
  migrationFeeOption,
@@ -4157,10 +4598,10 @@ function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4157
4598
  tokenType,
4158
4599
  tokenDecimal: tokenBaseDecimal,
4159
4600
  migrationQuoteThreshold: migrationQuoteThresholdInLamport,
4160
- partnerLpPercentage,
4161
- creatorLpPercentage,
4162
- partnerLockedLpPercentage,
4163
- creatorLockedLpPercentage,
4601
+ partnerLiquidityPercentage,
4602
+ partnerPermanentLockedLiquidityPercentage,
4603
+ creatorLiquidityPercentage,
4604
+ creatorPermanentLockedLiquidityPercentage,
4164
4605
  sqrtStartPrice: pMin,
4165
4606
  lockedVesting,
4166
4607
  migrationFeeOption,
@@ -4174,6 +4615,9 @@ function buildCurveWithCustomSqrtPrices(buildCurveWithCustomSqrtPricesParam) {
4174
4615
  dynamicFee: migratedPoolFeeParams.dynamicFee,
4175
4616
  poolFeeBps: migratedPoolFeeParams.poolFeeBps
4176
4617
  },
4618
+ poolCreationFee: poolCreationFeeInLamports,
4619
+ partnerLiquidityVestingInfo,
4620
+ creatorLiquidityVestingInfo,
4177
4621
  padding: [],
4178
4622
  curve,
4179
4623
  migrationFee,
@@ -4190,7 +4634,7 @@ var idl_default = {
4190
4634
  address: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN",
4191
4635
  metadata: {
4192
4636
  name: "dynamic_bonding_curve",
4193
- version: "0.1.7",
4637
+ version: "0.1.8",
4194
4638
  spec: "0.1.0",
4195
4639
  description: "Created with Anchor"
4196
4640
  },
@@ -4267,10 +4711,7 @@ var idl_default = {
4267
4711
  },
4268
4712
  {
4269
4713
  name: "creator",
4270
- signer: true,
4271
- relations: [
4272
- "pool"
4273
- ]
4714
+ signer: true
4274
4715
  },
4275
4716
  {
4276
4717
  name: "token_base_program",
@@ -4329,18 +4770,18 @@ var idl_default = {
4329
4770
  ]
4330
4771
  },
4331
4772
  {
4332
- name: "claim_pool_creation_fee",
4773
+ name: "claim_legacy_pool_creation_fee",
4333
4774
  discriminator: [
4334
- 246,
4335
- 51,
4336
- 18,
4337
- 222,
4338
- 80,
4339
- 42,
4340
- 236,
4341
- 205
4342
- ],
4343
- accounts: [
4775
+ 96,
4776
+ 11,
4777
+ 187,
4778
+ 225,
4779
+ 54,
4780
+ 117,
4781
+ 161,
4782
+ 134
4783
+ ],
4784
+ accounts: [
4344
4785
  {
4345
4786
  name: "pool",
4346
4787
  writable: true
@@ -4352,14 +4793,11 @@ var idl_default = {
4352
4793
  ]
4353
4794
  },
4354
4795
  {
4355
- name: "operator",
4796
+ name: "signer",
4356
4797
  docs: [
4357
4798
  "Operator"
4358
4799
  ],
4359
- signer: true,
4360
- relations: [
4361
- "claim_fee_operator"
4362
- ]
4800
+ signer: true
4363
4801
  },
4364
4802
  {
4365
4803
  name: "treasury",
@@ -4405,6 +4843,72 @@ var idl_default = {
4405
4843
  ],
4406
4844
  args: []
4407
4845
  },
4846
+ {
4847
+ name: "claim_partner_pool_creation_fee",
4848
+ discriminator: [
4849
+ 250,
4850
+ 238,
4851
+ 26,
4852
+ 4,
4853
+ 139,
4854
+ 10,
4855
+ 101,
4856
+ 248
4857
+ ],
4858
+ accounts: [
4859
+ {
4860
+ name: "config",
4861
+ relations: [
4862
+ "pool"
4863
+ ]
4864
+ },
4865
+ {
4866
+ name: "pool",
4867
+ writable: true
4868
+ },
4869
+ {
4870
+ name: "fee_claimer",
4871
+ signer: true
4872
+ },
4873
+ {
4874
+ name: "fee_receiver",
4875
+ writable: true
4876
+ },
4877
+ {
4878
+ name: "event_authority",
4879
+ pda: {
4880
+ seeds: [
4881
+ {
4882
+ kind: "const",
4883
+ value: [
4884
+ 95,
4885
+ 95,
4886
+ 101,
4887
+ 118,
4888
+ 101,
4889
+ 110,
4890
+ 116,
4891
+ 95,
4892
+ 97,
4893
+ 117,
4894
+ 116,
4895
+ 104,
4896
+ 111,
4897
+ 114,
4898
+ 105,
4899
+ 116,
4900
+ 121
4901
+ ]
4902
+ }
4903
+ ]
4904
+ }
4905
+ },
4906
+ {
4907
+ name: "program"
4908
+ }
4909
+ ],
4910
+ args: []
4911
+ },
4408
4912
  {
4409
4913
  name: "claim_protocol_fee",
4410
4914
  discriminator: [
@@ -4663,14 +5167,11 @@ var idl_default = {
4663
5167
  ]
4664
5168
  },
4665
5169
  {
4666
- name: "operator",
5170
+ name: "signer",
4667
5171
  docs: [
4668
- "Operator"
5172
+ "Signer"
4669
5173
  ],
4670
- signer: true,
4671
- relations: [
4672
- "claim_fee_operator"
4673
- ]
5174
+ signer: true
4674
5175
  },
4675
5176
  {
4676
5177
  name: "token_base_program",
@@ -4719,6 +5220,82 @@ var idl_default = {
4719
5220
  ],
4720
5221
  args: []
4721
5222
  },
5223
+ {
5224
+ name: "claim_protocol_pool_creation_fee",
5225
+ discriminator: [
5226
+ 114,
5227
+ 205,
5228
+ 83,
5229
+ 188,
5230
+ 240,
5231
+ 153,
5232
+ 25,
5233
+ 54
5234
+ ],
5235
+ accounts: [
5236
+ {
5237
+ name: "config",
5238
+ relations: [
5239
+ "pool"
5240
+ ]
5241
+ },
5242
+ {
5243
+ name: "pool",
5244
+ writable: true
5245
+ },
5246
+ {
5247
+ name: "claim_fee_operator",
5248
+ docs: [
5249
+ "Claim fee operator"
5250
+ ]
5251
+ },
5252
+ {
5253
+ name: "signer",
5254
+ docs: [
5255
+ "Operator"
5256
+ ],
5257
+ signer: true
5258
+ },
5259
+ {
5260
+ name: "treasury",
5261
+ writable: true,
5262
+ address: "4EWqcx3aNZmMetCnxwLYwyNjan6XLGp3Ca2W316vrSjv"
5263
+ },
5264
+ {
5265
+ name: "event_authority",
5266
+ pda: {
5267
+ seeds: [
5268
+ {
5269
+ kind: "const",
5270
+ value: [
5271
+ 95,
5272
+ 95,
5273
+ 101,
5274
+ 118,
5275
+ 101,
5276
+ 110,
5277
+ 116,
5278
+ 95,
5279
+ 97,
5280
+ 117,
5281
+ 116,
5282
+ 104,
5283
+ 111,
5284
+ 114,
5285
+ 105,
5286
+ 116,
5287
+ 121
5288
+ ]
5289
+ }
5290
+ ]
5291
+ }
5292
+ },
5293
+ {
5294
+ name: "program"
5295
+ }
5296
+ ],
5297
+ args: []
5298
+ },
4722
5299
  {
4723
5300
  name: "claim_trading_fee",
4724
5301
  discriminator: [
@@ -4800,10 +5377,7 @@ var idl_default = {
4800
5377
  },
4801
5378
  {
4802
5379
  name: "fee_claimer",
4803
- signer: true,
4804
- relations: [
4805
- "config"
4806
- ]
5380
+ signer: true
4807
5381
  },
4808
5382
  {
4809
5383
  name: "token_base_program",
@@ -4862,16 +5436,16 @@ var idl_default = {
4862
5436
  ]
4863
5437
  },
4864
5438
  {
4865
- name: "close_claim_fee_operator",
5439
+ name: "close_claim_protocol_fee_operator",
4866
5440
  discriminator: [
4867
- 38,
4868
- 134,
4869
- 82,
4870
- 216,
4871
- 95,
4872
- 124,
4873
- 17,
4874
- 99
5441
+ 8,
5442
+ 41,
5443
+ 87,
5444
+ 35,
5445
+ 80,
5446
+ 48,
5447
+ 121,
5448
+ 26
4875
5449
  ],
4876
5450
  accounts: [
4877
5451
  {
@@ -4883,7 +5457,7 @@ var idl_default = {
4883
5457
  writable: true
4884
5458
  },
4885
5459
  {
4886
- name: "admin",
5460
+ name: "signer",
4887
5461
  signer: true
4888
5462
  },
4889
5463
  {
@@ -4922,19 +5496,16 @@ var idl_default = {
4922
5496
  args: []
4923
5497
  },
4924
5498
  {
4925
- name: "create_claim_fee_operator",
4926
- docs: [
4927
- "ADMIN FUNCTIONS_ ///"
4928
- ],
5499
+ name: "create_claim_protocol_fee_operator",
4929
5500
  discriminator: [
4930
- 169,
4931
- 62,
4932
- 207,
4933
- 107,
4934
- 58,
4935
- 187,
4936
- 162,
4937
- 109
5501
+ 51,
5502
+ 19,
5503
+ 150,
5504
+ 252,
5505
+ 105,
5506
+ 157,
5507
+ 48,
5508
+ 91
4938
5509
  ],
4939
5510
  accounts: [
4940
5511
  {
@@ -4969,7 +5540,11 @@ var idl_default = {
4969
5540
  name: "operator"
4970
5541
  },
4971
5542
  {
4972
- name: "admin",
5543
+ name: "signer",
5544
+ signer: true
5545
+ },
5546
+ {
5547
+ name: "payer",
4973
5548
  writable: true,
4974
5549
  signer: true
4975
5550
  },
@@ -5392,10 +5967,7 @@ var idl_default = {
5392
5967
  },
5393
5968
  {
5394
5969
  name: "creator",
5395
- signer: true,
5396
- relations: [
5397
- "virtual_pool"
5398
- ]
5970
+ signer: true
5399
5971
  },
5400
5972
  {
5401
5973
  name: "payer",
@@ -5511,10 +6083,7 @@ var idl_default = {
5511
6083
  },
5512
6084
  {
5513
6085
  name: "creator",
5514
- signer: true,
5515
- relations: [
5516
- "virtual_pool"
5517
- ]
6086
+ signer: true
5518
6087
  },
5519
6088
  {
5520
6089
  name: "token_quote_program",
@@ -6549,7 +7118,8 @@ var idl_default = {
6549
7118
  },
6550
7119
  {
6551
7120
  name: "first_position_nft_mint",
6552
- writable: true
7121
+ writable: true,
7122
+ signer: true
6553
7123
  },
6554
7124
  {
6555
7125
  name: "first_position_nft_account",
@@ -6562,6 +7132,7 @@ var idl_default = {
6562
7132
  {
6563
7133
  name: "second_position_nft_mint",
6564
7134
  writable: true,
7135
+ signer: true,
6565
7136
  optional: true
6566
7137
  },
6567
7138
  {
@@ -6849,10 +7420,7 @@ var idl_default = {
6849
7420
  },
6850
7421
  {
6851
7422
  name: "fee_claimer",
6852
- signer: true,
6853
- relations: [
6854
- "config"
6855
- ]
7423
+ signer: true
6856
7424
  },
6857
7425
  {
6858
7426
  name: "token_quote_program",
@@ -7034,6 +7602,19 @@ var idl_default = {
7034
7602
  "config"
7035
7603
  ]
7036
7604
  },
7605
+ {
7606
+ name: "claim_fee_operator",
7607
+ docs: [
7608
+ "Claim fee operator"
7609
+ ]
7610
+ },
7611
+ {
7612
+ name: "signer",
7613
+ docs: [
7614
+ "Signer"
7615
+ ],
7616
+ signer: true
7617
+ },
7037
7618
  {
7038
7619
  name: "token_quote_program",
7039
7620
  docs: [
@@ -7403,10 +7984,7 @@ var idl_default = {
7403
7984
  },
7404
7985
  {
7405
7986
  name: "creator",
7406
- signer: true,
7407
- relations: [
7408
- "virtual_pool"
7409
- ]
7987
+ signer: true
7410
7988
  },
7411
7989
  {
7412
7990
  name: "new_creator"
@@ -7441,37 +8019,7 @@ var idl_default = {
7441
8019
  }
7442
8020
  },
7443
8021
  {
7444
- name: "program"
7445
- }
7446
- ],
7447
- args: []
7448
- },
7449
- {
7450
- name: "withdraw_lamports_from_pool_authority",
7451
- discriminator: [
7452
- 20,
7453
- 185,
7454
- 242,
7455
- 240,
7456
- 129,
7457
- 24,
7458
- 212,
7459
- 194
7460
- ],
7461
- accounts: [
7462
- {
7463
- name: "pool_authority",
7464
- writable: true,
7465
- address: "FhVo3mqL8PW5pH5U2CN4XE33DokiyZnUwuGpH2hmHLuM"
7466
- },
7467
- {
7468
- name: "receiver",
7469
- writable: true,
7470
- address: "4EWqcx3aNZmMetCnxwLYwyNjan6XLGp3Ca2W316vrSjv"
7471
- },
7472
- {
7473
- name: "system_program",
7474
- address: "11111111111111111111111111111111"
8022
+ name: "program"
7475
8023
  }
7476
8024
  ],
7477
8025
  args: []
@@ -7999,6 +8547,19 @@ var idl_default = {
7999
8547
  37
8000
8548
  ]
8001
8549
  },
8550
+ {
8551
+ name: "EvtPartnerClaimPoolCreationFee",
8552
+ discriminator: [
8553
+ 174,
8554
+ 223,
8555
+ 44,
8556
+ 150,
8557
+ 145,
8558
+ 98,
8559
+ 89,
8560
+ 195
8561
+ ]
8562
+ },
8002
8563
  {
8003
8564
  name: "EvtPartnerMetadata",
8004
8565
  discriminator: [
@@ -8385,6 +8946,31 @@ var idl_default = {
8385
8946
  code: 6050,
8386
8947
  name: "AccountInvariantViolation",
8387
8948
  msg: "Account invariant violation"
8949
+ },
8950
+ {
8951
+ code: 6051,
8952
+ name: "InvalidPoolCreationFee",
8953
+ msg: "Invalid pool creation fee"
8954
+ },
8955
+ {
8956
+ code: 6052,
8957
+ name: "PoolCreationFeeHasBeenClaimed",
8958
+ msg: "Pool creation fee has been claimed"
8959
+ },
8960
+ {
8961
+ code: 6053,
8962
+ name: "Unauthorized",
8963
+ msg: "Not permit to do this action"
8964
+ },
8965
+ {
8966
+ code: 6054,
8967
+ name: "ZeroPoolCreationFee",
8968
+ msg: "Pool creation fee is zero"
8969
+ },
8970
+ {
8971
+ code: 6055,
8972
+ name: "InvalidMigrationLockedLiquidity",
8973
+ msg: "Invalid migration locked liquidity"
8388
8974
  }
8389
8975
  ],
8390
8976
  types: [
@@ -8570,19 +9156,19 @@ var idl_default = {
8570
9156
  type: "u8"
8571
9157
  },
8572
9158
  {
8573
- name: "partner_lp_percentage",
9159
+ name: "partner_liquidity_percentage",
8574
9160
  type: "u8"
8575
9161
  },
8576
9162
  {
8577
- name: "partner_locked_lp_percentage",
9163
+ name: "partner_permanent_locked_liquidity_percentage",
8578
9164
  type: "u8"
8579
9165
  },
8580
9166
  {
8581
- name: "creator_lp_percentage",
9167
+ name: "creator_liquidity_percentage",
8582
9168
  type: "u8"
8583
9169
  },
8584
9170
  {
8585
- name: "creator_locked_lp_percentage",
9171
+ name: "creator_permanent_locked_liquidity_percentage",
8586
9172
  type: "u8"
8587
9173
  },
8588
9174
  {
@@ -8639,6 +9225,29 @@ var idl_default = {
8639
9225
  }
8640
9226
  }
8641
9227
  },
9228
+ {
9229
+ name: "pool_creation_fee",
9230
+ docs: [
9231
+ "pool creation fee in SOL lamports value"
9232
+ ],
9233
+ type: "u64"
9234
+ },
9235
+ {
9236
+ name: "partner_liquidity_vesting_info",
9237
+ type: {
9238
+ defined: {
9239
+ name: "LiquidityVestingInfoParams"
9240
+ }
9241
+ }
9242
+ },
9243
+ {
9244
+ name: "creator_liquidity_vesting_info",
9245
+ type: {
9246
+ defined: {
9247
+ name: "LiquidityVestingInfoParams"
9248
+ }
9249
+ }
9250
+ },
8642
9251
  {
8643
9252
  name: "padding",
8644
9253
  docs: [
@@ -8646,8 +9255,8 @@ var idl_default = {
8646
9255
  ],
8647
9256
  type: {
8648
9257
  array: [
8649
- "u64",
8650
- 7
9258
+ "u8",
9259
+ 22
8651
9260
  ]
8652
9261
  }
8653
9262
  },
@@ -8850,7 +9459,7 @@ var idl_default = {
8850
9459
  type: "pubkey"
8851
9460
  },
8852
9461
  {
8853
- name: "treasury",
9462
+ name: "receiver",
8854
9463
  type: "pubkey"
8855
9464
  },
8856
9465
  {
@@ -8987,19 +9596,19 @@ var idl_default = {
8987
9596
  type: "u8"
8988
9597
  },
8989
9598
  {
8990
- name: "partner_locked_lp_percentage",
9599
+ name: "partner_permanent_locked_liquidity_percentage",
8991
9600
  type: "u8"
8992
9601
  },
8993
9602
  {
8994
- name: "partner_lp_percentage",
9603
+ name: "partner_liquidity_percentage",
8995
9604
  type: "u8"
8996
9605
  },
8997
9606
  {
8998
- name: "creator_locked_lp_percentage",
9607
+ name: "creator_permanent_locked_liquidity_percentage",
8999
9608
  type: "u8"
9000
9609
  },
9001
9610
  {
9002
- name: "creator_lp_percentage",
9611
+ name: "creator_liquidity_percentage",
9003
9612
  type: "u8"
9004
9613
  },
9005
9614
  {
@@ -9171,6 +9780,26 @@ var idl_default = {
9171
9780
  ]
9172
9781
  }
9173
9782
  },
9783
+ {
9784
+ name: "EvtPartnerClaimPoolCreationFee",
9785
+ type: {
9786
+ kind: "struct",
9787
+ fields: [
9788
+ {
9789
+ name: "pool",
9790
+ type: "pubkey"
9791
+ },
9792
+ {
9793
+ name: "partner",
9794
+ type: "pubkey"
9795
+ },
9796
+ {
9797
+ name: "creation_fee",
9798
+ type: "u64"
9799
+ }
9800
+ ]
9801
+ }
9802
+ },
9174
9803
  {
9175
9804
  name: "EvtPartnerMetadata",
9176
9805
  docs: [
@@ -9473,6 +10102,79 @@ var idl_default = {
9473
10102
  ]
9474
10103
  }
9475
10104
  },
10105
+ {
10106
+ name: "LiquidityVestingInfo",
10107
+ serialization: "bytemuck",
10108
+ repr: {
10109
+ kind: "c"
10110
+ },
10111
+ type: {
10112
+ kind: "struct",
10113
+ fields: [
10114
+ {
10115
+ name: "is_initialized",
10116
+ type: "u8"
10117
+ },
10118
+ {
10119
+ name: "vesting_percentage",
10120
+ type: "u8"
10121
+ },
10122
+ {
10123
+ name: "_padding",
10124
+ type: {
10125
+ array: [
10126
+ "u8",
10127
+ 2
10128
+ ]
10129
+ }
10130
+ },
10131
+ {
10132
+ name: "bps_per_period",
10133
+ type: "u16"
10134
+ },
10135
+ {
10136
+ name: "number_of_periods",
10137
+ type: "u16"
10138
+ },
10139
+ {
10140
+ name: "frequency",
10141
+ type: "u32"
10142
+ },
10143
+ {
10144
+ name: "cliff_duration_from_migration_time",
10145
+ type: "u32"
10146
+ }
10147
+ ]
10148
+ }
10149
+ },
10150
+ {
10151
+ name: "LiquidityVestingInfoParams",
10152
+ type: {
10153
+ kind: "struct",
10154
+ fields: [
10155
+ {
10156
+ name: "vesting_percentage",
10157
+ type: "u8"
10158
+ },
10159
+ {
10160
+ name: "bps_per_period",
10161
+ type: "u16"
10162
+ },
10163
+ {
10164
+ name: "number_of_periods",
10165
+ type: "u16"
10166
+ },
10167
+ {
10168
+ name: "cliff_duration_from_migration_time",
10169
+ type: "u32"
10170
+ },
10171
+ {
10172
+ name: "frequency",
10173
+ type: "u32"
10174
+ }
10175
+ ]
10176
+ }
10177
+ },
9476
10178
  {
9477
10179
  name: "LockEscrow",
9478
10180
  docs: [
@@ -9603,7 +10305,7 @@ var idl_default = {
9603
10305
  {
9604
10306
  name: "padding_0",
9605
10307
  docs: [
9606
- "!!! BE CAREFUL to use tomestone field, previous is pool creator"
10308
+ "!!! BE CAREFUL to use tombstone field, previous is pool creator"
9607
10309
  ],
9608
10310
  type: {
9609
10311
  array: [
@@ -9627,30 +10329,30 @@ var idl_default = {
9627
10329
  type: "pubkey"
9628
10330
  },
9629
10331
  {
9630
- name: "partner_locked_lp",
10332
+ name: "partner_locked_liquidity",
9631
10333
  docs: [
9632
- "partner locked lp"
10334
+ "partner locked liquidity"
9633
10335
  ],
9634
10336
  type: "u64"
9635
10337
  },
9636
10338
  {
9637
- name: "partner_lp",
10339
+ name: "partner_liquidity",
9638
10340
  docs: [
9639
- "partner lp"
10341
+ "partner liquidity"
9640
10342
  ],
9641
10343
  type: "u64"
9642
10344
  },
9643
10345
  {
9644
- name: "creator_locked_lp",
10346
+ name: "creator_locked_liquidity",
9645
10347
  docs: [
9646
- "creator locked lp"
10348
+ "creator locked liquidity"
9647
10349
  ],
9648
10350
  type: "u64"
9649
10351
  },
9650
10352
  {
9651
- name: "creator_lp",
10353
+ name: "creator_liquidity",
9652
10354
  docs: [
9653
- "creator lp"
10355
+ "creator liquidity"
9654
10356
  ],
9655
10357
  type: "u64"
9656
10358
  },
@@ -9664,28 +10366,28 @@ var idl_default = {
9664
10366
  {
9665
10367
  name: "creator_locked_status",
9666
10368
  docs: [
9667
- "flag to check whether lp is locked for creator"
10369
+ "flag to check whether liquidity token is locked for creator"
9668
10370
  ],
9669
10371
  type: "u8"
9670
10372
  },
9671
10373
  {
9672
10374
  name: "partner_locked_status",
9673
10375
  docs: [
9674
- "flag to check whether lp is locked for partner"
10376
+ "flag to check whether liquidity token is locked for partner"
9675
10377
  ],
9676
10378
  type: "u8"
9677
10379
  },
9678
10380
  {
9679
10381
  name: "creator_claim_status",
9680
10382
  docs: [
9681
- "flag to check whether creator has claimed lp token"
10383
+ "flag to check whether creator has claimed liquidity token"
9682
10384
  ],
9683
10385
  type: "u8"
9684
10386
  },
9685
10387
  {
9686
10388
  name: "partner_claim_status",
9687
10389
  docs: [
9688
- "flag to check whether partner has claimed lp token"
10390
+ "flag to check whether partner has claimed liquidity token"
9689
10391
  ],
9690
10392
  type: "u8"
9691
10393
  },
@@ -9832,6 +10534,41 @@ var idl_default = {
9832
10534
  }
9833
10535
  }
9834
10536
  },
10537
+ {
10538
+ name: "partner_liquidity_vesting_info",
10539
+ type: {
10540
+ defined: {
10541
+ name: "LiquidityVestingInfo"
10542
+ }
10543
+ }
10544
+ },
10545
+ {
10546
+ name: "creator_liquidity_vesting_info",
10547
+ type: {
10548
+ defined: {
10549
+ name: "LiquidityVestingInfo"
10550
+ }
10551
+ }
10552
+ },
10553
+ {
10554
+ name: "padding_0",
10555
+ docs: [
10556
+ "Padding for future use"
10557
+ ],
10558
+ type: {
10559
+ array: [
10560
+ "u8",
10561
+ 14
10562
+ ]
10563
+ }
10564
+ },
10565
+ {
10566
+ name: "padding_1",
10567
+ docs: [
10568
+ "Previously was protocol and referral fee percent. Beware of tombstone."
10569
+ ],
10570
+ type: "u16"
10571
+ },
9835
10572
  {
9836
10573
  name: "collect_fee_mode",
9837
10574
  docs: [
@@ -9882,30 +10619,30 @@ var idl_default = {
9882
10619
  type: "u8"
9883
10620
  },
9884
10621
  {
9885
- name: "partner_locked_lp_percentage",
10622
+ name: "partner_permanent_locked_liquidity_percentage",
9886
10623
  docs: [
9887
- "partner locked lp percentage"
10624
+ "partner locked liquidity percentage"
9888
10625
  ],
9889
10626
  type: "u8"
9890
10627
  },
9891
10628
  {
9892
- name: "partner_lp_percentage",
10629
+ name: "partner_liquidity_percentage",
9893
10630
  docs: [
9894
- "partner lp percentage"
10631
+ "partner liquidity percentage"
9895
10632
  ],
9896
10633
  type: "u8"
9897
10634
  },
9898
10635
  {
9899
- name: "creator_locked_lp_percentage",
10636
+ name: "creator_permanent_locked_liquidity_percentage",
9900
10637
  docs: [
9901
10638
  "creator post migration fee percentage"
9902
10639
  ],
9903
10640
  type: "u8"
9904
10641
  },
9905
10642
  {
9906
- name: "creator_lp_percentage",
10643
+ name: "creator_liquidity_percentage",
9907
10644
  docs: [
9908
- "creator lp percentage"
10645
+ "creator liquidity percentage"
9909
10646
  ],
9910
10647
  type: "u8"
9911
10648
  },
@@ -9952,10 +10689,7 @@ var idl_default = {
9952
10689
  type: "u8"
9953
10690
  },
9954
10691
  {
9955
- name: "_padding_0",
9956
- docs: [
9957
- "padding 0"
9958
- ],
10692
+ name: "padding_2",
9959
10693
  type: {
9960
10694
  array: [
9961
10695
  "u8",
@@ -10045,10 +10779,17 @@ var idl_default = {
10045
10779
  type: {
10046
10780
  array: [
10047
10781
  "u8",
10048
- 12
10782
+ 4
10049
10783
  ]
10050
10784
  }
10051
10785
  },
10786
+ {
10787
+ name: "pool_creation_fee",
10788
+ docs: [
10789
+ "pool creation fee in lamports value"
10790
+ ],
10791
+ type: "u64"
10792
+ },
10052
10793
  {
10053
10794
  name: "_padding_2",
10054
10795
  docs: [
@@ -10168,32 +10909,6 @@ var idl_default = {
10168
10909
  name: "DynamicFeeConfig"
10169
10910
  }
10170
10911
  }
10171
- },
10172
- {
10173
- name: "padding_0",
10174
- type: {
10175
- array: [
10176
- "u64",
10177
- 5
10178
- ]
10179
- }
10180
- },
10181
- {
10182
- name: "padding_1",
10183
- type: {
10184
- array: [
10185
- "u8",
10186
- 6
10187
- ]
10188
- }
10189
- },
10190
- {
10191
- name: "protocol_fee_percent",
10192
- type: "u8"
10193
- },
10194
- {
10195
- name: "referral_fee_percent",
10196
- type: "u8"
10197
10912
  }
10198
10913
  ]
10199
10914
  }
@@ -10569,16 +11284,29 @@ var idl_default = {
10569
11284
  ],
10570
11285
  type: "u64"
10571
11286
  },
11287
+ {
11288
+ name: "legacy_creation_fee_bits",
11289
+ docs: [
11290
+ "legacy creation fee bits, we dont use this now"
11291
+ ],
11292
+ type: "u8"
11293
+ },
10572
11294
  {
10573
11295
  name: "creation_fee_bits",
11296
+ docs: [
11297
+ "pool creation fee claim status"
11298
+ ],
10574
11299
  type: "u8"
10575
11300
  },
10576
11301
  {
10577
11302
  name: "_padding_0",
11303
+ docs: [
11304
+ "Padding for further use"
11305
+ ],
10578
11306
  type: {
10579
11307
  array: [
10580
11308
  "u8",
10581
- 7
11309
+ 6
10582
11310
  ]
10583
11311
  }
10584
11312
  },
@@ -24864,6 +25592,25 @@ var MigrationService = class extends DynamicBondingCurveProgram {
24864
25592
  );
24865
25593
  const tokenBaseProgram = poolConfigState.tokenType == 0 ? _spltoken.TOKEN_PROGRAM_ID : _spltoken.TOKEN_2022_PROGRAM_ID;
24866
25594
  const tokenQuoteProgram = poolConfigState.quoteTokenFlag == 0 ? _spltoken.TOKEN_PROGRAM_ID : _spltoken.TOKEN_2022_PROGRAM_ID;
25595
+ const firstPositionVestingAddress = deriveDammV2PositionVestingAccount(firstPosition);
25596
+ const secondPositionVestingAddress = deriveDammV2PositionVestingAccount(secondPosition);
25597
+ const remainingAccounts = [
25598
+ {
25599
+ isSigner: false,
25600
+ isWritable: false,
25601
+ pubkey: dammConfig
25602
+ },
25603
+ {
25604
+ isSigner: false,
25605
+ isWritable: true,
25606
+ pubkey: firstPositionVestingAddress
25607
+ },
25608
+ {
25609
+ isSigner: false,
25610
+ isWritable: true,
25611
+ pubkey: secondPositionVestingAddress
25612
+ }
25613
+ ];
24867
25614
  const tx = await this.program.methods.migrationDammV2().accountsStrict({
24868
25615
  virtualPool,
24869
25616
  migrationMetadata,
@@ -24890,15 +25637,9 @@ var MigrationService = class extends DynamicBondingCurveProgram {
24890
25637
  token2022Program: _spltoken.TOKEN_2022_PROGRAM_ID,
24891
25638
  systemProgram: _web3js.SystemProgram.programId,
24892
25639
  dammEventAuthority
24893
- }).remainingAccounts([
24894
- {
24895
- isSigner: false,
24896
- isWritable: false,
24897
- pubkey: dammConfig
24898
- }
24899
- ]).transaction();
25640
+ }).remainingAccounts(remainingAccounts).transaction();
24900
25641
  const modifyComputeUnits = _web3js.ComputeBudgetProgram.setComputeUnitLimit({
24901
- units: 5e5
25642
+ units: 6e5
24902
25643
  });
24903
25644
  tx.add(modifyComputeUnits);
24904
25645
  return {
@@ -25349,6 +26090,33 @@ var PartnerService = class extends DynamicBondingCurveProgram {
25349
26090
  }).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
25350
26091
  return transaction;
25351
26092
  }
26093
+ /**
26094
+ * Claim partner pool creation fee
26095
+ * @param params - The claim partner pool creation fee parameters
26096
+ * @returns A claim partner pool creation fee transaction
26097
+ */
26098
+ async claimPartnerPoolCreationFee(params) {
26099
+ const { virtualPool, feeReceiver } = params;
26100
+ const virtualPoolState = await this.state.getPool(virtualPool);
26101
+ if (!virtualPoolState) {
26102
+ throw new Error(`Pool not found: ${virtualPool.toString()}`);
26103
+ }
26104
+ const config = virtualPoolState.config;
26105
+ const configState = await this.state.getPoolConfig(
26106
+ virtualPoolState.config
26107
+ );
26108
+ if (!configState) {
26109
+ throw new Error(`Pool config not found for virtual pool`);
26110
+ }
26111
+ const feeClaimer = configState.feeClaimer;
26112
+ const transaction = await this.program.methods.claimPartnerPoolCreationFee().accountsPartial({
26113
+ config,
26114
+ pool: virtualPool,
26115
+ feeClaimer,
26116
+ feeReceiver
26117
+ }).transaction();
26118
+ return transaction;
26119
+ }
25352
26120
  };
25353
26121
 
25354
26122
  // src/services/pool.ts
@@ -26925,5 +27693,17 @@ var DynamicBondingCurveClient = class _DynamicBondingCurveClient {
26925
27693
 
26926
27694
 
26927
27695
 
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;
27696
+
27697
+
27698
+
27699
+
27700
+
27701
+
27702
+
27703
+
27704
+
27705
+
27706
+
27707
+
27708
+ exports.ActivationType = ActivationType; exports.BASE_ADDRESS = BASE_ADDRESS; 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.DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS = DEFAULT_LIQUIDITY_VESTING_INFO_PARAMS; 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.HOST_FEE_PERCENT = HOST_FEE_PERCENT; exports.LOCKER_PROGRAM_ID = LOCKER_PROGRAM_ID; exports.MAX_BASIS_POINT = MAX_BASIS_POINT; exports.MAX_CREATOR_MIGRATION_FEE_PERCENTAGE = MAX_CREATOR_MIGRATION_FEE_PERCENTAGE; exports.MAX_CURVE_POINT = MAX_CURVE_POINT; exports.MAX_FEE_BPS = MAX_FEE_BPS; exports.MAX_FEE_NUMERATOR = MAX_FEE_NUMERATOR; exports.MAX_LOCK_DURATION_IN_SECONDS = MAX_LOCK_DURATION_IN_SECONDS; exports.MAX_MIGRATED_POOL_FEE_BPS = MAX_MIGRATED_POOL_FEE_BPS; exports.MAX_MIGRATION_FEE_PERCENTAGE = MAX_MIGRATION_FEE_PERCENTAGE; exports.MAX_POOL_CREATION_FEE = MAX_POOL_CREATION_FEE; exports.MAX_PRICE_CHANGE_PERCENTAGE_DEFAULT = MAX_PRICE_CHANGE_PERCENTAGE_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_LOCKED_LIQUIDITY_BPS = MIN_LOCKED_LIQUIDITY_BPS; exports.MIN_MIGRATED_POOL_FEE_BPS = MIN_MIGRATED_POOL_FEE_BPS; exports.MIN_POOL_CREATION_FEE = MIN_POOL_CREATION_FEE; 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.PROTOCOL_FEE_PERCENT = PROTOCOL_FEE_PERCENT; exports.PROTOCOL_POOL_CREATION_FEE_PERCENT = PROTOCOL_POOL_CREATION_FEE_PERCENT; exports.PartnerService = PartnerService; exports.PoolService = PoolService; exports.RESOLUTION = RESOLUTION; exports.Rounding = Rounding; exports.SECONDS_PER_DAY = SECONDS_PER_DAY; exports.SWAP_BUFFER_PERCENTAGE = SWAP_BUFFER_PERCENTAGE; exports.SafeMath = SafeMath; exports.StateService = StateService; exports.SwapMode = SwapMode; 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.calculateLockedLiquidityBpsAtTime = calculateLockedLiquidityBpsAtTime; 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.deriveDammV2PositionVestingAccount = deriveDammV2PositionVestingAccount; 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.getLiquidityVestingInfoParams = getLiquidityVestingInfoParams; 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.getVestingLockedLiquidityBpsAtNSeconds = getVestingLockedLiquidityBpsAtNSeconds; 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.validateLiquidityVestingInfo = validateLiquidityVestingInfo; exports.validateMigratedPoolFee = validateMigratedPoolFee; exports.validateMigrationAndTokenType = validateMigrationAndTokenType; exports.validateMigrationFee = validateMigrationFee; exports.validateMigrationFeeOption = validateMigrationFeeOption; exports.validateMinimumLockedLiquidity = validateMinimumLockedLiquidity; exports.validatePoolCreationFee = validatePoolCreationFee; exports.validatePoolFees = validatePoolFees; exports.validateSwapAmount = validateSwapAmount; exports.validateTokenDecimals = validateTokenDecimals; exports.validateTokenSupply = validateTokenSupply; exports.validateTokenUpdateAuthorityOptions = validateTokenUpdateAuthorityOptions; exports.wrapSOLInstruction = wrapSOLInstruction;
26929
27709
  //# sourceMappingURL=index.cjs.map