@defisaver/automation-sdk 1.2.31 → 1.2.33
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/README.md +36 -0
- package/esm/constants/index.js +20 -0
- package/esm/services/strategiesService.js +68 -1
- package/esm/services/strategySubService.d.ts +6 -0
- package/esm/services/strategySubService.js +10 -0
- package/esm/services/subDataService.d.ts +13 -1
- package/esm/services/subDataService.js +35 -1
- package/esm/services/triggerService.d.ts +2 -2
- package/esm/services/triggerService.js +2 -2
- package/esm/types/enums.d.ts +8 -2
- package/esm/types/enums.js +8 -2
- package/package.json +1 -1
- package/src/constants/index.ts +20 -0
- package/src/services/strategiesService.ts +81 -1
- package/src/services/strategySubService.ts +24 -0
- package/src/services/subDataService.ts +51 -1
- package/src/services/triggerService.ts +4 -4
- package/src/types/enums.ts +8 -2
- package/umd/index.js +150 -7
- package/yarn-error.log +0 -7233
package/src/types/enums.ts
CHANGED
|
@@ -27,7 +27,9 @@ export namespace ProtocolIdentifiers {
|
|
|
27
27
|
MakerDAO = 'MakerDAO',
|
|
28
28
|
Liquity = 'Liquity',
|
|
29
29
|
ChickenBonds = 'Chicken Bonds',
|
|
30
|
+
CompoundV2 = 'Compound__V2',
|
|
30
31
|
CompoundV3 = 'Compound__V3',
|
|
32
|
+
AaveV2 = 'Aave__V2',
|
|
31
33
|
AaveV3 = 'Aave__V3',
|
|
32
34
|
MorphoAaveV2 = 'Morpho-Aave__V2',
|
|
33
35
|
Exchange = 'Exchange',
|
|
@@ -113,8 +115,12 @@ export namespace Bundles {
|
|
|
113
115
|
LIQUITY_BOOST = 17,
|
|
114
116
|
SPARK_REPAY = 18,
|
|
115
117
|
SPARK_BOOST = 19,
|
|
116
|
-
SPARK_CLOSE_TO_DEBT =
|
|
117
|
-
SPARK_CLOSE_TO_COLLATERAL =
|
|
118
|
+
SPARK_CLOSE_TO_DEBT = -21231230, // @dev This was never deployed
|
|
119
|
+
SPARK_CLOSE_TO_COLLATERAL = -21231231, // @dev This was never deployed
|
|
120
|
+
AAVE_V2_REPAY = 22,
|
|
121
|
+
AAVE_V2_BOOST = 23,
|
|
122
|
+
COMP_V2_REPAY = 20,
|
|
123
|
+
COMP_V2_BOOST = 21,
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
export enum OptimismIds {
|
package/umd/index.js
CHANGED
|
@@ -328,6 +328,26 @@ var MAINNET_BUNDLES_INFO = {
|
|
|
328
328
|
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.SPARK_CLOSE_TO_COLLATERAL,
|
|
329
329
|
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToCollateral,
|
|
330
330
|
protocol: PROTOCOLS.Spark
|
|
331
|
+
},
|
|
332
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V2_REPAY]: {
|
|
333
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V2_REPAY,
|
|
334
|
+
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
|
|
335
|
+
protocol: PROTOCOLS.AaveV2
|
|
336
|
+
},
|
|
337
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V2_BOOST]: {
|
|
338
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V2_BOOST,
|
|
339
|
+
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Boost,
|
|
340
|
+
protocol: PROTOCOLS.AaveV2
|
|
341
|
+
},
|
|
342
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V2_REPAY]: {
|
|
343
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V2_REPAY,
|
|
344
|
+
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
|
|
345
|
+
protocol: PROTOCOLS.CompoundV2
|
|
346
|
+
},
|
|
347
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V2_BOOST]: {
|
|
348
|
+
strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.COMP_V2_BOOST,
|
|
349
|
+
strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Boost,
|
|
350
|
+
protocol: PROTOCOLS.CompoundV2
|
|
331
351
|
}
|
|
332
352
|
};
|
|
333
353
|
var OPTIMISM_BUNDLES_INFO = {
|
|
@@ -431,7 +451,9 @@ var ProtocolIdentifiers;
|
|
|
431
451
|
StrategiesAutomation["MakerDAO"] = "MakerDAO";
|
|
432
452
|
StrategiesAutomation["Liquity"] = "Liquity";
|
|
433
453
|
StrategiesAutomation["ChickenBonds"] = "Chicken Bonds";
|
|
454
|
+
StrategiesAutomation["CompoundV2"] = "Compound__V2";
|
|
434
455
|
StrategiesAutomation["CompoundV3"] = "Compound__V3";
|
|
456
|
+
StrategiesAutomation["AaveV2"] = "Aave__V2";
|
|
435
457
|
StrategiesAutomation["AaveV3"] = "Aave__V3";
|
|
436
458
|
StrategiesAutomation["MorphoAaveV2"] = "Morpho-Aave__V2";
|
|
437
459
|
StrategiesAutomation["Exchange"] = "Exchange";
|
|
@@ -527,8 +549,12 @@ var Bundles;
|
|
|
527
549
|
MainnetIds[MainnetIds["LIQUITY_BOOST"] = 17] = "LIQUITY_BOOST";
|
|
528
550
|
MainnetIds[MainnetIds["SPARK_REPAY"] = 18] = "SPARK_REPAY";
|
|
529
551
|
MainnetIds[MainnetIds["SPARK_BOOST"] = 19] = "SPARK_BOOST";
|
|
530
|
-
MainnetIds[MainnetIds["SPARK_CLOSE_TO_DEBT"] =
|
|
531
|
-
MainnetIds[MainnetIds["SPARK_CLOSE_TO_COLLATERAL"] =
|
|
552
|
+
MainnetIds[MainnetIds["SPARK_CLOSE_TO_DEBT"] = -21231230] = "SPARK_CLOSE_TO_DEBT";
|
|
553
|
+
MainnetIds[MainnetIds["SPARK_CLOSE_TO_COLLATERAL"] = -21231231] = "SPARK_CLOSE_TO_COLLATERAL";
|
|
554
|
+
MainnetIds[MainnetIds["AAVE_V2_REPAY"] = 22] = "AAVE_V2_REPAY";
|
|
555
|
+
MainnetIds[MainnetIds["AAVE_V2_BOOST"] = 23] = "AAVE_V2_BOOST";
|
|
556
|
+
MainnetIds[MainnetIds["COMP_V2_REPAY"] = 20] = "COMP_V2_REPAY";
|
|
557
|
+
MainnetIds[MainnetIds["COMP_V2_BOOST"] = 21] = "COMP_V2_BOOST";
|
|
532
558
|
})(MainnetIds || (MainnetIds = {}));
|
|
533
559
|
_Bundles.MainnetIds = MainnetIds;
|
|
534
560
|
var OptimismIds;
|
|
@@ -1601,6 +1627,39 @@ function parseLiquityTrailingStop(position, parseData) {
|
|
|
1601
1627
|
};
|
|
1602
1628
|
return _position;
|
|
1603
1629
|
}
|
|
1630
|
+
function parseAaveV2LeverageManagement(position, parseData) {
|
|
1631
|
+
var _position = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(position);
|
|
1632
|
+
var {
|
|
1633
|
+
subStruct,
|
|
1634
|
+
subId
|
|
1635
|
+
} = parseData.subscriptionEventData;
|
|
1636
|
+
var {
|
|
1637
|
+
isEnabled
|
|
1638
|
+
} = parseData.strategiesSubsData;
|
|
1639
|
+
var triggerData = _triggerService__WEBPACK_IMPORTED_MODULE_6__.aaveV2RatioTrigger.decode(subStruct.triggerData);
|
|
1640
|
+
var subData = _subDataService__WEBPACK_IMPORTED_MODULE_5__.aaveV2LeverageManagementSubData.decode(subStruct.subData);
|
|
1641
|
+
_position.strategyData.decoded.triggerData = triggerData;
|
|
1642
|
+
_position.strategyData.decoded.subData = subData;
|
|
1643
|
+
var isRepay = _position.strategy.strategyId === _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay;
|
|
1644
|
+
if (isRepay) {
|
|
1645
|
+
_position.specific = {
|
|
1646
|
+
minRatio: triggerData.ratio,
|
|
1647
|
+
minOptimalRatio: subData.targetRatio,
|
|
1648
|
+
repayEnabled: true,
|
|
1649
|
+
subId1: Number(subId)
|
|
1650
|
+
};
|
|
1651
|
+
} else {
|
|
1652
|
+
_position.specific = {
|
|
1653
|
+
maxRatio: triggerData.ratio,
|
|
1654
|
+
maxOptimalRatio: subData.targetRatio,
|
|
1655
|
+
boostEnabled: isEnabled,
|
|
1656
|
+
subId2: Number(subId)
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
_position.strategy.strategyId = _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.LeverageManagement;
|
|
1660
|
+
_position.specific.mergeWithSameId = true;
|
|
1661
|
+
return _position;
|
|
1662
|
+
}
|
|
1604
1663
|
function parseAaveV3LeverageManagement(position, parseData) {
|
|
1605
1664
|
var _position = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(position);
|
|
1606
1665
|
var {
|
|
@@ -1611,7 +1670,7 @@ function parseAaveV3LeverageManagement(position, parseData) {
|
|
|
1611
1670
|
isEnabled
|
|
1612
1671
|
} = parseData.strategiesSubsData;
|
|
1613
1672
|
var triggerData = _triggerService__WEBPACK_IMPORTED_MODULE_6__.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
1614
|
-
var subData = _subDataService__WEBPACK_IMPORTED_MODULE_5__.
|
|
1673
|
+
var subData = _subDataService__WEBPACK_IMPORTED_MODULE_5__.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
1615
1674
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
1616
1675
|
_position.strategyData.decoded.subData = subData;
|
|
1617
1676
|
var isRepay = _position.strategy.strategyId === _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay;
|
|
@@ -1692,6 +1751,40 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
1692
1751
|
_position.strategy.strategyId = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.isRatioStateOver)(ratioState) ? _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.TakeProfit : _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.StopLoss;
|
|
1693
1752
|
return _position;
|
|
1694
1753
|
}
|
|
1754
|
+
function parseCompoundV2LeverageManagement(position, parseData) {
|
|
1755
|
+
var _position = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(position);
|
|
1756
|
+
var {
|
|
1757
|
+
subStruct,
|
|
1758
|
+
subId
|
|
1759
|
+
} = parseData.subscriptionEventData;
|
|
1760
|
+
var {
|
|
1761
|
+
isEnabled
|
|
1762
|
+
} = parseData.strategiesSubsData;
|
|
1763
|
+
var triggerData = _triggerService__WEBPACK_IMPORTED_MODULE_6__.compoundV2RatioTrigger.decode(subStruct.triggerData);
|
|
1764
|
+
var subData = _subDataService__WEBPACK_IMPORTED_MODULE_5__.compoundV2LeverageManagementSubData.decode(subStruct.subData);
|
|
1765
|
+
_position.strategyData.decoded.triggerData = triggerData;
|
|
1766
|
+
_position.strategyData.decoded.subData = subData;
|
|
1767
|
+
_position.owner = triggerData.owner;
|
|
1768
|
+
var isRepay = [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay, _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.EoaRepay].includes(_position.strategy.strategyId);
|
|
1769
|
+
if (isRepay) {
|
|
1770
|
+
_position.specific = {
|
|
1771
|
+
minRatio: triggerData.ratio,
|
|
1772
|
+
minOptimalRatio: subData.targetRatio,
|
|
1773
|
+
repayEnabled: true,
|
|
1774
|
+
subId1: Number(subId)
|
|
1775
|
+
};
|
|
1776
|
+
} else {
|
|
1777
|
+
_position.specific = {
|
|
1778
|
+
maxRatio: triggerData.ratio,
|
|
1779
|
+
maxOptimalRatio: subData.targetRatio,
|
|
1780
|
+
boostEnabled: isEnabled,
|
|
1781
|
+
subId2: Number(subId)
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
_position.strategy.strategyId = _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.LeverageManagement;
|
|
1785
|
+
_position.specific.mergeWithSameId = true;
|
|
1786
|
+
return _position;
|
|
1787
|
+
}
|
|
1695
1788
|
function parseCompoundV3LeverageManagement(position, parseData) {
|
|
1696
1789
|
var _position = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(position);
|
|
1697
1790
|
var {
|
|
@@ -1880,12 +1973,20 @@ var parsingMethodsMapping = {
|
|
|
1880
1973
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseLiquityLeverageManagement,
|
|
1881
1974
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Boost]: parseLiquityLeverageManagement
|
|
1882
1975
|
},
|
|
1976
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.AaveV2]: {
|
|
1977
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseAaveV2LeverageManagement,
|
|
1978
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Boost]: parseAaveV2LeverageManagement
|
|
1979
|
+
},
|
|
1883
1980
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.AaveV3]: {
|
|
1884
1981
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseAaveV3LeverageManagement,
|
|
1885
1982
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Boost]: parseAaveV3LeverageManagement,
|
|
1886
1983
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToDebt]: parseAaveV3CloseOnPrice,
|
|
1887
1984
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToCollateral]: parseAaveV3CloseOnPrice
|
|
1888
1985
|
},
|
|
1986
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.CompoundV2]: {
|
|
1987
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseCompoundV2LeverageManagement,
|
|
1988
|
+
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Boost]: parseCompoundV2LeverageManagement
|
|
1989
|
+
},
|
|
1889
1990
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.CompoundV3]: {
|
|
1890
1991
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseCompoundV3LeverageManagement,
|
|
1891
1992
|
[_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Boost]: parseCompoundV3LeverageManagement,
|
|
@@ -19173,9 +19274,11 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
19173
19274
|
"use strict";
|
|
19174
19275
|
__webpack_require__.r(__webpack_exports__);
|
|
19175
19276
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19176
|
-
/* harmony export */ "
|
|
19277
|
+
/* harmony export */ "aaveV2LeverageManagementSubData": () => (/* binding */ aaveV2LeverageManagementSubData),
|
|
19278
|
+
/* harmony export */ "aaveV3LeverageManagementSubData": () => (/* binding */ aaveV3LeverageManagementSubData),
|
|
19177
19279
|
/* harmony export */ "aaveV3QuotePriceSubData": () => (/* binding */ aaveV3QuotePriceSubData),
|
|
19178
19280
|
/* harmony export */ "cBondsRebondSubData": () => (/* binding */ cBondsRebondSubData),
|
|
19281
|
+
/* harmony export */ "compoundV2LeverageManagementSubData": () => (/* binding */ compoundV2LeverageManagementSubData),
|
|
19179
19282
|
/* harmony export */ "compoundV3LeverageManagementSubData": () => (/* binding */ compoundV3LeverageManagementSubData),
|
|
19180
19283
|
/* harmony export */ "exchangeDcaSubData": () => (/* binding */ exchangeDcaSubData),
|
|
19181
19284
|
/* harmony export */ "exchangeLimitOrderSubData": () => (/* binding */ exchangeLimitOrderSubData),
|
|
@@ -19312,7 +19415,21 @@ var liquityCloseSubData = {
|
|
|
19312
19415
|
};
|
|
19313
19416
|
}
|
|
19314
19417
|
};
|
|
19315
|
-
var
|
|
19418
|
+
var aaveV2LeverageManagementSubData = {
|
|
19419
|
+
encode(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled) {
|
|
19420
|
+
return [new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxOptimalRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minOptimalRatio).mul(1e16).toString(),
|
|
19421
|
+
// @ts-ignore // TODO
|
|
19422
|
+
boostEnabled];
|
|
19423
|
+
},
|
|
19424
|
+
decode(subData) {
|
|
19425
|
+
var ratioWei = mockedWeb3.eth.abi.decodeParameter('uint256', subData[1]);
|
|
19426
|
+
var targetRatio = (0,_utils__WEBPACK_IMPORTED_MODULE_5__.weiToRatioPercentage)(ratioWei);
|
|
19427
|
+
return {
|
|
19428
|
+
targetRatio
|
|
19429
|
+
};
|
|
19430
|
+
}
|
|
19431
|
+
};
|
|
19432
|
+
var aaveV3LeverageManagementSubData = {
|
|
19316
19433
|
// TODO encode?
|
|
19317
19434
|
decode(subData) {
|
|
19318
19435
|
var ratioWei = mockedWeb3.eth.abi.decodeParameter('uint256', subData[0]);
|
|
@@ -19345,6 +19462,20 @@ var aaveV3QuotePriceSubData = {
|
|
|
19345
19462
|
};
|
|
19346
19463
|
}
|
|
19347
19464
|
};
|
|
19465
|
+
var compoundV2LeverageManagementSubData = {
|
|
19466
|
+
encode(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled) {
|
|
19467
|
+
return [new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxOptimalRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minOptimalRatio).mul(1e16).toString(),
|
|
19468
|
+
// @ts-ignore // TODO
|
|
19469
|
+
boostEnabled];
|
|
19470
|
+
},
|
|
19471
|
+
decode(subData) {
|
|
19472
|
+
var weiRatio = mockedWeb3.eth.abi.decodeParameter('uint256', subData[0]);
|
|
19473
|
+
var targetRatio = (0,_utils__WEBPACK_IMPORTED_MODULE_5__.weiToRatioPercentage)(weiRatio);
|
|
19474
|
+
return {
|
|
19475
|
+
targetRatio
|
|
19476
|
+
};
|
|
19477
|
+
}
|
|
19478
|
+
};
|
|
19348
19479
|
var compoundV3LeverageManagementSubData = {
|
|
19349
19480
|
encode(market, baseToken, minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled, isEOA) {
|
|
19350
19481
|
return [market, baseToken, new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(maxOptimalRatio).mul(1e16).toString(), new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(minOptimalRatio).mul(1e16).toString(),
|
|
@@ -29325,7 +29456,7 @@ var compoundV2RatioTrigger = {
|
|
|
29325
29456
|
var decodedData = mockedWeb3.eth.abi.decodeParameters(['address', 'uint256', 'uint8'], triggerData[0]);
|
|
29326
29457
|
return {
|
|
29327
29458
|
owner: decodedData[0],
|
|
29328
|
-
ratio: new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(mockedWeb3.utils.fromWei(decodedData[1])).mul(100).
|
|
29459
|
+
ratio: new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(mockedWeb3.utils.fromWei(decodedData[1])).mul(100).toNumber(),
|
|
29329
29460
|
ratioState: +decodedData[2]
|
|
29330
29461
|
};
|
|
29331
29462
|
}
|
|
@@ -29366,7 +29497,7 @@ var aaveV2RatioTrigger = {
|
|
|
29366
29497
|
return {
|
|
29367
29498
|
owner: decodedData[0],
|
|
29368
29499
|
market: decodedData[1],
|
|
29369
|
-
ratio: new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(mockedWeb3.utils.fromWei(decodedData[2])).mul(100).
|
|
29500
|
+
ratio: new (decimal_js__WEBPACK_IMPORTED_MODULE_0___default())(mockedWeb3.utils.fromWei(decodedData[2])).mul(100).toNumber(),
|
|
29370
29501
|
ratioState: +decodedData[3]
|
|
29371
29502
|
};
|
|
29372
29503
|
}
|
|
@@ -29559,8 +29690,10 @@ class ArbitrumStrategies extends _private_StrategiesAutomation__WEBPACK_IMPORTED
|
|
|
29559
29690
|
"use strict";
|
|
29560
29691
|
__webpack_require__.r(__webpack_exports__);
|
|
29561
29692
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29693
|
+
/* harmony export */ "aaveV2Encode": () => (/* binding */ aaveV2Encode),
|
|
29562
29694
|
/* harmony export */ "aaveV3Encode": () => (/* binding */ aaveV3Encode),
|
|
29563
29695
|
/* harmony export */ "chickenBondsEncode": () => (/* binding */ chickenBondsEncode),
|
|
29696
|
+
/* harmony export */ "compoundV2Encode": () => (/* binding */ compoundV2Encode),
|
|
29564
29697
|
/* harmony export */ "compoundV3Encode": () => (/* binding */ compoundV3Encode),
|
|
29565
29698
|
/* harmony export */ "exchangeEncode": () => (/* binding */ exchangeEncode),
|
|
29566
29699
|
/* harmony export */ "liquityEncode": () => (/* binding */ liquityEncode),
|
|
@@ -29659,6 +29792,11 @@ var chickenBondsEncode = {
|
|
|
29659
29792
|
return _subDataService__WEBPACK_IMPORTED_MODULE_3__.cBondsRebondSubData.encode(bondId);
|
|
29660
29793
|
}
|
|
29661
29794
|
};
|
|
29795
|
+
var aaveV2Encode = {
|
|
29796
|
+
leverageManagement(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled) {
|
|
29797
|
+
return _subDataService__WEBPACK_IMPORTED_MODULE_3__.aaveV2LeverageManagementSubData.encode(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled);
|
|
29798
|
+
}
|
|
29799
|
+
};
|
|
29662
29800
|
var aaveV3Encode = {
|
|
29663
29801
|
leverageManagement(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled) {
|
|
29664
29802
|
var subInput = '0x';
|
|
@@ -29690,6 +29828,11 @@ var aaveV3Encode = {
|
|
|
29690
29828
|
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
29691
29829
|
}
|
|
29692
29830
|
};
|
|
29831
|
+
var compoundV2Encode = {
|
|
29832
|
+
leverageManagement(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled) {
|
|
29833
|
+
return _subDataService__WEBPACK_IMPORTED_MODULE_3__.compoundV2LeverageManagementSubData.encode(minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled);
|
|
29834
|
+
}
|
|
29835
|
+
};
|
|
29693
29836
|
var compoundV3Encode = {
|
|
29694
29837
|
leverageManagement(market, baseToken, minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled, isEOA) {
|
|
29695
29838
|
return _subDataService__WEBPACK_IMPORTED_MODULE_3__.compoundV3LeverageManagementSubData.encode(market, baseToken, minRatio, maxRatio, maxOptimalRatio, minOptimalRatio, boostEnabled, isEOA);
|