@defisaver/automation-sdk 3.3.15-liq-prot-3-dev → 3.3.16-dev-13082-morpho-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.
Files changed (42) hide show
  1. package/cjs/constants/index.js +51 -111
  2. package/cjs/index.d.ts +2 -2
  3. package/cjs/index.js +2 -5
  4. package/cjs/services/strategiesService.js +13 -157
  5. package/cjs/services/strategySubService.d.ts +21 -18
  6. package/cjs/services/strategySubService.js +74 -78
  7. package/cjs/services/strategySubService.test.js +216 -3
  8. package/cjs/services/subDataService.d.ts +20 -70
  9. package/cjs/services/subDataService.js +79 -23
  10. package/cjs/services/subDataService.test.js +302 -17
  11. package/cjs/services/triggerService.test.js +60 -0
  12. package/cjs/services/utils.d.ts +1 -2
  13. package/cjs/services/utils.js +1 -14
  14. package/cjs/types/enums.d.ts +17 -33
  15. package/cjs/types/enums.js +14 -30
  16. package/esm/constants/index.js +51 -111
  17. package/esm/index.d.ts +2 -2
  18. package/esm/index.js +2 -5
  19. package/esm/services/strategiesService.js +13 -157
  20. package/esm/services/strategySubService.d.ts +21 -18
  21. package/esm/services/strategySubService.js +73 -78
  22. package/esm/services/strategySubService.test.js +214 -4
  23. package/esm/services/subDataService.d.ts +20 -70
  24. package/esm/services/subDataService.js +77 -21
  25. package/esm/services/subDataService.test.js +300 -18
  26. package/esm/services/triggerService.test.js +61 -1
  27. package/esm/services/utils.d.ts +1 -2
  28. package/esm/services/utils.js +1 -13
  29. package/esm/types/enums.d.ts +17 -33
  30. package/esm/types/enums.js +14 -30
  31. package/package.json +1 -1
  32. package/src/constants/index.ts +52 -113
  33. package/src/index.ts +6 -22
  34. package/src/services/strategiesService.ts +13 -221
  35. package/src/services/strategySubService.test.ts +275 -3
  36. package/src/services/strategySubService.ts +121 -173
  37. package/src/services/subDataService.test.ts +324 -18
  38. package/src/services/subDataService.ts +106 -42
  39. package/src/services/triggerService.test.ts +69 -0
  40. package/src/services/utils.test.ts +1 -1
  41. package/src/services/utils.ts +1 -15
  42. package/src/types/enums.ts +16 -30
@@ -1,10 +1,11 @@
1
1
  import { expect } from 'chai';
2
+ import Dec from 'decimal.js';
2
3
  import { otherAddresses } from '@defisaver/sdk';
3
4
  import { getAssetInfo, MAXUINT } from '@defisaver/tokens';
4
5
  import * as web3Utils from 'web3-utils';
5
6
  import { Bundles, ChainId, CloseToAssetType, RatioState, Strategies } from '../types/enums';
6
7
  import '../configuration';
7
- import { liquityEncode, makerEncode, aaveV3Encode, compoundV3Encode, exchangeEncode, crvUSDEncode, morphoBlueEncode, sparkEncode, aaveV4Encode, } from './strategySubService';
8
+ import { chickenBondsEncode, liquityEncode, makerEncode, aaveV3Encode, compoundV3Encode, morphoAaveV2Encode, exchangeEncode, crvUSDEncode, morphoBlueEncode, sparkEncode, aaveV4Encode, } from './strategySubService';
8
9
  describe('Feature: strategySubService.ts', () => {
9
10
  describe('When testing strategySubService.makerEncode', () => {
10
11
  // @ts-ignore // TODO - this requires change in @defisaver/tokens
@@ -95,7 +96,7 @@ describe('Feature: strategySubService.ts', () => {
95
96
  });
96
97
  });
97
98
  });
98
- describe('leverageManagement()', () => {
99
+ describe('leverageManagementWithoutSubProxy()', () => {
99
100
  const examples = [
100
101
  // Repay scenario (isBoost=false, RatioState.UNDER)
101
102
  [
@@ -138,7 +139,7 @@ describe('Feature: strategySubService.ts', () => {
138
139
  ];
139
140
  examples.forEach(([expected, actual]) => {
140
141
  it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
141
- expect(makerEncode.leverageManagement(...actual)).to.eql(expected);
142
+ expect(makerEncode.leverageManagementWithoutSubProxy(...actual)).to.eql(expected);
142
143
  });
143
144
  });
144
145
  });
@@ -265,6 +266,21 @@ describe('Feature: strategySubService.ts', () => {
265
266
  });
266
267
  });
267
268
  });
269
+ describe('When testing strategySubService.chickenBondsEncode', () => {
270
+ describe('rebond()', () => {
271
+ const examples = [
272
+ [
273
+ ['0x00000000000000000000000000000000000000000000000000000000000005e3'],
274
+ [1507]
275
+ ]
276
+ ];
277
+ examples.forEach(([expected, actual]) => {
278
+ it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
279
+ expect(chickenBondsEncode.rebond(...actual)).to.eql(expected);
280
+ });
281
+ });
282
+ });
283
+ });
268
284
  describe('When testing strategySubService.aaveV3Encode', () => {
269
285
  describe('closeToAsset()', () => {
270
286
  const examples = [
@@ -954,6 +970,25 @@ describe('Feature: strategySubService.ts', () => {
954
970
  });
955
971
  });
956
972
  });
973
+ describe('When testing strategySubService.morphoAaveV2Encode', () => {
974
+ describe('leverageManagement()', () => {
975
+ const examples = [
976
+ [
977
+ [new Dec(160).mul(1e16).toString(), new Dec(220).mul(1e16).toString(), new Dec(180).mul(1e16).toString(), new Dec(190).mul(1e16).toString(), true],
978
+ [160, 220, 180, 190, true]
979
+ ],
980
+ [
981
+ [new Dec(160).mul(1e16).toString(), new Dec(200).mul(1e16).toString(), new Dec(180).mul(1e16).toString(), new Dec(190).mul(1e16).toString(), false],
982
+ [160, 200, 180, 190, false]
983
+ ],
984
+ ];
985
+ examples.forEach(([expected, actual]) => {
986
+ it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
987
+ expect(morphoAaveV2Encode.leverageManagement(...actual)).to.eql(expected);
988
+ });
989
+ });
990
+ });
991
+ });
957
992
  describe('When testing strategySubService.exchangeEncode', () => {
958
993
  describe('dca()', () => {
959
994
  const examples = [
@@ -1162,6 +1197,142 @@ describe('Feature: strategySubService.ts', () => {
1162
1197
  });
1163
1198
  });
1164
1199
  });
1200
+ describe('leverageManagementOnPrice()', () => {
1201
+ const examples = [
1202
+ [
1203
+ [
1204
+ Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
1205
+ true,
1206
+ ['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000003a352944000000000000000000000000000000000000000000000000000000000000000001'],
1207
+ [
1208
+ '0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
1209
+ '0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
1210
+ '0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
1211
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
1212
+ '0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
1213
+ '0x0000000000000000000000000000000000000000000000001bc16d674ec80000',
1214
+ '0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
1215
+ ],
1216
+ ],
1217
+ [
1218
+ Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
1219
+ true,
1220
+ web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
1221
+ web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
1222
+ web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
1223
+ web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
1224
+ '945000000000000000',
1225
+ web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
1226
+ 200,
1227
+ 2500,
1228
+ RatioState.UNDER,
1229
+ ],
1230
+ ],
1231
+ [
1232
+ [
1233
+ Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
1234
+ true,
1235
+ ['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000005d21dba0000000000000000000000000000000000000000000000000000000000000000000'],
1236
+ [
1237
+ '0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
1238
+ '0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
1239
+ '0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
1240
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
1241
+ '0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
1242
+ '0x00000000000000000000000000000000000000000000000016345785d8a00000',
1243
+ '0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
1244
+ ],
1245
+ ],
1246
+ [
1247
+ Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
1248
+ true,
1249
+ web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
1250
+ web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
1251
+ web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
1252
+ web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
1253
+ '945000000000000000',
1254
+ web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
1255
+ 160,
1256
+ 4000,
1257
+ RatioState.OVER,
1258
+ ],
1259
+ ],
1260
+ ];
1261
+ examples.forEach(([expected, actual]) => {
1262
+ it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
1263
+ expect(morphoBlueEncode.leverageManagementOnPrice(...actual)).to.eql(expected);
1264
+ });
1265
+ });
1266
+ });
1267
+ describe('leverageManagementOnPriceGeneric()', () => {
1268
+ const examples = [
1269
+ [
1270
+ [
1271
+ Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
1272
+ true,
1273
+ ['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000003a352944000000000000000000000000000000000000000000000000000000000000000001'],
1274
+ [
1275
+ '0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
1276
+ '0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
1277
+ '0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
1278
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
1279
+ '0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
1280
+ '0x0000000000000000000000000000000000000000000000001bc16d674ec80000',
1281
+ '0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
1282
+ ],
1283
+ ],
1284
+ [
1285
+ web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
1286
+ web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
1287
+ web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
1288
+ web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
1289
+ '945000000000000000',
1290
+ web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
1291
+ 200,
1292
+ 2500,
1293
+ RatioState.UNDER,
1294
+ false,
1295
+ false,
1296
+ ChainId.Ethereum,
1297
+ ],
1298
+ ],
1299
+ [
1300
+ [
1301
+ Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
1302
+ true,
1303
+ ['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000005d21dba0000000000000000000000000000000000000000000000000000000000000000000'],
1304
+ [
1305
+ '0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
1306
+ '0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
1307
+ '0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
1308
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
1309
+ '0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
1310
+ '0x00000000000000000000000000000000000000000000000016345785d8a00000',
1311
+ '0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
1312
+ ],
1313
+ ],
1314
+ [
1315
+ web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
1316
+ web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
1317
+ web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
1318
+ web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
1319
+ '945000000000000000',
1320
+ web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
1321
+ 160,
1322
+ 4000,
1323
+ RatioState.OVER,
1324
+ true,
1325
+ false,
1326
+ ChainId.Ethereum,
1327
+ ],
1328
+ ],
1329
+ ];
1330
+ examples.forEach(([expected, actual]) => {
1331
+ it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
1332
+ expect(morphoBlueEncode.leverageManagementOnPriceGeneric(...actual)).to.eql(expected);
1333
+ });
1334
+ });
1335
+ });
1165
1336
  describe('closeOnPrice()', () => {
1166
1337
  const examples = [
1167
1338
  [
@@ -1190,7 +1361,7 @@ describe('Feature: strategySubService.ts', () => {
1190
1361
  1500,
1191
1362
  CloseToAssetType.DEBT,
1192
1363
  4000,
1193
- CloseToAssetType.COLLATERAL
1364
+ CloseToAssetType.COLLATERAL,
1194
1365
  ]
1195
1366
  ],
1196
1367
  ];
@@ -1200,6 +1371,45 @@ describe('Feature: strategySubService.ts', () => {
1200
1371
  });
1201
1372
  });
1202
1373
  });
1374
+ describe('closeOnPriceGeneric()', () => {
1375
+ const examples = [
1376
+ [
1377
+ [
1378
+ Bundles.MainnetIds.MORPHO_BLUE_CLOSE,
1379
+ true,
1380
+ ['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
1381
+ [
1382
+ '0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
1383
+ '0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
1384
+ '0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
1385
+ '0x0000000000000000000000000000000000000000000000000000000000000000',
1386
+ '0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
1387
+ '0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
1388
+ '0x0000000000000000000000000000000000000000000000000000000000000005',
1389
+ ],
1390
+ ],
1391
+ [
1392
+ web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
1393
+ web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
1394
+ web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
1395
+ web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
1396
+ '945000000000000000',
1397
+ web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
1398
+ 1500,
1399
+ CloseToAssetType.DEBT,
1400
+ 4000,
1401
+ CloseToAssetType.COLLATERAL,
1402
+ false,
1403
+ ChainId.Ethereum,
1404
+ ]
1405
+ ],
1406
+ ];
1407
+ examples.forEach(([expected, actual]) => {
1408
+ it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
1409
+ expect(morphoBlueEncode.closeOnPriceGeneric(...actual)).to.eql(expected);
1410
+ });
1411
+ });
1412
+ });
1203
1413
  });
1204
1414
  describe('When testing strategySubService.sparkEncode', () => {
1205
1415
  describe('leverageManagementOnPrice()', () => {
@@ -1,5 +1,5 @@
1
1
  import type { EthereumAddress } from '../types';
2
- import type { CloseStrategyType } from '../types/enums';
2
+ import type { CloseStrategyType, OrderType } from '../types/enums';
3
3
  import { ChainId, RatioState } from '../types/enums';
4
4
  /**
5
5
  _______ _______ .______ .______ _______ ______ ___ .___________. _______ _______
@@ -10,11 +10,13 @@ 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[];
13
14
  decode(subData: string[]): {
14
15
  targetRatio: number;
15
16
  };
16
17
  };
17
18
  export declare const cBondsRebondSubData: {
19
+ encode(bondId: number | string): string[];
18
20
  decode(subData: string[]): {
19
21
  bondId: string;
20
22
  };
@@ -55,21 +57,13 @@ export declare const makerCloseSubData: {
55
57
  closeToAssetAddr: EthereumAddress;
56
58
  };
57
59
  };
58
- export declare const legacyMakerLeverageManagementSubData: {
60
+ export declare const makerLeverageManagementSubData: {
59
61
  decode: (subData: string[]) => {
60
62
  vaultId: number;
61
63
  targetRatio: number;
62
64
  };
63
65
  };
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: {
66
+ export declare const makerLeverageManagementWithoutSubProxy: {
73
67
  encode(vaultId: number, targetRatio: number, daiAddr?: EthereumAddress): string[];
74
68
  decode(subData: string[]): {
75
69
  vaultId: number;
@@ -90,12 +84,12 @@ export declare const liquityRepayFromSavingsSubData: {
90
84
  targetRatio: number;
91
85
  };
92
86
  };
93
- export declare const legacyLiquityLeverageManagementSubData: {
87
+ export declare const liquityLeverageManagementSubData: {
94
88
  decode: (subData: string[]) => {
95
89
  targetRatio: number;
96
90
  };
97
91
  };
98
- export declare const liquityLeverageManagementSubData: {
92
+ export declare const liquityLeverageManagementSubDataWithoutSubProxy: {
99
93
  encode(targetRatio: number, ratioState: RatioState): string[];
100
94
  decode(subData: string[]): {
101
95
  targetRatio: number;
@@ -184,12 +178,13 @@ export declare const liquityV2PaybackSubData: {
184
178
  / _____ \ / _____ \ \ / | |____ \ / / /_
185
179
  /__/ \__\ /__/ \__\ \__/ |_______| \__/ |____|
186
180
  */
187
- export declare const legacyAaveV2LeverageManagementSubData: {
181
+ export declare const aaveV2LeverageManagementSubData: {
182
+ encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
188
183
  decode(subData: string[]): {
189
184
  targetRatio: number;
190
185
  };
191
186
  };
192
- export declare const aaveV2LeverageManagementSubData: {
187
+ export declare const aaveV2LeverageManagementSubDataWithoutSubProxy: {
193
188
  encode(market: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
194
189
  decode(subData: string[]): {
195
190
  market: EthereumAddress;
@@ -205,19 +200,12 @@ export declare const aaveV2LeverageManagementSubData: {
205
200
  / _____ \ / _____ \ \ / | |____ \ / ___) |
206
201
  /__/ \__\ /__/ \__\ \__/ |_______| \__/ |____/
207
202
  */
208
- export declare const legacyAaveV3LeverageManagementSubData: {
209
- decode(subData: string[]): {
210
- targetRatio: number;
211
- };
212
- };
213
203
  export declare const aaveV3LeverageManagementSubData: {
214
- encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress, isGeneric: boolean): string[];
215
204
  decode(subData: string[]): {
216
205
  targetRatio: number;
217
- ratioState: RatioState;
218
206
  };
219
207
  };
220
- export declare const aaveV3LiquidationProtectionSubData: {
208
+ export declare const aaveV3LeverageManagementSubDataWithoutSubProxy: {
221
209
  encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress, isGeneric: boolean): string[];
222
210
  decode(subData: string[]): {
223
211
  targetRatio: number;
@@ -296,15 +284,6 @@ export declare const aaveV4LeverageManagementSubData: {
296
284
  targetRatio: number;
297
285
  };
298
286
  };
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
- };
308
287
  export declare const aaveV4LeverageManagementOnPriceSubData: {
309
288
  encode: (spoke: EthereumAddress, owner: EthereumAddress, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, ratioState: RatioState, targetRatio: number) => string[];
310
289
  decode: (subData: string[]) => {
@@ -350,12 +329,13 @@ export declare const aaveV4CollateralSwitchSubData: {
350
329
  | `----.| `--' | | | | | | | \ / / /_
351
330
  \______| \______/ |__| |__| | _| \__/ |____|
352
331
  */
353
- export declare const legacyCompoundV2LeverageManagementSubData: {
332
+ export declare const compoundV2LeverageManagementSubData: {
333
+ encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
354
334
  decode(subData: string[]): {
355
335
  targetRatio: number;
356
336
  };
357
337
  };
358
- export declare const compoundV2LeverageManagementSubData: {
338
+ export declare const compoundV2LeverageManagementSubDataWithoutSubProxy: {
359
339
  encode(targetRatio: number, ratioState: RatioState): string[];
360
340
  decode(subData: string[]): {
361
341
  targetRatio: number;
@@ -371,15 +351,12 @@ export declare const compoundV2LeverageManagementSubData: {
371
351
  \______| \______/ |__| |__| | _| \__/ |____/
372
352
  */
373
353
  export declare const compoundV3LeverageManagementSubData: {
374
- encode(market: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
354
+ encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string[];
375
355
  decode(subData: string[]): {
376
- market: EthereumAddress;
377
- baseToken: EthereumAddress;
378
356
  targetRatio: number;
379
- ratioState: RatioState;
380
357
  };
381
358
  };
382
- export declare const compoundV3LiquidationProtectionSubData: {
359
+ export declare const compoundV3LeverageManagementSubDataWithoutSubProxy: {
383
360
  encode(market: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState): string[];
384
361
  decode(subData: string[]): {
385
362
  market: EthereumAddress;
@@ -426,14 +403,15 @@ export declare const exchangeDcaSubData: {
426
403
  interval: string;
427
404
  };
428
405
  };
429
- export declare const legacyExchangeLimitOrderSubData: {
406
+ export declare const exchangeLimitOrderSubData: {
407
+ encode(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, targetPrice: string, goodUntil: string | number, orderType: OrderType): string[];
430
408
  decode: (subData: string[], chainId: ChainId) => {
431
409
  fromToken: string;
432
410
  toToken: string;
433
411
  amount: string;
434
412
  };
435
413
  };
436
- export declare const exchangeLimitOrderSubData: {
414
+ export declare const exchangeLimitOrderSubDataWithoutSubProxy: {
437
415
  encode(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string): string[];
438
416
  decode: (subData: string[], chainId: ChainId) => {
439
417
  fromToken: string;
@@ -449,19 +427,12 @@ export declare const exchangeLimitOrderSubData: {
449
427
  .----) | | | / _____ \ | |\ \----.| . \
450
428
  |_______/ | _| /__/ \__\ | _| `._____||__|\__\
451
429
  */
452
- export declare const legacySparkLeverageManagementSubData: {
453
- decode(subData: string[]): {
454
- targetRatio: number;
455
- };
456
- };
457
430
  export declare const sparkLeverageManagementSubData: {
458
- encode(targetRatio: number, ratioState: RatioState): string[];
459
431
  decode(subData: string[]): {
460
432
  targetRatio: number;
461
- ratioState: RatioState;
462
433
  };
463
434
  };
464
- export declare const sparkLiquidationProtectionSubData: {
435
+ export declare const sparkLeverageManagementSubDataWithoutSubProxy: {
465
436
  encode(targetRatio: number, ratioState: RatioState): string[];
466
437
  decode(subData: string[]): {
467
438
  targetRatio: number;
@@ -546,18 +517,6 @@ export declare const morphoBlueLeverageManagementSubData: {
546
517
  targetRatio: number;
547
518
  };
548
519
  };
549
- export declare const morphoBlueLiquidationProtectionSubData: {
550
- encode: (loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, ratioState: RatioState, targetRatio: number, user: EthereumAddress, isEOA: boolean) => string[];
551
- decode: (subData: string[]) => {
552
- loanToken: string;
553
- collToken: string;
554
- oracle: string;
555
- irm: string;
556
- lltv: string;
557
- user: string;
558
- targetRatio: number;
559
- };
560
- };
561
520
  export declare const morphoBlueLeverageManagementOnPriceSubData: {
562
521
  encode(loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, targetRatio: number, user: EthereumAddress): string[];
563
522
  decode(subData: string[]): {
@@ -599,12 +558,3 @@ export declare const fluidLeverageManagementSubData: {
599
558
  targetRatio: number;
600
559
  };
601
560
  };
602
- export declare const fluidLiquidationProtectionSubData: {
603
- encode: (nftId: string, vault: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
604
- decode: (subData: string[]) => {
605
- nftId: string;
606
- vault: string;
607
- ratioState: RatioState;
608
- targetRatio: number;
609
- };
610
- };