@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.
- package/cjs/constants/index.js +51 -111
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -5
- package/cjs/services/strategiesService.js +13 -157
- package/cjs/services/strategySubService.d.ts +21 -18
- package/cjs/services/strategySubService.js +74 -78
- package/cjs/services/strategySubService.test.js +216 -3
- package/cjs/services/subDataService.d.ts +20 -70
- package/cjs/services/subDataService.js +79 -23
- package/cjs/services/subDataService.test.js +302 -17
- package/cjs/services/triggerService.test.js +60 -0
- package/cjs/services/utils.d.ts +1 -2
- package/cjs/services/utils.js +1 -14
- package/cjs/types/enums.d.ts +17 -33
- package/cjs/types/enums.js +14 -30
- package/esm/constants/index.js +51 -111
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -5
- package/esm/services/strategiesService.js +13 -157
- package/esm/services/strategySubService.d.ts +21 -18
- package/esm/services/strategySubService.js +73 -78
- package/esm/services/strategySubService.test.js +214 -4
- package/esm/services/subDataService.d.ts +20 -70
- package/esm/services/subDataService.js +77 -21
- package/esm/services/subDataService.test.js +300 -18
- package/esm/services/triggerService.test.js +61 -1
- package/esm/services/utils.d.ts +1 -2
- package/esm/services/utils.js +1 -13
- package/esm/types/enums.d.ts +17 -33
- package/esm/types/enums.js +14 -30
- package/package.json +1 -1
- package/src/constants/index.ts +52 -113
- package/src/index.ts +6 -22
- package/src/services/strategiesService.ts +13 -221
- package/src/services/strategySubService.test.ts +275 -3
- package/src/services/strategySubService.ts +121 -173
- package/src/services/subDataService.test.ts +324 -18
- package/src/services/subDataService.ts +106 -42
- package/src/services/triggerService.test.ts +69 -0
- package/src/services/utils.test.ts +1 -1
- package/src/services/utils.ts +1 -15
- package/src/types/enums.ts +16 -30
|
@@ -22,8 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
const chai_1 = require("chai");
|
|
30
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
27
31
|
const sdk_1 = require("@defisaver/sdk");
|
|
28
32
|
const tokens_1 = require("@defisaver/tokens");
|
|
29
33
|
const web3Utils = __importStar(require("web3-utils"));
|
|
@@ -120,7 +124,7 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
120
124
|
});
|
|
121
125
|
});
|
|
122
126
|
});
|
|
123
|
-
describe('
|
|
127
|
+
describe('leverageManagementWithoutSubProxy()', () => {
|
|
124
128
|
const examples = [
|
|
125
129
|
// Repay scenario (isBoost=false, RatioState.UNDER)
|
|
126
130
|
[
|
|
@@ -163,7 +167,7 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
163
167
|
];
|
|
164
168
|
examples.forEach(([expected, actual]) => {
|
|
165
169
|
it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
166
|
-
(0, chai_1.expect)(strategySubService_1.makerEncode.
|
|
170
|
+
(0, chai_1.expect)(strategySubService_1.makerEncode.leverageManagementWithoutSubProxy(...actual)).to.eql(expected);
|
|
167
171
|
});
|
|
168
172
|
});
|
|
169
173
|
});
|
|
@@ -290,6 +294,21 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
290
294
|
});
|
|
291
295
|
});
|
|
292
296
|
});
|
|
297
|
+
describe('When testing strategySubService.chickenBondsEncode', () => {
|
|
298
|
+
describe('rebond()', () => {
|
|
299
|
+
const examples = [
|
|
300
|
+
[
|
|
301
|
+
['0x00000000000000000000000000000000000000000000000000000000000005e3'],
|
|
302
|
+
[1507]
|
|
303
|
+
]
|
|
304
|
+
];
|
|
305
|
+
examples.forEach(([expected, actual]) => {
|
|
306
|
+
it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
307
|
+
(0, chai_1.expect)(strategySubService_1.chickenBondsEncode.rebond(...actual)).to.eql(expected);
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
});
|
|
293
312
|
describe('When testing strategySubService.aaveV3Encode', () => {
|
|
294
313
|
describe('closeToAsset()', () => {
|
|
295
314
|
const examples = [
|
|
@@ -979,6 +998,25 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
979
998
|
});
|
|
980
999
|
});
|
|
981
1000
|
});
|
|
1001
|
+
describe('When testing strategySubService.morphoAaveV2Encode', () => {
|
|
1002
|
+
describe('leverageManagement()', () => {
|
|
1003
|
+
const examples = [
|
|
1004
|
+
[
|
|
1005
|
+
[new decimal_js_1.default(160).mul(1e16).toString(), new decimal_js_1.default(220).mul(1e16).toString(), new decimal_js_1.default(180).mul(1e16).toString(), new decimal_js_1.default(190).mul(1e16).toString(), true],
|
|
1006
|
+
[160, 220, 180, 190, true]
|
|
1007
|
+
],
|
|
1008
|
+
[
|
|
1009
|
+
[new decimal_js_1.default(160).mul(1e16).toString(), new decimal_js_1.default(200).mul(1e16).toString(), new decimal_js_1.default(180).mul(1e16).toString(), new decimal_js_1.default(190).mul(1e16).toString(), false],
|
|
1010
|
+
[160, 200, 180, 190, false]
|
|
1011
|
+
],
|
|
1012
|
+
];
|
|
1013
|
+
examples.forEach(([expected, actual]) => {
|
|
1014
|
+
it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1015
|
+
(0, chai_1.expect)(strategySubService_1.morphoAaveV2Encode.leverageManagement(...actual)).to.eql(expected);
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
982
1020
|
describe('When testing strategySubService.exchangeEncode', () => {
|
|
983
1021
|
describe('dca()', () => {
|
|
984
1022
|
const examples = [
|
|
@@ -1187,6 +1225,142 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
1187
1225
|
});
|
|
1188
1226
|
});
|
|
1189
1227
|
});
|
|
1228
|
+
describe('leverageManagementOnPrice()', () => {
|
|
1229
|
+
const examples = [
|
|
1230
|
+
[
|
|
1231
|
+
[
|
|
1232
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
|
|
1233
|
+
true,
|
|
1234
|
+
['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000003a352944000000000000000000000000000000000000000000000000000000000000000001'],
|
|
1235
|
+
[
|
|
1236
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
1237
|
+
'0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
|
1238
|
+
'0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
|
|
1239
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
1240
|
+
'0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
|
|
1241
|
+
'0x0000000000000000000000000000000000000000000000001bc16d674ec80000',
|
|
1242
|
+
'0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
|
|
1243
|
+
],
|
|
1244
|
+
],
|
|
1245
|
+
[
|
|
1246
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
|
|
1247
|
+
true,
|
|
1248
|
+
web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
|
|
1249
|
+
web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
|
|
1250
|
+
web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
|
|
1251
|
+
web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
|
|
1252
|
+
'945000000000000000',
|
|
1253
|
+
web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
|
|
1254
|
+
200,
|
|
1255
|
+
2500,
|
|
1256
|
+
enums_1.RatioState.UNDER,
|
|
1257
|
+
],
|
|
1258
|
+
],
|
|
1259
|
+
[
|
|
1260
|
+
[
|
|
1261
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
|
|
1262
|
+
true,
|
|
1263
|
+
['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000005d21dba0000000000000000000000000000000000000000000000000000000000000000000'],
|
|
1264
|
+
[
|
|
1265
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
1266
|
+
'0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
|
1267
|
+
'0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
|
|
1268
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
1269
|
+
'0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
|
|
1270
|
+
'0x00000000000000000000000000000000000000000000000016345785d8a00000',
|
|
1271
|
+
'0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
|
|
1272
|
+
],
|
|
1273
|
+
],
|
|
1274
|
+
[
|
|
1275
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
|
|
1276
|
+
true,
|
|
1277
|
+
web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
|
|
1278
|
+
web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
|
|
1279
|
+
web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
|
|
1280
|
+
web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
|
|
1281
|
+
'945000000000000000',
|
|
1282
|
+
web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
|
|
1283
|
+
160,
|
|
1284
|
+
4000,
|
|
1285
|
+
enums_1.RatioState.OVER,
|
|
1286
|
+
],
|
|
1287
|
+
],
|
|
1288
|
+
];
|
|
1289
|
+
examples.forEach(([expected, actual]) => {
|
|
1290
|
+
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1291
|
+
(0, chai_1.expect)(strategySubService_1.morphoBlueEncode.leverageManagementOnPrice(...actual)).to.eql(expected);
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
});
|
|
1295
|
+
describe('leverageManagementOnPriceGeneric()', () => {
|
|
1296
|
+
const examples = [
|
|
1297
|
+
[
|
|
1298
|
+
[
|
|
1299
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_REPAY_ON_PRICE,
|
|
1300
|
+
true,
|
|
1301
|
+
['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000003a352944000000000000000000000000000000000000000000000000000000000000000001'],
|
|
1302
|
+
[
|
|
1303
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
1304
|
+
'0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
|
1305
|
+
'0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
|
|
1306
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
1307
|
+
'0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
|
|
1308
|
+
'0x0000000000000000000000000000000000000000000000001bc16d674ec80000',
|
|
1309
|
+
'0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
|
|
1310
|
+
],
|
|
1311
|
+
],
|
|
1312
|
+
[
|
|
1313
|
+
web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
|
|
1314
|
+
web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
|
|
1315
|
+
web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
|
|
1316
|
+
web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
|
|
1317
|
+
'945000000000000000',
|
|
1318
|
+
web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
|
|
1319
|
+
200,
|
|
1320
|
+
2500,
|
|
1321
|
+
enums_1.RatioState.UNDER,
|
|
1322
|
+
false,
|
|
1323
|
+
false,
|
|
1324
|
+
enums_1.ChainId.Ethereum,
|
|
1325
|
+
],
|
|
1326
|
+
],
|
|
1327
|
+
[
|
|
1328
|
+
[
|
|
1329
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_BOOST_ON_PRICE,
|
|
1330
|
+
true,
|
|
1331
|
+
['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000005d21dba0000000000000000000000000000000000000000000000000000000000000000000'],
|
|
1332
|
+
[
|
|
1333
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
1334
|
+
'0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
|
1335
|
+
'0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
|
|
1336
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
1337
|
+
'0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
|
|
1338
|
+
'0x00000000000000000000000000000000000000000000000016345785d8a00000',
|
|
1339
|
+
'0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
|
|
1340
|
+
],
|
|
1341
|
+
],
|
|
1342
|
+
[
|
|
1343
|
+
web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
|
|
1344
|
+
web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
|
|
1345
|
+
web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
|
|
1346
|
+
web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
|
|
1347
|
+
'945000000000000000',
|
|
1348
|
+
web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
|
|
1349
|
+
160,
|
|
1350
|
+
4000,
|
|
1351
|
+
enums_1.RatioState.OVER,
|
|
1352
|
+
true,
|
|
1353
|
+
false,
|
|
1354
|
+
enums_1.ChainId.Ethereum,
|
|
1355
|
+
],
|
|
1356
|
+
],
|
|
1357
|
+
];
|
|
1358
|
+
examples.forEach(([expected, actual]) => {
|
|
1359
|
+
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1360
|
+
(0, chai_1.expect)(strategySubService_1.morphoBlueEncode.leverageManagementOnPriceGeneric(...actual)).to.eql(expected);
|
|
1361
|
+
});
|
|
1362
|
+
});
|
|
1363
|
+
});
|
|
1190
1364
|
describe('closeOnPrice()', () => {
|
|
1191
1365
|
const examples = [
|
|
1192
1366
|
[
|
|
@@ -1215,7 +1389,7 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
1215
1389
|
1500,
|
|
1216
1390
|
enums_1.CloseToAssetType.DEBT,
|
|
1217
1391
|
4000,
|
|
1218
|
-
enums_1.CloseToAssetType.COLLATERAL
|
|
1392
|
+
enums_1.CloseToAssetType.COLLATERAL,
|
|
1219
1393
|
]
|
|
1220
1394
|
],
|
|
1221
1395
|
];
|
|
@@ -1225,6 +1399,45 @@ describe('Feature: strategySubService.ts', () => {
|
|
|
1225
1399
|
});
|
|
1226
1400
|
});
|
|
1227
1401
|
});
|
|
1402
|
+
describe('closeOnPriceGeneric()', () => {
|
|
1403
|
+
const examples = [
|
|
1404
|
+
[
|
|
1405
|
+
[
|
|
1406
|
+
enums_1.Bundles.MainnetIds.MORPHO_BLUE_CLOSE,
|
|
1407
|
+
true,
|
|
1408
|
+
['0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
1409
|
+
[
|
|
1410
|
+
'0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
1411
|
+
'0x0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
|
1412
|
+
'0x000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc',
|
|
1413
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
1414
|
+
'0x0000000000000000000000000000000000000000000000000d1d507e40be8000',
|
|
1415
|
+
'0x0000000000000000000000001031d218133afab8c2b819b1366c7e434ad91e9c',
|
|
1416
|
+
'0x0000000000000000000000000000000000000000000000000000000000000005',
|
|
1417
|
+
],
|
|
1418
|
+
],
|
|
1419
|
+
[
|
|
1420
|
+
web3Utils.toChecksumAddress('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
|
|
1421
|
+
web3Utils.toChecksumAddress('0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'),
|
|
1422
|
+
web3Utils.toChecksumAddress('0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC'),
|
|
1423
|
+
web3Utils.toChecksumAddress('0x0000000000000000000000000000000000000000'),
|
|
1424
|
+
'945000000000000000',
|
|
1425
|
+
web3Utils.toChecksumAddress('0x1031d218133AFaB8c2B819B1366c7E434Ad91E9c'),
|
|
1426
|
+
1500,
|
|
1427
|
+
enums_1.CloseToAssetType.DEBT,
|
|
1428
|
+
4000,
|
|
1429
|
+
enums_1.CloseToAssetType.COLLATERAL,
|
|
1430
|
+
false,
|
|
1431
|
+
enums_1.ChainId.Ethereum,
|
|
1432
|
+
]
|
|
1433
|
+
],
|
|
1434
|
+
];
|
|
1435
|
+
examples.forEach(([expected, actual]) => {
|
|
1436
|
+
it(`Given ${JSON.stringify(actual)} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1437
|
+
(0, chai_1.expect)(strategySubService_1.morphoBlueEncode.closeOnPriceGeneric(...actual)).to.eql(expected);
|
|
1438
|
+
});
|
|
1439
|
+
});
|
|
1440
|
+
});
|
|
1228
1441
|
});
|
|
1229
1442
|
describe('When testing strategySubService.sparkEncode', () => {
|
|
1230
1443
|
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
|
|
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
|
|
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
|
|
87
|
+
export declare const liquityLeverageManagementSubData: {
|
|
94
88
|
decode: (subData: string[]) => {
|
|
95
89
|
targetRatio: number;
|
|
96
90
|
};
|
|
97
91
|
};
|
|
98
|
-
export declare const
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
};
|