@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
@@ -573,65 +573,24 @@ export const MAINNET_BUNDLES_INFO: MainnetBundleInfo = {
573
573
  strategyId: Strategies.Identifiers.EoaCloseOnPrice,
574
574
  protocol: PROTOCOLS.AaveV4,
575
575
  },
576
- [Bundles.MainnetIds.MAKER_SW_LIQUIDATION_PROTECTION]: {
577
- strategyOrBundleId: Bundles.MainnetIds.MAKER_SW_LIQUIDATION_PROTECTION,
578
- strategyId: Strategies.Identifiers.LiquidationProtection,
579
- protocol: PROTOCOLS.MakerDAO,
580
- },
581
- [Bundles.MainnetIds.AAVE_V3_SW_LIQUIDATION_PROTECTION]: {
582
- strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_SW_LIQUIDATION_PROTECTION,
583
- strategyId: Strategies.Identifiers.LiquidationProtection,
584
- protocol: PROTOCOLS.AaveV3,
585
- },
586
- [Bundles.MainnetIds.AAVE_V4_SW_LIQUIDATION_PROTECTION]: {
587
- strategyOrBundleId: Bundles.MainnetIds.AAVE_V4_SW_LIQUIDATION_PROTECTION,
588
- strategyId: Strategies.Identifiers.LiquidationProtection,
589
- protocol: PROTOCOLS.AaveV4,
590
- },
591
- [Bundles.MainnetIds.SPARK_SW_LIQUIDATION_PROTECTION]: {
592
- strategyOrBundleId: Bundles.MainnetIds.SPARK_SW_LIQUIDATION_PROTECTION,
593
- strategyId: Strategies.Identifiers.LiquidationProtection,
594
- protocol: PROTOCOLS.Spark,
595
- },
596
- [Bundles.MainnetIds.COMP_V3_SW_LIQUIDATION_PROTECTION]: {
597
- strategyOrBundleId: Bundles.MainnetIds.COMP_V3_SW_LIQUIDATION_PROTECTION,
598
- strategyId: Strategies.Identifiers.LiquidationProtection,
599
- protocol: PROTOCOLS.CompoundV3,
600
- },
601
- [Bundles.MainnetIds.COMP_V3_EOA_LIQUIDATION_PROTECTION]: {
602
- strategyOrBundleId: Bundles.MainnetIds.COMP_V3_EOA_LIQUIDATION_PROTECTION,
603
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
604
- protocol: PROTOCOLS.CompoundV3,
605
- },
606
- [Bundles.MainnetIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION]: {
607
- strategyOrBundleId:
608
- Bundles.MainnetIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION,
609
- strategyId: Strategies.Identifiers.LiquidationProtection,
576
+ [Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE]: {
577
+ strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
578
+ strategyId: Strategies.Identifiers.RepayOnPrice,
610
579
  protocol: PROTOCOLS.MorphoBlue,
611
580
  },
612
- [Bundles.MainnetIds.FLUID_T1_SW_LIQUIDATION_PROTECTION]: {
613
- strategyOrBundleId: Bundles.MainnetIds.FLUID_T1_SW_LIQUIDATION_PROTECTION,
614
- strategyId: Strategies.Identifiers.LiquidationProtection,
615
- protocol: PROTOCOLS.FluidT1,
616
- },
617
- [Bundles.MainnetIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION]: {
618
- strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION,
619
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
620
- protocol: PROTOCOLS.AaveV3,
621
- },
622
- [Bundles.MainnetIds.AAVE_V4_EOA_LIQUIDATION_PROTECTION]: {
623
- strategyOrBundleId: Bundles.MainnetIds.AAVE_V4_EOA_LIQUIDATION_PROTECTION,
624
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
625
- protocol: PROTOCOLS.AaveV4,
581
+ [Bundles.MainnetIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE]: {
582
+ strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE,
583
+ strategyId: Strategies.Identifiers.EoaBoostOnPrice,
584
+ protocol: PROTOCOLS.MorphoBlue,
626
585
  },
627
- [Bundles.MainnetIds.MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION]: {
628
- strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION,
629
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
586
+ [Bundles.MainnetIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE]: {
587
+ strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE,
588
+ strategyId: Strategies.Identifiers.EoaRepayOnPrice,
630
589
  protocol: PROTOCOLS.MorphoBlue,
631
590
  },
632
- [Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE]: {
633
- strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
634
- strategyId: Strategies.Identifiers.RepayOnPrice,
591
+ [Bundles.MainnetIds.MORPHO_BLUE_EOA_CLOSE]: {
592
+ strategyOrBundleId: Bundles.MainnetIds.MORPHO_BLUE_EOA_CLOSE,
593
+ strategyId: Strategies.Identifiers.EoaCloseOnPrice,
635
594
  protocol: PROTOCOLS.MorphoBlue,
636
595
  },
637
596
  };
@@ -692,16 +651,7 @@ export const OPTIMISM_BUNDLES_INFO: OptimismBundleInfo = {
692
651
  strategyId: Strategies.Identifiers.EoaCloseOnPrice,
693
652
  protocol: PROTOCOLS.AaveV3,
694
653
  },
695
- [Bundles.OptimismIds.AAVE_V3_SW_LIQUIDATION_PROTECTION]: {
696
- strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_SW_LIQUIDATION_PROTECTION,
697
- strategyId: Strategies.Identifiers.LiquidationProtection,
698
- protocol: PROTOCOLS.AaveV3,
699
- },
700
- [Bundles.OptimismIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION]: {
701
- strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION,
702
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
703
- protocol: PROTOCOLS.AaveV3,
704
- },
654
+
705
655
  };
706
656
 
707
657
  export const BASE_BUNDLES_INFO: BaseBundleInfo = {
@@ -845,35 +795,30 @@ export const BASE_BUNDLES_INFO: BaseBundleInfo = {
845
795
  strategyId: Strategies.Identifiers.RepayOnPrice,
846
796
  protocol: PROTOCOLS.MorphoBlue,
847
797
  },
848
- [Bundles.BaseIds.AAVE_V3_SW_LIQUIDATION_PROTECTION]: {
849
- strategyOrBundleId: Bundles.BaseIds.AAVE_V3_SW_LIQUIDATION_PROTECTION,
850
- strategyId: Strategies.Identifiers.LiquidationProtection,
851
- protocol: PROTOCOLS.AaveV3,
852
- },
853
- [Bundles.BaseIds.COMP_V3_SW_LIQUIDATION_PROTECTION]: {
854
- strategyOrBundleId: Bundles.BaseIds.COMP_V3_SW_LIQUIDATION_PROTECTION,
855
- strategyId: Strategies.Identifiers.LiquidationProtection,
856
- protocol: PROTOCOLS.CompoundV3,
798
+ [Bundles.BaseIds.MORPHO_BLUE_EOA_REPAY]: {
799
+ strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_EOA_REPAY,
800
+ strategyId: Strategies.Identifiers.EoaRepay,
801
+ protocol: PROTOCOLS.MorphoBlue,
857
802
  },
858
- [Bundles.BaseIds.COMP_V3_EOA_LIQUIDATION_PROTECTION]: {
859
- strategyOrBundleId: Bundles.BaseIds.COMP_V3_EOA_LIQUIDATION_PROTECTION,
860
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
861
- protocol: PROTOCOLS.CompoundV3,
803
+ [Bundles.BaseIds.MORPHO_BLUE_EOA_BOOST]: {
804
+ strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_EOA_BOOST,
805
+ strategyId: Strategies.Identifiers.EoaBoost,
806
+ protocol: PROTOCOLS.MorphoBlue,
862
807
  },
863
- [Bundles.BaseIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION]: {
864
- strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION,
865
- strategyId: Strategies.Identifiers.LiquidationProtection,
808
+ [Bundles.BaseIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE]: {
809
+ strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE,
810
+ strategyId: Strategies.Identifiers.EoaBoostOnPrice,
866
811
  protocol: PROTOCOLS.MorphoBlue,
867
812
  },
868
- [Bundles.BaseIds.FLUID_T1_SW_LIQUIDATION_PROTECTION]: {
869
- strategyOrBundleId: Bundles.BaseIds.FLUID_T1_SW_LIQUIDATION_PROTECTION,
870
- strategyId: Strategies.Identifiers.LiquidationProtection,
871
- protocol: PROTOCOLS.FluidT1,
813
+ [Bundles.BaseIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE]: {
814
+ strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE,
815
+ strategyId: Strategies.Identifiers.EoaRepayOnPrice,
816
+ protocol: PROTOCOLS.MorphoBlue,
872
817
  },
873
- [Bundles.BaseIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION]: {
874
- strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION,
875
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
876
- protocol: PROTOCOLS.AaveV3,
818
+ [Bundles.BaseIds.MORPHO_BLUE_EOA_CLOSE]: {
819
+ strategyOrBundleId: Bundles.BaseIds.MORPHO_BLUE_EOA_CLOSE,
820
+ strategyId: Strategies.Identifiers.EoaCloseOnPrice,
821
+ protocol: PROTOCOLS.MorphoBlue,
877
822
  },
878
823
  };
879
824
 
@@ -1028,40 +973,19 @@ export const ARBITRUM_BUNDLES_INFO: ArbitrumBundleInfo = {
1028
973
  strategyId: Strategies.Identifiers.RepayOnPrice,
1029
974
  protocol: PROTOCOLS.MorphoBlue,
1030
975
  },
1031
- [Bundles.ArbitrumIds.AAVE_V3_SW_LIQUIDATION_PROTECTION]: {
1032
- strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_SW_LIQUIDATION_PROTECTION,
1033
- strategyId: Strategies.Identifiers.LiquidationProtection,
1034
- protocol: PROTOCOLS.AaveV3,
1035
- },
1036
- [Bundles.ArbitrumIds.COMP_V3_SW_LIQUIDATION_PROTECTION]: {
1037
- strategyOrBundleId: Bundles.ArbitrumIds.COMP_V3_SW_LIQUIDATION_PROTECTION,
1038
- strategyId: Strategies.Identifiers.LiquidationProtection,
1039
- protocol: PROTOCOLS.CompoundV3,
1040
- },
1041
- [Bundles.ArbitrumIds.COMP_V3_EOA_LIQUIDATION_PROTECTION]: {
1042
- strategyOrBundleId: Bundles.ArbitrumIds.COMP_V3_EOA_LIQUIDATION_PROTECTION,
1043
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
1044
- protocol: PROTOCOLS.CompoundV3,
1045
- },
1046
- [Bundles.ArbitrumIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION]: {
1047
- strategyOrBundleId:
1048
- Bundles.ArbitrumIds.MORPHO_BLUE_SW_LIQUIDATION_PROTECTION,
1049
- strategyId: Strategies.Identifiers.LiquidationProtection,
976
+ [Bundles.ArbitrumIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE]: {
977
+ strategyOrBundleId: Bundles.ArbitrumIds.MORPHO_BLUE_EOA_BOOST_ON_PRICE,
978
+ strategyId: Strategies.Identifiers.EoaBoostOnPrice,
1050
979
  protocol: PROTOCOLS.MorphoBlue,
1051
980
  },
1052
- [Bundles.ArbitrumIds.FLUID_T1_SW_LIQUIDATION_PROTECTION]: {
1053
- strategyOrBundleId: Bundles.ArbitrumIds.FLUID_T1_SW_LIQUIDATION_PROTECTION,
1054
- strategyId: Strategies.Identifiers.LiquidationProtection,
1055
- protocol: PROTOCOLS.FluidT1,
1056
- },
1057
- [Bundles.ArbitrumIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION]: {
1058
- strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_LIQUIDATION_PROTECTION,
1059
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
1060
- protocol: PROTOCOLS.AaveV3,
981
+ [Bundles.ArbitrumIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE]: {
982
+ strategyOrBundleId: Bundles.ArbitrumIds.MORPHO_BLUE_EOA_REPAY_ON_PRICE,
983
+ strategyId: Strategies.Identifiers.EoaRepayOnPrice,
984
+ protocol: PROTOCOLS.MorphoBlue,
1061
985
  },
1062
- [Bundles.ArbitrumIds.MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION]: {
1063
- strategyOrBundleId: Bundles.ArbitrumIds.MORPHO_BLUE_EOA_LIQUIDATION_PROTECTION,
1064
- strategyId: Strategies.Identifiers.EoaLiquidationProtection,
986
+ [Bundles.ArbitrumIds.MORPHO_BLUE_EOA_CLOSE]: {
987
+ strategyOrBundleId: Bundles.ArbitrumIds.MORPHO_BLUE_EOA_CLOSE,
988
+ strategyId: Strategies.Identifiers.EoaCloseOnPrice,
1065
989
  protocol: PROTOCOLS.MorphoBlue,
1066
990
  },
1067
991
  };
package/src/index.ts CHANGED
@@ -24,34 +24,18 @@ import * as enums from './types/enums';
24
24
  import type * as types from './types';
25
25
 
26
26
  import {
27
- getRatioStateInfoForAaveCloseStrategy,
28
- compareSubHashes,
29
- encodeSubId,
30
- getCloseStrategyType,
27
+ getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId, getCloseStrategyType,
31
28
  } from './services/utils';
32
29
 
33
30
  const utils = {
34
- compareSubHashes,
35
- encodeSubId,
36
- getCloseStrategyType,
37
- getRatioStateInfoForAaveCloseStrategy,
31
+ getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId, getCloseStrategyType,
38
32
  };
39
33
 
40
34
  export {
41
- ArbitrumStrategies,
42
- BaseStrategies,
43
- EthereumStrategies,
44
- LegacyAaveAutomation,
45
- LegacyCompoundAutomation,
46
- LegacyMakerAutomation,
47
- OptimismStrategies,
48
- constants,
49
- enums,
50
- strategiesService,
51
- strategySubService,
52
- subDataService,
53
- triggerService,
54
- utils,
35
+ LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation,
36
+ EthereumStrategies, OptimismStrategies, ArbitrumStrategies, BaseStrategies,
37
+ triggerService, subDataService, strategySubService, utils,
38
+ enums, constants, strategiesService,
55
39
  };
56
40
 
57
41
  export type { types };