flash-sdk 2.52.3 → 2.53.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.
@@ -30,6 +30,9 @@ export declare class PoolAccount implements Pool {
30
30
  compoundingStats: CompoundingStats;
31
31
  compoundingMintBump: number;
32
32
  compoundingLpVaultBump: number;
33
+ minLpPriceUsd: BN;
34
+ maxLpPriceUsd: BN;
35
+ padding2: BN[];
33
36
  constructor(publicKey: PublicKey, parseData: Pool);
34
37
  static from(publicKey: PublicKey, parseData: Pool): PoolAccount;
35
38
  updatePoolData(parseData: Pool): void;
@@ -1113,7 +1113,7 @@
1113
1113
  "targetCustody": "7gfDTeMREaKcg3SMfrgVP7fjrstmrzzAeYCAcVaHTV9h",
1114
1114
  "collateralCustody": "7gfDTeMREaKcg3SMfrgVP7fjrstmrzzAeYCAcVaHTV9h",
1115
1115
  "side": "long",
1116
- "maxLev": 25,
1116
+ "maxLev": 10,
1117
1117
  "targetCustodyId": 1,
1118
1118
  "collateralCustodyId": 1,
1119
1119
  "targetMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
@@ -1127,7 +1127,7 @@
1127
1127
  "targetCustody": "7gfDTeMREaKcg3SMfrgVP7fjrstmrzzAeYCAcVaHTV9h",
1128
1128
  "collateralCustody": "qFFbK8PHbNt4433AUTHHDsmDuQGTQhixc8t4sCzugG4",
1129
1129
  "side": "short",
1130
- "maxLev": 25,
1130
+ "maxLev": 10,
1131
1131
  "targetCustodyId": 1,
1132
1132
  "collateralCustodyId": 0,
1133
1133
  "targetMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
@@ -1141,7 +1141,7 @@
1141
1141
  "targetCustody": "Gw81Uk5LarYkoCtwY95b1uT8tqTyzYQf3WM3yvgi9N43",
1142
1142
  "collateralCustody": "Gw81Uk5LarYkoCtwY95b1uT8tqTyzYQf3WM3yvgi9N43",
1143
1143
  "side": "long",
1144
- "maxLev": 25,
1144
+ "maxLev": 10,
1145
1145
  "targetCustodyId": 2,
1146
1146
  "collateralCustodyId": 2,
1147
1147
  "targetMint": "2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv",
@@ -1155,7 +1155,7 @@
1155
1155
  "targetCustody": "Gw81Uk5LarYkoCtwY95b1uT8tqTyzYQf3WM3yvgi9N43",
1156
1156
  "collateralCustody": "qFFbK8PHbNt4433AUTHHDsmDuQGTQhixc8t4sCzugG4",
1157
1157
  "side": "short",
1158
- "maxLev": 25,
1158
+ "maxLev": 10,
1159
1159
  "targetCustodyId": 2,
1160
1160
  "collateralCustodyId": 0,
1161
1161
  "targetMint": "2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv",
@@ -1266,7 +1266,7 @@
1266
1266
  "targetCustody": "AMAea38ijDJuoq14mwxzQkGEyZEnjw69eqrMQ9uHPdyP",
1267
1267
  "collateralCustody": "AMAea38ijDJuoq14mwxzQkGEyZEnjw69eqrMQ9uHPdyP",
1268
1268
  "side": "long",
1269
- "maxLev": 25,
1269
+ "maxLev": 10,
1270
1270
  "targetCustodyId": 1,
1271
1271
  "collateralCustodyId": 1,
1272
1272
  "targetMint": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
@@ -1280,7 +1280,7 @@
1280
1280
  "targetCustody": "AMAea38ijDJuoq14mwxzQkGEyZEnjw69eqrMQ9uHPdyP",
1281
1281
  "collateralCustody": "EtLnmKsmbTPH1mUhZSNU5ErEoFrSgYoxoKX8BSzEZmnn",
1282
1282
  "side": "short",
1283
- "maxLev": 25,
1283
+ "maxLev": 10,
1284
1284
  "targetCustodyId": 1,
1285
1285
  "collateralCustodyId": 0,
1286
1286
  "targetMint": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
@@ -1516,7 +1516,7 @@
1516
1516
  "targetCustody": "EHzgXgb2azBXG9bgPT2GEPfe6FtyQwiJtPxMUwny4WFe",
1517
1517
  "collateralCustody": "EHzgXgb2azBXG9bgPT2GEPfe6FtyQwiJtPxMUwny4WFe",
1518
1518
  "side": "long",
1519
- "maxLev": 25,
1519
+ "maxLev": 5,
1520
1520
  "targetCustodyId": 2,
1521
1521
  "collateralCustodyId": 2,
1522
1522
  "targetMint": "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump",
@@ -1530,7 +1530,7 @@
1530
1530
  "targetCustody": "EHzgXgb2azBXG9bgPT2GEPfe6FtyQwiJtPxMUwny4WFe",
1531
1531
  "collateralCustody": "B1b3WnCbwrQC8yk6o5rVLGGJFD7BdQBLyaWsRw4Lqgp2",
1532
1532
  "side": "short",
1533
- "maxLev": 25,
1533
+ "maxLev": 5,
1534
1534
  "targetCustodyId": 2,
1535
1535
  "collateralCustodyId": 0,
1536
1536
  "targetMint": "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump",
@@ -2645,7 +2645,7 @@
2645
2645
  "targetCustody": "DtmPaayiEidB5VQEZXCv5g54F5aaTguCQXck13wfE7Sp",
2646
2646
  "collateralCustody": "DtmPaayiEidB5VQEZXCv5g54F5aaTguCQXck13wfE7Sp",
2647
2647
  "side": "long",
2648
- "maxLev": 25,
2648
+ "maxLev": 10,
2649
2649
  "targetCustodyId": 1,
2650
2650
  "collateralCustodyId": 1,
2651
2651
  "targetMint": "bonkmzC5QamYYD9LE73evR6UH49ojDxsFt9Juwqsx7h",
@@ -2659,7 +2659,7 @@
2659
2659
  "targetCustody": "DtmPaayiEidB5VQEZXCv5g54F5aaTguCQXck13wfE7Sp",
2660
2660
  "collateralCustody": "9ikjiYhjcNhGF7t6zfsDpXh2MwCT2ydm5rFsB4yN3XEs",
2661
2661
  "side": "short",
2662
- "maxLev": 25,
2662
+ "maxLev": 10,
2663
2663
  "targetCustodyId": 1,
2664
2664
  "collateralCustodyId": 0,
2665
2665
  "targetMint": "bonkmzC5QamYYD9LE73evR6UH49ojDxsFt9Juwqsx7h",
@@ -2673,7 +2673,7 @@
2673
2673
  "targetCustody": "D3o8xWXiaCx3JfWAFn2PGtGVChXUM2NtA7zLLZ7jSY4Z",
2674
2674
  "collateralCustody": "D3o8xWXiaCx3JfWAFn2PGtGVChXUM2NtA7zLLZ7jSY4Z",
2675
2675
  "side": "long",
2676
- "maxLev": 25,
2676
+ "maxLev": 10,
2677
2677
  "targetCustodyId": 2,
2678
2678
  "collateralCustodyId": 2,
2679
2679
  "targetMint": "pguzpUxEhB5Rd3dUhioFBQd8RTkQzrkE4JBenyC86ZU",
@@ -2687,7 +2687,7 @@
2687
2687
  "targetCustody": "D3o8xWXiaCx3JfWAFn2PGtGVChXUM2NtA7zLLZ7jSY4Z",
2688
2688
  "collateralCustody": "9ikjiYhjcNhGF7t6zfsDpXh2MwCT2ydm5rFsB4yN3XEs",
2689
2689
  "side": "short",
2690
- "maxLev": 25,
2690
+ "maxLev": 10,
2691
2691
  "targetCustodyId": 2,
2692
2692
  "collateralCustodyId": 0,
2693
2693
  "targetMint": "pguzpUxEhB5Rd3dUhioFBQd8RTkQzrkE4JBenyC86ZU",
@@ -2798,7 +2798,7 @@
2798
2798
  "targetCustody": "8Z94RGNLFuAxxgi3e4TQ2mxsmD4JJypxFTVaTw5BANC7",
2799
2799
  "collateralCustody": "8Z94RGNLFuAxxgi3e4TQ2mxsmD4JJypxFTVaTw5BANC7",
2800
2800
  "side": "long",
2801
- "maxLev": 25,
2801
+ "maxLev": 10,
2802
2802
  "targetCustodyId": 1,
2803
2803
  "collateralCustodyId": 1,
2804
2804
  "targetMint": "wif1hWbc3yHA6ij5iPLhnMV19EDFcN6WETVP3QV16dQ",
@@ -2812,7 +2812,7 @@
2812
2812
  "targetCustody": "8Z94RGNLFuAxxgi3e4TQ2mxsmD4JJypxFTVaTw5BANC7",
2813
2813
  "collateralCustody": "6nMH1Yz7dDgqE4qiFP7FESD233zDBexuBsefGSshAJnM",
2814
2814
  "side": "short",
2815
- "maxLev": 25,
2815
+ "maxLev": 10,
2816
2816
  "targetCustodyId": 1,
2817
2817
  "collateralCustodyId": 0,
2818
2818
  "targetMint": "wif1hWbc3yHA6ij5iPLhnMV19EDFcN6WETVP3QV16dQ",
@@ -3048,7 +3048,7 @@
3048
3048
  "targetCustody": "EbH7fBbcTojR5P8kPDEFeUnFRGr5SXKWaavqtCgpH9G4",
3049
3049
  "collateralCustody": "EbH7fBbcTojR5P8kPDEFeUnFRGr5SXKWaavqtCgpH9G4",
3050
3050
  "side": "long",
3051
- "maxLev": 25,
3051
+ "maxLev": 5,
3052
3052
  "targetCustodyId": 2,
3053
3053
  "collateralCustodyId": 2,
3054
3054
  "targetMint": "fartpRHniUMJ2dG3AFkFcmvDHptBSqBbttYwE3hKv5t",
@@ -3062,7 +3062,7 @@
3062
3062
  "targetCustody": "EbH7fBbcTojR5P8kPDEFeUnFRGr5SXKWaavqtCgpH9G4",
3063
3063
  "collateralCustody": "FheNnJ2RmuVCJFvHbhADFHwfQwnCX9nMhdsay1hxSmkv",
3064
3064
  "side": "short",
3065
- "maxLev": 25,
3065
+ "maxLev": 5,
3066
3066
  "targetCustodyId": 2,
3067
3067
  "collateralCustodyId": 0,
3068
3068
  "targetMint": "fartpRHniUMJ2dG3AFkFcmvDHptBSqBbttYwE3hKv5t",
@@ -19,8 +19,8 @@ export declare class PositionAccount implements Position {
19
19
  unsettledAmount: BN;
20
20
  unsettledFeesUsd: BN;
21
21
  cumulativeLockFeeSnapshot: BN;
22
- takeProfitPrice: ContractOraclePrice;
23
- stopLossPrice: ContractOraclePrice;
22
+ degenSizeUsd: BN;
23
+ buffer: BN;
24
24
  sizeDecimals: number;
25
25
  lockedDecimals: number;
26
26
  collateralDecimals: number;
@@ -29,4 +29,5 @@ export declare class PositionAccount implements Position {
29
29
  static from(publicKey: PublicKey, parseData: Position): PositionAccount;
30
30
  clone(): PositionAccount;
31
31
  updatePositionData(position: Position): void;
32
+ isDegenMode(): boolean;
32
33
  }
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.PositionAccount = void 0;
15
+ var anchor_1 = require("@coral-xyz/anchor");
15
16
  var PositionAccount = (function () {
16
17
  function PositionAccount(publicKey, parseData) {
17
18
  this.publicKey = publicKey;
@@ -26,6 +27,9 @@ var PositionAccount = (function () {
26
27
  PositionAccount.prototype.updatePositionData = function (position) {
27
28
  Object.assign(this, __assign({}, position));
28
29
  };
30
+ PositionAccount.prototype.isDegenMode = function () {
31
+ return this.degenSizeUsd.gt(new anchor_1.BN(0));
32
+ };
29
33
  return PositionAccount;
30
34
  }());
31
35
  exports.PositionAccount = PositionAccount;
@@ -82,10 +82,10 @@ var ViewHelper = (function () {
82
82
  console.log("decode error::", error);
83
83
  }
84
84
  };
85
- ViewHelper.prototype.simulateTransaction = function (transaction_1) {
86
- return __awaiter(this, arguments, void 0, function (transaction, userPublicKey) {
85
+ ViewHelper.prototype.simulateTransaction = function (transaction, userPublicKey) {
86
+ if (userPublicKey === void 0) { userPublicKey = undefined; }
87
+ return __awaiter(this, void 0, void 0, function () {
87
88
  var latestBlockhash, messageV0, transaction2;
88
- if (userPublicKey === void 0) { userPublicKey = undefined; }
89
89
  return __generator(this, function (_a) {
90
90
  switch (_a.label) {
91
91
  case 0:
@@ -129,10 +129,10 @@ var getBackupOracleInstruction = function (program, poolConfig, backupOracleSecr
129
129
  }
130
130
  };
131
131
  exports.getBackupOracleInstruction = getBackupOracleInstruction;
132
- function createBackupOracleInstruction(poolAddress_1) {
133
- return __awaiter(this, arguments, void 0, function (poolAddress, overrideCheck) {
132
+ function createBackupOracleInstruction(poolAddress, overrideCheck) {
133
+ if (overrideCheck === void 0) { overrideCheck = false; }
134
+ return __awaiter(this, void 0, void 0, function () {
134
135
  var backupOracleData, backUpOracleInstruction, error_1;
135
- if (overrideCheck === void 0) { overrideCheck = false; }
136
136
  return __generator(this, function (_a) {
137
137
  switch (_a.label) {
138
138
  case 0: