pinpet-sdk 2.1.16 → 2.1.18

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.
@@ -41917,12 +41917,12 @@ decimal.exports;
41917
41917
 
41918
41918
  var decimalExports = decimal.exports;
41919
41919
 
41920
- const Decimal = decimalExports;
41920
+ const Decimal$1 = decimalExports;
41921
41921
 
41922
41922
  // Configure Decimal.js to use 50-bit precision for better accuracy with tiny prices
41923
41923
  // Increased from 28 to 50 to handle extremely small prices (e.g., 0.000000041571)
41924
41924
  // ROUND_HALF_UP ensures consistent rounding behavior
41925
- Decimal.set({ precision: 50, rounding: Decimal.ROUND_HALF_UP });
41925
+ Decimal$1.set({ precision: 50, rounding: Decimal$1.ROUND_HALF_UP });
41926
41926
 
41927
41927
 
41928
41928
  /**
@@ -41950,19 +41950,19 @@ class CurveAMM$8 {
41950
41950
  * Initial SOL reserve amount, represented as Decimal
41951
41951
  * @type {Decimal}
41952
41952
  */
41953
- static INITIAL_SOL_RESERVE_DECIMAL = new Decimal('30');
41953
+ static INITIAL_SOL_RESERVE_DECIMAL = new Decimal$1('30');
41954
41954
 
41955
41955
  /**
41956
41956
  * Initial Token reserve amount, represented as Decimal
41957
41957
  * @type {Decimal}
41958
41958
  */
41959
- static INITIAL_TOKEN_RESERVE_DECIMAL = new Decimal('1073000000');
41959
+ static INITIAL_TOKEN_RESERVE_DECIMAL = new Decimal$1('1073000000');
41960
41960
 
41961
41961
  /**
41962
41962
  * Initial constant K value, represented as Decimal
41963
41963
  * @type {Decimal}
41964
41964
  */
41965
- static INITIAL_K_DECIMAL = new Decimal('32190000000');
41965
+ static INITIAL_K_DECIMAL = new Decimal$1('32190000000');
41966
41966
 
41967
41967
  /**
41968
41968
  * Minimum price that can appear, below this price may cause overflow
@@ -41970,26 +41970,26 @@ class CurveAMM$8 {
41970
41970
  * Reduced from 1e-9 to 1e-12 to support wider range of pool configurations
41971
41971
  * @type {Decimal}
41972
41972
  */
41973
- static INITIAL_MIN_PRICE_DECIMAL = new Decimal('0.000000000001'); // 1e-12
41973
+ static INITIAL_MIN_PRICE_DECIMAL = new Decimal$1('0.000000000001'); // 1e-12
41974
41974
 
41975
41975
  /**
41976
41976
  * Decimal representation of precision factor = 10^23
41977
41977
  * @type {Decimal}
41978
41978
  */
41979
41979
  //static PRICE_PRECISION_FACTOR_DECIMAL = new Decimal('10000000000000000000000000000');
41980
- static PRICE_PRECISION_FACTOR_DECIMAL = new Decimal('100000000000000000000000');
41980
+ static PRICE_PRECISION_FACTOR_DECIMAL = new Decimal$1('100000000000000000000000');
41981
41981
 
41982
41982
  /**
41983
41983
  * Decimal representation of Token precision factor = 1000000000 (10^9)
41984
41984
  * @type {Decimal}
41985
41985
  */
41986
- static TOKEN_PRECISION_FACTOR_DECIMAL = new Decimal('1000000000');
41986
+ static TOKEN_PRECISION_FACTOR_DECIMAL = new Decimal$1('1000000000');
41987
41987
 
41988
41988
  /**
41989
41989
  * Decimal representation of SOL precision factor = 1000000000
41990
41990
  * @type {Decimal}
41991
41991
  */
41992
- static SOL_PRECISION_FACTOR_DECIMAL = new Decimal('1000000000');
41992
+ static SOL_PRECISION_FACTOR_DECIMAL = new Decimal$1('1000000000');
41993
41993
 
41994
41994
 
41995
41995
  /**
@@ -42018,7 +42018,7 @@ class CurveAMM$8 {
42018
42018
  if (typeof price === 'bigint') {
42019
42019
  price = price.toString();
42020
42020
  }
42021
- const priceDecimal = new Decimal(price);
42021
+ const priceDecimal = new Decimal$1(price);
42022
42022
  return priceDecimal.div(this.PRICE_PRECISION_FACTOR_DECIMAL);
42023
42023
  }
42024
42024
 
@@ -42068,9 +42068,9 @@ class CurveAMM$8 {
42068
42068
  if (typeof price === 'bigint') {
42069
42069
  price = price.toString();
42070
42070
  }
42071
- const priceDecimal = new Decimal(price);
42071
+ const priceDecimal = new Decimal$1(price);
42072
42072
  // Use old precision factor 10^15
42073
- const oldPrecisionFactor = new Decimal('1000000000000000');
42073
+ const oldPrecisionFactor = new Decimal$1('1000000000000000');
42074
42074
  return priceDecimal.div(oldPrecisionFactor);
42075
42075
  }
42076
42076
 
@@ -42083,7 +42083,7 @@ class CurveAMM$8 {
42083
42083
  */
42084
42084
  static decimalToU64(price) {
42085
42085
  // Directly use old precision factor for conversion
42086
- const oldPrecisionFactor = new Decimal('1000000000000000');
42086
+ const oldPrecisionFactor = new Decimal$1('1000000000000000');
42087
42087
  const scaled = price.mul(oldPrecisionFactor);
42088
42088
  const floored = scaled.floor();
42089
42089
  if (floored.isNaN() || floored.isNegative() || floored.gt('18446744073709551615')) {
@@ -42102,7 +42102,7 @@ class CurveAMM$8 {
42102
42102
  */
42103
42103
  static decimalToU64Ceil(price) {
42104
42104
  // Directly use old precision factor for conversion
42105
- const oldPrecisionFactor = new Decimal('1000000000000000');
42105
+ const oldPrecisionFactor = new Decimal$1('1000000000000000');
42106
42106
  const scaled = price.mul(oldPrecisionFactor);
42107
42107
  const ceiled = scaled.ceil();
42108
42108
  if (ceiled.isNaN() || ceiled.isNegative() || ceiled.gt('18446744073709551615')) {
@@ -42186,7 +42186,7 @@ class CurveAMM$8 {
42186
42186
  if (typeof amount === 'bigint') {
42187
42187
  amount = amount.toString();
42188
42188
  }
42189
- const amountDecimal = new Decimal(amount);
42189
+ const amountDecimal = new Decimal$1(amount);
42190
42190
  return amountDecimal.div(this.TOKEN_PRECISION_FACTOR_DECIMAL);
42191
42191
  }
42192
42192
 
@@ -42200,7 +42200,7 @@ class CurveAMM$8 {
42200
42200
  if (typeof amount === 'bigint') {
42201
42201
  amount = amount.toString();
42202
42202
  }
42203
- const amountDecimal = new Decimal(amount);
42203
+ const amountDecimal = new Decimal$1(amount);
42204
42204
  return amountDecimal.div(this.SOL_PRECISION_FACTOR_DECIMAL);
42205
42205
  }
42206
42206
 
@@ -42218,8 +42218,8 @@ class CurveAMM$8 {
42218
42218
  * const k2 = CurveAMM.calculateK(60, 1073000000);
42219
42219
  */
42220
42220
  static calculateK(initialVirtualSol, initialVirtualToken) {
42221
- const sol = new Decimal(initialVirtualSol);
42222
- const token = new Decimal(initialVirtualToken);
42221
+ const sol = new Decimal$1(initialVirtualSol);
42222
+ const token = new Decimal$1(initialVirtualToken);
42223
42223
  return sol.mul(token);
42224
42224
  }
42225
42225
 
@@ -42241,8 +42241,8 @@ class CurveAMM$8 {
42241
42241
  * @returns {bigint|null} u128格式的初始价格
42242
42242
  */
42243
42243
  static getInitialPriceWithParams(initialVirtualSol, initialVirtualToken) {
42244
- const sol = new Decimal(initialVirtualSol);
42245
- const token = new Decimal(initialVirtualToken);
42244
+ const sol = new Decimal$1(initialVirtualSol);
42245
+ const token = new Decimal$1(initialVirtualToken);
42246
42246
  const initialPrice = sol.div(token);
42247
42247
  return this.decimalToU128(initialPrice);
42248
42248
  }
@@ -42485,7 +42485,7 @@ class CurveAMM$8 {
42485
42485
  }
42486
42486
 
42487
42487
  // Warning for extremely small prices that may have precision issues
42488
- const warningPrice = new Decimal('0.0000001'); // 10^-7
42488
+ const warningPrice = new Decimal$1('0.0000001'); // 10^-7
42489
42489
  if (price.lt(warningPrice)) {
42490
42490
  // Only log once per execution to avoid spam (use a static flag)
42491
42491
  if (!this._tinyPriceWarningShown) {
@@ -43039,7 +43039,7 @@ class CurveAMM$8 {
43039
43039
  if (typeof price === 'bigint') {
43040
43040
  price = price.toString();
43041
43041
  }
43042
- const priceDecimal = new Decimal(price);
43042
+ const priceDecimal = new Decimal$1(price);
43043
43043
  const convertedPrice = priceDecimal.div(this.PRICE_PRECISION_FACTOR_DECIMAL);
43044
43044
  return convertedPrice.toFixed(decimalPlaces);
43045
43045
  }
@@ -46030,6 +46030,7 @@ var long_shrot_stop = {
46030
46030
  };
46031
46031
 
46032
46032
  const CurveAMM$5 = curve_amm;
46033
+ const Decimal = decimalExports;
46033
46034
 
46034
46035
 
46035
46036
  /**
@@ -46146,13 +46147,15 @@ function calcLiqTokenBuy$1(price, buyTokenAmount, orders, onceMaxOrder, passOrde
46146
46147
 
46147
46148
  try {
46148
46149
  const priceBigInt = BigInt(price);
46149
- const initialVirtualSolBigInt = BigInt(initialVirtualSol.toString());
46150
- const initialVirtualTokenBigInt = BigInt(initialVirtualToken.toString());
46150
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46151
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46152
+
46153
+
46151
46154
  [, result.ideal_lp_sol_amount] = CurveAMM$5.buyFromPriceWithTokenOutputWithParams(
46152
46155
  priceBigInt,
46153
46156
  buyTokenAmountBigInt,
46154
- initialVirtualSolBigInt,
46155
- initialVirtualTokenBigInt
46157
+ initialVirtualSolDecimal,
46158
+ initialVirtualTokenDecimal
46156
46159
  );
46157
46160
  // console.log(`理想计算: 当前价格=${priceBigInt}, 目标代币=${buyTokenAmountBigInt}, 理想SOL=${result.ideal_lp_sol_amount}`);
46158
46161
  } catch (error) {
@@ -46162,7 +46165,14 @@ function calcLiqTokenBuy$1(price, buyTokenAmount, orders, onceMaxOrder, passOrde
46162
46165
 
46163
46166
  // orders 长度为0 时要单独计算
46164
46167
  if (orders.length === 0) {
46165
- [result.free_lp_sol_amount_sum, result.free_lp_token_amount_sum] = CurveAMM$5.buyFromPriceToPrice(BigInt(price), CurveAMM$5.MAX_U128_PRICE);
46168
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46169
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46170
+ [result.free_lp_sol_amount_sum, result.free_lp_token_amount_sum] = CurveAMM$5.buyFromPriceToPriceWithParams(
46171
+ BigInt(price),
46172
+ CurveAMM$5.MAX_U128_PRICE,
46173
+ initialVirtualSolDecimal,
46174
+ initialVirtualTokenDecimal
46175
+ );
46166
46176
  result.has_infinite_lp = true;
46167
46177
  result.real_lp_sol_amount = result.ideal_lp_sol_amount;
46168
46178
  return result
@@ -46210,7 +46220,14 @@ function calcLiqTokenBuy$1(price, buyTokenAmount, orders, onceMaxOrder, passOrde
46210
46220
  // 如果存在价格间隙,计算自由流动性
46211
46221
  if (endPrice > startPrice) {
46212
46222
  try {
46213
- const gapLiquidity = CurveAMM$5.buyFromPriceToPrice(startPrice, endPrice);
46223
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46224
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46225
+ const gapLiquidity = CurveAMM$5.buyFromPriceToPriceWithParams(
46226
+ startPrice,
46227
+ endPrice,
46228
+ initialVirtualSolDecimal,
46229
+ initialVirtualTokenDecimal
46230
+ );
46214
46231
  if (gapLiquidity && Array.isArray(gapLiquidity) && gapLiquidity.length === 2) {
46215
46232
  const [solAmount, tokenAmount] = gapLiquidity;
46216
46233
 
@@ -46348,7 +46365,14 @@ function calcLiqTokenBuy$1(price, buyTokenAmount, orders, onceMaxOrder, passOrde
46348
46365
 
46349
46366
  if (maxPrice > lastEndPrice) {
46350
46367
  try {
46351
- const infiniteLiquidity = CurveAMM$5.buyFromPriceToPrice(lastEndPrice, maxPrice);
46368
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46369
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46370
+ const infiniteLiquidity = CurveAMM$5.buyFromPriceToPriceWithParams(
46371
+ lastEndPrice,
46372
+ maxPrice,
46373
+ initialVirtualSolDecimal,
46374
+ initialVirtualTokenDecimal
46375
+ );
46352
46376
  if (infiniteLiquidity && Array.isArray(infiniteLiquidity) && infiniteLiquidity.length === 2) {
46353
46377
  const [solAmount, tokenAmount] = infiniteLiquidity;
46354
46378
 
@@ -46505,13 +46529,15 @@ function calcLiqTokenSell$1(price, sellTokenAmount, orders, onceMaxOrder, passOr
46505
46529
  // 计算理想情况下卖出能获得的SOL数量
46506
46530
  try {
46507
46531
  const priceBigInt = BigInt(price);
46508
- const initialVirtualSolBigInt = BigInt(initialVirtualSol.toString());
46509
- const initialVirtualTokenBigInt = BigInt(initialVirtualToken.toString());
46532
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46533
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46534
+
46535
+ //console.log("initialVirtualSolDecimal,initialVirtualTokenDecimal = ",initialVirtualSolDecimal.toString(),initialVirtualTokenDecimal.toString());
46510
46536
  [, result.ideal_lp_sol_amount] = CurveAMM$5.sellFromPriceWithTokenInputWithParams(
46511
46537
  priceBigInt,
46512
46538
  sellTokenAmountBigInt,
46513
- initialVirtualSolBigInt,
46514
- initialVirtualTokenBigInt
46539
+ initialVirtualSolDecimal,
46540
+ initialVirtualTokenDecimal
46515
46541
  );
46516
46542
  // console.log(`理想计算: 当前价格=${priceBigInt}, 卖出代币=${sellTokenAmountBigInt}, 理想SOL=${result.ideal_lp_sol_amount}`);
46517
46543
  } catch (error) {
@@ -46520,13 +46546,13 @@ function calcLiqTokenSell$1(price, sellTokenAmount, orders, onceMaxOrder, passOr
46520
46546
 
46521
46547
  // orders 长度为0 时要单独计算
46522
46548
  if (orders.length === 0) {
46523
- const initialVirtualSolBigInt = BigInt(initialVirtualSol.toString());
46524
- const initialVirtualTokenBigInt = BigInt(initialVirtualToken.toString());
46549
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46550
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46525
46551
  const sellResult = CurveAMM$5.sellFromPriceToPriceWithParams(
46526
46552
  BigInt(price),
46527
46553
  CurveAMM$5.MIN_U128_PRICE,
46528
- initialVirtualSolBigInt,
46529
- initialVirtualTokenBigInt
46554
+ initialVirtualSolDecimal,
46555
+ initialVirtualTokenDecimal
46530
46556
  );
46531
46557
  if (sellResult) {
46532
46558
  [result.free_lp_token_amount_sum, result.free_lp_sol_amount_sum] = sellResult;
@@ -46583,7 +46609,14 @@ function calcLiqTokenSell$1(price, sellTokenAmount, orders, onceMaxOrder, passOr
46583
46609
  // 如果存在价格间隙(卖出时startPrice应该大于endPrice)
46584
46610
  if (startPrice > endPrice) {
46585
46611
  try {
46586
- const gapLiquidity = CurveAMM$5.sellFromPriceToPrice(startPrice, endPrice);
46612
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46613
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46614
+ const gapLiquidity = CurveAMM$5.sellFromPriceToPriceWithParams(
46615
+ startPrice,
46616
+ endPrice,
46617
+ initialVirtualSolDecimal,
46618
+ initialVirtualTokenDecimal
46619
+ );
46587
46620
  if (gapLiquidity && Array.isArray(gapLiquidity) && gapLiquidity.length === 2) {
46588
46621
  const [tokenAmount, solAmount] = gapLiquidity;
46589
46622
 
@@ -46711,7 +46744,14 @@ function calcLiqTokenSell$1(price, sellTokenAmount, orders, onceMaxOrder, passOr
46711
46744
  if (lastEndPrice > minPrice) {
46712
46745
 
46713
46746
  try {
46714
- const infiniteLiquidity = CurveAMM$5.sellFromPriceToPrice(lastEndPrice, minPrice);
46747
+ const initialVirtualSolDecimal = new Decimal(initialVirtualSol).div(CurveAMM$5.SOL_PRECISION_FACTOR_DECIMAL);
46748
+ const initialVirtualTokenDecimal = new Decimal(initialVirtualToken).div(CurveAMM$5.TOKEN_PRECISION_FACTOR_DECIMAL);
46749
+ const infiniteLiquidity = CurveAMM$5.sellFromPriceToPriceWithParams(
46750
+ lastEndPrice,
46751
+ minPrice,
46752
+ initialVirtualSolDecimal,
46753
+ initialVirtualTokenDecimal
46754
+ );
46715
46755
  if (infiniteLiquidity && Array.isArray(infiniteLiquidity) && infiniteLiquidity.length === 2) {
46716
46756
  const [tokenAmount, solAmount] = infiniteLiquidity;
46717
46757
 
@@ -46789,7 +46829,7 @@ const { calcLiqTokenBuy, calcLiqTokenSell } = calcLiq;
46789
46829
  async function simulateTokenBuy$1(mint, buyTokenAmount, passOrder = null, lastPrice = null, ordersData = null) {
46790
46830
  // 获取价格和订单数据
46791
46831
 
46792
- console.log('simulateTokenBuy', mint, buyTokenAmount, passOrder, lastPrice, ordersData);
46832
+ //console.log('simulateTokenBuy', mint, buyTokenAmount, passOrder, lastPrice, ordersData);
46793
46833
 
46794
46834
  let price = lastPrice;
46795
46835
  if (!price) {
@@ -46954,6 +46994,8 @@ async function simulateTokenSell$1(mint, sellTokenAmount, passOrder = null, last
46954
46994
  price = await this.sdk.data.price(mint);
46955
46995
  }
46956
46996
 
46997
+ //console.log("price=",price);
46998
+
46957
46999
  let orders;
46958
47000
  if (!ordersData) {
46959
47001
  const ordersResponse = await this.sdk.data.orders(mint, {
@@ -49633,7 +49675,7 @@ class OrderUtils$2 {
49633
49675
 
49634
49676
  var orderUtils = OrderUtils$2;
49635
49677
 
49636
- var address = "CYdRzRacZ5kTc9Ht3U7mFhbsyxG3sZGEzC4cNf2Gjg2W";
49678
+ var address = "F2FzigE1Z374iDvreiM6hZQe6oGXgomJfv8PyybvUXye";
49637
49679
  var metadata = {
49638
49680
  name: "pinpet",
49639
49681
  version: "0.1.0",
@@ -52207,476 +52249,471 @@ var errors = [
52207
52249
  },
52208
52250
  {
52209
52251
  code: 6021,
52210
- name: "CloseShortImpossibleState",
52211
- msg: "Close short impossible state: current_total should always be greater than remaining_close_reduced_sol_with_fee"
52212
- },
52213
- {
52214
- code: 6022,
52215
52252
  name: "FeeSplitCalculationOverflow",
52216
52253
  msg: "Fee split calculation overflow"
52217
52254
  },
52218
52255
  {
52219
- code: 6023,
52256
+ code: 6022,
52220
52257
  name: "FeeAccumulationOverflow",
52221
52258
  msg: "Fee accumulation overflow"
52222
52259
  },
52223
52260
  {
52224
- code: 6024,
52261
+ code: 6023,
52225
52262
  name: "PartnerFeeAdditionOverflow",
52226
52263
  msg: "Partner fee addition overflow"
52227
52264
  },
52228
52265
  {
52229
- code: 6025,
52266
+ code: 6024,
52230
52267
  name: "BaseFeeAdditionOverflow",
52231
52268
  msg: "Base fee addition overflow"
52232
52269
  },
52233
52270
  {
52234
- code: 6026,
52271
+ code: 6025,
52235
52272
  name: "PoolFeeDeductionOverflow",
52236
52273
  msg: "Pool fee deduction overflow"
52237
52274
  },
52238
52275
  {
52239
- code: 6027,
52276
+ code: 6026,
52240
52277
  name: "FeeRandomDiscountOverflow",
52241
52278
  msg: "Fee random discount calculation overflow"
52242
52279
  },
52243
52280
  {
52244
- code: 6028,
52281
+ code: 6027,
52245
52282
  name: "SolReserveAdditionOverflow",
52246
52283
  msg: "SOL reserve addition overflow"
52247
52284
  },
52248
52285
  {
52249
- code: 6029,
52286
+ code: 6028,
52250
52287
  name: "SolReserveDeductionOverflow",
52251
52288
  msg: "SOL reserve deduction overflow"
52252
52289
  },
52253
52290
  {
52254
- code: 6030,
52291
+ code: 6029,
52255
52292
  name: "TokenReserveAdditionOverflow",
52256
52293
  msg: "Token reserve addition overflow"
52257
52294
  },
52258
52295
  {
52259
- code: 6031,
52296
+ code: 6030,
52260
52297
  name: "LamportsAdditionOverflow",
52261
52298
  msg: "Lamports addition overflow"
52262
52299
  },
52263
52300
  {
52264
- code: 6032,
52301
+ code: 6031,
52265
52302
  name: "LamportsDeductionOverflow",
52266
52303
  msg: "Lamports deduction overflow"
52267
52304
  },
52268
52305
  {
52269
- code: 6033,
52306
+ code: 6032,
52270
52307
  name: "DeadlineCalculationOverflow",
52271
52308
  msg: "Deadline calculation overflow"
52272
52309
  },
52273
52310
  {
52274
- code: 6034,
52311
+ code: 6033,
52275
52312
  name: "FeeDiscountFlagOverflow",
52276
52313
  msg: "Fee discount flag calculation overflow"
52277
52314
  },
52278
52315
  {
52279
- code: 6035,
52316
+ code: 6034,
52280
52317
  name: "Unauthorized",
52281
52318
  msg: "Unauthorized operation"
52282
52319
  },
52283
52320
  {
52284
- code: 6036,
52321
+ code: 6035,
52285
52322
  name: "RequiredParameter",
52286
52323
  msg: "All parameters are required during initialization"
52287
52324
  },
52288
52325
  {
52289
- code: 6037,
52326
+ code: 6036,
52290
52327
  name: "CurveCalculationError",
52291
52328
  msg: "Curve calculation error"
52292
52329
  },
52293
52330
  {
52294
- code: 6038,
52331
+ code: 6037,
52295
52332
  name: "InitialPriceCalculationError",
52296
52333
  msg: "Initial price calculation failed"
52297
52334
  },
52298
52335
  {
52299
- code: 6039,
52336
+ code: 6038,
52300
52337
  name: "BuyReserveRecalculationError",
52301
52338
  msg: "Reserve recalculation failed (after buy)"
52302
52339
  },
52303
52340
  {
52304
- code: 6040,
52341
+ code: 6039,
52305
52342
  name: "SellReserveRecalculationError",
52306
52343
  msg: "Reserve recalculation failed (after sell)"
52307
52344
  },
52308
52345
  {
52309
- code: 6041,
52346
+ code: 6040,
52310
52347
  name: "TotalAmountWithFeeError",
52311
52348
  msg: "Total amount with fee calculation failed"
52312
52349
  },
52313
52350
  {
52314
- code: 6042,
52351
+ code: 6041,
52315
52352
  name: "AmountAfterFeeError",
52316
52353
  msg: "Amount after fee calculation failed"
52317
52354
  },
52318
52355
  {
52319
- code: 6043,
52356
+ code: 6042,
52320
52357
  name: "BuyPriceRangeCalculationError",
52321
52358
  msg: "Buy price range calculation failed"
52322
52359
  },
52323
52360
  {
52324
- code: 6044,
52361
+ code: 6043,
52325
52362
  name: "SellPriceRangeCalculationError",
52326
52363
  msg: "Sell price range calculation failed"
52327
52364
  },
52328
52365
  {
52329
- code: 6045,
52366
+ code: 6044,
52330
52367
  name: "PriceAtStopLossBoundary",
52331
52368
  msg: "Price has reached stop-loss boundary, head order must be liquidated first"
52332
52369
  },
52333
52370
  {
52334
- code: 6046,
52371
+ code: 6045,
52335
52372
  name: "RemainingRangeCalculationError",
52336
52373
  msg: "Remaining range calculation failed"
52337
52374
  },
52338
52375
  {
52339
- code: 6047,
52376
+ code: 6046,
52340
52377
  name: "FullRangeCalculationError",
52341
52378
  msg: "Full range calculation failed"
52342
52379
  },
52343
52380
  {
52344
- code: 6048,
52381
+ code: 6047,
52345
52382
  name: "BuyFromPriceWithTokenNoneError",
52346
52383
  msg: "Curve function returned None: buy_from_price_with_token_output"
52347
52384
  },
52348
52385
  {
52349
- code: 6049,
52386
+ code: 6048,
52350
52387
  name: "SellFromPriceWithTokenNoneError",
52351
52388
  msg: "Curve function returned None: sell_from_price_with_token_input"
52352
52389
  },
52353
52390
  {
52354
- code: 6050,
52391
+ code: 6049,
52355
52392
  name: "ExceedsMaxSolAmount",
52356
52393
  msg: "Required SOL amount exceeds user-set maximum"
52357
52394
  },
52358
52395
  {
52359
- code: 6051,
52396
+ code: 6050,
52360
52397
  name: "InsufficientSolOutput",
52361
52398
  msg: "Insufficient SOL output"
52362
52399
  },
52363
52400
  {
52364
- code: 6052,
52401
+ code: 6051,
52365
52402
  name: "InsufficientRepayment",
52366
52403
  msg: "Insufficient proceeds to repay loan"
52367
52404
  },
52368
52405
  {
52369
- code: 6053,
52406
+ code: 6052,
52370
52407
  name: "InsufficientBorrowingReserve",
52371
52408
  msg: "Insufficient borrowing reserve"
52372
52409
  },
52373
52410
  {
52374
- code: 6054,
52411
+ code: 6053,
52375
52412
  name: "InsufficientTokenSale",
52376
52413
  msg: "Insufficient token sale amount"
52377
52414
  },
52378
52415
  {
52379
- code: 6055,
52416
+ code: 6054,
52380
52417
  name: "InsufficientLiquidity",
52381
52418
  msg: "Insufficient liquidity in current order"
52382
52419
  },
52383
52420
  {
52384
- code: 6056,
52421
+ code: 6055,
52385
52422
  name: "InsufficientMarketLiquidity",
52386
52423
  msg: "Insufficient market liquidity, cannot satisfy trade even after liquidating all stop-loss orders"
52387
52424
  },
52388
52425
  {
52389
- code: 6057,
52426
+ code: 6056,
52390
52427
  name: "TokenAmountDifferenceOutOfRange",
52391
52428
  msg: "Token amount difference exceeds valid range in margin trade"
52392
52429
  },
52393
52430
  {
52394
- code: 6058,
52431
+ code: 6057,
52395
52432
  name: "BorrowAmountMismatch",
52396
52433
  msg: "Borrow amount mismatch with locked tokens"
52397
52434
  },
52398
52435
  {
52399
- code: 6059,
52436
+ code: 6058,
52400
52437
  name: "CloseFeeCalculationError",
52401
52438
  msg: "Close fee calculation error"
52402
52439
  },
52403
52440
  {
52404
- code: 6060,
52441
+ code: 6059,
52405
52442
  name: "InsufficientMargin",
52406
52443
  msg: "Insufficient margin"
52407
52444
  },
52408
52445
  {
52409
- code: 6061,
52446
+ code: 6060,
52410
52447
  name: "InsufficientMinimumMargin",
52411
52448
  msg: "Margin below minimum requirement"
52412
52449
  },
52413
52450
  {
52414
- code: 6062,
52451
+ code: 6061,
52415
52452
  name: "InvalidAccountOwner",
52416
52453
  msg: "Invalid account owner"
52417
52454
  },
52418
52455
  {
52419
- code: 6063,
52456
+ code: 6062,
52420
52457
  name: "SellAmountExceedsOrderAmount",
52421
52458
  msg: "Sell amount exceeds order's token holdings"
52422
52459
  },
52423
52460
  {
52424
- code: 6064,
52461
+ code: 6063,
52425
52462
  name: "OrderNotExpiredMustCloseByOwner",
52426
52463
  msg: "Non-expired order must be closed by owner"
52427
52464
  },
52428
52465
  {
52429
- code: 6065,
52466
+ code: 6064,
52430
52467
  name: "SettlementAddressMustBeOwnerAddress",
52431
52468
  msg: "Settlement address must be owner address"
52432
52469
  },
52433
52470
  {
52434
- code: 6066,
52471
+ code: 6065,
52435
52472
  name: "BuyAmountExceedsOrderAmount",
52436
52473
  msg: "Buy amount exceeds order's token holdings"
52437
52474
  },
52438
52475
  {
52439
- code: 6067,
52476
+ code: 6066,
52440
52477
  name: "InsufficientTradeAmount",
52441
52478
  msg: "Trade amount below minimum requirement"
52442
52479
  },
52443
52480
  {
52444
- code: 6068,
52481
+ code: 6067,
52445
52482
  name: "SolAmountTooLarge",
52446
52483
  msg: "SOL amount exceeds maximum limit (10000000 SOL per transaction)"
52447
52484
  },
52448
52485
  {
52449
- code: 6069,
52486
+ code: 6068,
52450
52487
  name: "RemainingTokenAmountTooSmall",
52451
52488
  msg: "Remaining token amount below minimum trade requirement"
52452
52489
  },
52453
52490
  {
52454
- code: 6070,
52491
+ code: 6069,
52455
52492
  name: "TradeCooldownNotExpired",
52456
52493
  msg: "Trade cooldown period not expired, please try again later"
52457
52494
  },
52458
52495
  {
52459
- code: 6071,
52496
+ code: 6070,
52460
52497
  name: "ExceedApprovalAmount",
52461
52498
  msg: "Sell amount exceeds approved amount, please call approval function first"
52462
52499
  },
52463
52500
  {
52464
- code: 6072,
52501
+ code: 6071,
52465
52502
  name: "CooldownNotInitialized",
52466
52503
  msg: "Sell trade requires calling approval or buy function first to initialize cooldown PDA"
52467
52504
  },
52468
52505
  {
52469
- code: 6073,
52506
+ code: 6072,
52470
52507
  name: "CannotCloseCooldownWithBalance",
52471
52508
  msg: "Cannot close cooldown PDA with non-zero token balance"
52472
52509
  },
52473
52510
  {
52474
- code: 6074,
52511
+ code: 6073,
52475
52512
  name: "PriceCalculationError",
52476
52513
  msg: "Price calculation error"
52477
52514
  },
52478
52515
  {
52479
- code: 6075,
52516
+ code: 6074,
52480
52517
  name: "InvalidPartnerFeeRecipientAccount",
52481
52518
  msg: "Invalid partner fee recipient account"
52482
52519
  },
52483
52520
  {
52484
- code: 6076,
52521
+ code: 6075,
52485
52522
  name: "InvalidBaseFeeRecipientAccount",
52486
52523
  msg: "Invalid base fee recipient account"
52487
52524
  },
52488
52525
  {
52489
- code: 6077,
52526
+ code: 6076,
52490
52527
  name: "InvalidOrderbookAddress",
52491
52528
  msg: "Orderbook address does not match curve account orderbook"
52492
52529
  },
52493
52530
  {
52494
- code: 6078,
52531
+ code: 6077,
52495
52532
  name: "InvalidFeePercentage",
52496
52533
  msg: "Fee percentage must be between 0-100"
52497
52534
  },
52498
52535
  {
52499
- code: 6079,
52536
+ code: 6078,
52500
52537
  name: "InvalidFeeRate",
52501
52538
  msg: "Fee rate exceeds maximum limit (10%)"
52502
52539
  },
52503
52540
  {
52504
- code: 6080,
52541
+ code: 6079,
52505
52542
  name: "InvalidCustomFeeRate",
52506
52543
  msg: "Custom fee rate must be between 1000 (1%) and 5000 (5%)"
52507
52544
  },
52508
52545
  {
52509
- code: 6081,
52546
+ code: 6080,
52510
52547
  name: "InvalidBorrowDuration",
52511
52548
  msg: "Borrow duration out of valid range (3-30 days)"
52512
52549
  },
52513
52550
  {
52514
- code: 6082,
52551
+ code: 6081,
52515
52552
  name: "InvalidStopLossPrice",
52516
52553
  msg: "Stop loss price does not meet minimum interval requirement"
52517
52554
  },
52518
52555
  {
52519
- code: 6083,
52556
+ code: 6082,
52520
52557
  name: "NoProfitableFunds",
52521
52558
  msg: "No profitable funds to transfer"
52522
52559
  },
52523
52560
  {
52524
- code: 6084,
52561
+ code: 6083,
52525
52562
  name: "InsufficientPoolFunds",
52526
52563
  msg: "Insufficient pool funds"
52527
52564
  },
52528
52565
  {
52529
- code: 6085,
52566
+ code: 6084,
52530
52567
  name: "InsufficientPoolBalance",
52531
52568
  msg: "Pool SOL account balance would fall below minimum required balance"
52532
52569
  },
52533
52570
  {
52534
- code: 6086,
52571
+ code: 6085,
52535
52572
  name: "OrderBookManagerOverflow",
52536
52573
  msg: "Math operation overflow"
52537
52574
  },
52538
52575
  {
52539
- code: 6087,
52576
+ code: 6086,
52540
52577
  name: "OrderBookManagerInvalidSlotIndex",
52541
52578
  msg: "Invalid slot index"
52542
52579
  },
52543
52580
  {
52544
- code: 6088,
52581
+ code: 6087,
52545
52582
  name: "OrderBookManagerInvalidAccountData",
52546
52583
  msg: "Invalid account data"
52547
52584
  },
52548
52585
  {
52549
- code: 6089,
52586
+ code: 6088,
52550
52587
  name: "OrderBookManagerExceedsMaxCapacity",
52551
52588
  msg: "New capacity exceeds maximum limit"
52552
52589
  },
52553
52590
  {
52554
- code: 6090,
52591
+ code: 6089,
52555
52592
  name: "OrderBookManagerExceedsAccountSizeLimit",
52556
52593
  msg: "Account size exceeds 10MB limit"
52557
52594
  },
52558
52595
  {
52559
- code: 6091,
52596
+ code: 6090,
52560
52597
  name: "OrderBookManagerOrderIdMismatch",
52561
52598
  msg: "Order ID mismatch"
52562
52599
  },
52563
52600
  {
52564
- code: 6092,
52601
+ code: 6091,
52565
52602
  name: "OrderBookManagerEmptyOrderBook",
52566
52603
  msg: "Order book is empty"
52567
52604
  },
52568
52605
  {
52569
- code: 6093,
52606
+ code: 6092,
52570
52607
  name: "OrderBookManagerAccountNotWritable",
52571
52608
  msg: "Account is not writable"
52572
52609
  },
52573
52610
  {
52574
- code: 6094,
52611
+ code: 6093,
52575
52612
  name: "OrderBookManagerNotRentExempt",
52576
52613
  msg: "Account not rent-exempt"
52577
52614
  },
52578
52615
  {
52579
- code: 6095,
52616
+ code: 6094,
52580
52617
  name: "OrderBookManagerInvalidRentBalance",
52581
52618
  msg: "Invalid rent balance"
52582
52619
  },
52583
52620
  {
52584
- code: 6096,
52621
+ code: 6095,
52585
52622
  name: "OrderBookManagerInsufficientFunds",
52586
52623
  msg: "Insufficient funds"
52587
52624
  },
52588
52625
  {
52589
- code: 6097,
52626
+ code: 6096,
52590
52627
  name: "OrderBookManagerInvalidAccountOwner",
52591
52628
  msg: "OrderBook account owner mismatch"
52592
52629
  },
52593
52630
  {
52594
- code: 6098,
52631
+ code: 6097,
52595
52632
  name: "OrderBookManagerDataOutOfBounds",
52596
52633
  msg: "Data access out of bounds"
52597
52634
  },
52598
52635
  {
52599
- code: 6099,
52636
+ code: 6098,
52600
52637
  name: "NoValidInsertPosition",
52601
52638
  msg: "Cannot find valid insert position, all candidates failed due to price range overlap"
52602
52639
  },
52603
52640
  {
52604
- code: 6100,
52641
+ code: 6099,
52605
52642
  name: "EmptyCloseInsertIndices",
52606
52643
  msg: "close_insert_indices array cannot be empty"
52607
52644
  },
52608
52645
  {
52609
- code: 6101,
52646
+ code: 6100,
52610
52647
  name: "TooManyCloseInsertIndices",
52611
52648
  msg: "close_insert_indices array cannot exceed 20 elements"
52612
52649
  },
52613
52650
  {
52614
- code: 6102,
52651
+ code: 6101,
52615
52652
  name: "CloseOrderNotFound",
52616
52653
  msg: "Specified close order not found"
52617
52654
  },
52618
52655
  {
52619
- code: 6103,
52656
+ code: 6102,
52620
52657
  name: "LinkedListDeleteCountMismatch",
52621
52658
  msg: "Linked list delete count mismatch: count inconsistent before/after deletion"
52622
52659
  },
52623
52660
  {
52624
- code: 6104,
52661
+ code: 6103,
52625
52662
  name: "NameTooLong",
52626
52663
  msg: "Token name too long, max 32 bytes"
52627
52664
  },
52628
52665
  {
52629
- code: 6105,
52666
+ code: 6104,
52630
52667
  name: "NameEmpty",
52631
52668
  msg: "Token name cannot be empty"
52632
52669
  },
52633
52670
  {
52634
- code: 6106,
52671
+ code: 6105,
52635
52672
  name: "SymbolTooLong",
52636
52673
  msg: "Token symbol too long, max 10 bytes"
52637
52674
  },
52638
52675
  {
52639
- code: 6107,
52676
+ code: 6106,
52640
52677
  name: "SymbolEmpty",
52641
52678
  msg: "Token symbol cannot be empty"
52642
52679
  },
52643
52680
  {
52644
- code: 6108,
52681
+ code: 6107,
52645
52682
  name: "UriTooLong",
52646
52683
  msg: "URI too long, max 200 bytes"
52647
52684
  },
52648
52685
  {
52649
- code: 6109,
52686
+ code: 6108,
52650
52687
  name: "UriEmpty",
52651
52688
  msg: "URI cannot be empty"
52652
52689
  },
52653
52690
  {
52654
- code: 6110,
52691
+ code: 6109,
52655
52692
  name: "IncompleteAdvancedPoolParams",
52656
52693
  msg: "Incomplete advanced pool parameters: custom_lp_sol, custom_lp_token, custom_borrow_ratio, custom_borrow_duration must be provided together"
52657
52694
  },
52658
52695
  {
52659
- code: 6111,
52696
+ code: 6110,
52660
52697
  name: "InvalidInitialVirtualSol",
52661
52698
  msg: "Initial virtual SOL out of valid range"
52662
52699
  },
52663
52700
  {
52664
- code: 6112,
52701
+ code: 6111,
52665
52702
  name: "InvalidInitialVirtualToken",
52666
52703
  msg: "Initial virtual Token out of valid range"
52667
52704
  },
52668
52705
  {
52669
- code: 6113,
52706
+ code: 6112,
52670
52707
  name: "InvalidBorrowPoolRatio",
52671
52708
  msg: "Borrow pool ratio out of valid range"
52672
52709
  },
52673
52710
  {
52674
- code: 6114,
52711
+ code: 6113,
52675
52712
  name: "BorrowTokenCalculationOverflow",
52676
52713
  msg: "Borrow pool token amount calculation overflow"
52677
52714
  },
52678
52715
  {
52679
- code: 6115,
52716
+ code: 6114,
52680
52717
  name: "BorrowTokenAmountZero",
52681
52718
  msg: "Borrow pool token amount cannot be zero"
52682
52719
  }