@defisaver/automation-sdk 1.0.3 → 1.0.5
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/automation/private/LegacyProtocol.d.ts +2 -0
- package/esm/automation/private/LegacyProtocol.js +4 -0
- package/esm/automation/private/Protocol.d.ts +2 -0
- package/esm/automation/private/Protocol.js +4 -0
- package/esm/constants/index.js +24 -0
- package/esm/services/strategiesService.js +2 -1
- package/esm/types/index.d.ts +7 -4
- package/package.json +1 -1
- package/src/automation/private/LegacyProtocol.ts +7 -0
- package/src/automation/private/Protocol.ts +7 -0
- package/src/constants/index.ts +24 -0
- package/src/services/strategiesService.ts +4 -1
- package/src/types/index.ts +7 -4
- package/umd/index.js +37 -1
|
@@ -4,6 +4,7 @@ export default class Protocol implements Interfaces.LegacyProtocol {
|
|
|
4
4
|
#private;
|
|
5
5
|
id: ProtocolIdentifiers.LegacyAutomation;
|
|
6
6
|
name: string;
|
|
7
|
+
slug: string;
|
|
7
8
|
version: string;
|
|
8
9
|
fullName: string;
|
|
9
10
|
constructor(args: {
|
|
@@ -16,5 +17,6 @@ export default class Protocol implements Interfaces.LegacyProtocol {
|
|
|
16
17
|
*/
|
|
17
18
|
private getVersion;
|
|
18
19
|
private getName;
|
|
20
|
+
private getSlug;
|
|
19
21
|
private getFullName;
|
|
20
22
|
}
|
|
@@ -9,6 +9,7 @@ export default class Protocol {
|
|
|
9
9
|
_Protocol_versionSeparator.set(this, '__');
|
|
10
10
|
this.id = args.id;
|
|
11
11
|
this.name = this.getName();
|
|
12
|
+
this.slug = this.getSlug();
|
|
12
13
|
this.version = this.getVersion();
|
|
13
14
|
this.fullName = this.getFullName();
|
|
14
15
|
}
|
|
@@ -27,6 +28,9 @@ export default class Protocol {
|
|
|
27
28
|
getName() {
|
|
28
29
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
29
30
|
}
|
|
31
|
+
getSlug() {
|
|
32
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
33
|
+
}
|
|
30
34
|
getFullName() {
|
|
31
35
|
return this.hasVersion() ? `${this.name} ${this.version}` : this.name;
|
|
32
36
|
}
|
|
@@ -4,6 +4,7 @@ export default class Protocol implements Interfaces.Protocol {
|
|
|
4
4
|
#private;
|
|
5
5
|
id: ProtocolIdentifiers.StrategiesAutomation;
|
|
6
6
|
name: string;
|
|
7
|
+
slug: string;
|
|
7
8
|
version: string;
|
|
8
9
|
fullName: string;
|
|
9
10
|
constructor(args: {
|
|
@@ -16,5 +17,6 @@ export default class Protocol implements Interfaces.Protocol {
|
|
|
16
17
|
*/
|
|
17
18
|
private getVersion;
|
|
18
19
|
private getName;
|
|
20
|
+
private getSlug;
|
|
19
21
|
private getFullName;
|
|
20
22
|
}
|
|
@@ -9,6 +9,7 @@ export default class Protocol {
|
|
|
9
9
|
_Protocol_versionSeparator.set(this, '__');
|
|
10
10
|
this.id = args.id;
|
|
11
11
|
this.name = this.getName();
|
|
12
|
+
this.slug = this.getSlug();
|
|
12
13
|
this.version = this.getVersion();
|
|
13
14
|
this.fullName = this.getFullName();
|
|
14
15
|
}
|
|
@@ -27,6 +28,9 @@ export default class Protocol {
|
|
|
27
28
|
getName() {
|
|
28
29
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
29
30
|
}
|
|
31
|
+
getSlug() {
|
|
32
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
33
|
+
}
|
|
30
34
|
getFullName() {
|
|
31
35
|
return this.hasVersion() ? `${this.name} ${this.version}` : this.name;
|
|
32
36
|
}
|
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
|
},
|
|
@@ -213,7 +213,7 @@ function getParsingMethod(id, strategy) {
|
|
|
213
213
|
}
|
|
214
214
|
export function parseStrategiesAutomatedPosition(parseData) {
|
|
215
215
|
const { chainId, subscriptionEventData, strategiesSubsData } = parseData;
|
|
216
|
-
const { subStruct, proxy, subId } = subscriptionEventData;
|
|
216
|
+
const { subStruct, proxy, subId, subHash, } = subscriptionEventData;
|
|
217
217
|
const { isEnabled } = strategiesSubsData;
|
|
218
218
|
const id = subStruct.strategyOrBundleId;
|
|
219
219
|
const strategyOrBundleInfo = (subStruct.isBundle
|
|
@@ -224,6 +224,7 @@ export function parseStrategiesAutomatedPosition(parseData) {
|
|
|
224
224
|
const position = {
|
|
225
225
|
isEnabled,
|
|
226
226
|
chainId,
|
|
227
|
+
subHash,
|
|
227
228
|
subId: Number(subId),
|
|
228
229
|
owner: proxy,
|
|
229
230
|
protocol: Object.assign({}, strategyOrBundleInfo.protocol),
|
package/esm/types/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare namespace Interfaces {
|
|
|
54
54
|
interface ProtocolBase {
|
|
55
55
|
id: ProtocolIdentifiers.StrategiesAutomation | ProtocolIdentifiers.LegacyAutomation;
|
|
56
56
|
name: string;
|
|
57
|
+
slug: string;
|
|
57
58
|
fullName: string;
|
|
58
59
|
version: string;
|
|
59
60
|
}
|
|
@@ -73,12 +74,13 @@ export declare namespace Interfaces {
|
|
|
73
74
|
subscriptionsJson: Contract.WithMeta<T>;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
export interface Strategy {
|
|
77
|
+
export interface Strategy<T = StrategyOrBundleIds> {
|
|
78
|
+
strategyOrBundleId: T;
|
|
77
79
|
strategyId: Strategies.Identifiers | Strategies.IdOverrides;
|
|
78
80
|
protocol: Interfaces.Protocol;
|
|
79
81
|
isBundle?: boolean;
|
|
80
82
|
}
|
|
81
|
-
export interface BundleOrStrategy extends Strategy {
|
|
83
|
+
export interface BundleOrStrategy<T = StrategyOrBundleIds> extends Strategy<T> {
|
|
82
84
|
bundleId?: string;
|
|
83
85
|
bundleName?: string;
|
|
84
86
|
}
|
|
@@ -125,6 +127,7 @@ export declare namespace Position {
|
|
|
125
127
|
subId: number;
|
|
126
128
|
subIds?: number[];
|
|
127
129
|
isEnabled?: boolean;
|
|
130
|
+
subHash: string;
|
|
128
131
|
protocol: Interfaces.Protocol;
|
|
129
132
|
strategy: BundleOrStrategy;
|
|
130
133
|
strategyData: {
|
|
@@ -147,11 +150,11 @@ export declare namespace Position {
|
|
|
147
150
|
specific: any;
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
|
-
type StrategyInfo<T extends number> = Record<T, Strategy
|
|
153
|
+
type StrategyInfo<T extends number> = Record<T, Strategy<T>>;
|
|
151
154
|
export type MainnetStrategiesInfo = StrategyInfo<Strategies.MainnetIds>;
|
|
152
155
|
export type OptimismStrategiesInfo = StrategyInfo<Strategies.OptimismIds>;
|
|
153
156
|
export type ArbitrumStrategiesInfo = StrategyInfo<Strategies.ArbitrumIds>;
|
|
154
|
-
type BundleInfo<T extends number> = Record<T, BundleOrStrategy
|
|
157
|
+
type BundleInfo<T extends number> = Record<T, BundleOrStrategy<T>>;
|
|
155
158
|
export type MainnetBundleInfo = BundleInfo<Bundles.MainnetIds>;
|
|
156
159
|
export type OptimismBundleInfo = BundleInfo<Bundles.OptimismIds>;
|
|
157
160
|
export type ArbitrumBundleInfo = BundleInfo<Bundles.ArbitrumIds>;
|
package/package.json
CHANGED
|
@@ -6,6 +6,8 @@ export default class Protocol implements Interfaces.LegacyProtocol {
|
|
|
6
6
|
|
|
7
7
|
name: string;
|
|
8
8
|
|
|
9
|
+
slug: string;
|
|
10
|
+
|
|
9
11
|
version: string;
|
|
10
12
|
|
|
11
13
|
fullName: string;
|
|
@@ -16,6 +18,7 @@ export default class Protocol implements Interfaces.LegacyProtocol {
|
|
|
16
18
|
this.id = args.id;
|
|
17
19
|
|
|
18
20
|
this.name = this.getName();
|
|
21
|
+
this.slug = this.getSlug();
|
|
19
22
|
this.version = this.getVersion();
|
|
20
23
|
this.fullName = this.getFullName();
|
|
21
24
|
}
|
|
@@ -39,6 +42,10 @@ export default class Protocol implements Interfaces.LegacyProtocol {
|
|
|
39
42
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
private getSlug() {
|
|
46
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
private getFullName() {
|
|
43
50
|
return this.hasVersion() ? `${this.name} ${this.version}` : this.name;
|
|
44
51
|
}
|
|
@@ -6,6 +6,8 @@ export default class Protocol implements Interfaces.Protocol {
|
|
|
6
6
|
|
|
7
7
|
name: string;
|
|
8
8
|
|
|
9
|
+
slug: string;
|
|
10
|
+
|
|
9
11
|
version: string;
|
|
10
12
|
|
|
11
13
|
fullName: string;
|
|
@@ -16,6 +18,7 @@ export default class Protocol implements Interfaces.Protocol {
|
|
|
16
18
|
this.id = args.id;
|
|
17
19
|
|
|
18
20
|
this.name = this.getName();
|
|
21
|
+
this.slug = this.getSlug();
|
|
19
22
|
this.version = this.getVersion();
|
|
20
23
|
this.fullName = this.getFullName();
|
|
21
24
|
}
|
|
@@ -39,6 +42,10 @@ export default class Protocol implements Interfaces.Protocol {
|
|
|
39
42
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
private getSlug() {
|
|
46
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
private getFullName() {
|
|
43
50
|
return this.hasVersion() ? `${this.name} ${this.version}` : this.name;
|
|
44
51
|
}
|
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
|
},
|
|
@@ -294,7 +294,9 @@ function getParsingMethod(id: ProtocolIdentifiers.StrategiesAutomation, strategy
|
|
|
294
294
|
|
|
295
295
|
export function parseStrategiesAutomatedPosition(parseData: ParseData): Position.Automated | null {
|
|
296
296
|
const { chainId, subscriptionEventData, strategiesSubsData } = parseData;
|
|
297
|
-
const {
|
|
297
|
+
const {
|
|
298
|
+
subStruct, proxy, subId, subHash,
|
|
299
|
+
} = subscriptionEventData;
|
|
298
300
|
const { isEnabled } = strategiesSubsData;
|
|
299
301
|
|
|
300
302
|
const id = subStruct.strategyOrBundleId as StrategyOrBundleIds;
|
|
@@ -310,6 +312,7 @@ export function parseStrategiesAutomatedPosition(parseData: ParseData): Position
|
|
|
310
312
|
const position: Position.Automated = {
|
|
311
313
|
isEnabled,
|
|
312
314
|
chainId,
|
|
315
|
+
subHash,
|
|
313
316
|
subId: Number(subId),
|
|
314
317
|
owner: proxy,
|
|
315
318
|
protocol: {
|
package/src/types/index.ts
CHANGED
|
@@ -71,6 +71,7 @@ export declare namespace Interfaces {
|
|
|
71
71
|
interface ProtocolBase {
|
|
72
72
|
id: ProtocolIdentifiers.StrategiesAutomation | ProtocolIdentifiers.LegacyAutomation,
|
|
73
73
|
name: string,
|
|
74
|
+
slug: string,
|
|
74
75
|
fullName: string,
|
|
75
76
|
version: string,
|
|
76
77
|
}
|
|
@@ -94,13 +95,14 @@ export declare namespace Interfaces {
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
export interface Strategy {
|
|
98
|
+
export interface Strategy<T = StrategyOrBundleIds> {
|
|
99
|
+
strategyOrBundleId: T,
|
|
98
100
|
strategyId: Strategies.Identifiers | Strategies.IdOverrides,
|
|
99
101
|
protocol: Interfaces.Protocol,
|
|
100
102
|
isBundle?: boolean,
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
export interface BundleOrStrategy extends Strategy {
|
|
105
|
+
export interface BundleOrStrategy<T = StrategyOrBundleIds> extends Strategy<T> {
|
|
104
106
|
bundleId?: string,
|
|
105
107
|
bundleName?: string,
|
|
106
108
|
}
|
|
@@ -150,6 +152,7 @@ export declare namespace Position {
|
|
|
150
152
|
subId: number,
|
|
151
153
|
subIds?: number[],
|
|
152
154
|
isEnabled?: boolean,
|
|
155
|
+
subHash: string,
|
|
153
156
|
protocol: Interfaces.Protocol,
|
|
154
157
|
strategy: BundleOrStrategy,
|
|
155
158
|
strategyData: {
|
|
@@ -175,12 +178,12 @@ export declare namespace Position {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
|
|
178
|
-
type StrategyInfo<T extends number> = Record<T, Strategy
|
|
181
|
+
type StrategyInfo<T extends number> = Record<T, Strategy<T>>;
|
|
179
182
|
export type MainnetStrategiesInfo = StrategyInfo<Strategies.MainnetIds>;
|
|
180
183
|
export type OptimismStrategiesInfo = StrategyInfo<Strategies.OptimismIds>;
|
|
181
184
|
export type ArbitrumStrategiesInfo = StrategyInfo<Strategies.ArbitrumIds>;
|
|
182
185
|
|
|
183
|
-
type BundleInfo<T extends number> = Record<T, BundleOrStrategy
|
|
186
|
+
type BundleInfo<T extends number> = Record<T, BundleOrStrategy<T>>;
|
|
184
187
|
export type MainnetBundleInfo = BundleInfo<Bundles.MainnetIds>;
|
|
185
188
|
export type OptimismBundleInfo = BundleInfo<Bundles.OptimismIds>;
|
|
186
189
|
export type ArbitrumBundleInfo = BundleInfo<Bundles.ArbitrumIds>;
|
package/umd/index.js
CHANGED
|
@@ -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
|
}
|
|
@@ -418,6 +442,7 @@ class Protocol {
|
|
|
418
442
|
constructor(args) {
|
|
419
443
|
_defineProperty(this, "id", void 0);
|
|
420
444
|
_defineProperty(this, "name", void 0);
|
|
445
|
+
_defineProperty(this, "slug", void 0);
|
|
421
446
|
_defineProperty(this, "version", void 0);
|
|
422
447
|
_defineProperty(this, "fullName", void 0);
|
|
423
448
|
_classPrivateFieldInitSpec(this, _versionSeparator, {
|
|
@@ -426,6 +451,7 @@ class Protocol {
|
|
|
426
451
|
});
|
|
427
452
|
this.id = args.id;
|
|
428
453
|
this.name = this.getName();
|
|
454
|
+
this.slug = this.getSlug();
|
|
429
455
|
this.version = this.getVersion();
|
|
430
456
|
this.fullName = this.getFullName();
|
|
431
457
|
}
|
|
@@ -445,6 +471,9 @@ class Protocol {
|
|
|
445
471
|
getName() {
|
|
446
472
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
447
473
|
}
|
|
474
|
+
getSlug() {
|
|
475
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
476
|
+
}
|
|
448
477
|
getFullName() {
|
|
449
478
|
return this.hasVersion() ? "".concat(this.name, " ").concat(this.version) : this.name;
|
|
450
479
|
}
|
|
@@ -472,6 +501,7 @@ class Protocol {
|
|
|
472
501
|
constructor(args) {
|
|
473
502
|
_defineProperty(this, "id", void 0);
|
|
474
503
|
_defineProperty(this, "name", void 0);
|
|
504
|
+
_defineProperty(this, "slug", void 0);
|
|
475
505
|
_defineProperty(this, "version", void 0);
|
|
476
506
|
_defineProperty(this, "fullName", void 0);
|
|
477
507
|
_classPrivateFieldInitSpec(this, _versionSeparator, {
|
|
@@ -480,6 +510,7 @@ class Protocol {
|
|
|
480
510
|
});
|
|
481
511
|
this.id = args.id;
|
|
482
512
|
this.name = this.getName();
|
|
513
|
+
this.slug = this.getSlug();
|
|
483
514
|
this.version = this.getVersion();
|
|
484
515
|
this.fullName = this.getFullName();
|
|
485
516
|
}
|
|
@@ -499,6 +530,9 @@ class Protocol {
|
|
|
499
530
|
getName() {
|
|
500
531
|
return this.hasVersion() ? this.splitId()[0] : this.id;
|
|
501
532
|
}
|
|
533
|
+
getSlug() {
|
|
534
|
+
return this.name.split(' ').join('-').toLowerCase();
|
|
535
|
+
}
|
|
502
536
|
getFullName() {
|
|
503
537
|
return this.hasVersion() ? "".concat(this.name, " ").concat(this.version) : this.name;
|
|
504
538
|
}
|
|
@@ -1521,7 +1555,8 @@ function parseStrategiesAutomatedPosition(parseData) {
|
|
|
1521
1555
|
var {
|
|
1522
1556
|
subStruct,
|
|
1523
1557
|
proxy,
|
|
1524
|
-
subId
|
|
1558
|
+
subId,
|
|
1559
|
+
subHash
|
|
1525
1560
|
} = subscriptionEventData;
|
|
1526
1561
|
var {
|
|
1527
1562
|
isEnabled
|
|
@@ -1532,6 +1567,7 @@ function parseStrategiesAutomatedPosition(parseData) {
|
|
|
1532
1567
|
var position = {
|
|
1533
1568
|
isEnabled,
|
|
1534
1569
|
chainId,
|
|
1570
|
+
subHash,
|
|
1535
1571
|
subId: Number(subId),
|
|
1536
1572
|
owner: proxy,
|
|
1537
1573
|
protocol: _objectSpread({}, strategyOrBundleInfo.protocol),
|