@defisaver/automation-sdk 3.3.1 → 3.3.2-dev.0
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 +100 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +1 -1
- package/cjs/services/strategiesService.js +28 -9
- package/cjs/services/strategySubService.d.ts +3 -1
- package/cjs/services/strategySubService.js +15 -2
- package/cjs/services/strategySubService.test.js +314 -0
- package/cjs/services/subDataService.d.ts +25 -1
- package/cjs/services/subDataService.js +78 -2
- package/cjs/services/subDataService.test.js +456 -0
- package/cjs/services/triggerService.d.ts +9 -0
- package/cjs/services/triggerService.js +20 -1
- package/cjs/services/triggerService.test.js +46 -0
- package/cjs/types/enums.d.ts +24 -4
- package/cjs/types/enums.js +21 -0
- package/esm/constants/index.js +100 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/services/strategiesService.js +28 -9
- package/esm/services/strategySubService.d.ts +3 -1
- package/esm/services/strategySubService.js +15 -2
- package/esm/services/strategySubService.test.js +314 -0
- package/esm/services/subDataService.d.ts +25 -1
- package/esm/services/subDataService.js +77 -1
- package/esm/services/subDataService.test.js +456 -0
- package/esm/services/triggerService.d.ts +9 -0
- package/esm/services/triggerService.js +19 -0
- package/esm/services/triggerService.test.js +47 -1
- package/esm/types/enums.d.ts +24 -4
- package/esm/types/enums.js +21 -0
- package/package.json +1 -1
- package/src/constants/index.ts +103 -0
- package/src/index.ts +4 -2
- package/src/services/strategiesService.ts +31 -10
- package/src/services/strategySubService.test.ts +347 -0
- package/src/services/strategySubService.ts +57 -1
- package/src/services/subDataService.test.ts +532 -0
- package/src/services/subDataService.ts +122 -2
- package/src/services/triggerService.test.ts +50 -0
- package/src/services/triggerService.ts +29 -0
- package/src/types/enums.ts +21 -0
- package/src/types/index.ts +20 -0
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.compoundV3PriceRangeTrigger = exports.compoundV3PriceTrigger = exports.fluidRatioTrigger = exports.morphoBluePriceTrigger = exports.closePriceTrigger = exports.liquityV2QuotePriceTrigger = exports.liquityV2RatioTrigger = exports.morphoBlueRatioTrigger = exports.crvUsdHealthRatioTrigger = exports.crvUSDRatioTrigger = exports.curveUsdSoftLiquidationTrigger = exports.curveUsdBorrowRateTrigger = exports.sparkQuotePriceTrigger = exports.sparkRatioTrigger = exports.exchangeOffchainPriceTrigger = exports.exchangeTimestampTrigger = exports.compoundV3RatioTrigger = exports.cBondsRebondTrigger = exports.aaveV2RatioTrigger = exports.liquityV2AdjustTimeTrigger = exports.liquityV2DebtInFrontTrigger = exports.liquityDebtInFrontWithLimitTrigger = exports.liquityDebtInFrontTrigger = exports.liquityRatioTrigger = exports.compoundV2RatioTrigger = exports.aaveV3QuotePriceWithMaximumGasPriceTrigger = exports.aaveV3QuotePriceTrigger = exports.morphoAaveV2RatioTrigger = exports.aaveV3RatioTrigger = exports.makerRatioTrigger = exports.trailingStopTrigger = exports.chainlinkPriceTrigger = void 0;
|
|
29
|
+
exports.aaveV3QuotePriceRangeTrigger = exports.compoundV3PriceRangeTrigger = exports.compoundV3PriceTrigger = exports.fluidRatioTrigger = exports.morphoBluePriceTrigger = exports.closePriceTrigger = exports.liquityV2QuotePriceTrigger = exports.liquityV2RatioTrigger = exports.morphoBlueRatioTrigger = exports.crvUsdHealthRatioTrigger = exports.crvUSDRatioTrigger = exports.curveUsdSoftLiquidationTrigger = exports.curveUsdBorrowRateTrigger = exports.sparkQuotePriceTrigger = exports.sparkRatioTrigger = exports.exchangeOffchainPriceTrigger = exports.exchangeTimestampTrigger = exports.compoundV3RatioTrigger = exports.cBondsRebondTrigger = exports.aaveV2RatioTrigger = exports.liquityV2AdjustTimeTrigger = exports.liquityV2DebtInFrontTrigger = exports.liquityDebtInFrontWithLimitTrigger = exports.liquityDebtInFrontTrigger = exports.liquityRatioTrigger = exports.compoundV2RatioTrigger = exports.aaveV3QuotePriceWithMaximumGasPriceTrigger = exports.aaveV3QuotePriceTrigger = exports.morphoAaveV2RatioTrigger = exports.aaveV3RatioTrigger = exports.makerRatioTrigger = exports.trailingStopTrigger = exports.chainlinkPriceTrigger = void 0;
|
|
30
30
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
31
31
|
const tokens_1 = require("@defisaver/tokens");
|
|
32
32
|
const web3_eth_abi_1 = __importDefault(require("web3-eth-abi"));
|
|
@@ -507,3 +507,22 @@ exports.compoundV3PriceRangeTrigger = {
|
|
|
507
507
|
};
|
|
508
508
|
},
|
|
509
509
|
};
|
|
510
|
+
exports.aaveV3QuotePriceRangeTrigger = {
|
|
511
|
+
encode(collToken, debtToken, lowerPrice, upperPrice) {
|
|
512
|
+
// Price is scaled to 1e8
|
|
513
|
+
const lowerPriceFormatted = new decimal_js_1.default(lowerPrice).mul(1e8).floor().toString();
|
|
514
|
+
const upperPriceFormatted = new decimal_js_1.default(upperPrice).mul(1e8).floor().toString();
|
|
515
|
+
return [
|
|
516
|
+
web3_eth_abi_1.default.encodeParameters(['address', 'address', 'uint256', 'uint256'], [collToken, debtToken, lowerPriceFormatted, upperPriceFormatted]),
|
|
517
|
+
];
|
|
518
|
+
},
|
|
519
|
+
decode(triggerData) {
|
|
520
|
+
const decodedData = web3_eth_abi_1.default.decodeParameters(['address', 'address', 'uint256', 'uint256'], triggerData[0]);
|
|
521
|
+
return {
|
|
522
|
+
collToken: decodedData[0],
|
|
523
|
+
debtToken: decodedData[1],
|
|
524
|
+
lowerPrice: new decimal_js_1.default(decodedData[2]).div(1e8).toString(),
|
|
525
|
+
upperPrice: new decimal_js_1.default(decodedData[3]).div(1e8).toString(),
|
|
526
|
+
};
|
|
527
|
+
},
|
|
528
|
+
};
|
|
@@ -1136,4 +1136,50 @@ describe('Feature: triggerService.ts', () => {
|
|
|
1136
1136
|
});
|
|
1137
1137
|
});
|
|
1138
1138
|
});
|
|
1139
|
+
describe('When testing triggerService.aaveV3PriceRangeTrigger', () => {
|
|
1140
|
+
describe('encode()', () => {
|
|
1141
|
+
const examples = [
|
|
1142
|
+
[
|
|
1143
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
1144
|
+
[web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'), 1500, 4000]
|
|
1145
|
+
],
|
|
1146
|
+
[
|
|
1147
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746a528800'],
|
|
1148
|
+
[web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'), 0, 5000]
|
|
1149
|
+
],
|
|
1150
|
+
];
|
|
1151
|
+
examples.forEach(([expected, actual]) => {
|
|
1152
|
+
it(`Given ${actual} should return expected value: ${expected}`, () => {
|
|
1153
|
+
(0, chai_1.expect)(triggerService_1.aaveV3QuotePriceRangeTrigger.encode(...actual)).to.eql(expected);
|
|
1154
|
+
});
|
|
1155
|
+
});
|
|
1156
|
+
});
|
|
1157
|
+
describe('decode()', () => {
|
|
1158
|
+
const examples = [
|
|
1159
|
+
[
|
|
1160
|
+
{
|
|
1161
|
+
collToken: web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'),
|
|
1162
|
+
debtToken: web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
|
|
1163
|
+
lowerPrice: '1500',
|
|
1164
|
+
upperPrice: '4000',
|
|
1165
|
+
},
|
|
1166
|
+
['0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000022ecb25c000000000000000000000000000000000000000000000000000000005d21dba000'],
|
|
1167
|
+
],
|
|
1168
|
+
[
|
|
1169
|
+
{
|
|
1170
|
+
collToken: web3Utils.toChecksumAddress('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'),
|
|
1171
|
+
debtToken: web3Utils.toChecksumAddress('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
|
|
1172
|
+
lowerPrice: '0',
|
|
1173
|
+
upperPrice: '5000',
|
|
1174
|
+
},
|
|
1175
|
+
['000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746a528800'],
|
|
1176
|
+
],
|
|
1177
|
+
];
|
|
1178
|
+
examples.forEach(([expected, actual]) => {
|
|
1179
|
+
it(`Given ${actual} should return expected value: ${JSON.stringify(expected)}`, () => {
|
|
1180
|
+
(0, chai_1.expect)(triggerService_1.aaveV3QuotePriceRangeTrigger.decode(actual)).to.eql(expected);
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1139
1185
|
});
|
package/cjs/types/enums.d.ts
CHANGED
|
@@ -197,7 +197,12 @@ export declare namespace Bundles {
|
|
|
197
197
|
COMP_V3_SW_CLOSE = 48,
|
|
198
198
|
COMP_V3_EOA_REPAY_ON_PRICE = 49,
|
|
199
199
|
COMP_V3_EOA_BOOST_ON_PRICE = 50,
|
|
200
|
-
COMP_V3_EOA_CLOSE = 51
|
|
200
|
+
COMP_V3_EOA_CLOSE = 51,
|
|
201
|
+
AAVE_V3_EOA_REPAY = 52,
|
|
202
|
+
AAVE_V3_EOA_BOOST = 53,
|
|
203
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 54,
|
|
204
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 55,
|
|
205
|
+
AAVE_V3_EOA_CLOSE = 56
|
|
201
206
|
}
|
|
202
207
|
enum OptimismIds {
|
|
203
208
|
AAVE_V3_REPAY = 0,
|
|
@@ -205,7 +210,12 @@ export declare namespace Bundles {
|
|
|
205
210
|
AAVE_V3_CLOSE_TO_DEBT = 2,
|
|
206
211
|
AAVE_V3_CLOSE_TO_COLLATERAL = 3,
|
|
207
212
|
AAVE_V3_OPEN_ORDER_FROM_COLLATERAL = 4,
|
|
208
|
-
AAVE_V3_REPAY_ON_PRICE = 5
|
|
213
|
+
AAVE_V3_REPAY_ON_PRICE = 5,
|
|
214
|
+
AAVE_V3_EOA_REPAY = 6,
|
|
215
|
+
AAVE_V3_EOA_BOOST = 7,
|
|
216
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 8,
|
|
217
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 9,
|
|
218
|
+
AAVE_V3_EOA_CLOSE = 10
|
|
209
219
|
}
|
|
210
220
|
enum BaseIds {
|
|
211
221
|
AAVE_V3_REPAY = 0,
|
|
@@ -228,7 +238,12 @@ export declare namespace Bundles {
|
|
|
228
238
|
COMP_V3_EOA_BOOST_ON_PRICE = 19,
|
|
229
239
|
COMP_V3_EOA_CLOSE = 20,
|
|
230
240
|
COMP_V3_EOA_REPAY = 21,
|
|
231
|
-
COMP_V3_EOA_BOOST = 22
|
|
241
|
+
COMP_V3_EOA_BOOST = 22,
|
|
242
|
+
AAVE_V3_EOA_REPAY = 23,
|
|
243
|
+
AAVE_V3_EOA_BOOST = 24,
|
|
244
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 25,
|
|
245
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 26,
|
|
246
|
+
AAVE_V3_EOA_CLOSE = 27
|
|
232
247
|
}
|
|
233
248
|
enum ArbitrumIds {
|
|
234
249
|
AAVE_V3_REPAY = 0,
|
|
@@ -248,6 +263,11 @@ export declare namespace Bundles {
|
|
|
248
263
|
COMP_V3_EOA_BOOST_ON_PRICE = 14,
|
|
249
264
|
COMP_V3_EOA_CLOSE = 15,
|
|
250
265
|
COMP_V3_EOA_REPAY = 16,
|
|
251
|
-
COMP_V3_EOA_BOOST = 17
|
|
266
|
+
COMP_V3_EOA_BOOST = 17,
|
|
267
|
+
AAVE_V3_EOA_REPAY = 18,
|
|
268
|
+
AAVE_V3_EOA_BOOST = 19,
|
|
269
|
+
AAVE_V3_EOA_REPAY_ON_PRICE = 20,
|
|
270
|
+
AAVE_V3_EOA_BOOST_ON_PRICE = 21,
|
|
271
|
+
AAVE_V3_EOA_CLOSE = 22
|
|
252
272
|
}
|
|
253
273
|
}
|
package/cjs/types/enums.js
CHANGED
|
@@ -221,6 +221,12 @@ var Bundles;
|
|
|
221
221
|
MainnetIds[MainnetIds["COMP_V3_EOA_REPAY_ON_PRICE"] = 49] = "COMP_V3_EOA_REPAY_ON_PRICE";
|
|
222
222
|
MainnetIds[MainnetIds["COMP_V3_EOA_BOOST_ON_PRICE"] = 50] = "COMP_V3_EOA_BOOST_ON_PRICE";
|
|
223
223
|
MainnetIds[MainnetIds["COMP_V3_EOA_CLOSE"] = 51] = "COMP_V3_EOA_CLOSE";
|
|
224
|
+
// TODO -> Watch out for Liquity V2 Strategy deploy, should change IDs or here or there !!!
|
|
225
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_REPAY"] = 52] = "AAVE_V3_EOA_REPAY";
|
|
226
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_BOOST"] = 53] = "AAVE_V3_EOA_BOOST";
|
|
227
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_REPAY_ON_PRICE"] = 54] = "AAVE_V3_EOA_REPAY_ON_PRICE";
|
|
228
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 55] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
229
|
+
MainnetIds[MainnetIds["AAVE_V3_EOA_CLOSE"] = 56] = "AAVE_V3_EOA_CLOSE";
|
|
224
230
|
})(MainnetIds = Bundles.MainnetIds || (Bundles.MainnetIds = {}));
|
|
225
231
|
let OptimismIds;
|
|
226
232
|
(function (OptimismIds) {
|
|
@@ -230,6 +236,11 @@ var Bundles;
|
|
|
230
236
|
OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
|
|
231
237
|
OptimismIds[OptimismIds["AAVE_V3_OPEN_ORDER_FROM_COLLATERAL"] = 4] = "AAVE_V3_OPEN_ORDER_FROM_COLLATERAL";
|
|
232
238
|
OptimismIds[OptimismIds["AAVE_V3_REPAY_ON_PRICE"] = 5] = "AAVE_V3_REPAY_ON_PRICE";
|
|
239
|
+
OptimismIds[OptimismIds["AAVE_V3_EOA_REPAY"] = 6] = "AAVE_V3_EOA_REPAY";
|
|
240
|
+
OptimismIds[OptimismIds["AAVE_V3_EOA_BOOST"] = 7] = "AAVE_V3_EOA_BOOST";
|
|
241
|
+
OptimismIds[OptimismIds["AAVE_V3_EOA_REPAY_ON_PRICE"] = 8] = "AAVE_V3_EOA_REPAY_ON_PRICE";
|
|
242
|
+
OptimismIds[OptimismIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 9] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
243
|
+
OptimismIds[OptimismIds["AAVE_V3_EOA_CLOSE"] = 10] = "AAVE_V3_EOA_CLOSE";
|
|
233
244
|
})(OptimismIds = Bundles.OptimismIds || (Bundles.OptimismIds = {}));
|
|
234
245
|
let BaseIds;
|
|
235
246
|
(function (BaseIds) {
|
|
@@ -254,6 +265,11 @@ var Bundles;
|
|
|
254
265
|
BaseIds[BaseIds["COMP_V3_EOA_CLOSE"] = 20] = "COMP_V3_EOA_CLOSE";
|
|
255
266
|
BaseIds[BaseIds["COMP_V3_EOA_REPAY"] = 21] = "COMP_V3_EOA_REPAY";
|
|
256
267
|
BaseIds[BaseIds["COMP_V3_EOA_BOOST"] = 22] = "COMP_V3_EOA_BOOST";
|
|
268
|
+
BaseIds[BaseIds["AAVE_V3_EOA_REPAY"] = 23] = "AAVE_V3_EOA_REPAY";
|
|
269
|
+
BaseIds[BaseIds["AAVE_V3_EOA_BOOST"] = 24] = "AAVE_V3_EOA_BOOST";
|
|
270
|
+
BaseIds[BaseIds["AAVE_V3_EOA_REPAY_ON_PRICE"] = 25] = "AAVE_V3_EOA_REPAY_ON_PRICE";
|
|
271
|
+
BaseIds[BaseIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 26] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
272
|
+
BaseIds[BaseIds["AAVE_V3_EOA_CLOSE"] = 27] = "AAVE_V3_EOA_CLOSE";
|
|
257
273
|
})(BaseIds = Bundles.BaseIds || (Bundles.BaseIds = {}));
|
|
258
274
|
let ArbitrumIds;
|
|
259
275
|
(function (ArbitrumIds) {
|
|
@@ -275,5 +291,10 @@ var Bundles;
|
|
|
275
291
|
ArbitrumIds[ArbitrumIds["COMP_V3_EOA_CLOSE"] = 15] = "COMP_V3_EOA_CLOSE";
|
|
276
292
|
ArbitrumIds[ArbitrumIds["COMP_V3_EOA_REPAY"] = 16] = "COMP_V3_EOA_REPAY";
|
|
277
293
|
ArbitrumIds[ArbitrumIds["COMP_V3_EOA_BOOST"] = 17] = "COMP_V3_EOA_BOOST";
|
|
294
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_EOA_REPAY"] = 18] = "AAVE_V3_EOA_REPAY";
|
|
295
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_EOA_BOOST"] = 19] = "AAVE_V3_EOA_BOOST";
|
|
296
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_EOA_REPAY_ON_PRICE"] = 20] = "AAVE_V3_EOA_REPAY_ON_PRICE";
|
|
297
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_EOA_BOOST_ON_PRICE"] = 21] = "AAVE_V3_EOA_BOOST_ON_PRICE";
|
|
298
|
+
ArbitrumIds[ArbitrumIds["AAVE_V3_EOA_CLOSE"] = 22] = "AAVE_V3_EOA_CLOSE";
|
|
278
299
|
})(ArbitrumIds = Bundles.ArbitrumIds || (Bundles.ArbitrumIds = {}));
|
|
279
300
|
})(Bundles = exports.Bundles || (exports.Bundles = {}));
|
package/esm/constants/index.js
CHANGED
|
@@ -422,6 +422,31 @@ export const MAINNET_BUNDLES_INFO = {
|
|
|
422
422
|
strategyId: Strategies.Identifiers.EoaCloseOnPrice,
|
|
423
423
|
protocol: PROTOCOLS.CompoundV3,
|
|
424
424
|
},
|
|
425
|
+
[Bundles.MainnetIds.AAVE_V3_EOA_REPAY]: {
|
|
426
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_REPAY,
|
|
427
|
+
strategyId: Strategies.Identifiers.EoaRepay,
|
|
428
|
+
protocol: PROTOCOLS.AaveV3,
|
|
429
|
+
},
|
|
430
|
+
[Bundles.MainnetIds.AAVE_V3_EOA_BOOST]: {
|
|
431
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_BOOST,
|
|
432
|
+
strategyId: Strategies.Identifiers.EoaBoost,
|
|
433
|
+
protocol: PROTOCOLS.AaveV3,
|
|
434
|
+
},
|
|
435
|
+
[Bundles.MainnetIds.AAVE_V3_EOA_REPAY_ON_PRICE]: {
|
|
436
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_REPAY_ON_PRICE,
|
|
437
|
+
strategyId: Strategies.Identifiers.EoaRepayOnPrice,
|
|
438
|
+
protocol: PROTOCOLS.AaveV3,
|
|
439
|
+
},
|
|
440
|
+
[Bundles.MainnetIds.AAVE_V3_EOA_BOOST_ON_PRICE]: {
|
|
441
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_BOOST_ON_PRICE,
|
|
442
|
+
strategyId: Strategies.Identifiers.EoaBoostOnPrice,
|
|
443
|
+
protocol: PROTOCOLS.AaveV3,
|
|
444
|
+
},
|
|
445
|
+
[Bundles.MainnetIds.AAVE_V3_EOA_CLOSE]: {
|
|
446
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V3_EOA_CLOSE,
|
|
447
|
+
strategyId: Strategies.Identifiers.EoaCloseOnPrice,
|
|
448
|
+
protocol: PROTOCOLS.AaveV3,
|
|
449
|
+
},
|
|
425
450
|
};
|
|
426
451
|
export const OPTIMISM_BUNDLES_INFO = {
|
|
427
452
|
[Bundles.OptimismIds.AAVE_V3_REPAY]: {
|
|
@@ -454,6 +479,31 @@ export const OPTIMISM_BUNDLES_INFO = {
|
|
|
454
479
|
strategyId: Strategies.Identifiers.RepayOnPrice,
|
|
455
480
|
protocol: PROTOCOLS.AaveV3,
|
|
456
481
|
},
|
|
482
|
+
[Bundles.OptimismIds.AAVE_V3_EOA_REPAY]: {
|
|
483
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_REPAY,
|
|
484
|
+
strategyId: Strategies.Identifiers.EoaRepay,
|
|
485
|
+
protocol: PROTOCOLS.AaveV3,
|
|
486
|
+
},
|
|
487
|
+
[Bundles.OptimismIds.AAVE_V3_EOA_BOOST]: {
|
|
488
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_BOOST,
|
|
489
|
+
strategyId: Strategies.Identifiers.EoaBoost,
|
|
490
|
+
protocol: PROTOCOLS.AaveV3,
|
|
491
|
+
},
|
|
492
|
+
[Bundles.OptimismIds.AAVE_V3_EOA_REPAY_ON_PRICE]: {
|
|
493
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_REPAY_ON_PRICE,
|
|
494
|
+
strategyId: Strategies.Identifiers.EoaRepayOnPrice,
|
|
495
|
+
protocol: PROTOCOLS.AaveV3,
|
|
496
|
+
},
|
|
497
|
+
[Bundles.OptimismIds.AAVE_V3_EOA_BOOST_ON_PRICE]: {
|
|
498
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_BOOST_ON_PRICE,
|
|
499
|
+
strategyId: Strategies.Identifiers.EoaBoostOnPrice,
|
|
500
|
+
protocol: PROTOCOLS.AaveV3,
|
|
501
|
+
},
|
|
502
|
+
[Bundles.OptimismIds.AAVE_V3_EOA_CLOSE]: {
|
|
503
|
+
strategyOrBundleId: Bundles.OptimismIds.AAVE_V3_EOA_CLOSE,
|
|
504
|
+
strategyId: Strategies.Identifiers.EoaCloseOnPrice,
|
|
505
|
+
protocol: PROTOCOLS.AaveV3,
|
|
506
|
+
},
|
|
457
507
|
};
|
|
458
508
|
export const BASE_BUNDLES_INFO = {
|
|
459
509
|
[Bundles.BaseIds.AAVE_V3_REPAY]: {
|
|
@@ -561,6 +611,31 @@ export const BASE_BUNDLES_INFO = {
|
|
|
561
611
|
strategyId: Strategies.Identifiers.EoaBoost,
|
|
562
612
|
protocol: PROTOCOLS.CompoundV3,
|
|
563
613
|
},
|
|
614
|
+
[Bundles.BaseIds.AAVE_V3_EOA_REPAY]: {
|
|
615
|
+
strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_REPAY,
|
|
616
|
+
strategyId: Strategies.Identifiers.EoaRepay,
|
|
617
|
+
protocol: PROTOCOLS.AaveV3,
|
|
618
|
+
},
|
|
619
|
+
[Bundles.BaseIds.AAVE_V3_EOA_BOOST]: {
|
|
620
|
+
strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_BOOST,
|
|
621
|
+
strategyId: Strategies.Identifiers.EoaBoost,
|
|
622
|
+
protocol: PROTOCOLS.AaveV3,
|
|
623
|
+
},
|
|
624
|
+
[Bundles.BaseIds.AAVE_V3_EOA_REPAY_ON_PRICE]: {
|
|
625
|
+
strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_REPAY_ON_PRICE,
|
|
626
|
+
strategyId: Strategies.Identifiers.EoaRepayOnPrice,
|
|
627
|
+
protocol: PROTOCOLS.AaveV3,
|
|
628
|
+
},
|
|
629
|
+
[Bundles.BaseIds.AAVE_V3_EOA_BOOST_ON_PRICE]: {
|
|
630
|
+
strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_BOOST_ON_PRICE,
|
|
631
|
+
strategyId: Strategies.Identifiers.EoaBoostOnPrice,
|
|
632
|
+
protocol: PROTOCOLS.AaveV3,
|
|
633
|
+
},
|
|
634
|
+
[Bundles.BaseIds.AAVE_V3_EOA_CLOSE]: {
|
|
635
|
+
strategyOrBundleId: Bundles.BaseIds.AAVE_V3_EOA_CLOSE,
|
|
636
|
+
strategyId: Strategies.Identifiers.EoaCloseOnPrice,
|
|
637
|
+
protocol: PROTOCOLS.AaveV3,
|
|
638
|
+
},
|
|
564
639
|
};
|
|
565
640
|
export const ARBITRUM_BUNDLES_INFO = {
|
|
566
641
|
[Bundles.ArbitrumIds.AAVE_V3_REPAY]: {
|
|
@@ -653,6 +728,31 @@ export const ARBITRUM_BUNDLES_INFO = {
|
|
|
653
728
|
strategyId: Strategies.Identifiers.EoaBoost,
|
|
654
729
|
protocol: PROTOCOLS.CompoundV3,
|
|
655
730
|
},
|
|
731
|
+
[Bundles.ArbitrumIds.AAVE_V3_EOA_REPAY]: {
|
|
732
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_REPAY,
|
|
733
|
+
strategyId: Strategies.Identifiers.EoaRepay,
|
|
734
|
+
protocol: PROTOCOLS.AaveV3,
|
|
735
|
+
},
|
|
736
|
+
[Bundles.ArbitrumIds.AAVE_V3_EOA_BOOST]: {
|
|
737
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_BOOST,
|
|
738
|
+
strategyId: Strategies.Identifiers.EoaBoost,
|
|
739
|
+
protocol: PROTOCOLS.AaveV3,
|
|
740
|
+
},
|
|
741
|
+
[Bundles.ArbitrumIds.AAVE_V3_EOA_REPAY_ON_PRICE]: {
|
|
742
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_REPAY_ON_PRICE,
|
|
743
|
+
strategyId: Strategies.Identifiers.EoaRepayOnPrice,
|
|
744
|
+
protocol: PROTOCOLS.AaveV3,
|
|
745
|
+
},
|
|
746
|
+
[Bundles.ArbitrumIds.AAVE_V3_EOA_BOOST_ON_PRICE]: {
|
|
747
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_BOOST_ON_PRICE,
|
|
748
|
+
strategyId: Strategies.Identifiers.EoaBoostOnPrice,
|
|
749
|
+
protocol: PROTOCOLS.AaveV3,
|
|
750
|
+
},
|
|
751
|
+
[Bundles.ArbitrumIds.AAVE_V3_EOA_CLOSE]: {
|
|
752
|
+
strategyOrBundleId: Bundles.ArbitrumIds.AAVE_V3_EOA_CLOSE,
|
|
753
|
+
strategyId: Strategies.Identifiers.EoaCloseOnPrice,
|
|
754
|
+
protocol: PROTOCOLS.AaveV3,
|
|
755
|
+
},
|
|
656
756
|
};
|
|
657
757
|
export const BUNDLES_INFO = {
|
|
658
758
|
[ChainId.Ethereum]: MAINNET_BUNDLES_INFO,
|
package/esm/index.d.ts
CHANGED
|
@@ -13,11 +13,12 @@ import * as strategiesService from './services/strategiesService';
|
|
|
13
13
|
import * as constants from './constants';
|
|
14
14
|
import * as enums from './types/enums';
|
|
15
15
|
import type * as types from './types';
|
|
16
|
-
import { getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId } from './services/utils';
|
|
16
|
+
import { getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId, getCloseStrategyType } from './services/utils';
|
|
17
17
|
declare const utils: {
|
|
18
18
|
getRatioStateInfoForAaveCloseStrategy: typeof getRatioStateInfoForAaveCloseStrategy;
|
|
19
19
|
compareSubHashes: typeof compareSubHashes;
|
|
20
20
|
encodeSubId: typeof encodeSubId;
|
|
21
|
+
getCloseStrategyType: typeof getCloseStrategyType;
|
|
21
22
|
};
|
|
22
23
|
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, BaseStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, strategiesService, };
|
|
23
24
|
export type { types };
|
package/esm/index.js
CHANGED
|
@@ -16,8 +16,8 @@ import * as strategySubService from './services/strategySubService';
|
|
|
16
16
|
import * as strategiesService from './services/strategiesService';
|
|
17
17
|
import * as constants from './constants';
|
|
18
18
|
import * as enums from './types/enums';
|
|
19
|
-
import { getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId } from './services/utils';
|
|
19
|
+
import { getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId, getCloseStrategyType, } from './services/utils';
|
|
20
20
|
const utils = {
|
|
21
|
-
getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId,
|
|
21
|
+
getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId, getCloseStrategyType,
|
|
22
22
|
};
|
|
23
23
|
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, BaseStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, strategiesService, };
|
|
@@ -160,21 +160,25 @@ function parseAaveV2LeverageManagement(position, parseData) {
|
|
|
160
160
|
}
|
|
161
161
|
function parseAaveV3LeverageManagement(position, parseData) {
|
|
162
162
|
const _position = cloneDeep(position);
|
|
163
|
-
const { subStruct, subId } = parseData.subscriptionEventData;
|
|
163
|
+
const { subStruct, subId, subHash } = parseData.subscriptionEventData;
|
|
164
164
|
const { isEnabled } = parseData.strategiesSubsData;
|
|
165
165
|
const triggerData = triggerService.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
166
166
|
const subData = subDataService.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
167
167
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
168
168
|
_position.strategyData.decoded.subData = subData;
|
|
169
169
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, triggerData.market);
|
|
170
|
-
|
|
170
|
+
// TODO -> check if this change breaks something?
|
|
171
|
+
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
172
|
+
// TODO -> check if this change breaks something?
|
|
173
|
+
const isRepay = [Strategies.Identifiers.Repay, Strategies.Identifiers.EoaRepay].includes(_position.strategy.strategyId);
|
|
171
174
|
if (isRepay) {
|
|
172
175
|
_position.specific = {
|
|
173
176
|
triggerRepayRatio: triggerData.ratio,
|
|
174
177
|
targetRepayRatio: subData.targetRatio,
|
|
175
178
|
repayEnabled: true,
|
|
176
179
|
subId1: Number(subId),
|
|
177
|
-
|
|
180
|
+
subHashRepay: subHash,
|
|
181
|
+
mergeWithId: isEOA ? Strategies.Identifiers.EoaBoost : Strategies.Identifiers.Boost,
|
|
178
182
|
};
|
|
179
183
|
}
|
|
180
184
|
else {
|
|
@@ -183,10 +187,11 @@ function parseAaveV3LeverageManagement(position, parseData) {
|
|
|
183
187
|
targetBoostRatio: subData.targetRatio,
|
|
184
188
|
boostEnabled: isEnabled,
|
|
185
189
|
subId2: Number(subId),
|
|
186
|
-
|
|
190
|
+
subHashBoost: subHash,
|
|
191
|
+
mergeId: isEOA ? Strategies.Identifiers.EoaBoost : Strategies.Identifiers.Boost,
|
|
187
192
|
};
|
|
188
193
|
}
|
|
189
|
-
_position.strategy.strategyId = Strategies.IdOverrides.LeverageManagement;
|
|
194
|
+
_position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagement : Strategies.IdOverrides.LeverageManagement;
|
|
190
195
|
return _position;
|
|
191
196
|
}
|
|
192
197
|
function parseMorphoAaveV2LeverageManagement(position, parseData) {
|
|
@@ -239,7 +244,13 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
239
244
|
ratioState: triggerData.ratioState,
|
|
240
245
|
};
|
|
241
246
|
const { ratioState } = getRatioStateInfoForAaveCloseStrategy(_position.specific.ratioState, wethToEthByAddress(_position.specific.collAsset, parseData.chainId), wethToEthByAddress(_position.specific.debtAsset, parseData.chainId), parseData.chainId);
|
|
242
|
-
|
|
247
|
+
// TODO -> Check if those changes break something?
|
|
248
|
+
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
249
|
+
_position.strategy.strategyId = isEOA
|
|
250
|
+
? Strategies.Identifiers.EoaCloseOnPrice
|
|
251
|
+
: (_position.strategy.strategyId = isRatioStateOver(ratioState)
|
|
252
|
+
? Strategies.IdOverrides.TakeProfit
|
|
253
|
+
: Strategies.IdOverrides.StopLoss);
|
|
243
254
|
return _position;
|
|
244
255
|
}
|
|
245
256
|
function parseAaveV3CloseOnPriceWithMaximumGasPrice(position, parseData) {
|
|
@@ -313,13 +324,14 @@ function parseCompoundV3LeverageManagement(position, parseData) {
|
|
|
313
324
|
_position.strategyData.decoded.subData = subData;
|
|
314
325
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, triggerData.owner.toLowerCase(), triggerData.market);
|
|
315
326
|
const isRepay = [Strategies.Identifiers.Repay, Strategies.Identifiers.EoaRepay].includes(_position.strategy.strategyId);
|
|
327
|
+
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
316
328
|
if (isRepay) {
|
|
317
329
|
_position.specific = {
|
|
318
330
|
triggerRepayRatio: triggerData.ratio,
|
|
319
331
|
targetRepayRatio: subData.targetRatio,
|
|
320
332
|
repayEnabled: true,
|
|
321
333
|
subId1: Number(subId),
|
|
322
|
-
mergeWithId: Strategies.Identifiers.Boost,
|
|
334
|
+
mergeWithId: isEOA ? Strategies.Identifiers.EoaBoost : Strategies.Identifiers.Boost,
|
|
323
335
|
};
|
|
324
336
|
}
|
|
325
337
|
else {
|
|
@@ -328,10 +340,9 @@ function parseCompoundV3LeverageManagement(position, parseData) {
|
|
|
328
340
|
targetBoostRatio: subData.targetRatio,
|
|
329
341
|
boostEnabled: isEnabled,
|
|
330
342
|
subId2: Number(subId),
|
|
331
|
-
mergeId: Strategies.Identifiers.Boost,
|
|
343
|
+
mergeId: isEOA ? Strategies.Identifiers.EoaBoost : Strategies.Identifiers.Boost,
|
|
332
344
|
};
|
|
333
345
|
}
|
|
334
|
-
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
335
346
|
_position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagement : Strategies.IdOverrides.LeverageManagement;
|
|
336
347
|
return _position;
|
|
337
348
|
}
|
|
@@ -685,6 +696,9 @@ function parseAaveV3LeverageManagementOnPrice(position, parseData) {
|
|
|
685
696
|
collAssetId: subData.collAssetId,
|
|
686
697
|
ratio: subData.targetRatio,
|
|
687
698
|
};
|
|
699
|
+
// TODO -> check if this change breaks something?
|
|
700
|
+
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
701
|
+
_position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagementOnPrice : Strategies.IdOverrides.LeverageManagementOnPrice;
|
|
688
702
|
return _position;
|
|
689
703
|
}
|
|
690
704
|
function parseLiquityV2CloseOnPrice(position, parseData) {
|
|
@@ -824,6 +838,11 @@ const parsingMethodsMapping = {
|
|
|
824
838
|
[Strategies.Identifiers.CloseToCollateralWithGasPrice]: parseAaveV3CloseOnPriceWithMaximumGasPrice,
|
|
825
839
|
[Strategies.Identifiers.OpenOrderFromCollateral]: parseAaveV3LeverageManagementOnPrice,
|
|
826
840
|
[Strategies.Identifiers.RepayOnPrice]: parseAaveV3LeverageManagementOnPrice,
|
|
841
|
+
[Strategies.Identifiers.EoaRepay]: parseAaveV3LeverageManagement,
|
|
842
|
+
[Strategies.Identifiers.EoaBoost]: parseAaveV3LeverageManagement,
|
|
843
|
+
[Strategies.Identifiers.EoaRepayOnPrice]: parseAaveV3LeverageManagementOnPrice,
|
|
844
|
+
[Strategies.Identifiers.EoaBoostOnPrice]: parseAaveV3LeverageManagementOnPrice,
|
|
845
|
+
[Strategies.Identifiers.EoaCloseOnPrice]: parseAaveV3CloseOnPrice,
|
|
827
846
|
},
|
|
828
847
|
[ProtocolIdentifiers.StrategiesAutomation.CompoundV2]: {
|
|
829
848
|
[Strategies.Identifiers.Repay]: parseCompoundV2LeverageManagement,
|
|
@@ -60,7 +60,9 @@ export declare const aaveV3Encode: {
|
|
|
60
60
|
marketAddr: EthereumAddress;
|
|
61
61
|
targetRatio: number;
|
|
62
62
|
}): (number | boolean | string[])[];
|
|
63
|
-
leverageManagementWithoutSubProxy(strategyOrBundleId: number, market: EthereumAddress, user: EthereumAddress, ratioState: RatioState, targetRatio: number, triggerRatio: number): (number | boolean | string[])[];
|
|
63
|
+
leverageManagementWithoutSubProxy(strategyOrBundleId: number, market: EthereumAddress, user: EthereumAddress, ratioState: RatioState, targetRatio: number, triggerRatio: number, isGeneric?: boolean): (number | boolean | string[])[];
|
|
64
|
+
leverageManagementOnPriceGeneric(strategyOrBundleId: number, price: number, ratioState: RatioState, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number, user: EthereumAddress): (number | boolean | string[])[];
|
|
65
|
+
closeOnPriceGeneric(strategyOrBundleId: number, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, user: EthereumAddress, stopLossPrice?: number, stopLossType?: CloseToAssetType, takeProfitPrice?: number, takeProfitType?: CloseToAssetType): (number | boolean | string[])[];
|
|
64
66
|
};
|
|
65
67
|
export declare const compoundV2Encode: {
|
|
66
68
|
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
@@ -146,12 +146,25 @@ export const aaveV3Encode = {
|
|
|
146
146
|
const triggerDataEncoded = triggerService.aaveV3QuotePriceTrigger.encode(baseTokenAddress, quoteTokenAddress, price, state);
|
|
147
147
|
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
148
148
|
},
|
|
149
|
-
leverageManagementWithoutSubProxy(strategyOrBundleId, market, user, ratioState, targetRatio, triggerRatio) {
|
|
149
|
+
leverageManagementWithoutSubProxy(strategyOrBundleId, market, user, ratioState, targetRatio, triggerRatio, isGeneric = false) {
|
|
150
150
|
const isBundle = true;
|
|
151
|
-
const subData = subDataService.aaveV3LeverageManagementSubDataWithoutSubProxy.encode(targetRatio, ratioState);
|
|
151
|
+
const subData = subDataService.aaveV3LeverageManagementSubDataWithoutSubProxy.encode(targetRatio, ratioState, market, user, isGeneric);
|
|
152
152
|
const triggerData = triggerService.aaveV3RatioTrigger.encode(user, market, triggerRatio, ratioState);
|
|
153
153
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
154
154
|
},
|
|
155
|
+
leverageManagementOnPriceGeneric(strategyOrBundleId, price, ratioState, collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user) {
|
|
156
|
+
const isBundle = true;
|
|
157
|
+
const subDataEncoded = subDataService.aaveV3LeverageManagementOnPriceGeneric.encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio, user);
|
|
158
|
+
const triggerDataEncoded = triggerService.aaveV3QuotePriceTrigger.encode(collAsset, debtAsset, price, ratioState);
|
|
159
|
+
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
160
|
+
},
|
|
161
|
+
closeOnPriceGeneric(strategyOrBundleId, collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, user, stopLossPrice = 0, stopLossType = CloseToAssetType.DEBT, takeProfitPrice = 0, takeProfitType = CloseToAssetType.COLLATERAL) {
|
|
162
|
+
const isBundle = true;
|
|
163
|
+
const closeType = getCloseStrategyType(stopLossPrice, stopLossType, takeProfitPrice, takeProfitType);
|
|
164
|
+
const subDataEncoded = subDataService.aaveV3CloseGenericSubData.encode(collAsset, collAssetId, debtAsset, debtAssetId, closeType, marketAddr, user);
|
|
165
|
+
const triggerDataEncoded = triggerService.aaveV3QuotePriceRangeTrigger.encode(collAsset, debtAsset, stopLossPrice, takeProfitPrice);
|
|
166
|
+
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
167
|
+
},
|
|
155
168
|
};
|
|
156
169
|
export const compoundV2Encode = {
|
|
157
170
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|