@defisaver/automation-sdk 1.0.2 → 1.0.4
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/esm/constants/index.js +24 -0
- package/esm/types/index.d.ts +5 -4
- package/package.json +3 -3
- package/src/constants/index.ts +24 -0
- package/src/types/index.ts +5 -4
- package/umd/{web3.d.ts → index.js} +24 -0
- package/webpack.umd.js +1 -1
package/esm/constants/index.js
CHANGED
|
@@ -20,34 +20,42 @@ export const LEGACY_PROTOCOLS = (() => {
|
|
|
20
20
|
// Strategies info
|
|
21
21
|
export const MAINNET_STRATEGIES_INFO = {
|
|
22
22
|
[Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI]: {
|
|
23
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI,
|
|
23
24
|
strategyId: Strategies.Identifiers.CloseOnPriceToDebt,
|
|
24
25
|
protocol: PROTOCOLS.MakerDAO,
|
|
25
26
|
},
|
|
26
27
|
[Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL]: {
|
|
28
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL,
|
|
27
29
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
28
30
|
protocol: PROTOCOLS.MakerDAO,
|
|
29
31
|
},
|
|
30
32
|
[Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED]: {
|
|
33
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED,
|
|
31
34
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
32
35
|
protocol: PROTOCOLS.Liquity,
|
|
33
36
|
},
|
|
34
37
|
[Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL]: {
|
|
38
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL,
|
|
35
39
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
36
40
|
protocol: PROTOCOLS.MakerDAO,
|
|
37
41
|
},
|
|
38
42
|
[Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
43
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL,
|
|
39
44
|
strategyId: Strategies.Identifiers.TrailingStopToColl,
|
|
40
45
|
protocol: PROTOCOLS.MakerDAO,
|
|
41
46
|
},
|
|
42
47
|
[Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI]: {
|
|
48
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI,
|
|
43
49
|
strategyId: Strategies.Identifiers.TrailingStopToDebt,
|
|
44
50
|
protocol: PROTOCOLS.MakerDAO,
|
|
45
51
|
},
|
|
46
52
|
[Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
53
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL,
|
|
47
54
|
strategyId: Strategies.Identifiers.TrailingStopToColl,
|
|
48
55
|
protocol: PROTOCOLS.Liquity,
|
|
49
56
|
},
|
|
50
57
|
[Strategies.MainnetIds.CHICKEN_BONDS_REBOND]: {
|
|
58
|
+
strategyOrBundleId: Strategies.MainnetIds.CHICKEN_BONDS_REBOND,
|
|
51
59
|
strategyId: Strategies.Identifiers.Rebond,
|
|
52
60
|
protocol: PROTOCOLS.ChickenBonds,
|
|
53
61
|
},
|
|
@@ -67,76 +75,92 @@ export const STRATEGY_IDS = {
|
|
|
67
75
|
// Bundles info
|
|
68
76
|
export const MAINNET_BUNDLES_INFO = {
|
|
69
77
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN]: {
|
|
78
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN,
|
|
70
79
|
bundleId: BundleProtocols.Yearn,
|
|
71
80
|
bundleName: 'Yearn',
|
|
72
81
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
73
82
|
protocol: PROTOCOLS.MakerDAO,
|
|
74
83
|
},
|
|
75
84
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE]: {
|
|
85
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE,
|
|
76
86
|
bundleId: BundleProtocols.MStable,
|
|
77
87
|
bundleName: 'mStable',
|
|
78
88
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
79
89
|
protocol: PROTOCOLS.MakerDAO,
|
|
80
90
|
},
|
|
81
91
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI]: {
|
|
92
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI,
|
|
82
93
|
bundleId: BundleProtocols.Rari,
|
|
83
94
|
bundleName: 'Rari',
|
|
84
95
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
85
96
|
protocol: PROTOCOLS.MakerDAO,
|
|
86
97
|
},
|
|
87
98
|
[Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE]: {
|
|
99
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE,
|
|
88
100
|
strategyId: Strategies.Identifiers.Repay,
|
|
89
101
|
protocol: PROTOCOLS.CompoundV3,
|
|
90
102
|
},
|
|
91
103
|
[Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE]: {
|
|
104
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE,
|
|
92
105
|
strategyId: Strategies.Identifiers.Boost,
|
|
93
106
|
protocol: PROTOCOLS.CompoundV3,
|
|
94
107
|
},
|
|
95
108
|
[Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE]: {
|
|
109
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE,
|
|
96
110
|
strategyId: Strategies.Identifiers.EoaRepay,
|
|
97
111
|
protocol: PROTOCOLS.CompoundV3,
|
|
98
112
|
},
|
|
99
113
|
[Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE]: {
|
|
114
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE,
|
|
100
115
|
strategyId: Strategies.Identifiers.EoaBoost,
|
|
101
116
|
protocol: PROTOCOLS.CompoundV3,
|
|
102
117
|
},
|
|
103
118
|
[Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND]: {
|
|
119
|
+
strategyOrBundleId: Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND,
|
|
104
120
|
strategyId: Strategies.Identifiers.BondProtection,
|
|
105
121
|
protocol: PROTOCOLS.Liquity,
|
|
106
122
|
},
|
|
107
123
|
};
|
|
108
124
|
export const OPTIMISM_BUNDLES_INFO = {
|
|
109
125
|
[Bundles.OptimismIds.AAVE_V3_REPAY]: {
|
|
126
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_REPAY,
|
|
110
127
|
strategyId: Strategies.Identifiers.Repay,
|
|
111
128
|
protocol: PROTOCOLS.AaveV3,
|
|
112
129
|
},
|
|
113
130
|
[Bundles.OptimismIds.AAVE_V3_BOOST]: {
|
|
131
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_BOOST,
|
|
114
132
|
strategyId: Strategies.Identifiers.Boost,
|
|
115
133
|
protocol: PROTOCOLS.AaveV3,
|
|
116
134
|
},
|
|
117
135
|
[Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
136
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
118
137
|
strategyId: Strategies.Identifiers.CloseToDebt,
|
|
119
138
|
protocol: PROTOCOLS.AaveV3,
|
|
120
139
|
},
|
|
121
140
|
[Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
141
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
122
142
|
strategyId: Strategies.Identifiers.CloseToCollateral,
|
|
123
143
|
protocol: PROTOCOLS.AaveV3,
|
|
124
144
|
},
|
|
125
145
|
};
|
|
126
146
|
export const ARBITRUM_BUNDLES_INFO = {
|
|
127
147
|
[Bundles.ArbitrumIds.AAVE_V3_REPAY]: {
|
|
148
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_REPAY,
|
|
128
149
|
strategyId: Strategies.Identifiers.Repay,
|
|
129
150
|
protocol: PROTOCOLS.AaveV3,
|
|
130
151
|
},
|
|
131
152
|
[Bundles.ArbitrumIds.AAVE_V3_BOOST]: {
|
|
153
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_BOOST,
|
|
132
154
|
strategyId: Strategies.Identifiers.Boost,
|
|
133
155
|
protocol: PROTOCOLS.AaveV3,
|
|
134
156
|
},
|
|
135
157
|
[Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
158
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
136
159
|
strategyId: Strategies.Identifiers.CloseToDebt,
|
|
137
160
|
protocol: PROTOCOLS.AaveV3,
|
|
138
161
|
},
|
|
139
162
|
[Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
163
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
140
164
|
strategyId: Strategies.Identifiers.CloseToCollateral,
|
|
141
165
|
protocol: PROTOCOLS.AaveV3,
|
|
142
166
|
},
|
package/esm/types/index.d.ts
CHANGED
|
@@ -73,12 +73,13 @@ export declare namespace Interfaces {
|
|
|
73
73
|
subscriptionsJson: Contract.WithMeta<T>;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
export interface Strategy {
|
|
76
|
+
export interface Strategy<T = StrategyOrBundleIds> {
|
|
77
|
+
strategyOrBundleId: T;
|
|
77
78
|
strategyId: Strategies.Identifiers | Strategies.IdOverrides;
|
|
78
79
|
protocol: Interfaces.Protocol;
|
|
79
80
|
isBundle?: boolean;
|
|
80
81
|
}
|
|
81
|
-
export interface BundleOrStrategy extends Strategy {
|
|
82
|
+
export interface BundleOrStrategy<T = StrategyOrBundleIds> extends Strategy<T> {
|
|
82
83
|
bundleId?: string;
|
|
83
84
|
bundleName?: string;
|
|
84
85
|
}
|
|
@@ -147,11 +148,11 @@ export declare namespace Position {
|
|
|
147
148
|
specific: any;
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
|
-
type StrategyInfo<T extends number> = Record<T, Strategy
|
|
151
|
+
type StrategyInfo<T extends number> = Record<T, Strategy<T>>;
|
|
151
152
|
export type MainnetStrategiesInfo = StrategyInfo<Strategies.MainnetIds>;
|
|
152
153
|
export type OptimismStrategiesInfo = StrategyInfo<Strategies.OptimismIds>;
|
|
153
154
|
export type ArbitrumStrategiesInfo = StrategyInfo<Strategies.ArbitrumIds>;
|
|
154
|
-
type BundleInfo<T extends number> = Record<T, BundleOrStrategy
|
|
155
|
+
type BundleInfo<T extends number> = Record<T, BundleOrStrategy<T>>;
|
|
155
156
|
export type MainnetBundleInfo = BundleInfo<Bundles.MainnetIds>;
|
|
156
157
|
export type OptimismBundleInfo = BundleInfo<Bundles.OptimismIds>;
|
|
157
158
|
export type ArbitrumBundleInfo = BundleInfo<Bundles.ArbitrumIds>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/automation-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./umd/index.js",
|
|
6
|
-
"module": "./esm/
|
|
7
|
-
"types": "./esm/
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"types": "./esm/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\"",
|
|
10
10
|
"build:esm": "rm -rf esm && tsc -b",
|
package/src/constants/index.ts
CHANGED
|
@@ -31,34 +31,42 @@ export const LEGACY_PROTOCOLS: Record<keyof typeof ProtocolIdentifiers.LegacyAut
|
|
|
31
31
|
// Strategies info
|
|
32
32
|
export const MAINNET_STRATEGIES_INFO: MainnetStrategiesInfo = {
|
|
33
33
|
[Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI]: {
|
|
34
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI,
|
|
34
35
|
strategyId: Strategies.Identifiers.CloseOnPriceToDebt,
|
|
35
36
|
protocol: PROTOCOLS.MakerDAO,
|
|
36
37
|
},
|
|
37
38
|
[Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL]: {
|
|
39
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL,
|
|
38
40
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
39
41
|
protocol: PROTOCOLS.MakerDAO,
|
|
40
42
|
},
|
|
41
43
|
[Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED]: {
|
|
44
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED,
|
|
42
45
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
43
46
|
protocol: PROTOCOLS.Liquity,
|
|
44
47
|
},
|
|
45
48
|
[Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL]: {
|
|
49
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL,
|
|
46
50
|
strategyId: Strategies.Identifiers.CloseOnPriceToColl,
|
|
47
51
|
protocol: PROTOCOLS.MakerDAO,
|
|
48
52
|
},
|
|
49
53
|
[Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
54
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL,
|
|
50
55
|
strategyId: Strategies.Identifiers.TrailingStopToColl,
|
|
51
56
|
protocol: PROTOCOLS.MakerDAO,
|
|
52
57
|
},
|
|
53
58
|
[Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI]: {
|
|
59
|
+
strategyOrBundleId: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI,
|
|
54
60
|
strategyId: Strategies.Identifiers.TrailingStopToDebt,
|
|
55
61
|
protocol: PROTOCOLS.MakerDAO,
|
|
56
62
|
},
|
|
57
63
|
[Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
64
|
+
strategyOrBundleId: Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL,
|
|
58
65
|
strategyId: Strategies.Identifiers.TrailingStopToColl,
|
|
59
66
|
protocol: PROTOCOLS.Liquity,
|
|
60
67
|
},
|
|
61
68
|
[Strategies.MainnetIds.CHICKEN_BONDS_REBOND]: {
|
|
69
|
+
strategyOrBundleId: Strategies.MainnetIds.CHICKEN_BONDS_REBOND,
|
|
62
70
|
strategyId: Strategies.Identifiers.Rebond,
|
|
63
71
|
protocol: PROTOCOLS.ChickenBonds,
|
|
64
72
|
},
|
|
@@ -83,40 +91,48 @@ export const STRATEGY_IDS = {
|
|
|
83
91
|
// Bundles info
|
|
84
92
|
export const MAINNET_BUNDLES_INFO: MainnetBundleInfo = {
|
|
85
93
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN]: {
|
|
94
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN,
|
|
86
95
|
bundleId: BundleProtocols.Yearn,
|
|
87
96
|
bundleName: 'Yearn',
|
|
88
97
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
89
98
|
protocol: PROTOCOLS.MakerDAO,
|
|
90
99
|
},
|
|
91
100
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE]: {
|
|
101
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE,
|
|
92
102
|
bundleId: BundleProtocols.MStable,
|
|
93
103
|
bundleName: 'mStable',
|
|
94
104
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
95
105
|
protocol: PROTOCOLS.MakerDAO,
|
|
96
106
|
},
|
|
97
107
|
[Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI]: {
|
|
108
|
+
strategyOrBundleId: Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI,
|
|
98
109
|
bundleId: BundleProtocols.Rari,
|
|
99
110
|
bundleName: 'Rari',
|
|
100
111
|
strategyId: Strategies.Identifiers.SavingsLiqProtection,
|
|
101
112
|
protocol: PROTOCOLS.MakerDAO,
|
|
102
113
|
},
|
|
103
114
|
[Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE]: {
|
|
115
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE,
|
|
104
116
|
strategyId: Strategies.Identifiers.Repay,
|
|
105
117
|
protocol: PROTOCOLS.CompoundV3,
|
|
106
118
|
},
|
|
107
119
|
[Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE]: {
|
|
120
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE,
|
|
108
121
|
strategyId: Strategies.Identifiers.Boost,
|
|
109
122
|
protocol: PROTOCOLS.CompoundV3,
|
|
110
123
|
},
|
|
111
124
|
[Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE]: {
|
|
125
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE,
|
|
112
126
|
strategyId: Strategies.Identifiers.EoaRepay,
|
|
113
127
|
protocol: PROTOCOLS.CompoundV3,
|
|
114
128
|
},
|
|
115
129
|
[Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE]: {
|
|
130
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE,
|
|
116
131
|
strategyId: Strategies.Identifiers.EoaBoost,
|
|
117
132
|
protocol: PROTOCOLS.CompoundV3,
|
|
118
133
|
},
|
|
119
134
|
[Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND]: {
|
|
135
|
+
strategyOrBundleId: Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND,
|
|
120
136
|
strategyId: Strategies.Identifiers.BondProtection,
|
|
121
137
|
protocol: PROTOCOLS.Liquity,
|
|
122
138
|
},
|
|
@@ -124,18 +140,22 @@ export const MAINNET_BUNDLES_INFO: MainnetBundleInfo = {
|
|
|
124
140
|
|
|
125
141
|
export const OPTIMISM_BUNDLES_INFO: OptimismBundleInfo = {
|
|
126
142
|
[Bundles.OptimismIds.AAVE_V3_REPAY]: {
|
|
143
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_REPAY,
|
|
127
144
|
strategyId: Strategies.Identifiers.Repay,
|
|
128
145
|
protocol: PROTOCOLS.AaveV3,
|
|
129
146
|
},
|
|
130
147
|
[Bundles.OptimismIds.AAVE_V3_BOOST]: {
|
|
148
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_BOOST,
|
|
131
149
|
strategyId: Strategies.Identifiers.Boost,
|
|
132
150
|
protocol: PROTOCOLS.AaveV3,
|
|
133
151
|
},
|
|
134
152
|
[Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
153
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
135
154
|
strategyId: Strategies.Identifiers.CloseToDebt,
|
|
136
155
|
protocol: PROTOCOLS.AaveV3,
|
|
137
156
|
},
|
|
138
157
|
[Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
158
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
139
159
|
strategyId: Strategies.Identifiers.CloseToCollateral,
|
|
140
160
|
protocol: PROTOCOLS.AaveV3,
|
|
141
161
|
},
|
|
@@ -143,18 +163,22 @@ export const OPTIMISM_BUNDLES_INFO: OptimismBundleInfo = {
|
|
|
143
163
|
|
|
144
164
|
export const ARBITRUM_BUNDLES_INFO: ArbitrumBundleInfo = {
|
|
145
165
|
[Bundles.ArbitrumIds.AAVE_V3_REPAY]: {
|
|
166
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_REPAY,
|
|
146
167
|
strategyId: Strategies.Identifiers.Repay,
|
|
147
168
|
protocol: PROTOCOLS.AaveV3,
|
|
148
169
|
},
|
|
149
170
|
[Bundles.ArbitrumIds.AAVE_V3_BOOST]: {
|
|
171
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_BOOST,
|
|
150
172
|
strategyId: Strategies.Identifiers.Boost,
|
|
151
173
|
protocol: PROTOCOLS.AaveV3,
|
|
152
174
|
},
|
|
153
175
|
[Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
176
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
154
177
|
strategyId: Strategies.Identifiers.CloseToDebt,
|
|
155
178
|
protocol: PROTOCOLS.AaveV3,
|
|
156
179
|
},
|
|
157
180
|
[Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
181
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
158
182
|
strategyId: Strategies.Identifiers.CloseToCollateral,
|
|
159
183
|
protocol: PROTOCOLS.AaveV3,
|
|
160
184
|
},
|
package/src/types/index.ts
CHANGED
|
@@ -94,13 +94,14 @@ export declare namespace Interfaces {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
export interface Strategy {
|
|
97
|
+
export interface Strategy<T = StrategyOrBundleIds> {
|
|
98
|
+
strategyOrBundleId: T,
|
|
98
99
|
strategyId: Strategies.Identifiers | Strategies.IdOverrides,
|
|
99
100
|
protocol: Interfaces.Protocol,
|
|
100
101
|
isBundle?: boolean,
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
export interface BundleOrStrategy extends Strategy {
|
|
104
|
+
export interface BundleOrStrategy<T = StrategyOrBundleIds> extends Strategy<T> {
|
|
104
105
|
bundleId?: string,
|
|
105
106
|
bundleName?: string,
|
|
106
107
|
}
|
|
@@ -175,12 +176,12 @@ export declare namespace Position {
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
|
|
178
|
-
type StrategyInfo<T extends number> = Record<T, Strategy
|
|
179
|
+
type StrategyInfo<T extends number> = Record<T, Strategy<T>>;
|
|
179
180
|
export type MainnetStrategiesInfo = StrategyInfo<Strategies.MainnetIds>;
|
|
180
181
|
export type OptimismStrategiesInfo = StrategyInfo<Strategies.OptimismIds>;
|
|
181
182
|
export type ArbitrumStrategiesInfo = StrategyInfo<Strategies.ArbitrumIds>;
|
|
182
183
|
|
|
183
|
-
type BundleInfo<T extends number> = Record<T, BundleOrStrategy
|
|
184
|
+
type BundleInfo<T extends number> = Record<T, BundleOrStrategy<T>>;
|
|
184
185
|
export type MainnetBundleInfo = BundleInfo<Bundles.MainnetIds>;
|
|
185
186
|
export type OptimismBundleInfo = BundleInfo<Bundles.OptimismIds>;
|
|
186
187
|
export type ArbitrumBundleInfo = BundleInfo<Bundles.ArbitrumIds>;
|
|
@@ -126,34 +126,42 @@ var LEGACY_PROTOCOLS = (() => {
|
|
|
126
126
|
// Strategies info
|
|
127
127
|
var MAINNET_STRATEGIES_INFO = {
|
|
128
128
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI]: {
|
|
129
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI,
|
|
129
130
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseOnPriceToDebt,
|
|
130
131
|
protocol: PROTOCOLS.MakerDAO
|
|
131
132
|
},
|
|
132
133
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL]: {
|
|
134
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL,
|
|
133
135
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseOnPriceToColl,
|
|
134
136
|
protocol: PROTOCOLS.MakerDAO
|
|
135
137
|
},
|
|
136
138
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED]: {
|
|
139
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED,
|
|
137
140
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseOnPriceToColl,
|
|
138
141
|
protocol: PROTOCOLS.Liquity
|
|
139
142
|
},
|
|
140
143
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL]: {
|
|
144
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL,
|
|
141
145
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseOnPriceToColl,
|
|
142
146
|
protocol: PROTOCOLS.MakerDAO
|
|
143
147
|
},
|
|
144
148
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
149
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL,
|
|
145
150
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.TrailingStopToColl,
|
|
146
151
|
protocol: PROTOCOLS.MakerDAO
|
|
147
152
|
},
|
|
148
153
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI]: {
|
|
154
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI,
|
|
149
155
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.TrailingStopToDebt,
|
|
150
156
|
protocol: PROTOCOLS.MakerDAO
|
|
151
157
|
},
|
|
152
158
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL]: {
|
|
159
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL,
|
|
153
160
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.TrailingStopToColl,
|
|
154
161
|
protocol: PROTOCOLS.Liquity
|
|
155
162
|
},
|
|
156
163
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.CHICKEN_BONDS_REBOND]: {
|
|
164
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.CHICKEN_BONDS_REBOND,
|
|
157
165
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Rebond,
|
|
158
166
|
protocol: PROTOCOLS.ChickenBonds
|
|
159
167
|
}
|
|
@@ -174,76 +182,92 @@ var STRATEGY_IDS = {
|
|
|
174
182
|
// Bundles info
|
|
175
183
|
var MAINNET_BUNDLES_INFO = {
|
|
176
184
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN]: {
|
|
185
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_YEARN,
|
|
177
186
|
bundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.BundleProtocols.Yearn,
|
|
178
187
|
bundleName: 'Yearn',
|
|
179
188
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.SavingsLiqProtection,
|
|
180
189
|
protocol: PROTOCOLS.MakerDAO
|
|
181
190
|
},
|
|
182
191
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE]: {
|
|
192
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE,
|
|
183
193
|
bundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.BundleProtocols.MStable,
|
|
184
194
|
bundleName: 'mStable',
|
|
185
195
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.SavingsLiqProtection,
|
|
186
196
|
protocol: PROTOCOLS.MakerDAO
|
|
187
197
|
},
|
|
188
198
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI]: {
|
|
199
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MAKER_REPAY_FROM_SMART_SAVINGS_RARI,
|
|
189
200
|
bundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.BundleProtocols.Rari,
|
|
190
201
|
bundleName: 'Rari',
|
|
191
202
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.SavingsLiqProtection,
|
|
192
203
|
protocol: PROTOCOLS.MakerDAO
|
|
193
204
|
},
|
|
194
205
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE]: {
|
|
206
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_SW_REPAY_BUNDLE,
|
|
195
207
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
|
|
196
208
|
protocol: PROTOCOLS.CompoundV3
|
|
197
209
|
},
|
|
198
210
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE]: {
|
|
211
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_SW_BOOST_BUNDLE,
|
|
199
212
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Boost,
|
|
200
213
|
protocol: PROTOCOLS.CompoundV3
|
|
201
214
|
},
|
|
202
215
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE]: {
|
|
216
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_EOA_REPAY_BUNDLE,
|
|
203
217
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.EoaRepay,
|
|
204
218
|
protocol: PROTOCOLS.CompoundV3
|
|
205
219
|
},
|
|
206
220
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE]: {
|
|
221
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V3_EOA_BOOST_BUNDLE,
|
|
207
222
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.EoaBoost,
|
|
208
223
|
protocol: PROTOCOLS.CompoundV3
|
|
209
224
|
},
|
|
210
225
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND]: {
|
|
226
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND,
|
|
211
227
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.BondProtection,
|
|
212
228
|
protocol: PROTOCOLS.Liquity
|
|
213
229
|
}
|
|
214
230
|
};
|
|
215
231
|
var OPTIMISM_BUNDLES_INFO = {
|
|
216
232
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_REPAY]: {
|
|
233
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_REPAY,
|
|
217
234
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
|
|
218
235
|
protocol: PROTOCOLS.AaveV3
|
|
219
236
|
},
|
|
220
237
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_BOOST]: {
|
|
238
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_BOOST,
|
|
221
239
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Boost,
|
|
222
240
|
protocol: PROTOCOLS.AaveV3
|
|
223
241
|
},
|
|
224
242
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
243
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
225
244
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToDebt,
|
|
226
245
|
protocol: PROTOCOLS.AaveV3
|
|
227
246
|
},
|
|
228
247
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
248
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
229
249
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToCollateral,
|
|
230
250
|
protocol: PROTOCOLS.AaveV3
|
|
231
251
|
}
|
|
232
252
|
};
|
|
233
253
|
var ARBITRUM_BUNDLES_INFO = {
|
|
234
254
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_REPAY]: {
|
|
255
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_REPAY,
|
|
235
256
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
|
|
236
257
|
protocol: PROTOCOLS.AaveV3
|
|
237
258
|
},
|
|
238
259
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_BOOST]: {
|
|
260
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_BOOST,
|
|
239
261
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Boost,
|
|
240
262
|
protocol: PROTOCOLS.AaveV3
|
|
241
263
|
},
|
|
242
264
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT]: {
|
|
265
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_DEBT,
|
|
243
266
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToDebt,
|
|
244
267
|
protocol: PROTOCOLS.AaveV3
|
|
245
268
|
},
|
|
246
269
|
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL]: {
|
|
270
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_CLOSE_TO_COLLATERAL,
|
|
247
271
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToCollateral,
|
|
248
272
|
protocol: PROTOCOLS.AaveV3
|
|
249
273
|
}
|