@defisaver/automation-sdk 3.3.17 → 3.3.18-spark-eoa-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/constants/index.js +170 -0
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +5 -2
- package/cjs/services/ethereumService.test.js +4 -7
- package/cjs/services/strategiesService.js +195 -15
- package/cjs/services/strategySubService.d.ts +22 -17
- package/cjs/services/strategySubService.js +92 -28
- package/cjs/services/strategySubService.test.js +297 -40
- package/cjs/services/subDataService.d.ts +108 -20
- package/cjs/services/subDataService.js +97 -79
- package/cjs/services/subDataService.test.js +479 -174
- package/cjs/types/enums.d.ts +44 -6
- package/cjs/types/enums.js +38 -0
- package/esm/constants/index.js +170 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.js +5 -2
- package/esm/services/ethereumService.test.js +4 -7
- package/esm/services/strategiesService.js +195 -15
- package/esm/services/strategySubService.d.ts +22 -17
- package/esm/services/strategySubService.js +91 -27
- package/esm/services/strategySubService.test.js +298 -38
- package/esm/services/subDataService.d.ts +108 -20
- package/esm/services/subDataService.js +95 -77
- package/esm/services/subDataService.test.js +480 -172
- package/esm/types/enums.d.ts +44 -6
- package/esm/types/enums.js +38 -0
- package/package.json +1 -1
- package/src/constants/index.ts +172 -1
- package/src/index.ts +22 -6
- package/src/services/ethereumService.test.ts +5 -8
- package/src/services/strategiesService.ts +262 -16
- package/src/services/strategySubService.test.ts +384 -46
- package/src/services/strategySubService.ts +251 -40
- package/src/services/subDataService.test.ts +639 -231
- package/src/services/subDataService.ts +149 -106
- package/src/services/utils.test.ts +1 -1
- package/src/services/utils.ts +3 -1
- package/src/types/enums.ts +38 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthereumAddress } from '../types';
|
|
2
|
-
import type { CloseStrategyType
|
|
2
|
+
import type { CloseStrategyType } from '../types/enums';
|
|
3
3
|
import { ChainId, RatioState } from '../types/enums';
|
|
4
4
|
/**
|
|
5
5
|
_______ _______ .______ .______ _______ ______ ___ .___________. _______ _______
|
|
@@ -10,13 +10,11 @@ import { ChainId, RatioState } from '../types/enums';
|
|
|
10
10
|
|_______/ |_______|| _| | _| `._____||_______| \______/__/ \__\ |__| |_______||_______/
|
|
11
11
|
*/
|
|
12
12
|
export declare const morphoAaveV2LeverageManagementSubData: {
|
|
13
|
-
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
14
13
|
decode(subData: string[]): {
|
|
15
14
|
targetRatio: number;
|
|
16
15
|
};
|
|
17
16
|
};
|
|
18
17
|
export declare const cBondsRebondSubData: {
|
|
19
|
-
encode(bondId: number | string): string[];
|
|
20
18
|
decode(subData: string[]): {
|
|
21
19
|
bondId: string;
|
|
22
20
|
};
|
|
@@ -57,13 +55,21 @@ export declare const makerCloseSubData: {
|
|
|
57
55
|
closeToAssetAddr: EthereumAddress;
|
|
58
56
|
};
|
|
59
57
|
};
|
|
60
|
-
export declare const
|
|
58
|
+
export declare const legacyMakerLeverageManagementSubData: {
|
|
61
59
|
decode: (subData: string[]) => {
|
|
62
60
|
vaultId: number;
|
|
63
61
|
targetRatio: number;
|
|
64
62
|
};
|
|
65
63
|
};
|
|
66
|
-
export declare const
|
|
64
|
+
export declare const makerLeverageManagementSubData: {
|
|
65
|
+
encode(vaultId: number, targetRatio: number, daiAddr?: EthereumAddress): string[];
|
|
66
|
+
decode(subData: string[]): {
|
|
67
|
+
vaultId: number;
|
|
68
|
+
targetRatio: number;
|
|
69
|
+
daiAddr: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const makerLiquidationProtectionSubData: {
|
|
67
73
|
encode(vaultId: number, targetRatio: number, daiAddr?: EthereumAddress): string[];
|
|
68
74
|
decode(subData: string[]): {
|
|
69
75
|
vaultId: number;
|
|
@@ -84,12 +90,12 @@ export declare const liquityRepayFromSavingsSubData: {
|
|
|
84
90
|
targetRatio: number;
|
|
85
91
|
};
|
|
86
92
|
};
|
|
87
|
-
export declare const
|
|
93
|
+
export declare const legacyLiquityLeverageManagementSubData: {
|
|
88
94
|
decode: (subData: string[]) => {
|
|
89
95
|
targetRatio: number;
|
|
90
96
|
};
|
|
91
97
|
};
|
|
92
|
-
export declare const
|
|
98
|
+
export declare const liquityLeverageManagementSubData: {
|
|
93
99
|
encode(targetRatio: number, ratioState: RatioState): string[];
|
|
94
100
|
decode(subData: string[]): {
|
|
95
101
|
targetRatio: number;
|
|
@@ -178,13 +184,12 @@ export declare const liquityV2PaybackSubData: {
|
|
|
178
184
|
/ _____ \ / _____ \ \ / | |____ \ / / /_
|
|
179
185
|
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____|
|
|
180
186
|
*/
|
|
181
|
-
export declare const
|
|
182
|
-
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
187
|
+
export declare const legacyAaveV2LeverageManagementSubData: {
|
|
183
188
|
decode(subData: string[]): {
|
|
184
189
|
targetRatio: number;
|
|
185
190
|
};
|
|
186
191
|
};
|
|
187
|
-
export declare const
|
|
192
|
+
export declare const aaveV2LeverageManagementSubData: {
|
|
188
193
|
encode(market: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
|
|
189
194
|
decode(subData: string[]): {
|
|
190
195
|
market: EthereumAddress;
|
|
@@ -200,12 +205,19 @@ export declare const aaveV2LeverageManagementSubDataWithoutSubProxy: {
|
|
|
200
205
|
/ _____ \ / _____ \ \ / | |____ \ / ___) |
|
|
201
206
|
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____/
|
|
202
207
|
*/
|
|
208
|
+
export declare const legacyAaveV3LeverageManagementSubData: {
|
|
209
|
+
decode(subData: string[]): {
|
|
210
|
+
targetRatio: number;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
203
213
|
export declare const aaveV3LeverageManagementSubData: {
|
|
214
|
+
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress, isGeneric: boolean): string[];
|
|
204
215
|
decode(subData: string[]): {
|
|
205
216
|
targetRatio: number;
|
|
217
|
+
ratioState: RatioState;
|
|
206
218
|
};
|
|
207
219
|
};
|
|
208
|
-
export declare const
|
|
220
|
+
export declare const aaveV3LiquidationProtectionSubData: {
|
|
209
221
|
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress, isGeneric: boolean): string[];
|
|
210
222
|
decode(subData: string[]): {
|
|
211
223
|
targetRatio: number;
|
|
@@ -284,6 +296,15 @@ export declare const aaveV4LeverageManagementSubData: {
|
|
|
284
296
|
targetRatio: number;
|
|
285
297
|
};
|
|
286
298
|
};
|
|
299
|
+
export declare const aaveV4LiquidationProtectionSubData: {
|
|
300
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
301
|
+
decode: (subData: string[]) => {
|
|
302
|
+
spoke: string;
|
|
303
|
+
owner: string;
|
|
304
|
+
ratioState: RatioState;
|
|
305
|
+
targetRatio: number;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
287
308
|
export declare const aaveV4LeverageManagementOnPriceSubData: {
|
|
288
309
|
encode: (spoke: EthereumAddress, owner: EthereumAddress, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, ratioState: RatioState, targetRatio: number) => string[];
|
|
289
310
|
decode: (subData: string[]) => {
|
|
@@ -329,13 +350,12 @@ export declare const aaveV4CollateralSwitchSubData: {
|
|
|
329
350
|
| `----.| `--' | | | | | | | \ / / /_
|
|
330
351
|
\______| \______/ |__| |__| | _| \__/ |____|
|
|
331
352
|
*/
|
|
332
|
-
export declare const
|
|
333
|
-
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
353
|
+
export declare const legacyCompoundV2LeverageManagementSubData: {
|
|
334
354
|
decode(subData: string[]): {
|
|
335
355
|
targetRatio: number;
|
|
336
356
|
};
|
|
337
357
|
};
|
|
338
|
-
export declare const
|
|
358
|
+
export declare const compoundV2LeverageManagementSubData: {
|
|
339
359
|
encode(targetRatio: number, ratioState: RatioState): string[];
|
|
340
360
|
decode(subData: string[]): {
|
|
341
361
|
targetRatio: number;
|
|
@@ -351,12 +371,15 @@ export declare const compoundV2LeverageManagementSubDataWithoutSubProxy: {
|
|
|
351
371
|
\______| \______/ |__| |__| | _| \__/ |____/
|
|
352
372
|
*/
|
|
353
373
|
export declare const compoundV3LeverageManagementSubData: {
|
|
354
|
-
encode(market: EthereumAddress, baseToken: EthereumAddress,
|
|
374
|
+
encode(market: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
|
|
355
375
|
decode(subData: string[]): {
|
|
376
|
+
market: EthereumAddress;
|
|
377
|
+
baseToken: EthereumAddress;
|
|
356
378
|
targetRatio: number;
|
|
379
|
+
ratioState: RatioState;
|
|
357
380
|
};
|
|
358
381
|
};
|
|
359
|
-
export declare const
|
|
382
|
+
export declare const compoundV3LiquidationProtectionSubData: {
|
|
360
383
|
encode(market: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
|
|
361
384
|
decode(subData: string[]): {
|
|
362
385
|
market: EthereumAddress;
|
|
@@ -403,15 +426,14 @@ export declare const exchangeDcaSubData: {
|
|
|
403
426
|
interval: string;
|
|
404
427
|
};
|
|
405
428
|
};
|
|
406
|
-
export declare const
|
|
407
|
-
encode(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, targetPrice: string, goodUntil: string | number, orderType: OrderType): string[];
|
|
429
|
+
export declare const legacyExchangeLimitOrderSubData: {
|
|
408
430
|
decode: (subData: string[], chainId: ChainId) => {
|
|
409
431
|
fromToken: string;
|
|
410
432
|
toToken: string;
|
|
411
433
|
amount: string;
|
|
412
434
|
};
|
|
413
435
|
};
|
|
414
|
-
export declare const
|
|
436
|
+
export declare const exchangeLimitOrderSubData: {
|
|
415
437
|
encode(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string): string[];
|
|
416
438
|
decode: (subData: string[], chainId: ChainId) => {
|
|
417
439
|
fromToken: string;
|
|
@@ -427,18 +449,39 @@ export declare const exchangeLimitOrderSubDataWithoutSubProxy: {
|
|
|
427
449
|
.----) | | | / _____ \ | |\ \----.| . \
|
|
428
450
|
|_______/ | _| /__/ \__\ | _| `._____||__|\__\
|
|
429
451
|
*/
|
|
452
|
+
export declare const legacySparkLeverageManagementSubData: {
|
|
453
|
+
decode(subData: string[]): {
|
|
454
|
+
targetRatio: number;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
430
457
|
export declare const sparkLeverageManagementSubData: {
|
|
458
|
+
encode(targetRatio: number, ratioState: RatioState): string[];
|
|
431
459
|
decode(subData: string[]): {
|
|
432
460
|
targetRatio: number;
|
|
461
|
+
ratioState: RatioState;
|
|
433
462
|
};
|
|
434
463
|
};
|
|
435
|
-
export declare const
|
|
464
|
+
export declare const sparkLiquidationProtectionSubData: {
|
|
436
465
|
encode(targetRatio: number, ratioState: RatioState): string[];
|
|
437
466
|
decode(subData: string[]): {
|
|
438
467
|
targetRatio: number;
|
|
439
468
|
ratioState: RatioState;
|
|
440
469
|
};
|
|
441
470
|
};
|
|
471
|
+
export declare const sparkGenericLeverageManagementSubData: {
|
|
472
|
+
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress): string[];
|
|
473
|
+
decode(subData: string[]): {
|
|
474
|
+
targetRatio: number;
|
|
475
|
+
ratioState: RatioState;
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
export declare const sparkGenericLiquidationProtectionSubData: {
|
|
479
|
+
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress): string[];
|
|
480
|
+
decode(subData: string[]): {
|
|
481
|
+
targetRatio: number;
|
|
482
|
+
ratioState: RatioState;
|
|
483
|
+
};
|
|
484
|
+
};
|
|
442
485
|
export declare const sparkCloseGenericSubData: {
|
|
443
486
|
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, closeType: CloseStrategyType, marketAddr: EthereumAddress, user: EthereumAddress): string[];
|
|
444
487
|
decode(subData: string[]): {
|
|
@@ -462,6 +505,18 @@ export declare const sparkLeverageManagementOnPriceSubData: {
|
|
|
462
505
|
targetRatio: number;
|
|
463
506
|
};
|
|
464
507
|
};
|
|
508
|
+
export declare const sparkLeverageManagementOnPriceGenericSubData: {
|
|
509
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number, user: EthereumAddress): string[];
|
|
510
|
+
decode(subData: string[]): {
|
|
511
|
+
collAsset: string;
|
|
512
|
+
collAssetId: number;
|
|
513
|
+
debtAsset: string;
|
|
514
|
+
debtAssetId: number;
|
|
515
|
+
marketAddr: string;
|
|
516
|
+
targetRatio: number;
|
|
517
|
+
user: string;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
465
520
|
export declare const sparkCollateralSwitchSubData: {
|
|
466
521
|
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string, useOnBehalf?: boolean): string[];
|
|
467
522
|
decode(subData: string[]): {
|
|
@@ -473,6 +528,18 @@ export declare const sparkCollateralSwitchSubData: {
|
|
|
473
528
|
amountToSwitch: string;
|
|
474
529
|
};
|
|
475
530
|
};
|
|
531
|
+
export declare const sparkGenericFLCollateralSwitchSubData: {
|
|
532
|
+
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string, user: EthereumAddress): string[];
|
|
533
|
+
decode(subData: string[]): {
|
|
534
|
+
fromAsset: EthereumAddress;
|
|
535
|
+
fromAssetId: number;
|
|
536
|
+
toAsset: EthereumAddress;
|
|
537
|
+
toAssetId: number;
|
|
538
|
+
marketAddr: EthereumAddress;
|
|
539
|
+
amountToSwitch: string;
|
|
540
|
+
user: EthereumAddress;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
476
543
|
/**
|
|
477
544
|
______ .______ ____ ____ __ __ _______. _______
|
|
478
545
|
/ || _ \ \ \ / / | | | | / || \
|
|
@@ -517,6 +584,18 @@ export declare const morphoBlueLeverageManagementSubData: {
|
|
|
517
584
|
targetRatio: number;
|
|
518
585
|
};
|
|
519
586
|
};
|
|
587
|
+
export declare const morphoBlueLiquidationProtectionSubData: {
|
|
588
|
+
encode: (loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, ratioState: RatioState, targetRatio: number, user: EthereumAddress, isEOA: boolean) => string[];
|
|
589
|
+
decode: (subData: string[]) => {
|
|
590
|
+
loanToken: string;
|
|
591
|
+
collToken: string;
|
|
592
|
+
oracle: string;
|
|
593
|
+
irm: string;
|
|
594
|
+
lltv: string;
|
|
595
|
+
user: string;
|
|
596
|
+
targetRatio: number;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
520
599
|
export declare const morphoBlueLeverageManagementOnPriceSubData: {
|
|
521
600
|
encode(loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, targetRatio: number, user: EthereumAddress): string[];
|
|
522
601
|
decode(subData: string[]): {
|
|
@@ -558,3 +637,12 @@ export declare const fluidLeverageManagementSubData: {
|
|
|
558
637
|
targetRatio: number;
|
|
559
638
|
};
|
|
560
639
|
};
|
|
640
|
+
export declare const fluidLiquidationProtectionSubData: {
|
|
641
|
+
encode: (nftId: string, vault: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
642
|
+
decode: (subData: string[]) => {
|
|
643
|
+
nftId: string;
|
|
644
|
+
vault: string;
|
|
645
|
+
ratioState: RatioState;
|
|
646
|
+
targetRatio: number;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.fluidLeverageManagementSubData = void 0;
|
|
6
|
+
exports.sparkLeverageManagementOnPriceSubData = exports.sparkCloseGenericSubData = exports.sparkGenericLiquidationProtectionSubData = exports.sparkGenericLeverageManagementSubData = exports.sparkLiquidationProtectionSubData = exports.sparkLeverageManagementSubData = exports.legacySparkLeverageManagementSubData = exports.exchangeLimitOrderSubData = exports.legacyExchangeLimitOrderSubData = exports.exchangeDcaSubData = exports.compoundV3CloseSubData = exports.compoundV3LeverageManagementOnPriceSubData = exports.compoundV3LiquidationProtectionSubData = exports.compoundV3LeverageManagementSubData = exports.compoundV2LeverageManagementSubData = exports.legacyCompoundV2LeverageManagementSubData = exports.aaveV4CollateralSwitchSubData = exports.aaveV4CloseSubData = exports.aaveV4LeverageManagementOnPriceSubData = exports.aaveV4LiquidationProtectionSubData = exports.aaveV4LeverageManagementSubData = exports.aaveV3LeverageManagementOnPriceSubData = exports.aaveV3QuotePriceSubData = exports.aaveV3CollateralSwitchSubData = exports.aaveV3CloseGenericSubData = exports.aaveV3LeverageManagementOnPriceGeneric = exports.aaveV3LiquidationProtectionSubData = exports.aaveV3LeverageManagementSubData = exports.legacyAaveV3LeverageManagementSubData = exports.aaveV2LeverageManagementSubData = exports.legacyAaveV2LeverageManagementSubData = exports.liquityV2PaybackSubData = exports.liquityV2LeverageManagementOnPriceSubData = exports.liquityV2CloseSubData = exports.liquityV2LeverageManagementSubData = exports.liquityDebtInFrontRepaySubData = exports.liquityDsrSupplySubData = exports.liquityDsrPaybackSubData = exports.liquityCloseSubData = exports.liquityLeverageManagementSubData = exports.legacyLiquityLeverageManagementSubData = exports.liquityRepayFromSavingsSubData = exports.makerLiquidationProtectionSubData = exports.makerLeverageManagementSubData = exports.legacyMakerLeverageManagementSubData = exports.makerCloseSubData = exports.makerRepayFromSavingsSubData = exports.liquityPaybackUsingChickenBondSubData = exports.cBondsRebondSubData = exports.morphoAaveV2LeverageManagementSubData = void 0;
|
|
7
|
+
exports.fluidLiquidationProtectionSubData = exports.fluidLeverageManagementSubData = exports.morphoBlueCloseOnPriceSubData = exports.morphoBlueLeverageManagementOnPriceSubData = exports.morphoBlueLiquidationProtectionSubData = exports.morphoBlueLeverageManagementSubData = exports.crvUSDPaybackSubData = exports.crvUSDLeverageManagementSubData = exports.sparkGenericFLCollateralSwitchSubData = exports.sparkCollateralSwitchSubData = exports.sparkLeverageManagementOnPriceGenericSubData = void 0;
|
|
8
8
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
9
9
|
const web3_eth_abi_1 = __importDefault(require("web3-eth-abi"));
|
|
10
10
|
const web3_utils_1 = require("web3-utils");
|
|
@@ -22,16 +22,6 @@ const utils_1 = require("./utils");
|
|
|
22
22
|
|_______/ |_______|| _| | _| `._____||_______| \______/__/ \__\ |__| |_______||_______/
|
|
23
23
|
*/
|
|
24
24
|
exports.morphoAaveV2LeverageManagementSubData = {
|
|
25
|
-
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
26
|
-
return [
|
|
27
|
-
(0, utils_1.ratioPercentageToWei)(triggerRepayRatio),
|
|
28
|
-
(0, utils_1.ratioPercentageToWei)(triggerBoostRatio),
|
|
29
|
-
(0, utils_1.ratioPercentageToWei)(targetBoostRatio),
|
|
30
|
-
(0, utils_1.ratioPercentageToWei)(targetRepayRatio),
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
boostEnabled,
|
|
33
|
-
];
|
|
34
|
-
},
|
|
35
25
|
decode(subData) {
|
|
36
26
|
const ratioWei = web3_eth_abi_1.default.decodeParameter('uint128', subData[1]);
|
|
37
27
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(ratioWei);
|
|
@@ -39,10 +29,6 @@ exports.morphoAaveV2LeverageManagementSubData = {
|
|
|
39
29
|
},
|
|
40
30
|
};
|
|
41
31
|
exports.cBondsRebondSubData = {
|
|
42
|
-
encode(bondId) {
|
|
43
|
-
const bondIdEncoded = web3_eth_abi_1.default.encodeParameter('uint256', bondId);
|
|
44
|
-
return [bondIdEncoded];
|
|
45
|
-
},
|
|
46
32
|
decode(subData) {
|
|
47
33
|
const bondId = web3_eth_abi_1.default.decodeParameter('uint256', subData[1]).toString();
|
|
48
34
|
return { bondId };
|
|
@@ -124,7 +110,7 @@ exports.makerCloseSubData = {
|
|
|
124
110
|
};
|
|
125
111
|
},
|
|
126
112
|
};
|
|
127
|
-
exports.
|
|
113
|
+
exports.legacyMakerLeverageManagementSubData = {
|
|
128
114
|
decode: (subData) => {
|
|
129
115
|
const vaultId = +web3_eth_abi_1.default.decodeParameter('uint256', subData[0]).toString();
|
|
130
116
|
const weiRatio = web3_eth_abi_1.default.decodeParameter('uint256', subData[1]);
|
|
@@ -132,7 +118,7 @@ exports.makerLeverageManagementSubData = {
|
|
|
132
118
|
return { vaultId, targetRatio };
|
|
133
119
|
},
|
|
134
120
|
};
|
|
135
|
-
exports.
|
|
121
|
+
exports.makerLeverageManagementSubData = {
|
|
136
122
|
encode(vaultId, targetRatio, daiAddr) {
|
|
137
123
|
const encodedVaultId = web3_eth_abi_1.default.encodeParameter('uint256', vaultId);
|
|
138
124
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
@@ -146,6 +132,7 @@ exports.makerLeverageManagementWithoutSubProxy = {
|
|
|
146
132
|
return { vaultId, targetRatio, daiAddr };
|
|
147
133
|
},
|
|
148
134
|
};
|
|
135
|
+
exports.makerLiquidationProtectionSubData = exports.makerLeverageManagementSubData;
|
|
149
136
|
/**
|
|
150
137
|
__ __ ______ __ __ __ .___________.____ ____ ____ ____ __
|
|
151
138
|
| | | | / __ \ | | | | | | | |\ \ / / \ \ / / /_ |
|
|
@@ -161,14 +148,14 @@ exports.liquityRepayFromSavingsSubData = {
|
|
|
161
148
|
return { targetRatio };
|
|
162
149
|
},
|
|
163
150
|
};
|
|
164
|
-
exports.
|
|
151
|
+
exports.legacyLiquityLeverageManagementSubData = {
|
|
165
152
|
decode: (subData) => {
|
|
166
153
|
const weiRatio = web3_eth_abi_1.default.decodeParameter('uint256', subData[1]);
|
|
167
154
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(weiRatio);
|
|
168
155
|
return { targetRatio };
|
|
169
156
|
},
|
|
170
157
|
};
|
|
171
|
-
exports.
|
|
158
|
+
exports.liquityLeverageManagementSubData = {
|
|
172
159
|
encode(targetRatio, ratioState) {
|
|
173
160
|
const encodedRatioState = web3_eth_abi_1.default.encodeParameter('uint8', ratioState);
|
|
174
161
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
@@ -399,24 +386,14 @@ exports.liquityV2PaybackSubData = {
|
|
|
399
386
|
/ _____ \ / _____ \ \ / | |____ \ / / /_
|
|
400
387
|
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____|
|
|
401
388
|
*/
|
|
402
|
-
exports.
|
|
403
|
-
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
404
|
-
return [
|
|
405
|
-
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
406
|
-
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
407
|
-
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
408
|
-
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
409
|
-
// @ts-ignore // TODO
|
|
410
|
-
boostEnabled,
|
|
411
|
-
];
|
|
412
|
-
},
|
|
389
|
+
exports.legacyAaveV2LeverageManagementSubData = {
|
|
413
390
|
decode(subData) {
|
|
414
391
|
const ratioWei = web3_eth_abi_1.default.decodeParameter('uint256', subData[1]);
|
|
415
392
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(ratioWei);
|
|
416
393
|
return { targetRatio };
|
|
417
394
|
},
|
|
418
395
|
};
|
|
419
|
-
exports.
|
|
396
|
+
exports.aaveV2LeverageManagementSubData = {
|
|
420
397
|
encode(market, targetRatio, ratioState) {
|
|
421
398
|
const encodedMarket = web3_eth_abi_1.default.encodeParameter('address', market);
|
|
422
399
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
@@ -443,14 +420,14 @@ exports.aaveV2LeverageManagementSubDataWithoutSubProxy = {
|
|
|
443
420
|
/ _____ \ / _____ \ \ / | |____ \ / ___) |
|
|
444
421
|
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____/
|
|
445
422
|
*/
|
|
446
|
-
exports.
|
|
423
|
+
exports.legacyAaveV3LeverageManagementSubData = {
|
|
447
424
|
decode(subData) {
|
|
448
425
|
const ratioWei = web3_eth_abi_1.default.decodeParameter('uint256', subData[0]);
|
|
449
426
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(ratioWei);
|
|
450
427
|
return { targetRatio };
|
|
451
428
|
},
|
|
452
429
|
};
|
|
453
|
-
exports.
|
|
430
|
+
exports.aaveV3LeverageManagementSubData = {
|
|
454
431
|
encode(targetRatio, ratioState, market, user, isGeneric) {
|
|
455
432
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
456
433
|
const encodedRatioState = web3_eth_abi_1.default.encodeParameter('uint8', ratioState);
|
|
@@ -469,6 +446,7 @@ exports.aaveV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
469
446
|
return { targetRatio, ratioState };
|
|
470
447
|
},
|
|
471
448
|
};
|
|
449
|
+
exports.aaveV3LiquidationProtectionSubData = exports.aaveV3LeverageManagementSubData;
|
|
472
450
|
exports.aaveV3LeverageManagementOnPriceGeneric = {
|
|
473
451
|
encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user) {
|
|
474
452
|
const encodedColl = web3_eth_abi_1.default.encodeParameter('address', collAsset);
|
|
@@ -656,6 +634,7 @@ exports.aaveV4LeverageManagementSubData = {
|
|
|
656
634
|
};
|
|
657
635
|
},
|
|
658
636
|
};
|
|
637
|
+
exports.aaveV4LiquidationProtectionSubData = exports.aaveV4LeverageManagementSubData;
|
|
659
638
|
exports.aaveV4LeverageManagementOnPriceSubData = {
|
|
660
639
|
encode: (spoke, owner, collAsset, collAssetId, debtAsset, debtAssetId, ratioState, targetRatio) => {
|
|
661
640
|
const spokeEncoded = web3_eth_abi_1.default.encodeParameter('address', spoke);
|
|
@@ -772,24 +751,14 @@ exports.aaveV4CollateralSwitchSubData = {
|
|
|
772
751
|
| `----.| `--' | | | | | | | \ / / /_
|
|
773
752
|
\______| \______/ |__| |__| | _| \__/ |____|
|
|
774
753
|
*/
|
|
775
|
-
exports.
|
|
776
|
-
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
777
|
-
return [
|
|
778
|
-
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
779
|
-
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
780
|
-
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
781
|
-
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
782
|
-
// @ts-ignore // TODO
|
|
783
|
-
boostEnabled,
|
|
784
|
-
];
|
|
785
|
-
},
|
|
754
|
+
exports.legacyCompoundV2LeverageManagementSubData = {
|
|
786
755
|
decode(subData) {
|
|
787
756
|
const weiRatio = web3_eth_abi_1.default.decodeParameter('uint256', subData[0]);
|
|
788
757
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(weiRatio);
|
|
789
758
|
return { targetRatio };
|
|
790
759
|
},
|
|
791
760
|
};
|
|
792
|
-
exports.
|
|
761
|
+
exports.compoundV2LeverageManagementSubData = {
|
|
793
762
|
encode(targetRatio, ratioState) {
|
|
794
763
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
795
764
|
const encodedRatioState = web3_eth_abi_1.default.encodeParameter('uint8', ratioState);
|
|
@@ -815,25 +784,6 @@ exports.compoundV2LeverageManagementSubDataWithoutSubProxy = {
|
|
|
815
784
|
\______| \______/ |__| |__| | _| \__/ |____/
|
|
816
785
|
*/
|
|
817
786
|
exports.compoundV3LeverageManagementSubData = {
|
|
818
|
-
encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
819
|
-
return [
|
|
820
|
-
market,
|
|
821
|
-
baseToken,
|
|
822
|
-
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
823
|
-
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
824
|
-
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
825
|
-
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
826
|
-
// @ts-ignore // TODO
|
|
827
|
-
boostEnabled, isEOA,
|
|
828
|
-
];
|
|
829
|
-
},
|
|
830
|
-
decode(subData) {
|
|
831
|
-
const weiRatio = web3_eth_abi_1.default.decodeParameter('uint256', subData[3]);
|
|
832
|
-
const targetRatio = (0, utils_1.weiToRatioPercentage)(weiRatio);
|
|
833
|
-
return { targetRatio };
|
|
834
|
-
},
|
|
835
|
-
};
|
|
836
|
-
exports.compoundV3LeverageManagementSubDataWithoutSubProxy = {
|
|
837
787
|
encode(market, baseToken, targetRatio, ratioState) {
|
|
838
788
|
const encodedMarket = web3_eth_abi_1.default.encodeParameter('address', market);
|
|
839
789
|
const encodedBaseToken = web3_eth_abi_1.default.encodeParameter('address', baseToken);
|
|
@@ -851,6 +801,7 @@ exports.compoundV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
851
801
|
};
|
|
852
802
|
},
|
|
853
803
|
};
|
|
804
|
+
exports.compoundV3LiquidationProtectionSubData = exports.compoundV3LeverageManagementSubData;
|
|
854
805
|
exports.compoundV3LeverageManagementOnPriceSubData = {
|
|
855
806
|
encode(market, collToken, baseToken, targetRatio, ratioState, user) {
|
|
856
807
|
const marketEncoded = web3_eth_abi_1.default.encodeParameter('address', market);
|
|
@@ -936,17 +887,7 @@ exports.exchangeDcaSubData = {
|
|
|
936
887
|
};
|
|
937
888
|
},
|
|
938
889
|
};
|
|
939
|
-
exports.
|
|
940
|
-
encode(fromToken, toToken, amount, targetPrice, goodUntil, orderType) {
|
|
941
|
-
return [
|
|
942
|
-
fromToken,
|
|
943
|
-
toToken,
|
|
944
|
-
amount,
|
|
945
|
-
targetPrice,
|
|
946
|
-
new decimal_js_1.default(goodUntil).toString(),
|
|
947
|
-
new decimal_js_1.default(orderType).toString(),
|
|
948
|
-
];
|
|
949
|
-
},
|
|
890
|
+
exports.legacyExchangeLimitOrderSubData = {
|
|
950
891
|
decode: (subData, chainId) => {
|
|
951
892
|
const fromToken = web3_eth_abi_1.default.decodeParameter('address', subData[0]).toString();
|
|
952
893
|
const toToken = web3_eth_abi_1.default.decodeParameter('address', subData[1]).toString();
|
|
@@ -954,7 +895,7 @@ exports.exchangeLimitOrderSubData = {
|
|
|
954
895
|
return { fromToken, toToken, amount };
|
|
955
896
|
},
|
|
956
897
|
};
|
|
957
|
-
exports.
|
|
898
|
+
exports.exchangeLimitOrderSubData = {
|
|
958
899
|
encode(fromToken, toToken, amount) {
|
|
959
900
|
return [
|
|
960
901
|
web3_eth_abi_1.default.encodeParameter('address', fromToken),
|
|
@@ -977,14 +918,14 @@ exports.exchangeLimitOrderSubDataWithoutSubProxy = {
|
|
|
977
918
|
.----) | | | / _____ \ | |\ \----.| . \
|
|
978
919
|
|_______/ | _| /__/ \__\ | _| `._____||__|\__\
|
|
979
920
|
*/
|
|
980
|
-
exports.
|
|
921
|
+
exports.legacySparkLeverageManagementSubData = {
|
|
981
922
|
decode(subData) {
|
|
982
923
|
const ratioWei = web3_eth_abi_1.default.decodeParameter('uint256', subData[0]);
|
|
983
924
|
const targetRatio = (0, utils_1.weiToRatioPercentage)(ratioWei);
|
|
984
925
|
return { targetRatio };
|
|
985
926
|
},
|
|
986
927
|
};
|
|
987
|
-
exports.
|
|
928
|
+
exports.sparkLeverageManagementSubData = {
|
|
988
929
|
encode(targetRatio, ratioState) {
|
|
989
930
|
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
990
931
|
const encodedRatioState = web3_eth_abi_1.default.encodeParameter('uint8', ratioState);
|
|
@@ -998,6 +939,22 @@ exports.sparkLeverageManagementSubDataWithoutSubProxy = {
|
|
|
998
939
|
return { targetRatio, ratioState };
|
|
999
940
|
},
|
|
1000
941
|
};
|
|
942
|
+
exports.sparkLiquidationProtectionSubData = exports.sparkLeverageManagementSubData;
|
|
943
|
+
exports.sparkGenericLeverageManagementSubData = {
|
|
944
|
+
encode(targetRatio, ratioState, market, user) {
|
|
945
|
+
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
946
|
+
const encodedRatioState = web3_eth_abi_1.default.encodeParameter('uint8', ratioState);
|
|
947
|
+
const encodedMarket = web3_eth_abi_1.default.encodeParameter('address', market);
|
|
948
|
+
const encodedUser = web3_eth_abi_1.default.encodeParameter('address', user);
|
|
949
|
+
return [encodedTargetRatio, encodedRatioState, encodedMarket, encodedUser];
|
|
950
|
+
},
|
|
951
|
+
decode(subData) {
|
|
952
|
+
const targetRatio = (0, utils_1.weiToRatioPercentage)(String(web3_eth_abi_1.default.decodeParameter('uint256', subData[0])));
|
|
953
|
+
const ratioState = Number(web3_eth_abi_1.default.decodeParameter('uint8', subData[1]));
|
|
954
|
+
return { targetRatio, ratioState };
|
|
955
|
+
},
|
|
956
|
+
};
|
|
957
|
+
exports.sparkGenericLiquidationProtectionSubData = exports.sparkGenericLeverageManagementSubData;
|
|
1001
958
|
exports.sparkCloseGenericSubData = {
|
|
1002
959
|
encode(collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user) {
|
|
1003
960
|
const encodedColl = web3_eth_abi_1.default.encodeParameter('address', collAsset);
|
|
@@ -1054,6 +1011,33 @@ exports.sparkLeverageManagementOnPriceSubData = {
|
|
|
1054
1011
|
};
|
|
1055
1012
|
},
|
|
1056
1013
|
};
|
|
1014
|
+
exports.sparkLeverageManagementOnPriceGenericSubData = {
|
|
1015
|
+
encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user) {
|
|
1016
|
+
const encodedColl = web3_eth_abi_1.default.encodeParameter('address', collAsset);
|
|
1017
|
+
const encodedCollId = web3_eth_abi_1.default.encodeParameter('uint16', collAssetId);
|
|
1018
|
+
const encodedDebt = web3_eth_abi_1.default.encodeParameter('address', debtAsset);
|
|
1019
|
+
const encodedDebtId = web3_eth_abi_1.default.encodeParameter('uint16', debtAssetId);
|
|
1020
|
+
const encodedMarket = web3_eth_abi_1.default.encodeParameter('address', marketAddr);
|
|
1021
|
+
const encodedTargetRatio = web3_eth_abi_1.default.encodeParameter('uint256', (0, utils_1.ratioPercentageToWei)(targetRatio));
|
|
1022
|
+
const encodedUser = web3_eth_abi_1.default.encodeParameter('address', user);
|
|
1023
|
+
return [
|
|
1024
|
+
encodedColl, encodedCollId, encodedDebt, encodedDebtId,
|
|
1025
|
+
encodedMarket, encodedTargetRatio, encodedUser,
|
|
1026
|
+
];
|
|
1027
|
+
},
|
|
1028
|
+
decode(subData) {
|
|
1029
|
+
const collAsset = web3_eth_abi_1.default.decodeParameter('address', subData[0]);
|
|
1030
|
+
const collAssetId = Number(web3_eth_abi_1.default.decodeParameter('uint16', subData[1]));
|
|
1031
|
+
const debtAsset = web3_eth_abi_1.default.decodeParameter('address', subData[2]);
|
|
1032
|
+
const debtAssetId = Number(web3_eth_abi_1.default.decodeParameter('uint16', subData[3]));
|
|
1033
|
+
const marketAddr = web3_eth_abi_1.default.decodeParameter('address', subData[4]);
|
|
1034
|
+
const targetRatio = (0, utils_1.weiToRatioPercentage)(String(web3_eth_abi_1.default.decodeParameter('uint256', subData[5])));
|
|
1035
|
+
const user = web3_eth_abi_1.default.decodeParameter('address', subData[6]);
|
|
1036
|
+
return {
|
|
1037
|
+
collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user,
|
|
1038
|
+
};
|
|
1039
|
+
},
|
|
1040
|
+
};
|
|
1057
1041
|
exports.sparkCollateralSwitchSubData = {
|
|
1058
1042
|
encode(fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch, useOnBehalf = false) {
|
|
1059
1043
|
const encodedFromAsset = web3_eth_abi_1.default.encodeParameter('address', fromAsset);
|
|
@@ -1085,6 +1069,38 @@ exports.sparkCollateralSwitchSubData = {
|
|
|
1085
1069
|
};
|
|
1086
1070
|
},
|
|
1087
1071
|
};
|
|
1072
|
+
exports.sparkGenericFLCollateralSwitchSubData = {
|
|
1073
|
+
encode(fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch, user) {
|
|
1074
|
+
const encodedFromAsset = web3_eth_abi_1.default.encodeParameter('address', fromAsset);
|
|
1075
|
+
const encodedFromAssetId = web3_eth_abi_1.default.encodeParameter('uint16', fromAssetId);
|
|
1076
|
+
const encodedToAsset = web3_eth_abi_1.default.encodeParameter('address', toAsset);
|
|
1077
|
+
const encodedToAssetId = web3_eth_abi_1.default.encodeParameter('uint16', toAssetId);
|
|
1078
|
+
const encodedMarketAddr = web3_eth_abi_1.default.encodeParameter('address', marketAddr);
|
|
1079
|
+
const encodedAmountToSwitch = web3_eth_abi_1.default.encodeParameter('uint256', amountToSwitch);
|
|
1080
|
+
const encodedUser = web3_eth_abi_1.default.encodeParameter('address', user);
|
|
1081
|
+
return [
|
|
1082
|
+
encodedFromAsset,
|
|
1083
|
+
encodedFromAssetId,
|
|
1084
|
+
encodedToAsset,
|
|
1085
|
+
encodedToAssetId,
|
|
1086
|
+
encodedMarketAddr,
|
|
1087
|
+
encodedAmountToSwitch,
|
|
1088
|
+
encodedUser,
|
|
1089
|
+
];
|
|
1090
|
+
},
|
|
1091
|
+
decode(subData) {
|
|
1092
|
+
const fromAsset = web3_eth_abi_1.default.decodeParameter('address', subData[0]);
|
|
1093
|
+
const fromAssetId = Number(web3_eth_abi_1.default.decodeParameter('uint16', subData[1]));
|
|
1094
|
+
const toAsset = web3_eth_abi_1.default.decodeParameter('address', subData[2]);
|
|
1095
|
+
const toAssetId = Number(web3_eth_abi_1.default.decodeParameter('uint16', subData[3]));
|
|
1096
|
+
const marketAddr = web3_eth_abi_1.default.decodeParameter('address', subData[4]);
|
|
1097
|
+
const amountToSwitch = web3_eth_abi_1.default.decodeParameter('uint256', subData[5]);
|
|
1098
|
+
const user = web3_eth_abi_1.default.decodeParameter('address', subData[6]);
|
|
1099
|
+
return {
|
|
1100
|
+
fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch, user,
|
|
1101
|
+
};
|
|
1102
|
+
},
|
|
1103
|
+
};
|
|
1088
1104
|
/**
|
|
1089
1105
|
______ .______ ____ ____ __ __ _______. _______
|
|
1090
1106
|
/ || _ \ \ \ / / | | | | / || \
|
|
@@ -1179,6 +1195,7 @@ exports.morphoBlueLeverageManagementSubData = {
|
|
|
1179
1195
|
};
|
|
1180
1196
|
},
|
|
1181
1197
|
};
|
|
1198
|
+
exports.morphoBlueLiquidationProtectionSubData = exports.morphoBlueLeverageManagementSubData;
|
|
1182
1199
|
exports.morphoBlueLeverageManagementOnPriceSubData = {
|
|
1183
1200
|
encode(loanToken, collToken, oracle, irm, lltv, targetRatio, user) {
|
|
1184
1201
|
const loanTokenEncoded = web3_eth_abi_1.default.encodeParameter('address', loanToken);
|
|
@@ -1281,3 +1298,4 @@ exports.fluidLeverageManagementSubData = {
|
|
|
1281
1298
|
};
|
|
1282
1299
|
},
|
|
1283
1300
|
};
|
|
1301
|
+
exports.fluidLiquidationProtectionSubData = exports.fluidLeverageManagementSubData;
|