@defisaver/automation-sdk 3.0.1 → 3.0.2-dev2

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 (49) hide show
  1. package/esm/automation/private/LegacyAutomation.js +2 -2
  2. package/esm/automation/private/StrategiesAutomation.js +9 -1
  3. package/esm/automation/private/StrategiesAutomation.test.d.ts +1 -1
  4. package/esm/automation/private/StrategiesAutomation.test.js +500 -499
  5. package/esm/constants/index.d.ts +4 -25
  6. package/esm/constants/index.js +77 -1
  7. package/esm/services/ethereumService.test.d.ts +1 -1
  8. package/esm/services/ethereumService.test.js +1 -0
  9. package/esm/services/strategiesService.js +63 -3
  10. package/esm/services/strategiesService.test.d.ts +1 -1
  11. package/esm/services/strategiesService.test.js +1 -0
  12. package/esm/services/strategySubService.d.ts +17 -0
  13. package/esm/services/strategySubService.js +30 -1
  14. package/esm/services/strategySubService.test.d.ts +1 -1
  15. package/esm/services/strategySubService.test.js +152 -0
  16. package/esm/services/subDataService.d.ts +32 -0
  17. package/esm/services/subDataService.js +96 -1
  18. package/esm/services/subDataService.test.d.ts +1 -1
  19. package/esm/services/subDataService.test.js +193 -0
  20. package/esm/services/triggerService.d.ts +17 -0
  21. package/esm/services/triggerService.js +31 -1
  22. package/esm/services/triggerService.test.d.ts +1 -1
  23. package/esm/services/triggerService.test.js +65 -0
  24. package/esm/services/utils.test.d.ts +1 -1
  25. package/esm/services/utils.test.js +1 -0
  26. package/esm/types/enums.d.ts +27 -8
  27. package/esm/types/enums.js +19 -0
  28. package/package.json +3 -3
  29. package/scripts/generateContractTypes.js +1 -1
  30. package/src/automation/private/LegacyAutomation.ts +2 -2
  31. package/src/automation/private/StrategiesAutomation.test.ts +503 -501
  32. package/src/automation/private/StrategiesAutomation.ts +9 -0
  33. package/src/constants/index.ts +80 -3
  34. package/src/services/ethereumService.test.ts +1 -0
  35. package/src/services/ethereumService.ts +1 -1
  36. package/src/services/strategiesService.test.ts +1 -0
  37. package/src/services/strategiesService.ts +81 -3
  38. package/src/services/strategySubService.test.ts +187 -1
  39. package/src/services/strategySubService.ts +68 -0
  40. package/src/services/subDataService.test.ts +212 -1
  41. package/src/services/subDataService.ts +134 -1
  42. package/src/services/triggerService.test.ts +70 -0
  43. package/src/services/triggerService.ts +44 -1
  44. package/src/services/utils.test.ts +1 -0
  45. package/src/types/enums.ts +19 -0
  46. package/umd/index.js +397 -58
  47. package/.env +0 -4
  48. package/.yarn/releases/yarn-1.22.1.cjs +0 -147386
  49. package/.yarnrc.yml +0 -3
@@ -12,10 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ const web3_1 = __importDefault(require("web3"));
15
16
  const chai_1 = require("chai");
16
17
  const enums_1 = require("../../types/enums");
18
+ require("../../configuration");
17
19
  const StrategiesAutomation_1 = __importDefault(require("./StrategiesAutomation"));
18
- const web3_1 = __importDefault(require("web3"));
19
20
  require('dotenv').config({ path: '.env' });
20
21
  const Web3_1 = new web3_1.default(process.env.RPC_1);
21
22
  describe('Feature: StrategiesAutomation.ts', () => {
@@ -29,630 +30,630 @@ describe('Feature: StrategiesAutomation.ts', () => {
29
30
  [
30
31
  [
31
32
  {
32
- "isEnabled": true,
33
- "chainId": 1,
34
- "subHash": "0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee",
35
- "blockNumber": 0,
36
- "positionId": "1-aave__v3",
37
- "subId": 0,
38
- "protocol": {
39
- "id": "Aave__V3",
40
- "name": "Aave",
41
- "slug": "aave",
42
- "version": "V3",
43
- "fullName": "Aave V3"
44
- },
45
- "strategy": {
46
- "isBundle": true,
47
- "strategyOrBundleId": 0,
48
- "strategyId": "leverage-management",
49
- "protocol": {
50
- "id": "Aave__V3",
51
- "name": "Aave",
52
- "slug": "aave",
53
- "version": "V3",
54
- "fullName": "Aave V3"
33
+ 'isEnabled': true,
34
+ 'chainId': 1,
35
+ 'subHash': '0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee',
36
+ 'blockNumber': 0,
37
+ 'positionId': '1-aave__v3',
38
+ 'subId': 0,
39
+ 'protocol': {
40
+ 'id': 'Aave__V3',
41
+ 'name': 'Aave',
42
+ 'slug': 'aave',
43
+ 'version': 'V3',
44
+ 'fullName': 'Aave V3'
45
+ },
46
+ 'strategy': {
47
+ 'isBundle': true,
48
+ 'strategyOrBundleId': 0,
49
+ 'strategyId': 'leverage-management',
50
+ 'protocol': {
51
+ 'id': 'Aave__V3',
52
+ 'name': 'Aave',
53
+ 'slug': 'aave',
54
+ 'version': 'V3',
55
+ 'fullName': 'Aave V3'
55
56
  }
56
57
  },
57
- "strategyData": {
58
- "encoded": {
59
- "subData": [
60
- "0x000000000000000000000000000000000000000000000000120a871cc0020000",
61
- "0x0000000000000000000000000000000000000000000000000000000000000001",
62
- "0x0000000000000000000000000000000000000000000000000000000000000001",
63
- "0x0000000000000000000000000000000000000000000000000000000000000000"
58
+ 'strategyData': {
59
+ 'encoded': {
60
+ 'subData': [
61
+ '0x000000000000000000000000000000000000000000000000120a871cc0020000',
62
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
63
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
64
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
64
65
  ]
65
66
  },
66
- "decoded": {
67
- "triggerData": {
68
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
69
- "ratio": 120,
70
- "ratioState": 1
67
+ 'decoded': {
68
+ 'triggerData': {
69
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
70
+ 'ratio': 120,
71
+ 'ratioState': 1
71
72
  },
72
- "subData": {
73
- "targetRatio": 130
73
+ 'subData': {
74
+ 'targetRatio': 130
74
75
  }
75
76
  }
76
77
  },
77
- "specific": {
78
- "triggerRepayRatio": 120,
79
- "targetRepayRatio": 130,
80
- "repayEnabled": true,
81
- "subId1": 0,
82
- "mergeWithId": "boost"
78
+ 'specific': {
79
+ 'triggerRepayRatio': 120,
80
+ 'targetRepayRatio': 130,
81
+ 'repayEnabled': true,
82
+ 'subId1': 0,
83
+ 'mergeWithId': 'boost'
83
84
  }
84
85
  },
85
86
  {
86
- "isEnabled": false,
87
- "chainId": 1,
88
- "subHash": "0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee",
89
- "blockNumber": 0,
90
- "positionId": "1-aave__v3",
91
- "subId": 1,
92
- "protocol": {
93
- "id": "Aave__V3",
94
- "name": "Aave",
95
- "slug": "aave",
96
- "version": "V3",
97
- "fullName": "Aave V3"
98
- },
99
- "strategy": {
100
- "isBundle": true,
101
- "strategyOrBundleId": 0,
102
- "strategyId": "leverage-management",
103
- "protocol": {
104
- "id": "Aave__V3",
105
- "name": "Aave",
106
- "slug": "aave",
107
- "version": "V3",
108
- "fullName": "Aave V3"
87
+ 'isEnabled': false,
88
+ 'chainId': 1,
89
+ 'subHash': '0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee',
90
+ 'blockNumber': 0,
91
+ 'positionId': '1-aave__v3',
92
+ 'subId': 1,
93
+ 'protocol': {
94
+ 'id': 'Aave__V3',
95
+ 'name': 'Aave',
96
+ 'slug': 'aave',
97
+ 'version': 'V3',
98
+ 'fullName': 'Aave V3'
99
+ },
100
+ 'strategy': {
101
+ 'isBundle': true,
102
+ 'strategyOrBundleId': 0,
103
+ 'strategyId': 'leverage-management',
104
+ 'protocol': {
105
+ 'id': 'Aave__V3',
106
+ 'name': 'Aave',
107
+ 'slug': 'aave',
108
+ 'version': 'V3',
109
+ 'fullName': 'Aave V3'
109
110
  }
110
111
  },
111
- "strategyData": {
112
- "encoded": {
113
- "subData": [
114
- "0x000000000000000000000000000000000000000000000000120a871cc0020000",
115
- "0x0000000000000000000000000000000000000000000000000000000000000001",
116
- "0x0000000000000000000000000000000000000000000000000000000000000001",
117
- "0x0000000000000000000000000000000000000000000000000000000000000000"
112
+ 'strategyData': {
113
+ 'encoded': {
114
+ 'subData': [
115
+ '0x000000000000000000000000000000000000000000000000120a871cc0020000',
116
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
117
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
118
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
118
119
  ]
119
120
  },
120
- "decoded": {
121
- "triggerData": {
122
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
123
- "ratio": 120,
124
- "ratioState": 1
121
+ 'decoded': {
122
+ 'triggerData': {
123
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
124
+ 'ratio': 120,
125
+ 'ratioState': 1
125
126
  },
126
- "subData": {
127
- "targetRatio": 130
127
+ 'subData': {
128
+ 'targetRatio': 130
128
129
  }
129
130
  }
130
131
  },
131
- "specific": {
132
- "triggerRepayRatio": 120,
133
- "targetRepayRatio": 130,
134
- "repayEnabled": true,
135
- "subId1": 1,
136
- "mergeWithId": "boost"
132
+ 'specific': {
133
+ 'triggerRepayRatio': 120,
134
+ 'targetRepayRatio': 130,
135
+ 'repayEnabled': true,
136
+ 'subId1': 1,
137
+ 'mergeWithId': 'boost'
137
138
  }
138
139
  },
139
140
  {
140
- "isEnabled": false,
141
- "chainId": 1,
142
- "subHash": "0xe55917c42ac3e8f6c080e3780c5e0ea7a0a3da6c05e7ced5fe69fee48133a5eb",
143
- "blockNumber": 0,
144
- "positionId": "1-aave__v3",
145
- "subId": 2,
146
- "protocol": {
147
- "id": "Aave__V3",
148
- "name": "Aave",
149
- "slug": "aave",
150
- "version": "V3",
151
- "fullName": "Aave V3"
152
- },
153
- "strategy": {
154
- "isBundle": true,
155
- "strategyOrBundleId": 0,
156
- "strategyId": "leverage-management",
157
- "protocol": {
158
- "id": "Aave__V3",
159
- "name": "Aave",
160
- "slug": "aave",
161
- "version": "V3",
162
- "fullName": "Aave V3"
141
+ 'isEnabled': false,
142
+ 'chainId': 1,
143
+ 'subHash': '0xe55917c42ac3e8f6c080e3780c5e0ea7a0a3da6c05e7ced5fe69fee48133a5eb',
144
+ 'blockNumber': 0,
145
+ 'positionId': '1-aave__v3',
146
+ 'subId': 2,
147
+ 'protocol': {
148
+ 'id': 'Aave__V3',
149
+ 'name': 'Aave',
150
+ 'slug': 'aave',
151
+ 'version': 'V3',
152
+ 'fullName': 'Aave V3'
153
+ },
154
+ 'strategy': {
155
+ 'isBundle': true,
156
+ 'strategyOrBundleId': 0,
157
+ 'strategyId': 'leverage-management',
158
+ 'protocol': {
159
+ 'id': 'Aave__V3',
160
+ 'name': 'Aave',
161
+ 'slug': 'aave',
162
+ 'version': 'V3',
163
+ 'fullName': 'Aave V3'
163
164
  }
164
165
  },
165
- "strategyData": {
166
- "encoded": {
167
- "subData": [
168
- "0x00000000000000000000000000000000000000000000000014d1120d7b160000",
169
- "0x0000000000000000000000000000000000000000000000000000000000000001",
170
- "0x0000000000000000000000000000000000000000000000000000000000000001",
171
- "0x0000000000000000000000000000000000000000000000000000000000000000"
166
+ 'strategyData': {
167
+ 'encoded': {
168
+ 'subData': [
169
+ '0x00000000000000000000000000000000000000000000000014d1120d7b160000',
170
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
171
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
172
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
172
173
  ]
173
174
  },
174
- "decoded": {
175
- "triggerData": {
176
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
177
- "ratio": 135,
178
- "ratioState": 1
175
+ 'decoded': {
176
+ 'triggerData': {
177
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
178
+ 'ratio': 135,
179
+ 'ratioState': 1
179
180
  },
180
- "subData": {
181
- "targetRatio": 150
181
+ 'subData': {
182
+ 'targetRatio': 150
182
183
  }
183
184
  }
184
185
  },
185
- "specific": {
186
- "triggerRepayRatio": 135,
187
- "targetRepayRatio": 150,
188
- "repayEnabled": true,
189
- "subId1": 2,
190
- "mergeWithId": "boost"
186
+ 'specific': {
187
+ 'triggerRepayRatio': 135,
188
+ 'targetRepayRatio': 150,
189
+ 'repayEnabled': true,
190
+ 'subId1': 2,
191
+ 'mergeWithId': 'boost'
191
192
  }
192
193
  },
193
194
  {
194
- "isEnabled": false,
195
- "chainId": 1,
196
- "subHash": "0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b",
197
- "blockNumber": 0,
198
- "positionId": "1-aave__v3",
199
- "subId": 3,
200
- "protocol": {
201
- "id": "Aave__V3",
202
- "name": "Aave",
203
- "slug": "aave",
204
- "version": "V3",
205
- "fullName": "Aave V3"
206
- },
207
- "strategy": {
208
- "isBundle": true,
209
- "strategyOrBundleId": 1,
210
- "strategyId": "leverage-management",
211
- "protocol": {
212
- "id": "Aave__V3",
213
- "name": "Aave",
214
- "slug": "aave",
215
- "version": "V3",
216
- "fullName": "Aave V3"
195
+ 'isEnabled': false,
196
+ 'chainId': 1,
197
+ 'subHash': '0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b',
198
+ 'blockNumber': 0,
199
+ 'positionId': '1-aave__v3',
200
+ 'subId': 3,
201
+ 'protocol': {
202
+ 'id': 'Aave__V3',
203
+ 'name': 'Aave',
204
+ 'slug': 'aave',
205
+ 'version': 'V3',
206
+ 'fullName': 'Aave V3'
207
+ },
208
+ 'strategy': {
209
+ 'isBundle': true,
210
+ 'strategyOrBundleId': 1,
211
+ 'strategyId': 'leverage-management',
212
+ 'protocol': {
213
+ 'id': 'Aave__V3',
214
+ 'name': 'Aave',
215
+ 'slug': 'aave',
216
+ 'version': 'V3',
217
+ 'fullName': 'Aave V3'
217
218
  }
218
219
  },
219
- "strategyData": {
220
- "encoded": {
221
- "subData": [
222
- "0x00000000000000000000000000000000000000000000000014d1120d7b160000",
223
- "0x0000000000000000000000000000000000000000000000000000000000000000",
224
- "0x0000000000000000000000000000000000000000000000000000000000000001",
225
- "0x0000000000000000000000000000000000000000000000000000000000000000",
226
- "0x0000000000000000000000000000000000000000000000000000000000000001"
220
+ 'strategyData': {
221
+ 'encoded': {
222
+ 'subData': [
223
+ '0x00000000000000000000000000000000000000000000000014d1120d7b160000',
224
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
225
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
226
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
227
+ '0x0000000000000000000000000000000000000000000000000000000000000001'
227
228
  ]
228
229
  },
229
- "decoded": {
230
- "triggerData": {
231
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
232
- "ratio": 165,
233
- "ratioState": 0
230
+ 'decoded': {
231
+ 'triggerData': {
232
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
233
+ 'ratio': 165,
234
+ 'ratioState': 0
234
235
  },
235
- "subData": {
236
- "targetRatio": 150
236
+ 'subData': {
237
+ 'targetRatio': 150
237
238
  }
238
239
  }
239
240
  },
240
- "specific": {
241
- "triggerBoostRatio": 165,
242
- "targetBoostRatio": 150,
243
- "boostEnabled": false,
244
- "subId2": 3,
245
- "mergeId": "boost"
241
+ 'specific': {
242
+ 'triggerBoostRatio': 165,
243
+ 'targetBoostRatio': 150,
244
+ 'boostEnabled': false,
245
+ 'subId2': 3,
246
+ 'mergeId': 'boost'
246
247
  }
247
248
  },
248
249
  {
249
- "isEnabled": false,
250
- "chainId": 1,
251
- "subHash": "0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b",
252
- "blockNumber": 1,
253
- "positionId": "1-aave__v3",
254
- "subId": 4,
255
- "protocol": {
256
- "id": "Aave__V3",
257
- "name": "Aave",
258
- "slug": "aave",
259
- "version": "V3",
260
- "fullName": "Aave V3"
261
- },
262
- "strategy": {
263
- "isBundle": true,
264
- "strategyOrBundleId": 1,
265
- "strategyId": "leverage-management",
266
- "protocol": {
267
- "id": "Aave__V3",
268
- "name": "Aave",
269
- "slug": "aave",
270
- "version": "V3",
271
- "fullName": "Aave V3"
250
+ 'isEnabled': false,
251
+ 'chainId': 1,
252
+ 'subHash': '0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b',
253
+ 'blockNumber': 1,
254
+ 'positionId': '1-aave__v3',
255
+ 'subId': 4,
256
+ 'protocol': {
257
+ 'id': 'Aave__V3',
258
+ 'name': 'Aave',
259
+ 'slug': 'aave',
260
+ 'version': 'V3',
261
+ 'fullName': 'Aave V3'
262
+ },
263
+ 'strategy': {
264
+ 'isBundle': true,
265
+ 'strategyOrBundleId': 1,
266
+ 'strategyId': 'leverage-management',
267
+ 'protocol': {
268
+ 'id': 'Aave__V3',
269
+ 'name': 'Aave',
270
+ 'slug': 'aave',
271
+ 'version': 'V3',
272
+ 'fullName': 'Aave V3'
272
273
  }
273
274
  },
274
- "strategyData": {
275
- "encoded": {
276
- "subData": [
277
- "0x00000000000000000000000000000000000000000000000014d1120d7b160000",
278
- "0x0000000000000000000000000000000000000000000000000000000000000000",
279
- "0x0000000000000000000000000000000000000000000000000000000000000001",
280
- "0x0000000000000000000000000000000000000000000000000000000000000000",
281
- "0x0000000000000000000000000000000000000000000000000000000000000001"
275
+ 'strategyData': {
276
+ 'encoded': {
277
+ 'subData': [
278
+ '0x00000000000000000000000000000000000000000000000014d1120d7b160000',
279
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
280
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
281
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
282
+ '0x0000000000000000000000000000000000000000000000000000000000000001'
282
283
  ]
283
284
  },
284
- "decoded": {
285
- "triggerData": {
286
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
287
- "ratio": 165,
288
- "ratioState": 0
285
+ 'decoded': {
286
+ 'triggerData': {
287
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
288
+ 'ratio': 165,
289
+ 'ratioState': 0
289
290
  },
290
- "subData": {
291
- "targetRatio": 150
291
+ 'subData': {
292
+ 'targetRatio': 150
292
293
  }
293
294
  }
294
295
  },
295
- "specific": {
296
- "triggerBoostRatio": 165,
297
- "targetBoostRatio": 150,
298
- "boostEnabled": false,
299
- "subId2": 4,
300
- "mergeId": "boost"
296
+ 'specific': {
297
+ 'triggerBoostRatio': 165,
298
+ 'targetBoostRatio': 150,
299
+ 'boostEnabled': false,
300
+ 'subId2': 4,
301
+ 'mergeId': 'boost'
301
302
  }
302
303
  },
303
304
  {
304
- "isEnabled": false,
305
- "chainId": 1,
306
- "subHash": "0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b",
307
- "blockNumber": 1,
308
- "positionId": "1-aave__v3",
309
- "subId": 5,
310
- "protocol": {
311
- "id": "Aave__V3",
312
- "name": "Aave",
313
- "slug": "aave",
314
- "version": "V3",
315
- "fullName": "Aave V3"
316
- },
317
- "strategy": {
318
- "isBundle": true,
319
- "strategyOrBundleId": 1,
320
- "strategyId": "leverage-management",
321
- "protocol": {
322
- "id": "Aave__V3",
323
- "name": "Aave",
324
- "slug": "aave",
325
- "version": "V3",
326
- "fullName": "Aave V3"
305
+ 'isEnabled': false,
306
+ 'chainId': 1,
307
+ 'subHash': '0x96d6a5fe8127765a0fa55115621495bf66ebd16029b0883bc097eda1b597ab0b',
308
+ 'blockNumber': 1,
309
+ 'positionId': '1-aave__v3',
310
+ 'subId': 5,
311
+ 'protocol': {
312
+ 'id': 'Aave__V3',
313
+ 'name': 'Aave',
314
+ 'slug': 'aave',
315
+ 'version': 'V3',
316
+ 'fullName': 'Aave V3'
317
+ },
318
+ 'strategy': {
319
+ 'isBundle': true,
320
+ 'strategyOrBundleId': 1,
321
+ 'strategyId': 'leverage-management',
322
+ 'protocol': {
323
+ 'id': 'Aave__V3',
324
+ 'name': 'Aave',
325
+ 'slug': 'aave',
326
+ 'version': 'V3',
327
+ 'fullName': 'Aave V3'
327
328
  }
328
329
  },
329
- "strategyData": {
330
- "encoded": {
331
- "subData": [
332
- "0x00000000000000000000000000000000000000000000000014d1120d7b160000",
333
- "0x0000000000000000000000000000000000000000000000000000000000000000",
334
- "0x0000000000000000000000000000000000000000000000000000000000000001",
335
- "0x0000000000000000000000000000000000000000000000000000000000000000",
336
- "0x0000000000000000000000000000000000000000000000000000000000000001"
330
+ 'strategyData': {
331
+ 'encoded': {
332
+ 'subData': [
333
+ '0x00000000000000000000000000000000000000000000000014d1120d7b160000',
334
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
335
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
336
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
337
+ '0x0000000000000000000000000000000000000000000000000000000000000001'
337
338
  ]
338
339
  },
339
- "decoded": {
340
- "triggerData": {
341
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
342
- "ratio": 165,
343
- "ratioState": 0
340
+ 'decoded': {
341
+ 'triggerData': {
342
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
343
+ 'ratio': 165,
344
+ 'ratioState': 0
344
345
  },
345
- "subData": {
346
- "targetRatio": 150
346
+ 'subData': {
347
+ 'targetRatio': 150
347
348
  }
348
349
  }
349
350
  },
350
- "specific": {
351
- "triggerBoostRatio": 165,
352
- "targetBoostRatio": 150,
353
- "boostEnabled": false,
354
- "subId2": 5,
355
- "mergeId": "boost"
351
+ 'specific': {
352
+ 'triggerBoostRatio': 165,
353
+ 'targetBoostRatio': 150,
354
+ 'boostEnabled': false,
355
+ 'subId2': 5,
356
+ 'mergeId': 'boost'
356
357
  }
357
358
  },
358
359
  {
359
- "isEnabled": false,
360
- "chainId": 1,
361
- "subHash": "0x52cd11186443c2734f027a7175bccf80158c6a45906f4b33b5713b77244aa7f6",
362
- "blockNumber": 1,
363
- "positionId": "1-aave__v3",
364
- "subId": 6,
365
- "protocol": {
366
- "id": "Aave__V3",
367
- "name": "Aave",
368
- "slug": "aave",
369
- "version": "V3",
370
- "fullName": "Aave V3"
371
- },
372
- "strategy": {
373
- "isBundle": true,
374
- "strategyOrBundleId": 0,
375
- "strategyId": "leverage-management",
376
- "protocol": {
377
- "id": "Aave__V3",
378
- "name": "Aave",
379
- "slug": "aave",
380
- "version": "V3",
381
- "fullName": "Aave V3"
360
+ 'isEnabled': false,
361
+ 'chainId': 1,
362
+ 'subHash': '0x52cd11186443c2734f027a7175bccf80158c6a45906f4b33b5713b77244aa7f6',
363
+ 'blockNumber': 1,
364
+ 'positionId': '1-aave__v3',
365
+ 'subId': 6,
366
+ 'protocol': {
367
+ 'id': 'Aave__V3',
368
+ 'name': 'Aave',
369
+ 'slug': 'aave',
370
+ 'version': 'V3',
371
+ 'fullName': 'Aave V3'
372
+ },
373
+ 'strategy': {
374
+ 'isBundle': true,
375
+ 'strategyOrBundleId': 0,
376
+ 'strategyId': 'leverage-management',
377
+ 'protocol': {
378
+ 'id': 'Aave__V3',
379
+ 'name': 'Aave',
380
+ 'slug': 'aave',
381
+ 'version': 'V3',
382
+ 'fullName': 'Aave V3'
382
383
  }
383
384
  },
384
- "strategyData": {
385
- "encoded": {
386
- "subData": [
387
- "0x00000000000000000000000000000000000000000000000012bc29d8eec70000",
388
- "0x0000000000000000000000000000000000000000000000000000000000000001",
389
- "0x0000000000000000000000000000000000000000000000000000000000000001",
390
- "0x0000000000000000000000000000000000000000000000000000000000000000"
385
+ 'strategyData': {
386
+ 'encoded': {
387
+ 'subData': [
388
+ '0x00000000000000000000000000000000000000000000000012bc29d8eec70000',
389
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
390
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
391
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
391
392
  ]
392
393
  },
393
- "decoded": {
394
- "triggerData": {
395
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
396
- "ratio": 120,
397
- "ratioState": 1
394
+ 'decoded': {
395
+ 'triggerData': {
396
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
397
+ 'ratio': 120,
398
+ 'ratioState': 1
398
399
  },
399
- "subData": {
400
- "targetRatio": 135
400
+ 'subData': {
401
+ 'targetRatio': 135
401
402
  }
402
403
  }
403
404
  },
404
- "specific": {
405
- "triggerRepayRatio": 120,
406
- "targetRepayRatio": 135,
407
- "repayEnabled": true,
408
- "subId1": 6,
409
- "mergeWithId": "boost"
405
+ 'specific': {
406
+ 'triggerRepayRatio': 120,
407
+ 'targetRepayRatio': 135,
408
+ 'repayEnabled': true,
409
+ 'subId1': 6,
410
+ 'mergeWithId': 'boost'
410
411
  }
411
412
  }
412
413
  ], [
413
414
  {
414
- "isEnabled": true,
415
- "chainId": 1,
416
- "subHash": "0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee",
417
- "blockNumber": 0,
418
- "positionId": "1-aave__v3",
419
- "subId": 0,
420
- "protocol": {
421
- "id": "Aave__V3",
422
- "name": "Aave",
423
- "slug": "aave",
424
- "version": "V3",
425
- "fullName": "Aave V3"
426
- },
427
- "strategy": {
428
- "isBundle": true,
429
- "strategyOrBundleId": 0,
430
- "strategyId": "leverage-management",
431
- "protocol": {
432
- "id": "Aave__V3",
433
- "name": "Aave",
434
- "slug": "aave",
435
- "version": "V3",
436
- "fullName": "Aave V3"
415
+ 'isEnabled': true,
416
+ 'chainId': 1,
417
+ 'subHash': '0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee',
418
+ 'blockNumber': 0,
419
+ 'positionId': '1-aave__v3',
420
+ 'subId': 0,
421
+ 'protocol': {
422
+ 'id': 'Aave__V3',
423
+ 'name': 'Aave',
424
+ 'slug': 'aave',
425
+ 'version': 'V3',
426
+ 'fullName': 'Aave V3'
427
+ },
428
+ 'strategy': {
429
+ 'isBundle': true,
430
+ 'strategyOrBundleId': 0,
431
+ 'strategyId': 'leverage-management',
432
+ 'protocol': {
433
+ 'id': 'Aave__V3',
434
+ 'name': 'Aave',
435
+ 'slug': 'aave',
436
+ 'version': 'V3',
437
+ 'fullName': 'Aave V3'
437
438
  }
438
439
  },
439
- "strategyData": {
440
- "encoded": {
441
- "subData": [
442
- "0x000000000000000000000000000000000000000000000000120a871cc0020000",
443
- "0x0000000000000000000000000000000000000000000000000000000000000001",
444
- "0x0000000000000000000000000000000000000000000000000000000000000001",
445
- "0x0000000000000000000000000000000000000000000000000000000000000000"
440
+ 'strategyData': {
441
+ 'encoded': {
442
+ 'subData': [
443
+ '0x000000000000000000000000000000000000000000000000120a871cc0020000',
444
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
445
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
446
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
446
447
  ]
447
448
  },
448
- "decoded": {
449
- "triggerData": {
450
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
451
- "ratio": 120,
452
- "ratioState": 1
449
+ 'decoded': {
450
+ 'triggerData': {
451
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
452
+ 'ratio': 120,
453
+ 'ratioState': 1
453
454
  },
454
- "subData": {
455
- "targetRatio": 130
455
+ 'subData': {
456
+ 'targetRatio': 130
456
457
  }
457
458
  }
458
459
  },
459
- "specific": {
460
- "triggerBoostRatio": 165,
461
- "targetBoostRatio": 150,
462
- "boostEnabled": false,
463
- "subId2": 3,
464
- "mergeId": "boost",
465
- "triggerRepayRatio": 120,
466
- "targetRepayRatio": 130,
467
- "repayEnabled": true,
468
- "subId1": 0,
469
- "mergeWithId": "boost"
470
- },
471
- "subIds": [
460
+ 'specific': {
461
+ 'triggerBoostRatio': 165,
462
+ 'targetBoostRatio': 150,
463
+ 'boostEnabled': false,
464
+ 'subId2': 3,
465
+ 'mergeId': 'boost',
466
+ 'triggerRepayRatio': 120,
467
+ 'targetRepayRatio': 130,
468
+ 'repayEnabled': true,
469
+ 'subId1': 0,
470
+ 'mergeWithId': 'boost'
471
+ },
472
+ 'subIds': [
472
473
  0,
473
474
  3
474
475
  ]
475
476
  },
476
477
  {
477
- "isEnabled": false,
478
- "chainId": 1,
479
- "subHash": "0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee",
480
- "blockNumber": 1,
481
- "positionId": "1-aave__v3",
482
- "subId": 1,
483
- "protocol": {
484
- "id": "Aave__V3",
485
- "name": "Aave",
486
- "slug": "aave",
487
- "version": "V3",
488
- "fullName": "Aave V3"
489
- },
490
- "strategy": {
491
- "isBundle": true,
492
- "strategyOrBundleId": 0,
493
- "strategyId": "leverage-management",
494
- "protocol": {
495
- "id": "Aave__V3",
496
- "name": "Aave",
497
- "slug": "aave",
498
- "version": "V3",
499
- "fullName": "Aave V3"
478
+ 'isEnabled': false,
479
+ 'chainId': 1,
480
+ 'subHash': '0x7a14b187374b9ab02f6f7c95f275ef547376da010d53c715870cd053199a6aee',
481
+ 'blockNumber': 1,
482
+ 'positionId': '1-aave__v3',
483
+ 'subId': 1,
484
+ 'protocol': {
485
+ 'id': 'Aave__V3',
486
+ 'name': 'Aave',
487
+ 'slug': 'aave',
488
+ 'version': 'V3',
489
+ 'fullName': 'Aave V3'
490
+ },
491
+ 'strategy': {
492
+ 'isBundle': true,
493
+ 'strategyOrBundleId': 0,
494
+ 'strategyId': 'leverage-management',
495
+ 'protocol': {
496
+ 'id': 'Aave__V3',
497
+ 'name': 'Aave',
498
+ 'slug': 'aave',
499
+ 'version': 'V3',
500
+ 'fullName': 'Aave V3'
500
501
  }
501
502
  },
502
- "strategyData": {
503
- "encoded": {
504
- "subData": [
505
- "0x000000000000000000000000000000000000000000000000120a871cc0020000",
506
- "0x0000000000000000000000000000000000000000000000000000000000000001",
507
- "0x0000000000000000000000000000000000000000000000000000000000000001",
508
- "0x0000000000000000000000000000000000000000000000000000000000000000"
503
+ 'strategyData': {
504
+ 'encoded': {
505
+ 'subData': [
506
+ '0x000000000000000000000000000000000000000000000000120a871cc0020000',
507
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
508
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
509
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
509
510
  ]
510
511
  },
511
- "decoded": {
512
- "triggerData": {
513
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
514
- "ratio": 120,
515
- "ratioState": 1
512
+ 'decoded': {
513
+ 'triggerData': {
514
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
515
+ 'ratio': 120,
516
+ 'ratioState': 1
516
517
  },
517
- "subData": {
518
- "targetRatio": 130
518
+ 'subData': {
519
+ 'targetRatio': 130
519
520
  }
520
521
  }
521
522
  },
522
- "specific": {
523
- "triggerBoostRatio": 165,
524
- "targetBoostRatio": 150,
525
- "boostEnabled": false,
526
- "subId2": 4,
527
- "mergeId": "boost",
528
- "triggerRepayRatio": 120,
529
- "targetRepayRatio": 130,
530
- "repayEnabled": true,
531
- "subId1": 1,
532
- "mergeWithId": "boost"
533
- },
534
- "subIds": [
523
+ 'specific': {
524
+ 'triggerBoostRatio': 165,
525
+ 'targetBoostRatio': 150,
526
+ 'boostEnabled': false,
527
+ 'subId2': 4,
528
+ 'mergeId': 'boost',
529
+ 'triggerRepayRatio': 120,
530
+ 'targetRepayRatio': 130,
531
+ 'repayEnabled': true,
532
+ 'subId1': 1,
533
+ 'mergeWithId': 'boost'
534
+ },
535
+ 'subIds': [
535
536
  1,
536
537
  4
537
538
  ]
538
539
  },
539
540
  {
540
- "isEnabled": false,
541
- "chainId": 1,
542
- "subHash": "0xe55917c42ac3e8f6c080e3780c5e0ea7a0a3da6c05e7ced5fe69fee48133a5eb",
543
- "blockNumber": 1,
544
- "positionId": "1-aave__v3",
545
- "subId": 2,
546
- "protocol": {
547
- "id": "Aave__V3",
548
- "name": "Aave",
549
- "slug": "aave",
550
- "version": "V3",
551
- "fullName": "Aave V3"
552
- },
553
- "strategy": {
554
- "isBundle": true,
555
- "strategyOrBundleId": 0,
556
- "strategyId": "leverage-management",
557
- "protocol": {
558
- "id": "Aave__V3",
559
- "name": "Aave",
560
- "slug": "aave",
561
- "version": "V3",
562
- "fullName": "Aave V3"
541
+ 'isEnabled': false,
542
+ 'chainId': 1,
543
+ 'subHash': '0xe55917c42ac3e8f6c080e3780c5e0ea7a0a3da6c05e7ced5fe69fee48133a5eb',
544
+ 'blockNumber': 1,
545
+ 'positionId': '1-aave__v3',
546
+ 'subId': 2,
547
+ 'protocol': {
548
+ 'id': 'Aave__V3',
549
+ 'name': 'Aave',
550
+ 'slug': 'aave',
551
+ 'version': 'V3',
552
+ 'fullName': 'Aave V3'
553
+ },
554
+ 'strategy': {
555
+ 'isBundle': true,
556
+ 'strategyOrBundleId': 0,
557
+ 'strategyId': 'leverage-management',
558
+ 'protocol': {
559
+ 'id': 'Aave__V3',
560
+ 'name': 'Aave',
561
+ 'slug': 'aave',
562
+ 'version': 'V3',
563
+ 'fullName': 'Aave V3'
563
564
  }
564
565
  },
565
- "strategyData": {
566
- "encoded": {
567
- "subData": [
568
- "0x00000000000000000000000000000000000000000000000014d1120d7b160000",
569
- "0x0000000000000000000000000000000000000000000000000000000000000001",
570
- "0x0000000000000000000000000000000000000000000000000000000000000001",
571
- "0x0000000000000000000000000000000000000000000000000000000000000000"
566
+ 'strategyData': {
567
+ 'encoded': {
568
+ 'subData': [
569
+ '0x00000000000000000000000000000000000000000000000014d1120d7b160000',
570
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
571
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
572
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
572
573
  ]
573
574
  },
574
- "decoded": {
575
- "triggerData": {
576
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
577
- "ratio": 135,
578
- "ratioState": 1
575
+ 'decoded': {
576
+ 'triggerData': {
577
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
578
+ 'ratio': 135,
579
+ 'ratioState': 1
579
580
  },
580
- "subData": {
581
- "targetRatio": 150
581
+ 'subData': {
582
+ 'targetRatio': 150
582
583
  }
583
584
  }
584
585
  },
585
- "specific": {
586
- "triggerBoostRatio": 165,
587
- "targetBoostRatio": 150,
588
- "boostEnabled": false,
589
- "subId2": 5,
590
- "mergeId": "boost",
591
- "triggerRepayRatio": 135,
592
- "targetRepayRatio": 150,
593
- "repayEnabled": true,
594
- "subId1": 2,
595
- "mergeWithId": "boost"
596
- },
597
- "subIds": [
586
+ 'specific': {
587
+ 'triggerBoostRatio': 165,
588
+ 'targetBoostRatio': 150,
589
+ 'boostEnabled': false,
590
+ 'subId2': 5,
591
+ 'mergeId': 'boost',
592
+ 'triggerRepayRatio': 135,
593
+ 'targetRepayRatio': 150,
594
+ 'repayEnabled': true,
595
+ 'subId1': 2,
596
+ 'mergeWithId': 'boost'
597
+ },
598
+ 'subIds': [
598
599
  2,
599
600
  5
600
601
  ]
601
602
  },
602
603
  {
603
- "isEnabled": false,
604
- "chainId": 1,
605
- "subHash": "0x52cd11186443c2734f027a7175bccf80158c6a45906f4b33b5713b77244aa7f6",
606
- "blockNumber": 1,
607
- "positionId": "1-aave__v3",
608
- "subId": 6,
609
- "protocol": {
610
- "id": "Aave__V3",
611
- "name": "Aave",
612
- "slug": "aave",
613
- "version": "V3",
614
- "fullName": "Aave V3"
615
- },
616
- "strategy": {
617
- "isBundle": true,
618
- "strategyOrBundleId": 0,
619
- "strategyId": "leverage-management",
620
- "protocol": {
621
- "id": "Aave__V3",
622
- "name": "Aave",
623
- "slug": "aave",
624
- "version": "V3",
625
- "fullName": "Aave V3"
604
+ 'isEnabled': false,
605
+ 'chainId': 1,
606
+ 'subHash': '0x52cd11186443c2734f027a7175bccf80158c6a45906f4b33b5713b77244aa7f6',
607
+ 'blockNumber': 1,
608
+ 'positionId': '1-aave__v3',
609
+ 'subId': 6,
610
+ 'protocol': {
611
+ 'id': 'Aave__V3',
612
+ 'name': 'Aave',
613
+ 'slug': 'aave',
614
+ 'version': 'V3',
615
+ 'fullName': 'Aave V3'
616
+ },
617
+ 'strategy': {
618
+ 'isBundle': true,
619
+ 'strategyOrBundleId': 0,
620
+ 'strategyId': 'leverage-management',
621
+ 'protocol': {
622
+ 'id': 'Aave__V3',
623
+ 'name': 'Aave',
624
+ 'slug': 'aave',
625
+ 'version': 'V3',
626
+ 'fullName': 'Aave V3'
626
627
  }
627
628
  },
628
- "strategyData": {
629
- "encoded": {
630
- "subData": [
631
- "0x00000000000000000000000000000000000000000000000012bc29d8eec70000",
632
- "0x0000000000000000000000000000000000000000000000000000000000000001",
633
- "0x0000000000000000000000000000000000000000000000000000000000000001",
634
- "0x0000000000000000000000000000000000000000000000000000000000000000"
629
+ 'strategyData': {
630
+ 'encoded': {
631
+ 'subData': [
632
+ '0x00000000000000000000000000000000000000000000000012bc29d8eec70000',
633
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
634
+ '0x0000000000000000000000000000000000000000000000000000000000000001',
635
+ '0x0000000000000000000000000000000000000000000000000000000000000000'
635
636
  ]
636
637
  },
637
- "decoded": {
638
- "triggerData": {
639
- "market": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
640
- "ratio": 120,
641
- "ratioState": 1
638
+ 'decoded': {
639
+ 'triggerData': {
640
+ 'market': '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
641
+ 'ratio': 120,
642
+ 'ratioState': 1
642
643
  },
643
- "subData": {
644
- "targetRatio": 135
644
+ 'subData': {
645
+ 'targetRatio': 135
645
646
  }
646
647
  }
647
648
  },
648
- "specific": {
649
- "triggerRepayRatio": 120,
650
- "targetRepayRatio": 135,
651
- "repayEnabled": true,
652
- "subId1": 6,
653
- "mergeWithId": "boost"
649
+ 'specific': {
650
+ 'triggerRepayRatio': 120,
651
+ 'targetRepayRatio': 135,
652
+ 'repayEnabled': true,
653
+ 'subId1': 6,
654
+ 'mergeWithId': 'boost'
654
655
  },
655
- "subIds": [
656
+ 'subIds': [
656
657
  6
657
658
  ]
658
659
  }