@defisaver/automation-sdk 3.0.1 → 3.0.2

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