@instadapp/interop-x 0.0.0-dev.e916c22 → 0.0.0-dev.ea4acf6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/dist/package.json +9 -2
  2. package/dist/src/abi/aaveV2Resolver.json +832 -0
  3. package/dist/src/abi/aaveV3Resolver.json +628 -0
  4. package/dist/src/abi/balanceResolver.json +211 -0
  5. package/dist/src/abi/index.js +6 -0
  6. package/dist/src/api/index.js +7 -0
  7. package/dist/src/constants/addresses.js +6 -0
  8. package/dist/src/constants/capPerChain.js +8 -0
  9. package/dist/src/constants/index.js +2 -0
  10. package/dist/src/constants/tokens.js +44 -44
  11. package/dist/src/constants/wrappedNativeToken.js +8 -0
  12. package/dist/src/crons/index.js +3 -0
  13. package/dist/src/crons/prices.js +16 -0
  14. package/dist/src/db/models/transaction.js +1 -1
  15. package/dist/src/errors/index.js +30 -0
  16. package/dist/src/gnosis/actions/aaveV2/source.js +26 -1
  17. package/dist/src/gnosis/actions/aaveV2/target.js +18 -4
  18. package/dist/src/gnosis/actions/aaveV3/index.js +11 -0
  19. package/dist/src/gnosis/actions/aaveV3/source.js +74 -0
  20. package/dist/src/gnosis/actions/aaveV3/target.js +87 -0
  21. package/dist/src/gnosis/actions/index.js +2 -0
  22. package/dist/src/index.js +2 -1
  23. package/dist/src/providers/index.js +17 -0
  24. package/dist/src/providers/retry-provider.js +45 -0
  25. package/dist/src/services/Prices.js +74 -0
  26. package/dist/src/services/index.js +8 -0
  27. package/dist/src/tasks/InteropX/{ProcessSubmitSubmitEvents.js → ProcessSubmitEvents.js} +108 -14
  28. package/dist/src/tasks/InteropX/ProcessValidateEvents.js +30 -10
  29. package/dist/src/tasks/InteropX/SyncLogExecuteEvents.js +3 -2
  30. package/dist/src/tasks/InteropX/SyncLogSubmitEvents.js +3 -2
  31. package/dist/src/tasks/InteropX/SyncLogValidateEvents.js +3 -2
  32. package/dist/src/tasks/index.js +3 -4
  33. package/dist/src/typechain/AaveV2Resolver.js +2 -0
  34. package/dist/src/typechain/AaveV3Resolver.js +2 -0
  35. package/dist/src/typechain/BalanceResolver.js +2 -0
  36. package/dist/src/typechain/factories/AaveV2Resolver__factory.js +1191 -0
  37. package/dist/src/typechain/factories/AaveV3Resolver__factory.js +887 -0
  38. package/dist/src/typechain/factories/BalanceResolver__factory.js +228 -0
  39. package/dist/src/typechain/factories/index.js +7 -1
  40. package/dist/src/typechain/index.js +7 -1
  41. package/dist/src/utils/async.js +18 -0
  42. package/dist/src/utils/dsa.js +36 -0
  43. package/dist/src/utils/formatting.js +67 -0
  44. package/dist/src/utils/gnosis.js +87 -0
  45. package/dist/src/utils/http.js +10 -0
  46. package/dist/src/utils/index.js +22 -220
  47. package/dist/src/utils/interop.js +16 -0
  48. package/dist/src/utils/tokens.js +22 -0
  49. package/dist/src/utils/validate.js +111 -0
  50. package/dist/src/utils/web3.js +93 -0
  51. package/package.json +9 -2
  52. package/src/abi/aaveV2Resolver.json +832 -0
  53. package/src/abi/aaveV3Resolver.json +628 -0
  54. package/src/abi/balanceResolver.json +211 -0
  55. package/src/abi/index.ts +6 -0
  56. package/src/api/index.ts +8 -0
  57. package/src/constants/addresses.ts +18 -1
  58. package/src/constants/capPerChain.ts +5 -0
  59. package/src/constants/index.ts +2 -0
  60. package/src/constants/tokens.ts +44 -44
  61. package/src/constants/wrappedNativeToken.ts +5 -0
  62. package/src/crons/index.ts +1 -0
  63. package/src/crons/prices.ts +12 -0
  64. package/src/db/models/transaction.ts +1 -1
  65. package/src/errors/index.ts +26 -0
  66. package/src/gnosis/actions/aaveV2/source.ts +56 -3
  67. package/src/gnosis/actions/aaveV2/target.ts +30 -11
  68. package/src/gnosis/actions/aaveV3/index.ts +9 -0
  69. package/src/gnosis/actions/aaveV3/source.ts +119 -0
  70. package/src/gnosis/actions/aaveV3/target.ts +142 -0
  71. package/src/gnosis/actions/index.ts +2 -0
  72. package/src/index.ts +1 -0
  73. package/src/providers/index.ts +1 -0
  74. package/src/providers/retry-provider.ts +51 -0
  75. package/src/services/Prices.ts +89 -0
  76. package/src/services/index.ts +1 -0
  77. package/src/tasks/InteropX/{ProcessSubmitSubmitEvents.ts → ProcessSubmitEvents.ts} +135 -20
  78. package/src/tasks/InteropX/ProcessValidateEvents.ts +42 -19
  79. package/src/tasks/InteropX/SyncLogExecuteEvents.ts +5 -6
  80. package/src/tasks/InteropX/SyncLogSubmitEvents.ts +6 -7
  81. package/src/tasks/InteropX/SyncLogValidateEvents.ts +6 -7
  82. package/src/tasks/index.ts +3 -4
  83. package/src/typechain/AaveV2Resolver.ts +1017 -0
  84. package/src/typechain/AaveV3Resolver.ts +935 -0
  85. package/src/typechain/BalanceResolver.ts +266 -0
  86. package/src/typechain/factories/AaveV2Resolver__factory.ts +1198 -0
  87. package/src/typechain/factories/AaveV3Resolver__factory.ts +894 -0
  88. package/src/typechain/factories/BalanceResolver__factory.ts +235 -0
  89. package/src/typechain/factories/index.ts +3 -0
  90. package/src/typechain/index.ts +6 -0
  91. package/src/utils/async.ts +22 -0
  92. package/src/utils/dsa.ts +56 -0
  93. package/src/utils/formatting.ts +68 -0
  94. package/src/utils/gnosis.ts +166 -0
  95. package/src/utils/http.ts +6 -0
  96. package/src/utils/index.ts +9 -365
  97. package/src/utils/interop.ts +28 -0
  98. package/src/utils/tokens.ts +21 -0
  99. package/src/utils/validate.ts +179 -0
  100. package/src/utils/web3.ts +132 -0
@@ -0,0 +1,1198 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import type { Provider } from "@ethersproject/providers";
7
+ import type {
8
+ AaveV2Resolver,
9
+ AaveV2ResolverInterface,
10
+ } from "../AaveV2Resolver";
11
+
12
+ const _abi = [
13
+ {
14
+ inputs: [
15
+ {
16
+ internalType: "address",
17
+ name: "_aaveLendingPoolAddressesProvider",
18
+ type: "address",
19
+ },
20
+ {
21
+ internalType: "address",
22
+ name: "_aaveProtocolDataProvider",
23
+ type: "address",
24
+ },
25
+ {
26
+ internalType: "address",
27
+ name: "_instaIndex",
28
+ type: "address",
29
+ },
30
+ {
31
+ internalType: "address",
32
+ name: "_wnativeToken",
33
+ type: "address",
34
+ },
35
+ ],
36
+ stateMutability: "nonpayable",
37
+ type: "constructor",
38
+ },
39
+ {
40
+ inputs: [
41
+ {
42
+ internalType: "address",
43
+ name: "liquidity",
44
+ type: "address",
45
+ },
46
+ {
47
+ components: [
48
+ {
49
+ components: [
50
+ {
51
+ internalType: "address",
52
+ name: "sourceToken",
53
+ type: "address",
54
+ },
55
+ {
56
+ internalType: "address",
57
+ name: "targetToken",
58
+ type: "address",
59
+ },
60
+ {
61
+ internalType: "uint256",
62
+ name: "amount",
63
+ type: "uint256",
64
+ },
65
+ ],
66
+ internalType: "struct Variables.TokenInfo[]",
67
+ name: "supply",
68
+ type: "tuple[]",
69
+ },
70
+ {
71
+ components: [
72
+ {
73
+ internalType: "address",
74
+ name: "sourceToken",
75
+ type: "address",
76
+ },
77
+ {
78
+ internalType: "address",
79
+ name: "targetToken",
80
+ type: "address",
81
+ },
82
+ {
83
+ internalType: "uint256",
84
+ name: "amount",
85
+ type: "uint256",
86
+ },
87
+ ],
88
+ internalType: "struct Variables.TokenInfo[]",
89
+ name: "withdraw",
90
+ type: "tuple[]",
91
+ },
92
+ ],
93
+ internalType: "struct Variables.Position",
94
+ name: "position",
95
+ type: "tuple",
96
+ },
97
+ {
98
+ internalType: "uint256",
99
+ name: "safeRatioPercentage",
100
+ type: "uint256",
101
+ },
102
+ ],
103
+ name: "_checkAaveLiquidityRatio",
104
+ outputs: [
105
+ {
106
+ components: [
107
+ {
108
+ internalType: "bool",
109
+ name: "isOk",
110
+ type: "bool",
111
+ },
112
+ {
113
+ internalType: "uint256",
114
+ name: "ratio",
115
+ type: "uint256",
116
+ },
117
+ {
118
+ internalType: "uint256",
119
+ name: "maxRatio",
120
+ type: "uint256",
121
+ },
122
+ {
123
+ internalType: "uint256",
124
+ name: "maxLiquidationRatio",
125
+ type: "uint256",
126
+ },
127
+ {
128
+ internalType: "uint256",
129
+ name: "ltv",
130
+ type: "uint256",
131
+ },
132
+ {
133
+ internalType: "uint256",
134
+ name: "currentLiquidationThreshold",
135
+ type: "uint256",
136
+ },
137
+ {
138
+ internalType: "uint256",
139
+ name: "totalSupply",
140
+ type: "uint256",
141
+ },
142
+ {
143
+ internalType: "uint256",
144
+ name: "totalBorrow",
145
+ type: "uint256",
146
+ },
147
+ {
148
+ internalType: "uint256",
149
+ name: "price",
150
+ type: "uint256",
151
+ },
152
+ ],
153
+ internalType: "struct Helpers.PositionData",
154
+ name: "positionData",
155
+ type: "tuple",
156
+ },
157
+ ],
158
+ stateMutability: "view",
159
+ type: "function",
160
+ },
161
+ {
162
+ inputs: [
163
+ {
164
+ internalType: "address",
165
+ name: "liquidity",
166
+ type: "address",
167
+ },
168
+ {
169
+ internalType: "uint256",
170
+ name: "safeRatioPercentage",
171
+ type: "uint256",
172
+ },
173
+ {
174
+ internalType: "uint256",
175
+ name: "extraBorrow",
176
+ type: "uint256",
177
+ },
178
+ ],
179
+ name: "_checkLiquidityRatio",
180
+ outputs: [
181
+ {
182
+ components: [
183
+ {
184
+ internalType: "bool",
185
+ name: "isOk",
186
+ type: "bool",
187
+ },
188
+ {
189
+ internalType: "uint256",
190
+ name: "ratio",
191
+ type: "uint256",
192
+ },
193
+ {
194
+ internalType: "uint256",
195
+ name: "maxRatio",
196
+ type: "uint256",
197
+ },
198
+ {
199
+ internalType: "uint256",
200
+ name: "maxLiquidationRatio",
201
+ type: "uint256",
202
+ },
203
+ {
204
+ internalType: "uint256",
205
+ name: "ltv",
206
+ type: "uint256",
207
+ },
208
+ {
209
+ internalType: "uint256",
210
+ name: "currentLiquidationThreshold",
211
+ type: "uint256",
212
+ },
213
+ {
214
+ internalType: "uint256",
215
+ name: "totalSupply",
216
+ type: "uint256",
217
+ },
218
+ {
219
+ internalType: "uint256",
220
+ name: "totalBorrow",
221
+ type: "uint256",
222
+ },
223
+ {
224
+ internalType: "uint256",
225
+ name: "price",
226
+ type: "uint256",
227
+ },
228
+ ],
229
+ internalType: "struct Helpers.PositionData",
230
+ name: "positionData",
231
+ type: "tuple",
232
+ },
233
+ ],
234
+ stateMutability: "view",
235
+ type: "function",
236
+ },
237
+ {
238
+ inputs: [
239
+ {
240
+ internalType: "address",
241
+ name: "userAddress",
242
+ type: "address",
243
+ },
244
+ {
245
+ components: [
246
+ {
247
+ components: [
248
+ {
249
+ internalType: "address",
250
+ name: "sourceToken",
251
+ type: "address",
252
+ },
253
+ {
254
+ internalType: "address",
255
+ name: "targetToken",
256
+ type: "address",
257
+ },
258
+ {
259
+ internalType: "uint256",
260
+ name: "amount",
261
+ type: "uint256",
262
+ },
263
+ ],
264
+ internalType: "struct Variables.TokenInfo[]",
265
+ name: "supply",
266
+ type: "tuple[]",
267
+ },
268
+ {
269
+ components: [
270
+ {
271
+ internalType: "address",
272
+ name: "sourceToken",
273
+ type: "address",
274
+ },
275
+ {
276
+ internalType: "address",
277
+ name: "targetToken",
278
+ type: "address",
279
+ },
280
+ {
281
+ internalType: "uint256",
282
+ name: "amount",
283
+ type: "uint256",
284
+ },
285
+ ],
286
+ internalType: "struct Variables.TokenInfo[]",
287
+ name: "withdraw",
288
+ type: "tuple[]",
289
+ },
290
+ ],
291
+ internalType: "struct Variables.Position",
292
+ name: "position",
293
+ type: "tuple",
294
+ },
295
+ {
296
+ internalType: "uint256",
297
+ name: "safeRatioPercentage",
298
+ type: "uint256",
299
+ },
300
+ {
301
+ internalType: "bool",
302
+ name: "isTarget",
303
+ type: "bool",
304
+ },
305
+ ],
306
+ name: "_checkRatio",
307
+ outputs: [
308
+ {
309
+ components: [
310
+ {
311
+ internalType: "bool",
312
+ name: "isOk",
313
+ type: "bool",
314
+ },
315
+ {
316
+ internalType: "uint256",
317
+ name: "ratio",
318
+ type: "uint256",
319
+ },
320
+ {
321
+ internalType: "uint256",
322
+ name: "maxRatio",
323
+ type: "uint256",
324
+ },
325
+ {
326
+ internalType: "uint256",
327
+ name: "maxLiquidationRatio",
328
+ type: "uint256",
329
+ },
330
+ {
331
+ internalType: "uint256",
332
+ name: "ltv",
333
+ type: "uint256",
334
+ },
335
+ {
336
+ internalType: "uint256",
337
+ name: "currentLiquidationThreshold",
338
+ type: "uint256",
339
+ },
340
+ {
341
+ internalType: "uint256",
342
+ name: "totalSupply",
343
+ type: "uint256",
344
+ },
345
+ {
346
+ internalType: "uint256",
347
+ name: "totalBorrow",
348
+ type: "uint256",
349
+ },
350
+ {
351
+ internalType: "uint256",
352
+ name: "price",
353
+ type: "uint256",
354
+ },
355
+ ],
356
+ internalType: "struct Helpers.PositionData",
357
+ name: "positionData",
358
+ type: "tuple",
359
+ },
360
+ ],
361
+ stateMutability: "view",
362
+ type: "function",
363
+ },
364
+ {
365
+ inputs: [],
366
+ name: "aaveLendingPoolAddressesProvider",
367
+ outputs: [
368
+ {
369
+ internalType: "contract AaveLendingPoolProviderInterface",
370
+ name: "",
371
+ type: "address",
372
+ },
373
+ ],
374
+ stateMutability: "view",
375
+ type: "function",
376
+ },
377
+ {
378
+ inputs: [],
379
+ name: "aaveProtocolDataProvider",
380
+ outputs: [
381
+ {
382
+ internalType: "contract AaveDataProviderInterface",
383
+ name: "",
384
+ type: "address",
385
+ },
386
+ ],
387
+ stateMutability: "view",
388
+ type: "function",
389
+ },
390
+ {
391
+ inputs: [
392
+ {
393
+ internalType: "address",
394
+ name: "liquidityAddress",
395
+ type: "address",
396
+ },
397
+ {
398
+ components: [
399
+ {
400
+ components: [
401
+ {
402
+ internalType: "address",
403
+ name: "sourceToken",
404
+ type: "address",
405
+ },
406
+ {
407
+ internalType: "address",
408
+ name: "targetToken",
409
+ type: "address",
410
+ },
411
+ {
412
+ internalType: "uint256",
413
+ name: "amount",
414
+ type: "uint256",
415
+ },
416
+ ],
417
+ internalType: "struct Variables.TokenInfo[]",
418
+ name: "supply",
419
+ type: "tuple[]",
420
+ },
421
+ {
422
+ components: [
423
+ {
424
+ internalType: "address",
425
+ name: "sourceToken",
426
+ type: "address",
427
+ },
428
+ {
429
+ internalType: "address",
430
+ name: "targetToken",
431
+ type: "address",
432
+ },
433
+ {
434
+ internalType: "uint256",
435
+ name: "amount",
436
+ type: "uint256",
437
+ },
438
+ ],
439
+ internalType: "struct Variables.TokenInfo[]",
440
+ name: "withdraw",
441
+ type: "tuple[]",
442
+ },
443
+ ],
444
+ internalType: "struct Variables.Position",
445
+ name: "position",
446
+ type: "tuple",
447
+ },
448
+ {
449
+ internalType: "uint256",
450
+ name: "safeLiquidityRatioPercentage",
451
+ type: "uint256",
452
+ },
453
+ ],
454
+ name: "checkAaveLiquidity",
455
+ outputs: [
456
+ {
457
+ components: [
458
+ {
459
+ internalType: "bool",
460
+ name: "isOk",
461
+ type: "bool",
462
+ },
463
+ {
464
+ internalType: "uint256",
465
+ name: "ratio",
466
+ type: "uint256",
467
+ },
468
+ {
469
+ internalType: "uint256",
470
+ name: "maxRatio",
471
+ type: "uint256",
472
+ },
473
+ {
474
+ internalType: "uint256",
475
+ name: "maxLiquidationRatio",
476
+ type: "uint256",
477
+ },
478
+ {
479
+ internalType: "uint256",
480
+ name: "ltv",
481
+ type: "uint256",
482
+ },
483
+ {
484
+ internalType: "uint256",
485
+ name: "currentLiquidationThreshold",
486
+ type: "uint256",
487
+ },
488
+ {
489
+ internalType: "uint256",
490
+ name: "totalSupply",
491
+ type: "uint256",
492
+ },
493
+ {
494
+ internalType: "uint256",
495
+ name: "totalBorrow",
496
+ type: "uint256",
497
+ },
498
+ {
499
+ internalType: "uint256",
500
+ name: "price",
501
+ type: "uint256",
502
+ },
503
+ ],
504
+ internalType: "struct Helpers.PositionData",
505
+ name: "p",
506
+ type: "tuple",
507
+ },
508
+ ],
509
+ stateMutability: "view",
510
+ type: "function",
511
+ },
512
+ {
513
+ inputs: [
514
+ {
515
+ internalType: "address",
516
+ name: "userAddress",
517
+ type: "address",
518
+ },
519
+ {
520
+ components: [
521
+ {
522
+ components: [
523
+ {
524
+ internalType: "address",
525
+ name: "sourceToken",
526
+ type: "address",
527
+ },
528
+ {
529
+ internalType: "address",
530
+ name: "targetToken",
531
+ type: "address",
532
+ },
533
+ {
534
+ internalType: "uint256",
535
+ name: "amount",
536
+ type: "uint256",
537
+ },
538
+ ],
539
+ internalType: "struct Variables.TokenInfo[]",
540
+ name: "supply",
541
+ type: "tuple[]",
542
+ },
543
+ {
544
+ components: [
545
+ {
546
+ internalType: "address",
547
+ name: "sourceToken",
548
+ type: "address",
549
+ },
550
+ {
551
+ internalType: "address",
552
+ name: "targetToken",
553
+ type: "address",
554
+ },
555
+ {
556
+ internalType: "uint256",
557
+ name: "amount",
558
+ type: "uint256",
559
+ },
560
+ ],
561
+ internalType: "struct Variables.TokenInfo[]",
562
+ name: "withdraw",
563
+ type: "tuple[]",
564
+ },
565
+ ],
566
+ internalType: "struct Variables.Position",
567
+ name: "position",
568
+ type: "tuple",
569
+ },
570
+ {
571
+ internalType: "uint256",
572
+ name: "safeRatioPercentage",
573
+ type: "uint256",
574
+ },
575
+ {
576
+ internalType: "bool",
577
+ name: "isTarget",
578
+ type: "bool",
579
+ },
580
+ ],
581
+ name: "checkAavePosition",
582
+ outputs: [
583
+ {
584
+ components: [
585
+ {
586
+ internalType: "bool",
587
+ name: "isOk",
588
+ type: "bool",
589
+ },
590
+ {
591
+ internalType: "uint256",
592
+ name: "ratio",
593
+ type: "uint256",
594
+ },
595
+ {
596
+ internalType: "uint256",
597
+ name: "maxRatio",
598
+ type: "uint256",
599
+ },
600
+ {
601
+ internalType: "uint256",
602
+ name: "maxLiquidationRatio",
603
+ type: "uint256",
604
+ },
605
+ {
606
+ internalType: "uint256",
607
+ name: "ltv",
608
+ type: "uint256",
609
+ },
610
+ {
611
+ internalType: "uint256",
612
+ name: "currentLiquidationThreshold",
613
+ type: "uint256",
614
+ },
615
+ {
616
+ internalType: "uint256",
617
+ name: "totalSupply",
618
+ type: "uint256",
619
+ },
620
+ {
621
+ internalType: "uint256",
622
+ name: "totalBorrow",
623
+ type: "uint256",
624
+ },
625
+ {
626
+ internalType: "uint256",
627
+ name: "price",
628
+ type: "uint256",
629
+ },
630
+ ],
631
+ internalType: "struct Helpers.PositionData",
632
+ name: "p",
633
+ type: "tuple",
634
+ },
635
+ ],
636
+ stateMutability: "view",
637
+ type: "function",
638
+ },
639
+ {
640
+ inputs: [
641
+ {
642
+ internalType: "address",
643
+ name: "userAddress",
644
+ type: "address",
645
+ },
646
+ {
647
+ components: [
648
+ {
649
+ internalType: "address",
650
+ name: "targetDsa",
651
+ type: "address",
652
+ },
653
+ {
654
+ internalType: "uint256[]",
655
+ name: "supplyAmts",
656
+ type: "uint256[]",
657
+ },
658
+ {
659
+ internalType: "uint256[]",
660
+ name: "borrowAmts",
661
+ type: "uint256[]",
662
+ },
663
+ {
664
+ internalType: "address[]",
665
+ name: "supplyTokens",
666
+ type: "address[]",
667
+ },
668
+ {
669
+ internalType: "address[]",
670
+ name: "borrowTokens",
671
+ type: "address[]",
672
+ },
673
+ ],
674
+ internalType: "struct Variables.AaveData",
675
+ name: "data",
676
+ type: "tuple",
677
+ },
678
+ {
679
+ internalType: "bool",
680
+ name: "isTarget",
681
+ type: "bool",
682
+ },
683
+ ],
684
+ name: "checkBorrowToken",
685
+ outputs: [
686
+ {
687
+ internalType: "uint256",
688
+ name: "totalBorrow",
689
+ type: "uint256",
690
+ },
691
+ {
692
+ internalType: "bool",
693
+ name: "isOk",
694
+ type: "bool",
695
+ },
696
+ ],
697
+ stateMutability: "view",
698
+ type: "function",
699
+ },
700
+ {
701
+ inputs: [
702
+ {
703
+ internalType: "address",
704
+ name: "liquidityAddress",
705
+ type: "address",
706
+ },
707
+ {
708
+ internalType: "address[]",
709
+ name: "tokens",
710
+ type: "address[]",
711
+ },
712
+ {
713
+ internalType: "uint256",
714
+ name: "totalSupply",
715
+ type: "uint256",
716
+ },
717
+ {
718
+ internalType: "uint256",
719
+ name: "totalBorrow",
720
+ type: "uint256",
721
+ },
722
+ {
723
+ internalType: "uint256",
724
+ name: "safeLiquidityRatioPercentage",
725
+ type: "uint256",
726
+ },
727
+ {
728
+ internalType: "bool",
729
+ name: "isTarget",
730
+ type: "bool",
731
+ },
732
+ ],
733
+ name: "checkLiquidity",
734
+ outputs: [
735
+ {
736
+ components: [
737
+ {
738
+ internalType: "bool",
739
+ name: "isOk",
740
+ type: "bool",
741
+ },
742
+ {
743
+ internalType: "uint256",
744
+ name: "ratio",
745
+ type: "uint256",
746
+ },
747
+ {
748
+ internalType: "uint256",
749
+ name: "maxRatio",
750
+ type: "uint256",
751
+ },
752
+ {
753
+ internalType: "uint256",
754
+ name: "maxLiquidationRatio",
755
+ type: "uint256",
756
+ },
757
+ {
758
+ internalType: "uint256",
759
+ name: "ltv",
760
+ type: "uint256",
761
+ },
762
+ {
763
+ internalType: "uint256",
764
+ name: "currentLiquidationThreshold",
765
+ type: "uint256",
766
+ },
767
+ {
768
+ internalType: "uint256",
769
+ name: "totalSupply",
770
+ type: "uint256",
771
+ },
772
+ {
773
+ internalType: "uint256",
774
+ name: "totalBorrow",
775
+ type: "uint256",
776
+ },
777
+ {
778
+ internalType: "uint256",
779
+ name: "price",
780
+ type: "uint256",
781
+ },
782
+ ],
783
+ internalType: "struct Helpers.PositionData",
784
+ name: "p",
785
+ type: "tuple",
786
+ },
787
+ ],
788
+ stateMutability: "view",
789
+ type: "function",
790
+ },
791
+ {
792
+ inputs: [
793
+ {
794
+ internalType: "address",
795
+ name: "user",
796
+ type: "address",
797
+ },
798
+ {
799
+ internalType: "address[]",
800
+ name: "tokens",
801
+ type: "address[]",
802
+ },
803
+ ],
804
+ name: "checkLiquidityToken",
805
+ outputs: [
806
+ {
807
+ internalType: "uint256",
808
+ name: "totalSupply",
809
+ type: "uint256",
810
+ },
811
+ {
812
+ internalType: "uint256",
813
+ name: "totalBorrow",
814
+ type: "uint256",
815
+ },
816
+ {
817
+ internalType: "uint256",
818
+ name: "totalMaxBorrow",
819
+ type: "uint256",
820
+ },
821
+ {
822
+ internalType: "uint256",
823
+ name: "totalMaxLiquidation",
824
+ type: "uint256",
825
+ },
826
+ ],
827
+ stateMutability: "view",
828
+ type: "function",
829
+ },
830
+ {
831
+ inputs: [
832
+ {
833
+ internalType: "address",
834
+ name: "userAddress",
835
+ type: "address",
836
+ },
837
+ {
838
+ components: [
839
+ {
840
+ internalType: "address",
841
+ name: "targetDsa",
842
+ type: "address",
843
+ },
844
+ {
845
+ internalType: "uint256[]",
846
+ name: "supplyAmts",
847
+ type: "uint256[]",
848
+ },
849
+ {
850
+ internalType: "uint256[]",
851
+ name: "borrowAmts",
852
+ type: "uint256[]",
853
+ },
854
+ {
855
+ internalType: "address[]",
856
+ name: "supplyTokens",
857
+ type: "address[]",
858
+ },
859
+ {
860
+ internalType: "address[]",
861
+ name: "borrowTokens",
862
+ type: "address[]",
863
+ },
864
+ ],
865
+ internalType: "struct Variables.AaveData",
866
+ name: "data",
867
+ type: "tuple",
868
+ },
869
+ {
870
+ internalType: "bool",
871
+ name: "isTarget",
872
+ type: "bool",
873
+ },
874
+ ],
875
+ name: "checkSupplyToken",
876
+ outputs: [
877
+ {
878
+ internalType: "uint256",
879
+ name: "totalSupply",
880
+ type: "uint256",
881
+ },
882
+ {
883
+ internalType: "uint256",
884
+ name: "totalMaxBorrow",
885
+ type: "uint256",
886
+ },
887
+ {
888
+ internalType: "uint256",
889
+ name: "totalMaxLiquidation",
890
+ type: "uint256",
891
+ },
892
+ {
893
+ internalType: "bool",
894
+ name: "isOk",
895
+ type: "bool",
896
+ },
897
+ ],
898
+ stateMutability: "view",
899
+ type: "function",
900
+ },
901
+ {
902
+ inputs: [
903
+ {
904
+ internalType: "address",
905
+ name: "user",
906
+ type: "address",
907
+ },
908
+ {
909
+ internalType: "uint256",
910
+ name: "totalBorrowMove",
911
+ type: "uint256",
912
+ },
913
+ {
914
+ internalType: "uint256",
915
+ name: "totalMaxLiquidationMove",
916
+ type: "uint256",
917
+ },
918
+ ],
919
+ name: "checkUserPositionAfterMigration",
920
+ outputs: [
921
+ {
922
+ internalType: "bool",
923
+ name: "isOk",
924
+ type: "bool",
925
+ },
926
+ ],
927
+ stateMutability: "view",
928
+ type: "function",
929
+ },
930
+ {
931
+ inputs: [
932
+ {
933
+ internalType: "address[]",
934
+ name: "_tokens",
935
+ type: "address[]",
936
+ },
937
+ ],
938
+ name: "getTokenInfos",
939
+ outputs: [
940
+ {
941
+ components: [
942
+ {
943
+ internalType: "uint256",
944
+ name: "decimals",
945
+ type: "uint256",
946
+ },
947
+ {
948
+ internalType: "uint256",
949
+ name: "ltv",
950
+ type: "uint256",
951
+ },
952
+ {
953
+ internalType: "uint256",
954
+ name: "tl",
955
+ type: "uint256",
956
+ },
957
+ {
958
+ internalType: "bool",
959
+ name: "enabledAsCollateral",
960
+ type: "bool",
961
+ },
962
+ {
963
+ internalType: "bool",
964
+ name: "borrowingEnabled",
965
+ type: "bool",
966
+ },
967
+ {
968
+ internalType: "bool",
969
+ name: "isActive",
970
+ type: "bool",
971
+ },
972
+ {
973
+ internalType: "bool",
974
+ name: "isFrozen",
975
+ type: "bool",
976
+ },
977
+ {
978
+ internalType: "uint256",
979
+ name: "availableLiquidity",
980
+ type: "uint256",
981
+ },
982
+ {
983
+ internalType: "uint256",
984
+ name: "totalOverallDebt",
985
+ type: "uint256",
986
+ },
987
+ ],
988
+ internalType: "struct Helpers.ReserveConfigData[]",
989
+ name: "reserveConfigData",
990
+ type: "tuple[]",
991
+ },
992
+ ],
993
+ stateMutability: "view",
994
+ type: "function",
995
+ },
996
+ {
997
+ inputs: [
998
+ {
999
+ internalType: "address[]",
1000
+ name: "tokens",
1001
+ type: "address[]",
1002
+ },
1003
+ ],
1004
+ name: "getTokensPrices",
1005
+ outputs: [
1006
+ {
1007
+ internalType: "uint256[]",
1008
+ name: "tokenPricesInEth",
1009
+ type: "uint256[]",
1010
+ },
1011
+ ],
1012
+ stateMutability: "view",
1013
+ type: "function",
1014
+ },
1015
+ {
1016
+ inputs: [],
1017
+ name: "instaIndex",
1018
+ outputs: [
1019
+ {
1020
+ internalType: "contract IndexInterface",
1021
+ name: "",
1022
+ type: "address",
1023
+ },
1024
+ ],
1025
+ stateMutability: "view",
1026
+ type: "function",
1027
+ },
1028
+ {
1029
+ inputs: [
1030
+ {
1031
+ internalType: "address",
1032
+ name: "user",
1033
+ type: "address",
1034
+ },
1035
+ {
1036
+ internalType: "uint256",
1037
+ name: "safeRatioPercentage",
1038
+ type: "uint256",
1039
+ },
1040
+ ],
1041
+ name: "isPositionSafe",
1042
+ outputs: [
1043
+ {
1044
+ internalType: "bool",
1045
+ name: "isOk",
1046
+ type: "bool",
1047
+ },
1048
+ {
1049
+ internalType: "uint256",
1050
+ name: "userTl",
1051
+ type: "uint256",
1052
+ },
1053
+ {
1054
+ internalType: "uint256",
1055
+ name: "userLtv",
1056
+ type: "uint256",
1057
+ },
1058
+ ],
1059
+ stateMutability: "view",
1060
+ type: "function",
1061
+ },
1062
+ {
1063
+ inputs: [],
1064
+ name: "nativeToken",
1065
+ outputs: [
1066
+ {
1067
+ internalType: "address",
1068
+ name: "",
1069
+ type: "address",
1070
+ },
1071
+ ],
1072
+ stateMutability: "view",
1073
+ type: "function",
1074
+ },
1075
+ {
1076
+ inputs: [
1077
+ {
1078
+ components: [
1079
+ {
1080
+ components: [
1081
+ {
1082
+ internalType: "address",
1083
+ name: "sourceToken",
1084
+ type: "address",
1085
+ },
1086
+ {
1087
+ internalType: "address",
1088
+ name: "targetToken",
1089
+ type: "address",
1090
+ },
1091
+ {
1092
+ internalType: "uint256",
1093
+ name: "amount",
1094
+ type: "uint256",
1095
+ },
1096
+ ],
1097
+ internalType: "struct Variables.TokenInfo[]",
1098
+ name: "supply",
1099
+ type: "tuple[]",
1100
+ },
1101
+ {
1102
+ components: [
1103
+ {
1104
+ internalType: "address",
1105
+ name: "sourceToken",
1106
+ type: "address",
1107
+ },
1108
+ {
1109
+ internalType: "address",
1110
+ name: "targetToken",
1111
+ type: "address",
1112
+ },
1113
+ {
1114
+ internalType: "uint256",
1115
+ name: "amount",
1116
+ type: "uint256",
1117
+ },
1118
+ ],
1119
+ internalType: "struct Variables.TokenInfo[]",
1120
+ name: "withdraw",
1121
+ type: "tuple[]",
1122
+ },
1123
+ ],
1124
+ internalType: "struct Variables.Position",
1125
+ name: "position",
1126
+ type: "tuple",
1127
+ },
1128
+ {
1129
+ internalType: "bool",
1130
+ name: "isTarget",
1131
+ type: "bool",
1132
+ },
1133
+ ],
1134
+ name: "sortData",
1135
+ outputs: [
1136
+ {
1137
+ components: [
1138
+ {
1139
+ internalType: "address",
1140
+ name: "targetDsa",
1141
+ type: "address",
1142
+ },
1143
+ {
1144
+ internalType: "uint256[]",
1145
+ name: "supplyAmts",
1146
+ type: "uint256[]",
1147
+ },
1148
+ {
1149
+ internalType: "uint256[]",
1150
+ name: "borrowAmts",
1151
+ type: "uint256[]",
1152
+ },
1153
+ {
1154
+ internalType: "address[]",
1155
+ name: "supplyTokens",
1156
+ type: "address[]",
1157
+ },
1158
+ {
1159
+ internalType: "address[]",
1160
+ name: "borrowTokens",
1161
+ type: "address[]",
1162
+ },
1163
+ ],
1164
+ internalType: "struct Variables.AaveData",
1165
+ name: "aaveData",
1166
+ type: "tuple",
1167
+ },
1168
+ ],
1169
+ stateMutability: "view",
1170
+ type: "function",
1171
+ },
1172
+ {
1173
+ inputs: [],
1174
+ name: "wnativeToken",
1175
+ outputs: [
1176
+ {
1177
+ internalType: "address",
1178
+ name: "",
1179
+ type: "address",
1180
+ },
1181
+ ],
1182
+ stateMutability: "view",
1183
+ type: "function",
1184
+ },
1185
+ ];
1186
+
1187
+ export class AaveV2Resolver__factory {
1188
+ static readonly abi = _abi;
1189
+ static createInterface(): AaveV2ResolverInterface {
1190
+ return new utils.Interface(_abi) as AaveV2ResolverInterface;
1191
+ }
1192
+ static connect(
1193
+ address: string,
1194
+ signerOrProvider: Signer | Provider
1195
+ ): AaveV2Resolver {
1196
+ return new Contract(address, _abi, signerOrProvider) as AaveV2Resolver;
1197
+ }
1198
+ }