@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.
- package/cjs/constants/index.js +42 -117
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -5
- package/cjs/services/strategiesService.js +21 -160
- package/cjs/services/strategySubService.d.ts +21 -18
- package/cjs/services/strategySubService.js +74 -78
- package/cjs/services/strategySubService.test.js +149 -3
- package/cjs/services/subDataService.d.ts +20 -70
- package/cjs/services/subDataService.js +79 -23
- package/cjs/services/subDataService.test.js +202 -17
- package/cjs/services/utils.d.ts +1 -2
- package/cjs/services/utils.js +1 -14
- package/cjs/types/enums.d.ts +17 -36
- package/cjs/types/enums.js +11 -30
- package/esm/constants/index.js +42 -117
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -5
- package/esm/services/strategiesService.js +21 -160
- package/esm/services/strategySubService.d.ts +21 -18
- package/esm/services/strategySubService.js +73 -78
- package/esm/services/strategySubService.test.js +147 -4
- package/esm/services/subDataService.d.ts +20 -70
- package/esm/services/subDataService.js +77 -21
- package/esm/services/subDataService.test.js +200 -18
- package/esm/services/utils.d.ts +1 -2
- package/esm/services/utils.js +1 -13
- package/esm/types/enums.d.ts +17 -36
- package/esm/types/enums.js +11 -30
- package/package.json +1 -1
- package/src/constants/index.ts +43 -119
- package/src/index.ts +6 -22
- package/src/services/strategiesService.ts +23 -225
- package/src/services/strategySubService.test.ts +191 -3
- package/src/services/strategySubService.ts +121 -173
- package/src/services/subDataService.test.ts +214 -18
- package/src/services/subDataService.ts +106 -42
- package/src/services/utils.test.ts +1 -1
- package/src/services/utils.ts +1 -15
- package/src/types/enums.ts +13 -30
package/src/constants/index.ts
CHANGED
|
@@ -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.
|
|
577
|
-
strategyOrBundleId: Bundles.MainnetIds.
|
|
578
|
-
strategyId: Strategies.Identifiers.
|
|
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.
|
|
613
|
-
strategyOrBundleId: Bundles.MainnetIds.
|
|
614
|
-
strategyId: Strategies.Identifiers.
|
|
615
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
628
|
-
strategyOrBundleId: Bundles.MainnetIds.
|
|
629
|
-
strategyId: Strategies.Identifiers.
|
|
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.
|
|
633
|
-
strategyOrBundleId: Bundles.MainnetIds.
|
|
634
|
-
strategyId: Strategies.Identifiers.
|
|
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
|
-
|
|
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.
|
|
849
|
-
strategyOrBundleId: Bundles.BaseIds.
|
|
850
|
-
strategyId: Strategies.Identifiers.
|
|
851
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
859
|
-
strategyOrBundleId: Bundles.BaseIds.
|
|
860
|
-
strategyId: Strategies.Identifiers.
|
|
861
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
864
|
-
strategyOrBundleId: Bundles.BaseIds.
|
|
865
|
-
strategyId: Strategies.Identifiers.
|
|
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.
|
|
869
|
-
strategyOrBundleId: Bundles.BaseIds.
|
|
870
|
-
strategyId: Strategies.Identifiers.
|
|
871
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
874
|
-
strategyOrBundleId: Bundles.BaseIds.
|
|
875
|
-
strategyId: Strategies.Identifiers.
|
|
876
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
1032
|
-
strategyOrBundleId: Bundles.ArbitrumIds.
|
|
1033
|
-
strategyId: Strategies.Identifiers.
|
|
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.
|
|
1053
|
-
strategyOrBundleId: Bundles.ArbitrumIds.
|
|
1054
|
-
strategyId: Strategies.Identifiers.
|
|
1055
|
-
protocol: PROTOCOLS.
|
|
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.
|
|
1063
|
-
strategyOrBundleId: Bundles.ArbitrumIds.
|
|
1064
|
-
strategyId: Strategies.Identifiers.
|
|
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
|
-
|
|
42
|
-
BaseStrategies,
|
|
43
|
-
|
|
44
|
-
|
|
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 };
|