@defisaver/automation-sdk 3.3.21-debt-switch-dev-dev → 3.3.21-instant-twap-close-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 +10 -40
- package/cjs/services/strategiesService.js +21 -9
- package/cjs/services/strategiesService.test.js +62 -0
- package/cjs/services/strategySubService.d.ts +1 -1
- package/cjs/services/strategySubService.js +7 -6
- package/cjs/services/strategySubService.test.js +111 -71
- package/cjs/services/subDataService.d.ts +12 -10
- package/cjs/services/subDataService.js +36 -30
- package/cjs/services/subDataService.test.js +70 -104
- package/cjs/types/enums.d.ts +9 -15
- package/cjs/types/enums.js +4 -10
- package/esm/constants/index.js +10 -40
- package/esm/services/strategiesService.js +21 -9
- package/esm/services/strategiesService.test.js +63 -1
- package/esm/services/strategySubService.d.ts +1 -1
- package/esm/services/strategySubService.js +7 -6
- package/esm/services/strategySubService.test.js +111 -71
- package/esm/services/subDataService.d.ts +12 -10
- package/esm/services/subDataService.js +35 -29
- package/esm/services/subDataService.test.js +70 -104
- package/esm/types/enums.d.ts +9 -15
- package/esm/types/enums.js +4 -10
- package/package.json +1 -1
- package/src/constants/index.ts +10 -40
- package/src/services/strategiesService.test.ts +78 -1
- package/src/services/strategiesService.ts +27 -9
- package/src/services/strategySubService.test.ts +125 -84
- package/src/services/strategySubService.ts +20 -16
- package/src/services/subDataService.test.ts +98 -108
- package/src/services/subDataService.ts +51 -40
- package/src/types/enums.ts +4 -10
|
@@ -732,6 +732,117 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
732
732
|
});
|
|
733
733
|
});
|
|
734
734
|
});
|
|
735
|
+
describe('instantCloseOnPriceGeneric()', () => {
|
|
736
|
+
const examples = [
|
|
737
|
+
// Stop loss only (to debt)
|
|
738
|
+
[
|
|
739
|
+
[
|
|
740
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
741
|
+
true,
|
|
742
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000000000000000'],
|
|
743
|
+
[
|
|
744
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
745
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
746
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
747
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
748
|
+
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
749
|
+
'0x0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e',
|
|
750
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
751
|
+
'0x0000000000000000000000000000000000000000000000000de0b6b3a7640000',
|
|
752
|
+
'0x000000000000000000000000000000000000000000000000002386f26fc10000',
|
|
753
|
+
],
|
|
754
|
+
],
|
|
755
|
+
[
|
|
756
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
757
|
+
web3Utils.toChecksumAddress(getAssetInfo('WETH', ChainId.Ethereum).address),
|
|
758
|
+
0,
|
|
759
|
+
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
760
|
+
1,
|
|
761
|
+
web3Utils.toChecksumAddress('0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e'),
|
|
762
|
+
web3Utils.toChecksumAddress('0x1234567890123456789012345678901234567890'),
|
|
763
|
+
'1000000000000000000',
|
|
764
|
+
'10000000000000000',
|
|
765
|
+
1500,
|
|
766
|
+
CloseToAssetType.DEBT,
|
|
767
|
+
0,
|
|
768
|
+
CloseToAssetType.COLLATERAL, // takeProfitType (not used since price is 0)
|
|
769
|
+
]
|
|
770
|
+
],
|
|
771
|
+
// Take profit only (to collateral), zero tsi and slippage
|
|
772
|
+
[
|
|
773
|
+
[
|
|
774
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
775
|
+
true,
|
|
776
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746a528800'],
|
|
777
|
+
[
|
|
778
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
779
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
780
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
781
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
782
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
783
|
+
'0x0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e',
|
|
784
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
785
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
786
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
787
|
+
],
|
|
788
|
+
],
|
|
789
|
+
[
|
|
790
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
791
|
+
web3Utils.toChecksumAddress(getAssetInfo('WETH', ChainId.Ethereum).address),
|
|
792
|
+
0,
|
|
793
|
+
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
794
|
+
1,
|
|
795
|
+
web3Utils.toChecksumAddress('0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e'),
|
|
796
|
+
web3Utils.toChecksumAddress('0x1234567890123456789012345678901234567890'),
|
|
797
|
+
'0',
|
|
798
|
+
'0',
|
|
799
|
+
0,
|
|
800
|
+
CloseToAssetType.DEBT,
|
|
801
|
+
5000,
|
|
802
|
+
CloseToAssetType.COLLATERAL, // takeProfitType
|
|
803
|
+
]
|
|
804
|
+
],
|
|
805
|
+
// Take profit (to debt) and stop loss (to collateral)
|
|
806
|
+
[
|
|
807
|
+
[
|
|
808
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
809
|
+
true,
|
|
810
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
811
|
+
[
|
|
812
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
813
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
814
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
815
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
816
|
+
'0x0000000000000000000000000000000000000000000000000000000000000007',
|
|
817
|
+
'0x0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e',
|
|
818
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
819
|
+
'0x00000000000000000000000000000000000000000000000000b1a2bc2ec50000',
|
|
820
|
+
'0x0000000000000000000000000000000000000000000000000011c37937e08000',
|
|
821
|
+
],
|
|
822
|
+
],
|
|
823
|
+
[
|
|
824
|
+
Bundles.MainnetIds.AAVE_V3_EOA_INSTANT_CLOSE,
|
|
825
|
+
web3Utils.toChecksumAddress(getAssetInfo('WETH', ChainId.Ethereum).address),
|
|
826
|
+
0,
|
|
827
|
+
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
828
|
+
1,
|
|
829
|
+
web3Utils.toChecksumAddress('0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e'),
|
|
830
|
+
web3Utils.toChecksumAddress('0x1234567890123456789012345678901234567890'),
|
|
831
|
+
'50000000000000000',
|
|
832
|
+
'5000000000000000',
|
|
833
|
+
1500,
|
|
834
|
+
CloseToAssetType.COLLATERAL,
|
|
835
|
+
4000,
|
|
836
|
+
CloseToAssetType.DEBT, // takeProfitType
|
|
837
|
+
]
|
|
838
|
+
],
|
|
839
|
+
];
|
|
840
|
+
examples.forEach(([expected, actual]) => {
|
|
841
|
+
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
842
|
+
expect(aaveV3Encode.instantCloseOnPriceGeneric(...actual)).to.eql(expected);
|
|
843
|
+
});
|
|
844
|
+
});
|
|
845
|
+
});
|
|
735
846
|
describe('collateralSwitch()', () => {
|
|
736
847
|
const examples = [
|
|
737
848
|
// WETH -> USDC, price 100000, state UNDER
|
|
@@ -831,77 +942,6 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
831
942
|
});
|
|
832
943
|
});
|
|
833
944
|
});
|
|
834
|
-
describe('debtSwitch()', () => {
|
|
835
|
-
const examples = [
|
|
836
|
-
// USDC -> DAI, price 100000, state UNDER
|
|
837
|
-
[
|
|
838
|
-
[
|
|
839
|
-
Strategies.MainnetIds.AAVE_V3_DEBT_SWITCH,
|
|
840
|
-
false,
|
|
841
|
-
['0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000009184e72a0000000000000000000000000000000000000000000000000000000000000000001'],
|
|
842
|
-
[
|
|
843
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
844
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
845
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
846
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
847
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
848
|
-
'0x0000000000000000000000000000000000000000000000008ac7230489e80000',
|
|
849
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
850
|
-
],
|
|
851
|
-
],
|
|
852
|
-
[
|
|
853
|
-
Strategies.MainnetIds.AAVE_V3_DEBT_SWITCH,
|
|
854
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
855
|
-
1,
|
|
856
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
857
|
-
3,
|
|
858
|
-
web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
859
|
-
'10000000000000000000',
|
|
860
|
-
web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
861
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
862
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
863
|
-
100000,
|
|
864
|
-
RatioState.UNDER,
|
|
865
|
-
]
|
|
866
|
-
],
|
|
867
|
-
// DAI -> USDC (MaxUint256), price 1, state OVER
|
|
868
|
-
[
|
|
869
|
-
[
|
|
870
|
-
Strategies.MainnetIds.AAVE_V3_DEBT_SWITCH,
|
|
871
|
-
false,
|
|
872
|
-
['0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000000000000'],
|
|
873
|
-
[
|
|
874
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
875
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
876
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
877
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
878
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
879
|
-
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
|
|
880
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
881
|
-
],
|
|
882
|
-
],
|
|
883
|
-
[
|
|
884
|
-
Strategies.MainnetIds.AAVE_V3_DEBT_SWITCH,
|
|
885
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
886
|
-
3,
|
|
887
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
888
|
-
1,
|
|
889
|
-
web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
890
|
-
MAXUINT,
|
|
891
|
-
web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
892
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
893
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
894
|
-
1,
|
|
895
|
-
RatioState.OVER,
|
|
896
|
-
]
|
|
897
|
-
],
|
|
898
|
-
];
|
|
899
|
-
examples.forEach(([expected, actual]) => {
|
|
900
|
-
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
901
|
-
expect(aaveV3Encode.debtSwitch(...actual)).to.eql(expected);
|
|
902
|
-
});
|
|
903
|
-
});
|
|
904
|
-
});
|
|
905
945
|
});
|
|
906
946
|
describe('When testing strategySubService.compoundV3Encode', () => {
|
|
907
947
|
describe('leverageManagementOnPrice()', () => {
|
|
@@ -248,19 +248,22 @@ export declare const aaveV3CloseGenericSubData: {
|
|
|
248
248
|
owner: EthereumAddress;
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
|
-
export declare const
|
|
252
|
-
encode(
|
|
251
|
+
export declare const aaveV3InstantCloseGenericSubData: {
|
|
252
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, closeType: CloseStrategyType, marketAddr: EthereumAddress, user: EthereumAddress, tsi: string, slippage: string): string[];
|
|
253
253
|
decode(subData: string[]): {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
collAsset: EthereumAddress;
|
|
255
|
+
collAssetId: number;
|
|
256
|
+
debtAsset: EthereumAddress;
|
|
257
|
+
debtAssetId: number;
|
|
258
|
+
closeType: CloseStrategyType;
|
|
258
259
|
marketAddr: EthereumAddress;
|
|
259
|
-
|
|
260
|
+
owner: EthereumAddress;
|
|
261
|
+
tsi: string;
|
|
262
|
+
slippage: string;
|
|
260
263
|
};
|
|
261
264
|
};
|
|
262
|
-
export declare const
|
|
263
|
-
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string,
|
|
265
|
+
export declare const aaveV3CollateralSwitchSubData: {
|
|
266
|
+
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string, useOnBehalf?: boolean): string[];
|
|
264
267
|
decode(subData: string[]): {
|
|
265
268
|
fromAsset: EthereumAddress;
|
|
266
269
|
fromAssetId: number;
|
|
@@ -268,7 +271,6 @@ export declare const aaveV3DebtSwitchSubData: {
|
|
|
268
271
|
toAssetId: number;
|
|
269
272
|
marketAddr: EthereumAddress;
|
|
270
273
|
amountToSwitch: string;
|
|
271
|
-
user: EthereumAddress;
|
|
272
274
|
};
|
|
273
275
|
};
|
|
274
276
|
export declare const aaveV3QuotePriceSubData: {
|
|
@@ -511,46 +511,53 @@ export const aaveV3CloseGenericSubData = {
|
|
|
511
511
|
};
|
|
512
512
|
},
|
|
513
513
|
};
|
|
514
|
-
export const
|
|
515
|
-
encode(
|
|
516
|
-
const
|
|
517
|
-
const
|
|
518
|
-
const
|
|
519
|
-
const
|
|
520
|
-
const
|
|
521
|
-
const
|
|
522
|
-
const
|
|
514
|
+
export const aaveV3InstantCloseGenericSubData = {
|
|
515
|
+
encode(collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user, tsi, slippage) {
|
|
516
|
+
const encodedColl = AbiCoder.encodeParameter('address', collAsset);
|
|
517
|
+
const encodedCollId = AbiCoder.encodeParameter('uint16', collAssetId);
|
|
518
|
+
const encodedDebt = AbiCoder.encodeParameter('address', debtAsset);
|
|
519
|
+
const encodedDebtId = AbiCoder.encodeParameter('uint16', debtAssetId);
|
|
520
|
+
const encodedCloseType = AbiCoder.encodeParameter('uint8', closeType);
|
|
521
|
+
const encodedMarket = AbiCoder.encodeParameter('address', marketAddr);
|
|
522
|
+
const encodedUser = AbiCoder.encodeParameter('address', user);
|
|
523
|
+
const encodedTsi = AbiCoder.encodeParameter('uint256', tsi);
|
|
524
|
+
const encodedSlippage = AbiCoder.encodeParameter('uint256', slippage);
|
|
523
525
|
return [
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
526
|
+
encodedColl,
|
|
527
|
+
encodedCollId,
|
|
528
|
+
encodedDebt,
|
|
529
|
+
encodedDebtId,
|
|
530
|
+
encodedCloseType,
|
|
531
|
+
encodedMarket,
|
|
532
|
+
encodedUser,
|
|
533
|
+
encodedTsi,
|
|
534
|
+
encodedSlippage,
|
|
531
535
|
];
|
|
532
536
|
},
|
|
533
537
|
decode(subData) {
|
|
534
|
-
const
|
|
535
|
-
const
|
|
536
|
-
const
|
|
537
|
-
const
|
|
538
|
-
const
|
|
539
|
-
const
|
|
538
|
+
const collAsset = AbiCoder.decodeParameter('address', subData[0]);
|
|
539
|
+
const collAssetId = Number(AbiCoder.decodeParameter('uint16', subData[1]));
|
|
540
|
+
const debtAsset = AbiCoder.decodeParameter('address', subData[2]);
|
|
541
|
+
const debtAssetId = Number(AbiCoder.decodeParameter('uint16', subData[3]));
|
|
542
|
+
const closeType = Number(AbiCoder.decodeParameter('uint8', subData[4]));
|
|
543
|
+
const marketAddr = AbiCoder.decodeParameter('address', subData[5]);
|
|
544
|
+
const owner = AbiCoder.decodeParameter('address', subData[6]);
|
|
545
|
+
const tsi = AbiCoder.decodeParameter('uint256', subData[7]);
|
|
546
|
+
const slippage = AbiCoder.decodeParameter('uint256', subData[8]);
|
|
540
547
|
return {
|
|
541
|
-
|
|
548
|
+
collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, owner, tsi, slippage,
|
|
542
549
|
};
|
|
543
550
|
},
|
|
544
551
|
};
|
|
545
|
-
export const
|
|
546
|
-
encode(fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch,
|
|
552
|
+
export const aaveV3CollateralSwitchSubData = {
|
|
553
|
+
encode(fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch, useOnBehalf = false) {
|
|
547
554
|
const encodedFromAsset = AbiCoder.encodeParameter('address', fromAsset);
|
|
548
555
|
const encodedFromAssetId = AbiCoder.encodeParameter('uint8', fromAssetId);
|
|
549
556
|
const encodedToAsset = AbiCoder.encodeParameter('address', toAsset);
|
|
550
557
|
const encodedToAssetId = AbiCoder.encodeParameter('uint8', toAssetId);
|
|
551
558
|
const encodedMarketAddr = AbiCoder.encodeParameter('address', marketAddr);
|
|
552
559
|
const encodedAmountToSwitch = AbiCoder.encodeParameter('uint256', amountToSwitch);
|
|
553
|
-
const
|
|
560
|
+
const encodedUseOnBehalf = AbiCoder.encodeParameter('bool', useOnBehalf);
|
|
554
561
|
return [
|
|
555
562
|
encodedFromAsset,
|
|
556
563
|
encodedFromAssetId,
|
|
@@ -558,7 +565,7 @@ export const aaveV3DebtSwitchSubData = {
|
|
|
558
565
|
encodedToAssetId,
|
|
559
566
|
encodedMarketAddr,
|
|
560
567
|
encodedAmountToSwitch,
|
|
561
|
-
|
|
568
|
+
encodedUseOnBehalf,
|
|
562
569
|
];
|
|
563
570
|
},
|
|
564
571
|
decode(subData) {
|
|
@@ -568,9 +575,8 @@ export const aaveV3DebtSwitchSubData = {
|
|
|
568
575
|
const toAssetId = Number(AbiCoder.decodeParameter('uint8', subData[3]));
|
|
569
576
|
const marketAddr = AbiCoder.decodeParameter('address', subData[4]);
|
|
570
577
|
const amountToSwitch = AbiCoder.decodeParameter('uint256', subData[5]);
|
|
571
|
-
const user = AbiCoder.decodeParameter('address', subData[6]);
|
|
572
578
|
return {
|
|
573
|
-
fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch,
|
|
579
|
+
fromAsset, fromAssetId, toAsset, toAssetId, marketAddr, amountToSwitch,
|
|
574
580
|
};
|
|
575
581
|
},
|
|
576
582
|
};
|
|
@@ -510,110 +510,6 @@ describe('Feature: subDataService.ts', () => {
|
|
|
510
510
|
});
|
|
511
511
|
});
|
|
512
512
|
});
|
|
513
|
-
describe('When testing subDataService.aaveV3DebtSwitchSubData', () => {
|
|
514
|
-
describe('encode()', () => {
|
|
515
|
-
const examples = [
|
|
516
|
-
// USDC -> DAI
|
|
517
|
-
[
|
|
518
|
-
[
|
|
519
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
520
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
521
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
522
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
523
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
524
|
-
'0x0000000000000000000000000000000000000000000000008ac7230489e80000',
|
|
525
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
526
|
-
],
|
|
527
|
-
[
|
|
528
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
529
|
-
1,
|
|
530
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
531
|
-
3,
|
|
532
|
-
web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
533
|
-
'10000000000000000000',
|
|
534
|
-
web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
535
|
-
]
|
|
536
|
-
],
|
|
537
|
-
// DAI -> USDC (MaxUint256)
|
|
538
|
-
[
|
|
539
|
-
[
|
|
540
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
541
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
542
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
543
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
544
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
545
|
-
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
|
|
546
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
547
|
-
],
|
|
548
|
-
[
|
|
549
|
-
web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
550
|
-
3,
|
|
551
|
-
web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
552
|
-
1,
|
|
553
|
-
web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
554
|
-
MAXUINT,
|
|
555
|
-
web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
556
|
-
]
|
|
557
|
-
],
|
|
558
|
-
];
|
|
559
|
-
examples.forEach(([expected, actual]) => {
|
|
560
|
-
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
561
|
-
expect(subDataService.aaveV3DebtSwitchSubData.encode(...actual)).to.eql(expected);
|
|
562
|
-
});
|
|
563
|
-
});
|
|
564
|
-
});
|
|
565
|
-
describe('decode()', () => {
|
|
566
|
-
const examples = [
|
|
567
|
-
// USDC -> DAI
|
|
568
|
-
[
|
|
569
|
-
{
|
|
570
|
-
fromAsset: web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
571
|
-
fromAssetId: 1,
|
|
572
|
-
toAsset: web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
573
|
-
toAssetId: 3,
|
|
574
|
-
marketAddr: web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
575
|
-
amountToSwitch: '10000000000000000000',
|
|
576
|
-
user: web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
577
|
-
},
|
|
578
|
-
[
|
|
579
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
580
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
581
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
582
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
583
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
584
|
-
'0x0000000000000000000000000000000000000000000000008ac7230489e80000',
|
|
585
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
586
|
-
],
|
|
587
|
-
],
|
|
588
|
-
// DAI -> USDC (MaxUint256)
|
|
589
|
-
[
|
|
590
|
-
{
|
|
591
|
-
fromAsset: web3Utils.toChecksumAddress(getAssetInfo('DAI', ChainId.Ethereum).address),
|
|
592
|
-
fromAssetId: 3,
|
|
593
|
-
toAsset: web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address),
|
|
594
|
-
toAssetId: 1,
|
|
595
|
-
marketAddr: web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39'),
|
|
596
|
-
amountToSwitch: MAXUINT,
|
|
597
|
-
user: web3Utils.toChecksumAddress('0xDd6ecD6c9b9F7e29E0f14bb9D5F0D0A3C6cB6c6A'),
|
|
598
|
-
},
|
|
599
|
-
[
|
|
600
|
-
'0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f',
|
|
601
|
-
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
602
|
-
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
603
|
-
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
604
|
-
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
605
|
-
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
|
|
606
|
-
'0x000000000000000000000000dd6ecd6c9b9f7e29e0f14bb9d5f0d0a3c6cb6c6a',
|
|
607
|
-
],
|
|
608
|
-
],
|
|
609
|
-
];
|
|
610
|
-
examples.forEach(([expected, actual]) => {
|
|
611
|
-
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
612
|
-
expect(subDataService.aaveV3DebtSwitchSubData.decode(actual)).to.eql(expected);
|
|
613
|
-
});
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
});
|
|
617
513
|
describe('When testing subDataService.sparkCollateralSwitchSubData', () => {
|
|
618
514
|
describe('encode()', () => {
|
|
619
515
|
const examples = [
|
|
@@ -2360,6 +2256,76 @@ describe('Feature: subDataService.ts', () => {
|
|
|
2360
2256
|
});
|
|
2361
2257
|
});
|
|
2362
2258
|
});
|
|
2259
|
+
describe("When testing subDataService.aaveV3InstantCloseGenericSubData", () => {
|
|
2260
|
+
const WETH = web3Utils.toChecksumAddress(getAssetInfo('WETH', ChainId.Ethereum).address);
|
|
2261
|
+
const USDC = web3Utils.toChecksumAddress(getAssetInfo('USDC', ChainId.Ethereum).address);
|
|
2262
|
+
const MARKET = web3Utils.toChecksumAddress('0x87870Bca3F3fD6335C3F4ce8392D69d0B4161d39');
|
|
2263
|
+
const USER = web3Utils.toChecksumAddress('0x1234567890123456789012345678901234567890');
|
|
2264
|
+
const examples = [
|
|
2265
|
+
// TAKE_PROFIT_IN_COLLATERAL, zero tsi and slippage
|
|
2266
|
+
[
|
|
2267
|
+
[
|
|
2268
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
2269
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2270
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
2271
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
2272
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2273
|
+
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
2274
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
2275
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2276
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2277
|
+
],
|
|
2278
|
+
[WETH, 0, USDC, 1, CloseStrategyType.TAKE_PROFIT_IN_COLLATERAL, MARKET, USER, '0', '0'],
|
|
2279
|
+
],
|
|
2280
|
+
// STOP_LOSS_IN_DEBT
|
|
2281
|
+
[
|
|
2282
|
+
[
|
|
2283
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
2284
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2285
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
2286
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
2287
|
+
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
2288
|
+
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
2289
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
2290
|
+
'0x0000000000000000000000000000000000000000000000000de0b6b3a7640000',
|
|
2291
|
+
'0x000000000000000000000000000000000000000000000000002386f26fc10000',
|
|
2292
|
+
],
|
|
2293
|
+
[WETH, 0, USDC, 1, CloseStrategyType.STOP_LOSS_IN_DEBT, MARKET, USER, '1000000000000000000', '10000000000000000'],
|
|
2294
|
+
],
|
|
2295
|
+
// TAKE_PROFIT_IN_DEBT_AND_STOP_LOSS_IN_COLLATERAL, asset ids above uint8 range
|
|
2296
|
+
[
|
|
2297
|
+
[
|
|
2298
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
2299
|
+
'0x000000000000000000000000000000000000000000000000000000000000012c',
|
|
2300
|
+
'0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
2301
|
+
'0x0000000000000000000000000000000000000000000000000000000000000190',
|
|
2302
|
+
'0x0000000000000000000000000000000000000000000000000000000000000007',
|
|
2303
|
+
'0x00000000000000000000000087870bca3f3fd6335c3f4ce8392d69d0b4161d39',
|
|
2304
|
+
'0x0000000000000000000000001234567890123456789012345678901234567890',
|
|
2305
|
+
'0x00000000000000000000000000000000000000000000000000b1a2bc2ec50000',
|
|
2306
|
+
'0x0000000000000000000000000000000000000000000000000011c37937e08000',
|
|
2307
|
+
],
|
|
2308
|
+
[WETH, 300, USDC, 400, CloseStrategyType.TAKE_PROFIT_IN_DEBT_AND_STOP_LOSS_IN_COLLATERAL, MARKET, USER, '50000000000000000', '5000000000000000'],
|
|
2309
|
+
],
|
|
2310
|
+
];
|
|
2311
|
+
describe("encode()", () => {
|
|
2312
|
+
examples.forEach(([expected, actual]) => {
|
|
2313
|
+
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
2314
|
+
expect(subDataService.aaveV3InstantCloseGenericSubData.encode(...actual)).to.eql(expected);
|
|
2315
|
+
});
|
|
2316
|
+
});
|
|
2317
|
+
});
|
|
2318
|
+
describe("decode()", () => {
|
|
2319
|
+
examples.forEach(([encoded, [collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user, tsi, slippage]]) => {
|
|
2320
|
+
const expected = {
|
|
2321
|
+
collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, owner: user, tsi, slippage,
|
|
2322
|
+
};
|
|
2323
|
+
it(`Given ${JSON.stringify(encoded)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
2324
|
+
expect(subDataService.aaveV3InstantCloseGenericSubData.decode(encoded)).to.eql(expected);
|
|
2325
|
+
});
|
|
2326
|
+
});
|
|
2327
|
+
});
|
|
2328
|
+
});
|
|
2363
2329
|
describe('When testing subDataService.sparkLeverageManagementOnPriceSubData', () => {
|
|
2364
2330
|
describe('encode()', () => {
|
|
2365
2331
|
const examples = [
|
package/esm/types/enums.d.ts
CHANGED
|
@@ -91,30 +91,22 @@ export declare namespace Strategies {
|
|
|
91
91
|
AAVE_V4_COLLATERAL_SWITCH = 154,
|
|
92
92
|
AAVE_V4_COLLATERAL_SWITCH_EOA = 155,
|
|
93
93
|
SPARK_COLLATERAL_SWITCH = 156,
|
|
94
|
-
SPARK_GENERIC_FL_COLLATERAL_SWITCH = 167
|
|
95
|
-
AAVE_V3_DEBT_SWITCH = 168,
|
|
96
|
-
AAVE_V3_DEBT_SWITCH_EOA = 169
|
|
94
|
+
SPARK_GENERIC_FL_COLLATERAL_SWITCH = 167
|
|
97
95
|
}
|
|
98
96
|
enum OptimismIds {
|
|
99
97
|
EXCHANGE_DCA = 8,
|
|
100
98
|
EXCHANGE_LIMIT_ORDER = 9,
|
|
101
|
-
AAVE_V3_COLLATERAL_SWITCH = 24
|
|
102
|
-
AAVE_V3_DEBT_SWITCH = 25,
|
|
103
|
-
AAVE_V3_DEBT_SWITCH_EOA = 26
|
|
99
|
+
AAVE_V3_COLLATERAL_SWITCH = 24
|
|
104
100
|
}
|
|
105
101
|
enum BaseIds {
|
|
106
102
|
EXCHANGE_DCA = 8,
|
|
107
103
|
EXCHANGE_LIMIT_ORDER = 9,
|
|
108
|
-
AAVE_V3_COLLATERAL_SWITCH = 56
|
|
109
|
-
AAVE_V3_DEBT_SWITCH = 61,
|
|
110
|
-
AAVE_V3_DEBT_SWITCH_EOA = 62
|
|
104
|
+
AAVE_V3_COLLATERAL_SWITCH = 56
|
|
111
105
|
}
|
|
112
106
|
enum ArbitrumIds {
|
|
113
107
|
EXCHANGE_DCA = 8,
|
|
114
108
|
EXCHANGE_LIMIT_ORDER = 9,
|
|
115
|
-
AAVE_V3_COLLATERAL_SWITCH = 50
|
|
116
|
-
AAVE_V3_DEBT_SWITCH = 55,
|
|
117
|
-
AAVE_V3_DEBT_SWITCH_EOA = 56
|
|
109
|
+
AAVE_V3_COLLATERAL_SWITCH = 50
|
|
118
110
|
}
|
|
119
111
|
enum Identifiers {
|
|
120
112
|
SavingsLiqProtection = "smart-savings-liquidation-protection",
|
|
@@ -132,6 +124,8 @@ export declare namespace Strategies {
|
|
|
132
124
|
CloseOnPriceToColl = "close-on-price-to-collateral",
|
|
133
125
|
CloseOnPrice = "close-on-price",
|
|
134
126
|
EoaCloseOnPrice = "eoa-close-on-price",
|
|
127
|
+
InstantCloseOnPrice = "instant-close-on-price",
|
|
128
|
+
EoaInstantCloseOnPrice = "eoa-instant-close-on-price",
|
|
135
129
|
TrailingStopToColl = "trailing-stop-to-collateral",
|
|
136
130
|
TrailingStopToDebt = "trailing-stop-to-debt",
|
|
137
131
|
Rebond = "rebond",
|
|
@@ -148,8 +142,6 @@ export declare namespace Strategies {
|
|
|
148
142
|
EoaRepayOnPrice = "eoa-repay-on-price",
|
|
149
143
|
CollateralSwitch = "collateral-switch",
|
|
150
144
|
EoaCollateralSwitch = "eoa-collateral-switch",
|
|
151
|
-
DebtSwitch = "debt-switch",
|
|
152
|
-
EoaDebtSwitch = "eoa-debt-switch",
|
|
153
145
|
LiquidationProtection = "liquidation-protection",
|
|
154
146
|
EoaLiquidationProtection = "liquidation-protection-eoa"
|
|
155
147
|
}
|
|
@@ -260,7 +252,9 @@ export declare namespace Bundles {
|
|
|
260
252
|
SPARK_EOA_REPAY_ON_PRICE = 90,
|
|
261
253
|
SPARK_EOA_BOOST_ON_PRICE = 91,
|
|
262
254
|
SPARK_EOA_CLOSE = 92,
|
|
263
|
-
SPARK_EOA_LIQUIDATION_PROTECTION = 93
|
|
255
|
+
SPARK_EOA_LIQUIDATION_PROTECTION = 93,
|
|
256
|
+
AAVE_V3_SW_INSTANT_CLOSE = 94,
|
|
257
|
+
AAVE_V3_EOA_INSTANT_CLOSE = 95
|
|
264
258
|
}
|
|
265
259
|
enum OptimismIds {
|
|
266
260
|
AAVE_V3_REPAY = 0,
|
package/esm/types/enums.js
CHANGED
|
@@ -105,32 +105,24 @@ export var Strategies;
|
|
|
105
105
|
MainnetIds[MainnetIds["AAVE_V4_COLLATERAL_SWITCH_EOA"] = 155] = "AAVE_V4_COLLATERAL_SWITCH_EOA";
|
|
106
106
|
MainnetIds[MainnetIds["SPARK_COLLATERAL_SWITCH"] = 156] = "SPARK_COLLATERAL_SWITCH";
|
|
107
107
|
MainnetIds[MainnetIds["SPARK_GENERIC_FL_COLLATERAL_SWITCH"] = 167] = "SPARK_GENERIC_FL_COLLATERAL_SWITCH";
|
|
108
|
-
MainnetIds[MainnetIds["AAVE_V3_DEBT_SWITCH"] = 168] = "AAVE_V3_DEBT_SWITCH";
|
|
109
|
-
MainnetIds[MainnetIds["AAVE_V3_DEBT_SWITCH_EOA"] = 169] = "AAVE_V3_DEBT_SWITCH_EOA";
|
|
110
108
|
})(MainnetIds = Strategies.MainnetIds || (Strategies.MainnetIds = {}));
|
|
111
109
|
let OptimismIds;
|
|
112
110
|
(function (OptimismIds) {
|
|
113
111
|
OptimismIds[OptimismIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
|
|
114
112
|
OptimismIds[OptimismIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
|
|
115
113
|
OptimismIds[OptimismIds["AAVE_V3_COLLATERAL_SWITCH"] = 24] = "AAVE_V3_COLLATERAL_SWITCH";
|
|
116
|
-
OptimismIds[OptimismIds["AAVE_V3_DEBT_SWITCH"] = 25] = "AAVE_V3_DEBT_SWITCH";
|
|
117
|
-
OptimismIds[OptimismIds["AAVE_V3_DEBT_SWITCH_EOA"] = 26] = "AAVE_V3_DEBT_SWITCH_EOA";
|
|
118
114
|
})(OptimismIds = Strategies.OptimismIds || (Strategies.OptimismIds = {}));
|
|
119
115
|
let BaseIds;
|
|
120
116
|
(function (BaseIds) {
|
|
121
117
|
BaseIds[BaseIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
|
|
122
118
|
BaseIds[BaseIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
|
|
123
119
|
BaseIds[BaseIds["AAVE_V3_COLLATERAL_SWITCH"] = 56] = "AAVE_V3_COLLATERAL_SWITCH";
|
|
124
|
-
BaseIds[BaseIds["AAVE_V3_DEBT_SWITCH"] = 61] = "AAVE_V3_DEBT_SWITCH";
|
|
125
|
-
BaseIds[BaseIds["AAVE_V3_DEBT_SWITCH_EOA"] = 62] = "AAVE_V3_DEBT_SWITCH_EOA";
|
|
126
120
|
})(BaseIds = Strategies.BaseIds || (Strategies.BaseIds = {}));
|
|
127
121
|
let ArbitrumIds;
|
|
128
122
|
(function (ArbitrumIds) {
|
|
129
123
|
ArbitrumIds[ArbitrumIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
|
|
130
124
|
ArbitrumIds[ArbitrumIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
|
|
131
125
|
ArbitrumIds[ArbitrumIds["AAVE_V3_COLLATERAL_SWITCH"] = 50] = "AAVE_V3_COLLATERAL_SWITCH";
|
|
132
|
-
ArbitrumIds[ArbitrumIds["AAVE_V3_DEBT_SWITCH"] = 55] = "AAVE_V3_DEBT_SWITCH";
|
|
133
|
-
ArbitrumIds[ArbitrumIds["AAVE_V3_DEBT_SWITCH_EOA"] = 56] = "AAVE_V3_DEBT_SWITCH_EOA";
|
|
134
126
|
})(ArbitrumIds = Strategies.ArbitrumIds || (Strategies.ArbitrumIds = {}));
|
|
135
127
|
let Identifiers;
|
|
136
128
|
(function (Identifiers) {
|
|
@@ -149,6 +141,8 @@ export var Strategies;
|
|
|
149
141
|
Identifiers["CloseOnPriceToColl"] = "close-on-price-to-collateral";
|
|
150
142
|
Identifiers["CloseOnPrice"] = "close-on-price";
|
|
151
143
|
Identifiers["EoaCloseOnPrice"] = "eoa-close-on-price";
|
|
144
|
+
Identifiers["InstantCloseOnPrice"] = "instant-close-on-price";
|
|
145
|
+
Identifiers["EoaInstantCloseOnPrice"] = "eoa-instant-close-on-price";
|
|
152
146
|
Identifiers["TrailingStopToColl"] = "trailing-stop-to-collateral";
|
|
153
147
|
Identifiers["TrailingStopToDebt"] = "trailing-stop-to-debt";
|
|
154
148
|
Identifiers["Rebond"] = "rebond";
|
|
@@ -165,8 +159,6 @@ export var Strategies;
|
|
|
165
159
|
Identifiers["EoaRepayOnPrice"] = "eoa-repay-on-price";
|
|
166
160
|
Identifiers["CollateralSwitch"] = "collateral-switch";
|
|
167
161
|
Identifiers["EoaCollateralSwitch"] = "eoa-collateral-switch";
|
|
168
|
-
Identifiers["DebtSwitch"] = "debt-switch";
|
|
169
|
-
Identifiers["EoaDebtSwitch"] = "eoa-debt-switch";
|
|
170
162
|
Identifiers["LiquidationProtection"] = "liquidation-protection";
|
|
171
163
|
Identifiers["EoaLiquidationProtection"] = "liquidation-protection-eoa";
|
|
172
164
|
})(Identifiers = Strategies.Identifiers || (Strategies.Identifiers = {}));
|
|
@@ -281,6 +273,8 @@ export var Bundles;
|
|
|
281
273
|
MainnetIds[MainnetIds["SPARK_EOA_BOOST_ON_PRICE"] = 91] = "SPARK_EOA_BOOST_ON_PRICE";
|
|
282
274
|
MainnetIds[MainnetIds["SPARK_EOA_CLOSE"] = 92] = "SPARK_EOA_CLOSE";
|
|
283
275
|
MainnetIds[MainnetIds["SPARK_EOA_LIQUIDATION_PROTECTION"] = 93] = "SPARK_EOA_LIQUIDATION_PROTECTION";
|
|
276
|
+
MainnetIds[MainnetIds["AAVE_V3_SW_INSTANT_CLOSE"] = 94] = "AAVE_V3_SW_INSTANT_CLOSE";
|
|
277
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_INSTANT_CLOSE"] = 95] = "AAVE_V3_EOA_INSTANT_CLOSE";
|
|
284
278
|
})(MainnetIds = Bundles.MainnetIds || (Bundles.MainnetIds = {}));
|
|
285
279
|
let OptimismIds;
|
|
286
280
|
(function (OptimismIds) {
|