@defisaver/automation-sdk 3.3.16-liq-prot-dev → 3.3.17

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.
Files changed (39) hide show
  1. package/cjs/constants/index.js +42 -117
  2. package/cjs/index.d.ts +2 -2
  3. package/cjs/index.js +2 -5
  4. package/cjs/services/strategiesService.js +21 -160
  5. package/cjs/services/strategySubService.d.ts +21 -18
  6. package/cjs/services/strategySubService.js +74 -78
  7. package/cjs/services/strategySubService.test.js +149 -3
  8. package/cjs/services/subDataService.d.ts +20 -70
  9. package/cjs/services/subDataService.js +79 -23
  10. package/cjs/services/subDataService.test.js +202 -17
  11. package/cjs/services/utils.d.ts +1 -2
  12. package/cjs/services/utils.js +1 -14
  13. package/cjs/types/enums.d.ts +17 -36
  14. package/cjs/types/enums.js +11 -30
  15. package/esm/constants/index.js +42 -117
  16. package/esm/index.d.ts +2 -2
  17. package/esm/index.js +2 -5
  18. package/esm/services/strategiesService.js +21 -160
  19. package/esm/services/strategySubService.d.ts +21 -18
  20. package/esm/services/strategySubService.js +73 -78
  21. package/esm/services/strategySubService.test.js +147 -4
  22. package/esm/services/subDataService.d.ts +20 -70
  23. package/esm/services/subDataService.js +77 -21
  24. package/esm/services/subDataService.test.js +200 -18
  25. package/esm/services/utils.d.ts +1 -2
  26. package/esm/services/utils.js +1 -13
  27. package/esm/types/enums.d.ts +17 -36
  28. package/esm/types/enums.js +11 -30
  29. package/package.json +1 -1
  30. package/src/constants/index.ts +43 -119
  31. package/src/index.ts +6 -22
  32. package/src/services/strategiesService.ts +23 -225
  33. package/src/services/strategySubService.test.ts +191 -3
  34. package/src/services/strategySubService.ts +121 -173
  35. package/src/services/subDataService.test.ts +214 -18
  36. package/src/services/subDataService.ts +106 -42
  37. package/src/services/utils.test.ts +1 -1
  38. package/src/services/utils.ts +1 -15
  39. package/src/types/enums.ts +13 -30
@@ -2,7 +2,7 @@ import { expect } from 'chai';
2
2
  import { getAssetInfo } from '@defisaver/tokens';
3
3
 
4
4
  import type { EthereumAddress } from '../types';
5
- import { Bundles, ChainId, ProtocolIdentifiers, RatioState } from '../types/enums';
5
+ import { ChainId, ProtocolIdentifiers, RatioState } from '../types/enums';
6
6
 
7
7
  import '../configuration';
8
8
  import {
@@ -5,7 +5,6 @@ import { getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
5
5
 
6
6
  import type { EthereumAddress } from '../types';
7
7
  import {
8
- Bundles,
9
8
  ChainId, CloseStrategyType, CloseToAssetType, RatioState,
10
9
  } from '../types/enums';
11
10
 
@@ -172,17 +171,4 @@ export function getStopLossAndTakeProfitTypeByCloseStrategyType(
172
171
  default:
173
172
  throw new Error('CloseStrategyType not supported');
174
173
  }
175
- }
176
-
177
- export function getBundleIdsByNetwork(network: ChainId) {
178
- switch (Number(network)) {
179
- case ChainId.Ethereum:
180
- return Bundles.MainnetIds;
181
- case ChainId.Arbitrum:
182
- return Bundles.ArbitrumIds;
183
- case ChainId.Base:
184
- return Bundles.BaseIds;
185
- default:
186
- throw new Error(`Unsupported network ${network}`);
187
- }
188
- }
174
+ }
@@ -153,8 +153,6 @@ export namespace Strategies {
153
153
  EoaRepayOnPrice = 'eoa-repay-on-price',
154
154
  CollateralSwitch = 'collateral-switch',
155
155
  EoaCollateralSwitch = 'eoa-collateral-switch',
156
- LiquidationProtection = 'liquidation-protection',
157
- EoaLiquidationProtection = 'liquidation-protection-eoa',
158
156
  }
159
157
  export enum IdOverrides {
160
158
  TakeProfit = 'take-profit',
@@ -166,8 +164,6 @@ export namespace Strategies {
166
164
  EoaLeverageManagement = 'leverage-management-eoa',
167
165
  LeverageManagementOnPrice = 'leverage-management-on-price',
168
166
  EoaLeverageManagementOnPrice = 'leverage-management-on-price-eoa',
169
- LiquidationProtection = 'liquidation-protection',
170
- EoaLiquidationProtection = 'liquidation-protection-eoa',
171
167
  }
172
168
  }
173
169
 
@@ -244,18 +240,10 @@ export namespace Bundles {
244
240
  AAVE_V4_EOA_REPAY_ON_PRICE = 68,
245
241
  AAVE_V4_EOA_BOOST_ON_PRICE = 69,
246
242
  AAVE_V4_EOA_CLOSE = 70,
247
- AAVE_V3_SW_LIQUIDATION_PROTECTION = 71,
248
- SPARK_SW_LIQUIDATION_PROTECTION = 72,
249
- MAKER_SW_LIQUIDATION_PROTECTION = 75,
250
- FLUID_T1_SW_LIQUIDATION_PROTECTION = 76,
251
- AAVE_V4_SW_LIQUIDATION_PROTECTION = 77,
252
- MORPHO_BLUE_SW_LIQUIDATION_PROTECTION = 78,
253
- AAVE_V3_EOA_LIQUIDATION_PROTECTION = 79,
254
- AAVE_V4_EOA_LIQUIDATION_PROTECTION = 80,
255
- MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION = 81,
256
- COMP_V3_SW_LIQUIDATION_PROTECTION = 82,
257
- COMP_V3_EOA_LIQUIDATION_PROTECTION = 83,
258
243
  MORPHO_BLUE_REPAY_ON_PRICE = 84,
244
+ MORPHO_BLUE_EOA_BOOST_ON_PRICE = 85,
245
+ MORPHO_BLUE_EOA_REPAY_ON_PRICE = 86,
246
+ MORPHO_BLUE_EOA_CLOSE = 87,
259
247
  }
260
248
 
261
249
  export enum OptimismIds {
@@ -270,8 +258,6 @@ export namespace Bundles {
270
258
  AAVE_V3_EOA_REPAY_ON_PRICE = 8,
271
259
  AAVE_V3_EOA_BOOST_ON_PRICE = 9,
272
260
  AAVE_V3_EOA_CLOSE = 10,
273
- AAVE_V3_SW_LIQUIDATION_PROTECTION = 11,
274
- AAVE_V3_EOA_LIQUIDATION_PROTECTION = 12,
275
261
  }
276
262
 
277
263
  export enum BaseIds {
@@ -302,13 +288,12 @@ export namespace Bundles {
302
288
  AAVE_V3_EOA_BOOST_ON_PRICE = 26,
303
289
  AAVE_V3_EOA_CLOSE = 27,
304
290
  MORPHO_BLUE_CLOSE = 28,
305
- AAVE_V3_SW_LIQUIDATION_PROTECTION = 29,
306
- FLUID_T1_SW_LIQUIDATION_PROTECTION = 30,
307
- COMP_V3_SW_LIQUIDATION_PROTECTION = 32,
308
- COMP_V3_EOA_LIQUIDATION_PROTECTION = 33,
309
- AAVE_V3_EOA_LIQUIDATION_PROTECTION = 34,
310
- MORPHO_BLUE_SW_LIQUIDATION_PROTECTION = 35,
311
291
  MORPHO_BLUE_REPAY_ON_PRICE = 36,
292
+ MORPHO_BLUE_EOA_REPAY = 37,
293
+ MORPHO_BLUE_EOA_BOOST = 38,
294
+ MORPHO_BLUE_EOA_BOOST_ON_PRICE = 39,
295
+ MORPHO_BLUE_EOA_REPAY_ON_PRICE = 40,
296
+ MORPHO_BLUE_EOA_CLOSE = 41,
312
297
  }
313
298
 
314
299
  export enum ArbitrumIds {
@@ -341,13 +326,11 @@ export namespace Bundles {
341
326
  MORPHO_BLUE_EOA_REPAY = 26,
342
327
  MORPHO_BLUE_EOA_BOOST = 27,
343
328
  MORPHO_BLUE_CLOSE = 28,
344
- AAVE_V3_SW_LIQUIDATION_PROTECTION = 29,
345
- FLUID_T1_SW_LIQUIDATION_PROTECTION = 30,
346
- MORPHO_BLUE_SW_LIQUIDATION_PROTECTION = 31,
347
- COMP_V3_SW_LIQUIDATION_PROTECTION = 32,
348
- COMP_V3_EOA_LIQUIDATION_PROTECTION = 33,
349
- AAVE_V3_EOA_LIQUIDATION_PROTECTION = 34,
350
- MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION = 35,
351
329
  MORPHO_BLUE_REPAY_ON_PRICE = 36,
330
+ MORPHO_BLUE_EOA_BOOST_ON_PRICE = 37,
331
+ MORPHO_BLUE_EOA_REPAY_ON_PRICE = 38,
332
+ MORPHO_BLUE_EOA_CLOSE = 39,
352
333
  }
353
334
  }
335
+
336
+