@defisaver/automation-sdk 3.3.14-strategies-refactor-dev → 3.3.15-liq-prot-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 +95 -0
- package/cjs/index.d.ts +4 -3
- package/cjs/index.js +6 -2
- package/cjs/services/strategiesService.js +151 -0
- package/cjs/services/strategySubService.d.ts +9 -2
- package/cjs/services/strategySubService.js +47 -1
- package/cjs/services/subDataService.d.ts +64 -0
- package/cjs/services/subDataService.js +199 -5
- package/cjs/services/utils.d.ts +3 -1
- package/cjs/services/utils.js +34 -1
- package/cjs/services/utils.test.js +25 -0
- package/cjs/types/enums.d.ts +29 -6
- package/cjs/types/enums.js +23 -0
- package/esm/constants/index.js +95 -0
- package/esm/index.d.ts +4 -3
- package/esm/index.js +7 -3
- package/esm/services/strategiesService.js +151 -0
- package/esm/services/strategySubService.d.ts +9 -2
- package/esm/services/strategySubService.js +48 -2
- package/esm/services/subDataService.d.ts +64 -0
- package/esm/services/subDataService.js +197 -3
- package/esm/services/utils.d.ts +3 -1
- package/esm/services/utils.js +32 -1
- package/esm/services/utils.test.js +27 -2
- package/esm/types/enums.d.ts +29 -6
- package/esm/types/enums.js +23 -0
- package/package.json +1 -1
- package/src/constants/index.ts +96 -0
- package/src/index.ts +24 -6
- package/src/services/strategiesService.ts +216 -0
- package/src/services/strategySubService.ts +142 -5
- package/src/services/subDataService.ts +283 -3
- package/src/services/utils.test.ts +32 -1
- package/src/services/utils.ts +32 -1
- package/src/types/enums.ts +23 -0
|
@@ -71,6 +71,14 @@ export declare const makerLeverageManagementWithoutSubProxy: {
|
|
|
71
71
|
daiAddr: string;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
export declare const makerLiquidationProtectionSubData: {
|
|
75
|
+
encode(vaultId: number, targetRatio: number, daiAddr?: EthereumAddress): string[];
|
|
76
|
+
decode(subData: string[]): {
|
|
77
|
+
vaultId: number;
|
|
78
|
+
targetRatio: number;
|
|
79
|
+
daiAddr: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
74
82
|
/**
|
|
75
83
|
__ __ ______ __ __ __ .___________.____ ____ ____ ____ __
|
|
76
84
|
| | | | / __ \ | | | | | | | |\ \ / / \ \ / / /_ |
|
|
@@ -212,6 +220,13 @@ export declare const aaveV3LeverageManagementSubDataWithoutSubProxy: {
|
|
|
212
220
|
ratioState: RatioState;
|
|
213
221
|
};
|
|
214
222
|
};
|
|
223
|
+
export declare const aaveV3LiquidationProtectionSubData: {
|
|
224
|
+
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress): string[];
|
|
225
|
+
decode(subData: string[]): {
|
|
226
|
+
targetRatio: number;
|
|
227
|
+
ratioState: RatioState;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
215
230
|
export declare const aaveV3LeverageManagementOnPriceGeneric: {
|
|
216
231
|
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number, user: EthereumAddress): string[];
|
|
217
232
|
decode(subData: string[]): {
|
|
@@ -284,6 +299,15 @@ export declare const aaveV4LeverageManagementSubData: {
|
|
|
284
299
|
targetRatio: number;
|
|
285
300
|
};
|
|
286
301
|
};
|
|
302
|
+
export declare const aaveV4LiquidationProtectionSubData: {
|
|
303
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
304
|
+
decode: (subData: string[]) => {
|
|
305
|
+
spoke: string;
|
|
306
|
+
owner: string;
|
|
307
|
+
ratioState: RatioState;
|
|
308
|
+
targetRatio: number;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
287
311
|
export declare const aaveV4LeverageManagementOnPriceSubData: {
|
|
288
312
|
encode: (spoke: EthereumAddress, owner: EthereumAddress, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, ratioState: RatioState, targetRatio: number) => string[];
|
|
289
313
|
decode: (subData: string[]) => {
|
|
@@ -365,6 +389,18 @@ export declare const compoundV3LeverageManagementSubDataWithoutSubProxy: {
|
|
|
365
389
|
ratioState: RatioState;
|
|
366
390
|
};
|
|
367
391
|
};
|
|
392
|
+
export declare const compoundV3LiquidationProtectionSubData: {
|
|
393
|
+
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string[];
|
|
394
|
+
decode(subData: string[]): {
|
|
395
|
+
targetRatio: number;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
export declare const compoundV3L2LiquidationProtectionSubData: {
|
|
399
|
+
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string;
|
|
400
|
+
decode(subData: string[]): {
|
|
401
|
+
targetRatio: number;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
368
404
|
export declare const compoundV3LeverageManagementOnPriceSubData: {
|
|
369
405
|
encode(market: EthereumAddress, collToken: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState, user: EthereumAddress): string[];
|
|
370
406
|
decode(subData: string[]): {
|
|
@@ -439,6 +475,13 @@ export declare const sparkLeverageManagementSubDataWithoutSubProxy: {
|
|
|
439
475
|
ratioState: RatioState;
|
|
440
476
|
};
|
|
441
477
|
};
|
|
478
|
+
export declare const sparkLiquidationProtectionSubData: {
|
|
479
|
+
encode(targetRatio: number, ratioState: RatioState): 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[]): {
|
|
@@ -517,6 +560,18 @@ export declare const morphoBlueLeverageManagementSubData: {
|
|
|
517
560
|
targetRatio: number;
|
|
518
561
|
};
|
|
519
562
|
};
|
|
563
|
+
export declare const morphoBlueLiquidationProtectionSubData: {
|
|
564
|
+
encode: (loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, ratioState: RatioState, targetRatio: number, user: EthereumAddress, isEOA: boolean) => string[];
|
|
565
|
+
decode: (subData: string[]) => {
|
|
566
|
+
loanToken: string;
|
|
567
|
+
collToken: string;
|
|
568
|
+
oracle: string;
|
|
569
|
+
irm: string;
|
|
570
|
+
lltv: string;
|
|
571
|
+
user: string;
|
|
572
|
+
targetRatio: number;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
520
575
|
export declare const morphoBlueLeverageManagementOnPriceSubData: {
|
|
521
576
|
encode(loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, targetRatio: number, user: EthereumAddress): string[];
|
|
522
577
|
decode(subData: string[]): {
|
|
@@ -558,3 +613,12 @@ export declare const fluidLeverageManagementSubData: {
|
|
|
558
613
|
targetRatio: number;
|
|
559
614
|
};
|
|
560
615
|
};
|
|
616
|
+
export declare const fluidLiquidationProtectionSubData: {
|
|
617
|
+
encode: (nftId: string, vault: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
618
|
+
decode: (subData: string[]) => {
|
|
619
|
+
nftId: string;
|
|
620
|
+
vault: string;
|
|
621
|
+
ratioState: RatioState;
|
|
622
|
+
targetRatio: number;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
@@ -125,6 +125,8 @@ export const makerLeverageManagementSubData = {
|
|
|
125
125
|
return { vaultId, targetRatio };
|
|
126
126
|
},
|
|
127
127
|
};
|
|
128
|
+
// ! Any change here will PROBABLY require a change in makerLiquidationProtectionSubData as well, since it is copy paste
|
|
129
|
+
// ! Double check before changing
|
|
128
130
|
export const makerLeverageManagementWithoutSubProxy = {
|
|
129
131
|
encode(vaultId, targetRatio, daiAddr) {
|
|
130
132
|
const encodedVaultId = AbiCoder.encodeParameter('uint256', vaultId);
|
|
@@ -139,6 +141,20 @@ export const makerLeverageManagementWithoutSubProxy = {
|
|
|
139
141
|
return { vaultId, targetRatio, daiAddr };
|
|
140
142
|
},
|
|
141
143
|
};
|
|
144
|
+
export const makerLiquidationProtectionSubData = {
|
|
145
|
+
encode(vaultId, targetRatio, daiAddr) {
|
|
146
|
+
const encodedVaultId = AbiCoder.encodeParameter('uint256', vaultId);
|
|
147
|
+
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
148
|
+
const encodedDaiAddr = AbiCoder.encodeParameter('address', daiAddr || getAssetInfo('DAI', 1).address);
|
|
149
|
+
return [encodedVaultId, encodedTargetRatio, encodedDaiAddr];
|
|
150
|
+
},
|
|
151
|
+
decode(subData) {
|
|
152
|
+
const vaultId = +AbiCoder.decodeParameter('uint256', subData[0]).toString();
|
|
153
|
+
const targetRatio = weiToRatioPercentage(AbiCoder.decodeParameter('uint256', subData[1]));
|
|
154
|
+
const daiAddr = AbiCoder.decodeParameter('address', subData[2]).toString();
|
|
155
|
+
return { vaultId, targetRatio, daiAddr };
|
|
156
|
+
},
|
|
157
|
+
};
|
|
142
158
|
/**
|
|
143
159
|
__ __ ______ __ __ __ .___________.____ ____ ____ ____ __
|
|
144
160
|
| | | | / __ \ | | | | | | | |\ \ / / \ \ / / /_ |
|
|
@@ -443,6 +459,8 @@ export const aaveV3LeverageManagementSubData = {
|
|
|
443
459
|
return { targetRatio };
|
|
444
460
|
},
|
|
445
461
|
};
|
|
462
|
+
// ! Any change here will PROBABLY require a change in aaveV3LiquidationProtectionSubData as well
|
|
463
|
+
// ! Double check before changing. Liquidation protection is using Generic encoding for both - EOA and SW
|
|
446
464
|
export const aaveV3LeverageManagementSubDataWithoutSubProxy = {
|
|
447
465
|
encode(targetRatio, ratioState, market, user, isGeneric) {
|
|
448
466
|
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
@@ -462,6 +480,20 @@ export const aaveV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
462
480
|
return { targetRatio, ratioState };
|
|
463
481
|
},
|
|
464
482
|
};
|
|
483
|
+
export const aaveV3LiquidationProtectionSubData = {
|
|
484
|
+
encode(targetRatio, ratioState, market, user) {
|
|
485
|
+
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
486
|
+
const encodedRatioState = AbiCoder.encodeParameter('uint8', ratioState);
|
|
487
|
+
const encodedMarket = AbiCoder.encodeParameter('address', market);
|
|
488
|
+
const encodedUser = AbiCoder.encodeParameter('address', user);
|
|
489
|
+
return [encodedTargetRatio, encodedRatioState, encodedMarket, encodedUser];
|
|
490
|
+
},
|
|
491
|
+
decode(subData) {
|
|
492
|
+
const targetRatio = weiToRatioPercentage(AbiCoder.decodeParameter('uint256', subData[0]));
|
|
493
|
+
const ratioState = AbiCoder.decodeParameter('uint8', subData[1]);
|
|
494
|
+
return { targetRatio, ratioState };
|
|
495
|
+
},
|
|
496
|
+
};
|
|
465
497
|
export const aaveV3LeverageManagementOnPriceGeneric = {
|
|
466
498
|
encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user) {
|
|
467
499
|
const encodedColl = AbiCoder.encodeParameter('address', collAsset);
|
|
@@ -623,6 +655,8 @@ export const aaveV3LeverageManagementOnPriceSubData = {
|
|
|
623
655
|
/ _____ \ / _____ \ \ / | |____ \ / | |
|
|
624
656
|
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |_|
|
|
625
657
|
*/
|
|
658
|
+
// ! Any change here will PROBABLY require a change in aaveV4LiquidationProtectionSubData as well, since it is copy paste
|
|
659
|
+
// ! Double check before changing
|
|
626
660
|
export const aaveV4LeverageManagementSubData = {
|
|
627
661
|
encode: (spoke, owner, ratioState, targetRatio) => {
|
|
628
662
|
const spokeEncoded = AbiCoder.encodeParameter('address', spoke);
|
|
@@ -649,6 +683,32 @@ export const aaveV4LeverageManagementSubData = {
|
|
|
649
683
|
};
|
|
650
684
|
},
|
|
651
685
|
};
|
|
686
|
+
export const aaveV4LiquidationProtectionSubData = {
|
|
687
|
+
encode: (spoke, owner, ratioState, targetRatio) => {
|
|
688
|
+
const spokeEncoded = AbiCoder.encodeParameter('address', spoke);
|
|
689
|
+
const ownerEncoded = AbiCoder.encodeParameter('address', owner);
|
|
690
|
+
const ratioStateEncoded = AbiCoder.encodeParameter('uint8', ratioState);
|
|
691
|
+
const targetRatioEncoded = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
692
|
+
// Add two empty slots for future addons (e.g tsi or slippage settings)
|
|
693
|
+
return [
|
|
694
|
+
spokeEncoded,
|
|
695
|
+
ownerEncoded,
|
|
696
|
+
ratioStateEncoded,
|
|
697
|
+
targetRatioEncoded,
|
|
698
|
+
EMPTY_SLOT,
|
|
699
|
+
EMPTY_SLOT,
|
|
700
|
+
];
|
|
701
|
+
},
|
|
702
|
+
decode: (subData) => {
|
|
703
|
+
const spoke = AbiCoder.decodeParameter('address', subData[0]);
|
|
704
|
+
const owner = AbiCoder.decodeParameter('address', subData[1]);
|
|
705
|
+
const ratioState = Number(AbiCoder.decodeParameter('uint8', subData[2]));
|
|
706
|
+
const targetRatio = weiToRatioPercentage(AbiCoder.decodeParameter('uint256', subData[3]));
|
|
707
|
+
return {
|
|
708
|
+
spoke, owner, ratioState, targetRatio,
|
|
709
|
+
};
|
|
710
|
+
},
|
|
711
|
+
};
|
|
652
712
|
export const aaveV4LeverageManagementOnPriceSubData = {
|
|
653
713
|
encode: (spoke, owner, collAsset, collAssetId, debtAsset, debtAssetId, ratioState, targetRatio) => {
|
|
654
714
|
const spokeEncoded = AbiCoder.encodeParameter('address', spoke);
|
|
@@ -807,6 +867,8 @@ export const compoundV2LeverageManagementSubDataWithoutSubProxy = {
|
|
|
807
867
|
| `----.| `--' | | | | | | | \ / ___) |
|
|
808
868
|
\______| \______/ |__| |__| | _| \__/ |____/
|
|
809
869
|
*/
|
|
870
|
+
// ! Any change here will PROBABLY require a change in compoundV3LiquidationProtectionSubData as well, since it is copy paste
|
|
871
|
+
// ! Double check before changing
|
|
810
872
|
export const compoundV3LeverageManagementSubData = {
|
|
811
873
|
encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
812
874
|
return [
|
|
@@ -826,6 +888,8 @@ export const compoundV3LeverageManagementSubData = {
|
|
|
826
888
|
return { targetRatio };
|
|
827
889
|
},
|
|
828
890
|
};
|
|
891
|
+
// ! Any change here will PROBABLY require a change in compoundV3L2LiquidationProtectionSubData as well, since it is copy paste
|
|
892
|
+
// ! Double check before changing
|
|
829
893
|
export const compoundV3LeverageManagementSubDataWithoutSubProxy = {
|
|
830
894
|
encode(market, baseToken, targetRatio, ratioState) {
|
|
831
895
|
const encodedMarket = AbiCoder.encodeParameter('address', market);
|
|
@@ -844,6 +908,52 @@ export const compoundV3LeverageManagementSubDataWithoutSubProxy = {
|
|
|
844
908
|
};
|
|
845
909
|
},
|
|
846
910
|
};
|
|
911
|
+
export const compoundV3LiquidationProtectionSubData = {
|
|
912
|
+
encode(market, baseToken, triggerRepayRatio,
|
|
913
|
+
// TODO -> can remove boost stuff ? Not sure if want it to be compatible or not.
|
|
914
|
+
triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
915
|
+
return [
|
|
916
|
+
market,
|
|
917
|
+
baseToken,
|
|
918
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
919
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
920
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
921
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
922
|
+
// @ts-ignore // TODO
|
|
923
|
+
boostEnabled, isEOA,
|
|
924
|
+
];
|
|
925
|
+
},
|
|
926
|
+
decode(subData) {
|
|
927
|
+
const weiRatio = AbiCoder.decodeParameter('uint256', subData[3]);
|
|
928
|
+
const targetRatio = weiToRatioPercentage(weiRatio);
|
|
929
|
+
return { targetRatio };
|
|
930
|
+
},
|
|
931
|
+
};
|
|
932
|
+
export const compoundV3L2LiquidationProtectionSubData = {
|
|
933
|
+
encode(market, baseToken, triggerRepayRatio,
|
|
934
|
+
// TODO -> can remove boost stuff ? Not sure if want it to be compatible or not.
|
|
935
|
+
triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
936
|
+
let subInput = '0x';
|
|
937
|
+
subInput = subInput.concat(market.slice(2));
|
|
938
|
+
subInput = subInput.concat(baseToken.slice(2));
|
|
939
|
+
subInput = subInput.concat(new Dec(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
940
|
+
.padStart(32, '0'));
|
|
941
|
+
subInput = subInput.concat(new Dec(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
942
|
+
.padStart(32, '0'));
|
|
943
|
+
subInput = subInput.concat(new Dec(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
944
|
+
.padStart(32, '0'));
|
|
945
|
+
subInput = subInput.concat(new Dec(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
946
|
+
.padStart(32, '0'));
|
|
947
|
+
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
948
|
+
subInput = subInput.concat(isEOA ? '01' : '00');
|
|
949
|
+
return subInput;
|
|
950
|
+
},
|
|
951
|
+
decode(subData) {
|
|
952
|
+
const ratioWei = AbiCoder.decodeParameter('uint256', subData[3]);
|
|
953
|
+
const targetRatio = weiToRatioPercentage(ratioWei);
|
|
954
|
+
return { targetRatio };
|
|
955
|
+
},
|
|
956
|
+
};
|
|
847
957
|
export const compoundV3LeverageManagementOnPriceSubData = {
|
|
848
958
|
encode(market, collToken, baseToken, targetRatio, ratioState, user) {
|
|
849
959
|
const marketEncoded = AbiCoder.encodeParameter('address', market);
|
|
@@ -977,6 +1087,8 @@ export const sparkLeverageManagementSubData = {
|
|
|
977
1087
|
return { targetRatio };
|
|
978
1088
|
},
|
|
979
1089
|
};
|
|
1090
|
+
// ! Any change here will PROBABLY require a change in sparkLiquidationProtectionSubData as well, since it is copy paste
|
|
1091
|
+
// ! Double check before changing
|
|
980
1092
|
export const sparkLeverageManagementSubDataWithoutSubProxy = {
|
|
981
1093
|
encode(targetRatio, ratioState) {
|
|
982
1094
|
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
@@ -991,6 +1103,20 @@ export const sparkLeverageManagementSubDataWithoutSubProxy = {
|
|
|
991
1103
|
return { targetRatio, ratioState };
|
|
992
1104
|
},
|
|
993
1105
|
};
|
|
1106
|
+
export const sparkLiquidationProtectionSubData = {
|
|
1107
|
+
encode(targetRatio, ratioState) {
|
|
1108
|
+
const encodedTargetRatio = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
1109
|
+
const encodedRatioState = AbiCoder.encodeParameter('uint8', ratioState);
|
|
1110
|
+
const encodedUseDefaultMarket = AbiCoder.encodeParameter('bool', true);
|
|
1111
|
+
const encodedUseOnBehalf = AbiCoder.encodeParameter('bool', false);
|
|
1112
|
+
return [encodedTargetRatio, encodedRatioState, encodedUseDefaultMarket, encodedUseOnBehalf];
|
|
1113
|
+
},
|
|
1114
|
+
decode(subData) {
|
|
1115
|
+
const targetRatio = weiToRatioPercentage(AbiCoder.decodeParameter('uint256', subData[0]));
|
|
1116
|
+
const ratioState = AbiCoder.decodeParameter('uint8', subData[1]);
|
|
1117
|
+
return { targetRatio, ratioState };
|
|
1118
|
+
},
|
|
1119
|
+
};
|
|
994
1120
|
export const sparkCloseGenericSubData = {
|
|
995
1121
|
encode(collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user) {
|
|
996
1122
|
const encodedColl = AbiCoder.encodeParameter('address', collAsset);
|
|
@@ -1139,6 +1265,8 @@ export const crvUSDPaybackSubData = {
|
|
|
1139
1265
|
| | | | | `--' | | |\ \----.| | | | | | | `--' |
|
|
1140
1266
|
|__| |__| \______/ | _| `._____|| _| |__| |__| \______/
|
|
1141
1267
|
*/
|
|
1268
|
+
// ! Any change here will PROBABLY require a change in morphoBlueLiquidationProtectionSubData as well, since it is copy paste
|
|
1269
|
+
// ! Double check before changing
|
|
1142
1270
|
export const morphoBlueLeverageManagementSubData = {
|
|
1143
1271
|
encode: (loanToken, collToken, oracle, irm, lltv, ratioState, targetRatio, user, isEOA) => {
|
|
1144
1272
|
const loanTokenEncoded = AbiCoder.encodeParameter('address', loanToken);
|
|
@@ -1172,6 +1300,39 @@ export const morphoBlueLeverageManagementSubData = {
|
|
|
1172
1300
|
};
|
|
1173
1301
|
},
|
|
1174
1302
|
};
|
|
1303
|
+
export const morphoBlueLiquidationProtectionSubData = {
|
|
1304
|
+
encode: (loanToken, collToken, oracle, irm, lltv, ratioState, targetRatio, user, isEOA) => {
|
|
1305
|
+
const loanTokenEncoded = AbiCoder.encodeParameter('address', loanToken);
|
|
1306
|
+
const collTokenEncoded = AbiCoder.encodeParameter('address', collToken);
|
|
1307
|
+
const oracleEncoded = AbiCoder.encodeParameter('address', oracle);
|
|
1308
|
+
const irmEncoded = AbiCoder.encodeParameter('address', irm);
|
|
1309
|
+
const lltvEncoded = AbiCoder.encodeParameter('uint256', lltv);
|
|
1310
|
+
const ratioStateEncoded = AbiCoder.encodeParameter('uint8', ratioState);
|
|
1311
|
+
const targetRatioEncoded = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
1312
|
+
const userEncoded = AbiCoder.encodeParameter('address', user);
|
|
1313
|
+
const isEOAEncoded = AbiCoder.encodeParameter('bool', isEOA);
|
|
1314
|
+
return [loanTokenEncoded, collTokenEncoded, oracleEncoded, irmEncoded, lltvEncoded, ratioStateEncoded, targetRatioEncoded, userEncoded, isEOAEncoded];
|
|
1315
|
+
},
|
|
1316
|
+
decode: (subData) => {
|
|
1317
|
+
const loanToken = AbiCoder.decodeParameter('address', subData[0]);
|
|
1318
|
+
const collToken = AbiCoder.decodeParameter('address', subData[1]);
|
|
1319
|
+
const oracle = AbiCoder.decodeParameter('address', subData[2]);
|
|
1320
|
+
const irm = AbiCoder.decodeParameter('address', subData[3]);
|
|
1321
|
+
const lltv = AbiCoder.decodeParameter('uint256', subData[4]);
|
|
1322
|
+
const weiRatio = AbiCoder.decodeParameter('uint256', subData[6]);
|
|
1323
|
+
const user = AbiCoder.decodeParameter('address', subData[7]);
|
|
1324
|
+
const targetRatio = weiToRatioPercentage(weiRatio);
|
|
1325
|
+
return {
|
|
1326
|
+
loanToken,
|
|
1327
|
+
collToken,
|
|
1328
|
+
oracle,
|
|
1329
|
+
irm,
|
|
1330
|
+
lltv,
|
|
1331
|
+
user,
|
|
1332
|
+
targetRatio,
|
|
1333
|
+
};
|
|
1334
|
+
},
|
|
1335
|
+
};
|
|
1175
1336
|
export const morphoBlueLeverageManagementOnPriceSubData = {
|
|
1176
1337
|
encode(loanToken, collToken, oracle, irm, lltv, targetRatio, user) {
|
|
1177
1338
|
const loanTokenEncoded = AbiCoder.encodeParameter('address', loanToken);
|
|
@@ -1241,6 +1402,8 @@ _______ __ __ __ __ _______
|
|
|
1241
1402
|
| | | `----.| `--' | | | | '--' |
|
|
1242
1403
|
|__| |_______| \______/ |__| |_______/
|
|
1243
1404
|
*/
|
|
1405
|
+
// ! Any change here will PROBABLY require a change in fluidLeverageManagementSubData as well, since it is copy paste
|
|
1406
|
+
// ! Double check before changing
|
|
1244
1407
|
export const fluidLeverageManagementSubData = {
|
|
1245
1408
|
encode: (nftId, vault, ratioState, targetRatio) => {
|
|
1246
1409
|
const nftIdEncoded = AbiCoder.encodeParameter('uint256', nftId);
|
|
@@ -1248,9 +1411,40 @@ export const fluidLeverageManagementSubData = {
|
|
|
1248
1411
|
const ratioStateEncoded = AbiCoder.encodeParameter('uint8', ratioState);
|
|
1249
1412
|
const targetRatioEncoded = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
1250
1413
|
const wrapEthEncoded = AbiCoder.encodeParameter('bool', true);
|
|
1251
|
-
const
|
|
1252
|
-
const
|
|
1253
|
-
const
|
|
1414
|
+
const collActionType = CollActionType.WITHDRAW;
|
|
1415
|
+
const debtActionType = DebtActionType.PAYBACK;
|
|
1416
|
+
const collActionTypeEncoded = AbiCoder.encodeParameter('uint8', collActionType);
|
|
1417
|
+
const debtActionTypeEncoded = AbiCoder.encodeParameter('uint8', debtActionType);
|
|
1418
|
+
return [
|
|
1419
|
+
nftIdEncoded,
|
|
1420
|
+
vaultEncoded,
|
|
1421
|
+
ratioStateEncoded,
|
|
1422
|
+
targetRatioEncoded,
|
|
1423
|
+
wrapEthEncoded,
|
|
1424
|
+
collActionTypeEncoded,
|
|
1425
|
+
debtActionTypeEncoded,
|
|
1426
|
+
];
|
|
1427
|
+
},
|
|
1428
|
+
decode: (subData) => {
|
|
1429
|
+
const nftId = AbiCoder.decodeParameter('uint256', subData[0]);
|
|
1430
|
+
const vault = AbiCoder.decodeParameter('address', subData[1]);
|
|
1431
|
+
const ratioState = AbiCoder.decodeParameter('uint8', subData[2]);
|
|
1432
|
+
const weiRatio = AbiCoder.decodeParameter('uint256', subData[3]);
|
|
1433
|
+
const targetRatio = weiToRatioPercentage(weiRatio);
|
|
1434
|
+
return {
|
|
1435
|
+
nftId, vault, ratioState, targetRatio,
|
|
1436
|
+
};
|
|
1437
|
+
},
|
|
1438
|
+
};
|
|
1439
|
+
export const fluidLiquidationProtectionSubData = {
|
|
1440
|
+
encode: (nftId, vault, ratioState, targetRatio) => {
|
|
1441
|
+
const nftIdEncoded = AbiCoder.encodeParameter('uint256', nftId);
|
|
1442
|
+
const vaultEncoded = AbiCoder.encodeParameter('address', vault);
|
|
1443
|
+
const ratioStateEncoded = AbiCoder.encodeParameter('uint8', ratioState);
|
|
1444
|
+
const targetRatioEncoded = AbiCoder.encodeParameter('uint256', ratioPercentageToWei(targetRatio));
|
|
1445
|
+
const wrapEthEncoded = AbiCoder.encodeParameter('bool', true);
|
|
1446
|
+
const collActionType = CollActionType.WITHDRAW;
|
|
1447
|
+
const debtActionType = DebtActionType.PAYBACK;
|
|
1254
1448
|
const collActionTypeEncoded = AbiCoder.encodeParameter('uint8', collActionType);
|
|
1255
1449
|
const debtActionTypeEncoded = AbiCoder.encodeParameter('uint8', debtActionType);
|
|
1256
1450
|
return [
|
package/esm/services/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthereumAddress } from '../types';
|
|
2
|
-
import { ChainId, CloseStrategyType, CloseToAssetType, RatioState } from '../types/enums';
|
|
2
|
+
import { Bundles, ChainId, CloseStrategyType, CloseToAssetType, RatioState } from '../types/enums';
|
|
3
3
|
export declare function isDefined<T>(value: T): value is NonNullable<T>;
|
|
4
4
|
export declare function isUndefined(value: unknown): boolean;
|
|
5
5
|
export declare function compareAddresses(firstAddress: EthereumAddress, secondAddress: EthereumAddress): boolean;
|
|
@@ -28,3 +28,5 @@ export declare function getStopLossAndTakeProfitTypeByCloseStrategyType(closeStr
|
|
|
28
28
|
stopLossType: CloseToAssetType | undefined;
|
|
29
29
|
takeProfitType: CloseToAssetType | undefined;
|
|
30
30
|
};
|
|
31
|
+
export declare function getBundleIdsByNetwork(network: ChainId): typeof Bundles.MainnetIds | typeof Bundles.OptimismIds | typeof Bundles.ArbitrumIds | typeof Bundles.BaseIds;
|
|
32
|
+
export declare function getCompoundV3LeverageManagementBundleId(network: ChainId, isEOA: boolean, isBoost: boolean): number;
|
package/esm/services/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import Dec from 'decimal.js';
|
|
|
2
2
|
import * as web3Utils from 'web3-utils';
|
|
3
3
|
import AbiCoder from 'web3-eth-abi';
|
|
4
4
|
import { getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
5
|
-
import { ChainId, CloseStrategyType, CloseToAssetType, RatioState, } from '../types/enums';
|
|
5
|
+
import { Bundles, ChainId, CloseStrategyType, CloseToAssetType, RatioState, } from '../types/enums';
|
|
6
6
|
export function isDefined(value) {
|
|
7
7
|
return value !== undefined && value !== null;
|
|
8
8
|
}
|
|
@@ -137,3 +137,34 @@ export function getStopLossAndTakeProfitTypeByCloseStrategyType(closeStrategyTyp
|
|
|
137
137
|
throw new Error('CloseStrategyType not supported');
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
export function getBundleIdsByNetwork(network) {
|
|
141
|
+
switch (network) {
|
|
142
|
+
case ChainId.Arbitrum:
|
|
143
|
+
return Bundles.ArbitrumIds;
|
|
144
|
+
case ChainId.Base:
|
|
145
|
+
return Bundles.BaseIds;
|
|
146
|
+
case ChainId.Optimism:
|
|
147
|
+
return Bundles.OptimismIds;
|
|
148
|
+
default:
|
|
149
|
+
return Bundles.MainnetIds;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Mainnet uses the V2 bundle ids; L2s use the original bundle ids.
|
|
153
|
+
export function getCompoundV3LeverageManagementBundleId(network, isEOA, isBoost) {
|
|
154
|
+
switch (Number(network)) {
|
|
155
|
+
case ChainId.Ethereum:
|
|
156
|
+
if (isEOA)
|
|
157
|
+
return isBoost ? Bundles.MainnetIds.COMP_V3_EOA_BOOST_V2_BUNDLE : Bundles.MainnetIds.COMP_V3_EOA_REPAY_V2_BUNDLE;
|
|
158
|
+
return isBoost ? Bundles.MainnetIds.COMP_V3_SW_BOOST_V2_BUNDLE : Bundles.MainnetIds.COMP_V3_SW_REPAY_V2_BUNDLE;
|
|
159
|
+
case ChainId.Base:
|
|
160
|
+
if (isEOA)
|
|
161
|
+
return isBoost ? Bundles.BaseIds.COMP_V3_EOA_BOOST : Bundles.BaseIds.COMP_V3_EOA_REPAY;
|
|
162
|
+
return isBoost ? Bundles.BaseIds.COMP_V3_SW_BOOST_BUNDLE : Bundles.BaseIds.COMP_V3_SW_REPAY_BUNDLE;
|
|
163
|
+
case ChainId.Arbitrum:
|
|
164
|
+
if (isEOA)
|
|
165
|
+
return isBoost ? Bundles.ArbitrumIds.COMP_V3_EOA_BOOST : Bundles.ArbitrumIds.COMP_V3_EOA_REPAY;
|
|
166
|
+
return isBoost ? Bundles.ArbitrumIds.COMP_V3_SW_BOOST_BUNDLE : Bundles.ArbitrumIds.COMP_V3_SW_REPAY_BUNDLE;
|
|
167
|
+
default:
|
|
168
|
+
throw new Error(`Compound V3 leverage management is not supported on network ${network}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { getAssetInfo } from '@defisaver/tokens';
|
|
3
|
-
import { ChainId, ProtocolIdentifiers, RatioState } from '../types/enums';
|
|
3
|
+
import { Bundles, ChainId, ProtocolIdentifiers, RatioState } from '../types/enums';
|
|
4
4
|
import '../configuration';
|
|
5
|
-
import { addToArrayIf, addToObjectIf, compareAddresses, encodeSubId, ethToWeth, getRatioStateInfoForAaveCloseStrategy, isAddress, isDefined, isEmptyBytes, isRatioStateOver, isRatioStateUnder, isUndefined, ratioPercentageToWei, requireAddress, requireAddresses, weiToRatioPercentage, wethToEth, wethToEthByAddress, getPositionId, } from './utils';
|
|
5
|
+
import { addToArrayIf, addToObjectIf, compareAddresses, encodeSubId, ethToWeth, getCompoundV3LeverageManagementBundleId, getRatioStateInfoForAaveCloseStrategy, isAddress, isDefined, isEmptyBytes, isRatioStateOver, isRatioStateUnder, isUndefined, ratioPercentageToWei, requireAddress, requireAddresses, weiToRatioPercentage, wethToEth, wethToEthByAddress, getPositionId, } from './utils';
|
|
6
6
|
describe('Feature: utils.ts', () => {
|
|
7
7
|
describe('When testing utils.isDefined()', () => {
|
|
8
8
|
const examples = [
|
|
@@ -294,4 +294,29 @@ describe('Feature: utils.ts', () => {
|
|
|
294
294
|
});
|
|
295
295
|
});
|
|
296
296
|
});
|
|
297
|
+
describe('When testing utils.getCompoundV3LeverageManagementBundleId()', () => {
|
|
298
|
+
// Mainnet uses the V2 bundle ids; L2s use the original bundle ids.
|
|
299
|
+
const examples = [
|
|
300
|
+
[Bundles.MainnetIds.COMP_V3_SW_REPAY_V2_BUNDLE, [ChainId.Ethereum, false, false]],
|
|
301
|
+
[Bundles.MainnetIds.COMP_V3_SW_BOOST_V2_BUNDLE, [ChainId.Ethereum, false, true]],
|
|
302
|
+
[Bundles.MainnetIds.COMP_V3_EOA_REPAY_V2_BUNDLE, [ChainId.Ethereum, true, false]],
|
|
303
|
+
[Bundles.MainnetIds.COMP_V3_EOA_BOOST_V2_BUNDLE, [ChainId.Ethereum, true, true]],
|
|
304
|
+
[Bundles.BaseIds.COMP_V3_SW_REPAY_BUNDLE, [ChainId.Base, false, false]],
|
|
305
|
+
[Bundles.BaseIds.COMP_V3_SW_BOOST_BUNDLE, [ChainId.Base, false, true]],
|
|
306
|
+
[Bundles.BaseIds.COMP_V3_EOA_REPAY, [ChainId.Base, true, false]],
|
|
307
|
+
[Bundles.BaseIds.COMP_V3_EOA_BOOST, [ChainId.Base, true, true]],
|
|
308
|
+
[Bundles.ArbitrumIds.COMP_V3_SW_REPAY_BUNDLE, [ChainId.Arbitrum, false, false]],
|
|
309
|
+
[Bundles.ArbitrumIds.COMP_V3_SW_BOOST_BUNDLE, [ChainId.Arbitrum, false, true]],
|
|
310
|
+
[Bundles.ArbitrumIds.COMP_V3_EOA_REPAY, [ChainId.Arbitrum, true, false]],
|
|
311
|
+
[Bundles.ArbitrumIds.COMP_V3_EOA_BOOST, [ChainId.Arbitrum, true, true]],
|
|
312
|
+
];
|
|
313
|
+
examples.forEach(([expected, actual]) => {
|
|
314
|
+
it(`Given ${actual} should return expected value: ${expected}`, () => {
|
|
315
|
+
expect(getCompoundV3LeverageManagementBundleId(...actual)).to.equal(expected);
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
it(`Given ${ChainId.Optimism} (unsupported) should throw an error`, () => {
|
|
319
|
+
expect(() => getCompoundV3LeverageManagementBundleId(ChainId.Optimism, false, false)).to.throw(Error);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
297
322
|
});
|
package/esm/types/enums.d.ts
CHANGED
|
@@ -138,7 +138,9 @@ export declare namespace Strategies {
|
|
|
138
138
|
EoaBoostOnPrice = "eoa-boost-on-price",
|
|
139
139
|
EoaRepayOnPrice = "eoa-repay-on-price",
|
|
140
140
|
CollateralSwitch = "collateral-switch",
|
|
141
|
-
EoaCollateralSwitch = "eoa-collateral-switch"
|
|
141
|
+
EoaCollateralSwitch = "eoa-collateral-switch",
|
|
142
|
+
LiquidationProtection = "liquidation-protection",
|
|
143
|
+
EoaLiquidationProtection = "eoa-liquidation-protection"
|
|
142
144
|
}
|
|
143
145
|
enum IdOverrides {
|
|
144
146
|
TakeProfit = "take-profit",
|
|
@@ -149,7 +151,9 @@ export declare namespace Strategies {
|
|
|
149
151
|
LeverageManagement = "leverage-management",
|
|
150
152
|
EoaLeverageManagement = "leverage-management-eoa",
|
|
151
153
|
LeverageManagementOnPrice = "leverage-management-on-price",
|
|
152
|
-
EoaLeverageManagementOnPrice = "leverage-management-on-price-eoa"
|
|
154
|
+
EoaLeverageManagementOnPrice = "leverage-management-on-price-eoa",
|
|
155
|
+
LiquidationProtection = "liquidation-protection",
|
|
156
|
+
EoaLiquidationProtection = "liquidation-protection-eoa"
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
export declare namespace Bundles {
|
|
@@ -224,7 +228,15 @@ export declare namespace Bundles {
|
|
|
224
228
|
AAVE_V4_EOA_BOOST = 67,
|
|
225
229
|
AAVE_V4_EOA_REPAY_ON_PRICE = 68,
|
|
226
230
|
AAVE_V4_EOA_BOOST_ON_PRICE = 69,
|
|
227
|
-
AAVE_V4_EOA_CLOSE = 70
|
|
231
|
+
AAVE_V4_EOA_CLOSE = 70,
|
|
232
|
+
AAVE_V3_LIQUIDATION_PROTECTION = 71,
|
|
233
|
+
SPARK_LIQUIDATION_PROTECTION = 72,
|
|
234
|
+
COMP_V3_SW_LIQUIDATION_PROTECTION = 73,
|
|
235
|
+
COMP_V3_EOA_LIQUIDATION_PROTECTION = 74,
|
|
236
|
+
MAKER_LIQUIDATION_PROTECTION = 75,
|
|
237
|
+
FLUID_T1_LIQUIDATION_PROTECTION = 76,
|
|
238
|
+
AAVE_V4_LIQUIDATION_PROTECTION = 77,
|
|
239
|
+
MORPHO_BLUE_LIQUIDATION_PROTECTION = 78
|
|
228
240
|
}
|
|
229
241
|
enum OptimismIds {
|
|
230
242
|
AAVE_V3_REPAY = 0,
|
|
@@ -237,7 +249,8 @@ export declare namespace Bundles {
|
|
|
237
249
|
AAVE_V3_EOA_BOOST = 7,
|
|
238
250
|
AAVE_V3_EOA_REPAY_ON_PRICE = 8,
|
|
239
251
|
AAVE_V3_EOA_BOOST_ON_PRICE = 9,
|
|
240
|
-
AAVE_V3_EOA_CLOSE = 10
|
|
252
|
+
AAVE_V3_EOA_CLOSE = 10,
|
|
253
|
+
AAVE_V3_LIQUIDATION_PROTECTION = 11
|
|
241
254
|
}
|
|
242
255
|
enum BaseIds {
|
|
243
256
|
AAVE_V3_REPAY = 0,
|
|
@@ -266,7 +279,12 @@ export declare namespace Bundles {
|
|
|
266
279
|
AAVE_V3_EOA_REPAY_ON_PRICE = 25,
|
|
267
280
|
AAVE_V3_EOA_BOOST_ON_PRICE = 26,
|
|
268
281
|
AAVE_V3_EOA_CLOSE = 27,
|
|
269
|
-
MORPHO_BLUE_CLOSE = 28
|
|
282
|
+
MORPHO_BLUE_CLOSE = 28,
|
|
283
|
+
AAVE_V3_LIQUIDATION_PROTECTION = 29,
|
|
284
|
+
FLUID_T1_LIQUIDATION_PROTECTION = 30,
|
|
285
|
+
MORPHO_BLUE_LIQUIDATION_PROTECTION = 31,
|
|
286
|
+
COMP_V3_SW_LIQUIDATION_PROTECTION = 32,
|
|
287
|
+
COMP_V3_EOA_LIQUIDATION_PROTECTION = 33
|
|
270
288
|
}
|
|
271
289
|
enum ArbitrumIds {
|
|
272
290
|
AAVE_V3_REPAY = 0,
|
|
@@ -297,6 +315,11 @@ export declare namespace Bundles {
|
|
|
297
315
|
MORPHO_BLUE_BOOST_ON_PRICE = 25,
|
|
298
316
|
MORPHO_BLUE_EOA_REPAY = 26,
|
|
299
317
|
MORPHO_BLUE_EOA_BOOST = 27,
|
|
300
|
-
MORPHO_BLUE_CLOSE = 28
|
|
318
|
+
MORPHO_BLUE_CLOSE = 28,
|
|
319
|
+
AAVE_V3_LIQUIDATION_PROTECTION = 29,
|
|
320
|
+
FLUID_T1_LIQUIDATION_PROTECTION = 30,
|
|
321
|
+
MORPHO_BLUE_LIQUIDATION_PROTECTION = 31,
|
|
322
|
+
COMP_V3_SW_LIQUIDATION_PROTECTION = 32,
|
|
323
|
+
COMP_V3_EOA_LIQUIDATION_PROTECTION = 33
|
|
301
324
|
}
|
|
302
325
|
}
|
package/esm/types/enums.js
CHANGED
|
@@ -156,6 +156,8 @@ export var Strategies;
|
|
|
156
156
|
Identifiers["EoaRepayOnPrice"] = "eoa-repay-on-price";
|
|
157
157
|
Identifiers["CollateralSwitch"] = "collateral-switch";
|
|
158
158
|
Identifiers["EoaCollateralSwitch"] = "eoa-collateral-switch";
|
|
159
|
+
Identifiers["LiquidationProtection"] = "liquidation-protection";
|
|
160
|
+
Identifiers["EoaLiquidationProtection"] = "eoa-liquidation-protection";
|
|
159
161
|
})(Identifiers = Strategies.Identifiers || (Strategies.Identifiers = {}));
|
|
160
162
|
let IdOverrides;
|
|
161
163
|
(function (IdOverrides) {
|
|
@@ -168,6 +170,8 @@ export var Strategies;
|
|
|
168
170
|
IdOverrides["EoaLeverageManagement"] = "leverage-management-eoa";
|
|
169
171
|
IdOverrides["LeverageManagementOnPrice"] = "leverage-management-on-price";
|
|
170
172
|
IdOverrides["EoaLeverageManagementOnPrice"] = "leverage-management-on-price-eoa";
|
|
173
|
+
IdOverrides["LiquidationProtection"] = "liquidation-protection";
|
|
174
|
+
IdOverrides["EoaLiquidationProtection"] = "liquidation-protection-eoa";
|
|
171
175
|
})(IdOverrides = Strategies.IdOverrides || (Strategies.IdOverrides = {}));
|
|
172
176
|
})(Strategies || (Strategies = {}));
|
|
173
177
|
export var Bundles;
|
|
@@ -245,6 +249,14 @@ export var Bundles;
|
|
|
245
249
|
MainnetIds[MainnetIds["AAVE_V4_EOA_REPAY_ON_PRICE"] = 68] = "AAVE_V4_EOA_REPAY_ON_PRICE";
|
|
246
250
|
MainnetIds[MainnetIds["AAVE_V4_EOA_BOOST_ON_PRICE"] = 69] = "AAVE_V4_EOA_BOOST_ON_PRICE";
|
|
247
251
|
MainnetIds[MainnetIds["AAVE_V4_EOA_CLOSE"] = 70] = "AAVE_V4_EOA_CLOSE";
|
|
252
|
+
MainnetIds[MainnetIds["AAVE_V3_LIQUIDATION_PROTECTION"] = 71] = "AAVE_V3_LIQUIDATION_PROTECTION";
|
|
253
|
+
MainnetIds[MainnetIds["SPARK_LIQUIDATION_PROTECTION"] = 72] = "SPARK_LIQUIDATION_PROTECTION";
|
|
254
|
+
MainnetIds[MainnetIds["COMP_V3_SW_LIQUIDATION_PROTECTION"] = 73] = "COMP_V3_SW_LIQUIDATION_PROTECTION";
|
|
255
|
+
MainnetIds[MainnetIds["COMP_V3_EOA_LIQUIDATION_PROTECTION"] = 74] = "COMP_V3_EOA_LIQUIDATION_PROTECTION";
|
|
256
|
+
MainnetIds[MainnetIds["MAKER_LIQUIDATION_PROTECTION"] = 75] = "MAKER_LIQUIDATION_PROTECTION";
|
|
257
|
+
MainnetIds[MainnetIds["FLUID_T1_LIQUIDATION_PROTECTION"] = 76] = "FLUID_T1_LIQUIDATION_PROTECTION";
|
|
258
|
+
MainnetIds[MainnetIds["AAVE_V4_LIQUIDATION_PROTECTION"] = 77] = "AAVE_V4_LIQUIDATION_PROTECTION";
|
|
259
|
+
MainnetIds[MainnetIds["MORPHO_BLUE_LIQUIDATION_PROTECTION"] = 78] = "MORPHO_BLUE_LIQUIDATION_PROTECTION";
|
|
248
260
|
})(MainnetIds = Bundles.MainnetIds || (Bundles.MainnetIds = {}));
|
|
249
261
|
let OptimismIds;
|
|
250
262
|
(function (OptimismIds) {
|
|
@@ -259,6 +271,7 @@ export var Bundles;
|
|
|
259
271
|
OptimismIds[OptimismIds["AAVE_V3_EOA_REPAY_ON_PRICE"] = 8] = "AAVE_V3_EOA_REPAY_ON_PRICE";
|
|
260
272
|
OptimismIds[OptimismIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 9] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
261
273
|
OptimismIds[OptimismIds["AAVE_V3_EOA_CLOSE"] = 10] = "AAVE_V3_EOA_CLOSE";
|
|
274
|
+
OptimismIds[OptimismIds["AAVE_V3_LIQUIDATION_PROTECTION"] = 11] = "AAVE_V3_LIQUIDATION_PROTECTION";
|
|
262
275
|
})(OptimismIds = Bundles.OptimismIds || (Bundles.OptimismIds = {}));
|
|
263
276
|
let BaseIds;
|
|
264
277
|
(function (BaseIds) {
|
|
@@ -289,6 +302,11 @@ export var Bundles;
|
|
|
289
302
|
BaseIds[BaseIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 26] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
290
303
|
BaseIds[BaseIds["AAVE_V3_EOA_CLOSE"] = 27] = "AAVE_V3_EOA_CLOSE";
|
|
291
304
|
BaseIds[BaseIds["MORPHO_BLUE_CLOSE"] = 28] = "MORPHO_BLUE_CLOSE";
|
|
305
|
+
BaseIds[BaseIds["AAVE_V3_LIQUIDATION_PROTECTION"] = 29] = "AAVE_V3_LIQUIDATION_PROTECTION";
|
|
306
|
+
BaseIds[BaseIds["FLUID_T1_LIQUIDATION_PROTECTION"] = 30] = "FLUID_T1_LIQUIDATION_PROTECTION";
|
|
307
|
+
BaseIds[BaseIds["MORPHO_BLUE_LIQUIDATION_PROTECTION"] = 31] = "MORPHO_BLUE_LIQUIDATION_PROTECTION";
|
|
308
|
+
BaseIds[BaseIds["COMP_V3_SW_LIQUIDATION_PROTECTION"] = 32] = "COMP_V3_SW_LIQUIDATION_PROTECTION";
|
|
309
|
+
BaseIds[BaseIds["COMP_V3_EOA_LIQUIDATION_PROTECTION"] = 33] = "COMP_V3_EOA_LIQUIDATION_PROTECTION";
|
|
292
310
|
})(BaseIds = Bundles.BaseIds || (Bundles.BaseIds = {}));
|
|
293
311
|
let ArbitrumIds;
|
|
294
312
|
(function (ArbitrumIds) {
|
|
@@ -321,5 +339,10 @@ export var Bundles;
|
|
|
321
339
|
ArbitrumIds[ArbitrumIds["MORPHO_BLUE_EOA_REPAY"] = 26] = "MORPHO_BLUE_EOA_REPAY";
|
|
322
340
|
ArbitrumIds[ArbitrumIds["MORPHO_BLUE_EOA_BOOST"] = 27] = "MORPHO_BLUE_EOA_BOOST";
|
|
323
341
|
ArbitrumIds[ArbitrumIds["MORPHO_BLUE_CLOSE"] = 28] = "MORPHO_BLUE_CLOSE";
|
|
342
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_LIQUIDATION_PROTECTION"] = 29] = "AAVE_V3_LIQUIDATION_PROTECTION";
|
|
343
|
+
ArbitrumIds[ArbitrumIds["FLUID_T1_LIQUIDATION_PROTECTION"] = 30] = "FLUID_T1_LIQUIDATION_PROTECTION";
|
|
344
|
+
ArbitrumIds[ArbitrumIds["MORPHO_BLUE_LIQUIDATION_PROTECTION"] = 31] = "MORPHO_BLUE_LIQUIDATION_PROTECTION";
|
|
345
|
+
ArbitrumIds[ArbitrumIds["COMP_V3_SW_LIQUIDATION_PROTECTION"] = 32] = "COMP_V3_SW_LIQUIDATION_PROTECTION";
|
|
346
|
+
ArbitrumIds[ArbitrumIds["COMP_V3_EOA_LIQUIDATION_PROTECTION"] = 33] = "COMP_V3_EOA_LIQUIDATION_PROTECTION";
|
|
324
347
|
})(ArbitrumIds = Bundles.ArbitrumIds || (Bundles.ArbitrumIds = {}));
|
|
325
348
|
})(Bundles || (Bundles = {}));
|