@defisaver/automation-sdk 2.0.2 → 2.0.3
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/.eslintrc.js +1 -0
- package/esm/abis/index.js +27 -15
- package/esm/automation/private/Automation.js +9 -6
- package/esm/automation/private/LegacyAutomation.d.ts +5 -5
- package/esm/automation/private/LegacyAutomation.js +30 -23
- package/esm/automation/private/LegacyProtocol.js +4 -1
- package/esm/automation/private/Protocol.js +4 -1
- package/esm/automation/private/StrategiesAutomation.d.ts +2 -2
- package/esm/automation/private/StrategiesAutomation.js +27 -21
- package/esm/automation/public/ArbitrumStrategies.js +10 -4
- package/esm/automation/public/EthereumStrategies.js +10 -4
- package/esm/automation/public/OptimismStrategies.js +10 -4
- package/esm/automation/public/legacy/LegacyAaveAutomation.js +13 -7
- package/esm/automation/public/legacy/LegacyCompoundAutomation.js +13 -7
- package/esm/automation/public/legacy/LegacyMakerAutomation.js +13 -7
- package/esm/configuration.js +8 -5
- package/esm/constants/index.js +281 -275
- package/esm/index.js +57 -17
- package/esm/services/contractService.js +22 -14
- package/esm/services/ethereumService.js +18 -10
- package/esm/services/strategiesService.js +130 -103
- package/esm/services/strategySubService.js +90 -61
- package/esm/services/subDataService.js +151 -145
- package/esm/services/triggerService.d.ts +5 -5
- package/esm/services/triggerService.js +124 -94
- package/esm/services/utils.js +82 -33
- package/esm/services/utils.test.d.ts +1 -0
- package/esm/services/utils.test.js +362 -0
- package/esm/types/contracts/generated/Erc20.js +2 -1
- package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.js +2 -1
- package/esm/types/contracts/generated/Legacy_AuthCheck.js +2 -1
- package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.js +2 -1
- package/esm/types/contracts/generated/Legacy_MakerSubscriptions.js +2 -1
- package/esm/types/contracts/generated/SubStorage.js +2 -1
- package/esm/types/contracts/generated/UniMulticall.js +2 -1
- package/esm/types/contracts/generated/index.js +2 -1
- package/esm/types/contracts/generated/types.js +2 -1
- package/esm/types/enums.js +17 -14
- package/esm/types/index.js +2 -1
- package/package.json +11 -7
- package/src/automation/private/LegacyAutomation.ts +11 -10
- package/src/automation/private/StrategiesAutomation.ts +5 -6
- package/src/configuration.ts +0 -3
- package/src/index.ts +0 -1
- package/src/services/ethereumService.ts +6 -6
- package/src/services/subDataService.ts +75 -76
- package/src/services/triggerService.ts +83 -83
- package/src/services/utils.test.ts +414 -0
- package/src/services/utils.ts +6 -7
- package/tsconfig.json +1 -1
- package/umd/index.js +7016 -4105
- package/src/types/typings/process.d.ts +0 -9
- package/yarn-error.log +0 -7233
|
@@ -1,117 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.sparkEncode = exports.exchangeEncode = exports.morphoAaveV2Encode = exports.compoundV3Encode = exports.compoundV2Encode = exports.aaveV3Encode = exports.aaveV2Encode = exports.chickenBondsEncode = exports.liquityEncode = exports.makerEncode = void 0;
|
|
30
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
31
|
+
const tokens_1 = require("@defisaver/tokens");
|
|
32
|
+
const enums_1 = require("../types/enums");
|
|
33
|
+
const subDataService = __importStar(require("./subDataService"));
|
|
34
|
+
const triggerService = __importStar(require("./triggerService"));
|
|
35
|
+
const utils_1 = require("./utils");
|
|
36
|
+
exports.makerEncode = {
|
|
37
|
+
repayFromSavings(bundleId, vaultId, triggerRepayRatio, targetRepayRatio, isBundle = true, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
9
38
|
const subData = subDataService.makerRepayFromSavingsSubData.encode(vaultId, targetRepayRatio, chainId, daiAddr, mcdCdpManagerAddr);
|
|
10
|
-
const triggerData = triggerService.makerRatioTrigger.encode(vaultId, triggerRepayRatio, RatioState.UNDER);
|
|
39
|
+
const triggerData = triggerService.makerRatioTrigger.encode(vaultId, triggerRepayRatio, enums_1.RatioState.UNDER);
|
|
11
40
|
return [bundleId, isBundle, triggerData, subData];
|
|
12
41
|
},
|
|
13
|
-
closeOnPrice(vaultId, ratioState, price, closeToAssetAddr, chainlinkCollAddress, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
14
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
42
|
+
closeOnPrice(vaultId, ratioState, price, closeToAssetAddr, chainlinkCollAddress, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
43
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
15
44
|
const subData = subDataService.makerCloseSubData.encode(vaultId, closeToAssetAddr, chainId, daiAddr, mcdCdpManagerAddr);
|
|
16
45
|
const triggerData = triggerService.chainlinkPriceTrigger.encode(chainlinkCollAddress, price, ratioState);
|
|
17
|
-
const strategyOrBundleId = compareAddresses(closeToAssetAddr, getAssetInfo('DAI', chainId).address)
|
|
18
|
-
? Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI
|
|
19
|
-
: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL;
|
|
46
|
+
const strategyOrBundleId = (0, utils_1.compareAddresses)(closeToAssetAddr, (0, tokens_1.getAssetInfo)('DAI', chainId).address)
|
|
47
|
+
? enums_1.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI
|
|
48
|
+
: enums_1.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL;
|
|
20
49
|
const isBundle = false;
|
|
21
50
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
22
51
|
},
|
|
23
|
-
trailingStop(vaultId, triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
24
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
52
|
+
trailingStop(vaultId, triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
53
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
25
54
|
const subData = subDataService.makerCloseSubData.encode(vaultId, closeToAssetAddr, chainId, daiAddr, mcdCdpManagerAddr);
|
|
26
55
|
const triggerData = triggerService.trailingStopTrigger.encode(chainlinkCollAddress, triggerPercentage, roundId);
|
|
27
|
-
const strategyOrBundleId = compareAddresses(closeToAssetAddr, getAssetInfo('DAI', chainId).address)
|
|
28
|
-
? Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI
|
|
29
|
-
: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL;
|
|
56
|
+
const strategyOrBundleId = (0, utils_1.compareAddresses)(closeToAssetAddr, (0, tokens_1.getAssetInfo)('DAI', chainId).address)
|
|
57
|
+
? enums_1.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI
|
|
58
|
+
: enums_1.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL;
|
|
30
59
|
const isBundle = false;
|
|
31
60
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
32
61
|
},
|
|
33
62
|
leverageManagement(vaultId, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
34
63
|
return [
|
|
35
64
|
vaultId,
|
|
36
|
-
new
|
|
37
|
-
new
|
|
38
|
-
new
|
|
39
|
-
new
|
|
65
|
+
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
66
|
+
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
67
|
+
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
68
|
+
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
40
69
|
boostEnabled,
|
|
41
70
|
];
|
|
42
71
|
},
|
|
43
72
|
};
|
|
44
|
-
|
|
45
|
-
closeOnPrice(priceOverOrUnder, price, closeToAssetAddr, chainlinkCollAddress, chainId = ChainId.Ethereum, collAddr, debtAddr) {
|
|
46
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
73
|
+
exports.liquityEncode = {
|
|
74
|
+
closeOnPrice(priceOverOrUnder, price, closeToAssetAddr, chainlinkCollAddress, chainId = enums_1.ChainId.Ethereum, collAddr, debtAddr) {
|
|
75
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
47
76
|
const subData = subDataService.liquityCloseSubData.encode(closeToAssetAddr, chainId, collAddr, debtAddr);
|
|
48
77
|
const triggerData = triggerService.chainlinkPriceTrigger.encode(chainlinkCollAddress, price, priceOverOrUnder);
|
|
49
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL;
|
|
78
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL;
|
|
50
79
|
const isBundle = false;
|
|
51
80
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
52
81
|
},
|
|
53
|
-
trailingStop(triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = ChainId.Ethereum, collAddr, debtAddr) {
|
|
54
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
82
|
+
trailingStop(triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = enums_1.ChainId.Ethereum, collAddr, debtAddr) {
|
|
83
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
55
84
|
const subData = subDataService.liquityCloseSubData.encode(closeToAssetAddr, chainId, collAddr, debtAddr);
|
|
56
85
|
const triggerData = triggerService.trailingStopTrigger.encode(chainlinkCollAddress, triggerPercentage, roundId);
|
|
57
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL;
|
|
86
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL;
|
|
58
87
|
const isBundle = false;
|
|
59
88
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
60
89
|
},
|
|
61
|
-
paybackFromChickenBondStrategySub(proxyAddress, ratio, sourceId, sourceType, ratioState = RatioState.UNDER) {
|
|
62
|
-
requireAddress(proxyAddress);
|
|
90
|
+
paybackFromChickenBondStrategySub(proxyAddress, ratio, sourceId, sourceType, ratioState = enums_1.RatioState.UNDER) {
|
|
91
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
63
92
|
const subData = subDataService.liquityPaybackUsingChickenBondSubData.encode(sourceId, sourceType);
|
|
64
93
|
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, ratio, ratioState);
|
|
65
|
-
const strategyId = Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND;
|
|
94
|
+
const strategyId = enums_1.Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND;
|
|
66
95
|
const isBundle = true;
|
|
67
96
|
return [strategyId, isBundle, triggerData, subData];
|
|
68
97
|
},
|
|
69
98
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
70
99
|
return [
|
|
71
|
-
new
|
|
72
|
-
new
|
|
73
|
-
new
|
|
74
|
-
new
|
|
100
|
+
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
101
|
+
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
102
|
+
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
103
|
+
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
75
104
|
boostEnabled,
|
|
76
105
|
];
|
|
77
106
|
},
|
|
78
107
|
dsrPayback(proxyAddress, triggerRatio, targetRatio) {
|
|
79
|
-
requireAddress(proxyAddress);
|
|
108
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
80
109
|
const subData = subDataService.liquityDsrPaybackSubData.encode(targetRatio);
|
|
81
|
-
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, RatioState.UNDER);
|
|
82
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_DSR_PAYBACK;
|
|
110
|
+
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, enums_1.RatioState.UNDER);
|
|
111
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_DSR_PAYBACK;
|
|
83
112
|
const isBundle = false;
|
|
84
113
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
85
114
|
},
|
|
86
115
|
dsrSupply(proxyAddress, triggerRatio, targetRatio) {
|
|
87
|
-
requireAddress(proxyAddress);
|
|
116
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
88
117
|
const subData = subDataService.liquityDsrSupplySubData.encode(targetRatio);
|
|
89
|
-
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, RatioState.UNDER);
|
|
90
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_DSR_SUPPLY;
|
|
118
|
+
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, enums_1.RatioState.UNDER);
|
|
119
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_DSR_SUPPLY;
|
|
91
120
|
const isBundle = false;
|
|
92
121
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
93
122
|
},
|
|
94
123
|
};
|
|
95
|
-
|
|
124
|
+
exports.chickenBondsEncode = {
|
|
96
125
|
rebond(bondId) {
|
|
97
126
|
return subDataService.cBondsRebondSubData.encode(bondId);
|
|
98
127
|
},
|
|
99
128
|
};
|
|
100
|
-
|
|
129
|
+
exports.aaveV2Encode = {
|
|
101
130
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
102
131
|
return subDataService.aaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
103
132
|
},
|
|
104
133
|
};
|
|
105
|
-
|
|
134
|
+
exports.aaveV3Encode = {
|
|
106
135
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
107
136
|
let subInput = '0x';
|
|
108
|
-
subInput = subInput.concat(new
|
|
137
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
109
138
|
.padStart(32, '0'));
|
|
110
|
-
subInput = subInput.concat(new
|
|
139
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
111
140
|
.padStart(32, '0'));
|
|
112
|
-
subInput = subInput.concat(new
|
|
141
|
+
subInput = subInput.concat(new decimal_js_1.default(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
113
142
|
.padStart(32, '0'));
|
|
114
|
-
subInput = subInput.concat(new
|
|
143
|
+
subInput = subInput.concat(new decimal_js_1.default(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
115
144
|
.padStart(32, '0'));
|
|
116
145
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
117
146
|
return subInput;
|
|
@@ -124,24 +153,24 @@ export const aaveV3Encode = {
|
|
|
124
153
|
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
125
154
|
},
|
|
126
155
|
};
|
|
127
|
-
|
|
156
|
+
exports.compoundV2Encode = {
|
|
128
157
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
129
158
|
return subDataService.compoundV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
130
159
|
},
|
|
131
160
|
};
|
|
132
|
-
|
|
161
|
+
exports.compoundV3Encode = {
|
|
133
162
|
leverageManagement(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
134
163
|
return subDataService.compoundV3LeverageManagementSubData.encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA);
|
|
135
164
|
},
|
|
136
165
|
};
|
|
137
|
-
|
|
166
|
+
exports.morphoAaveV2Encode = {
|
|
138
167
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
139
168
|
return subDataService.morphoAaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
140
169
|
},
|
|
141
170
|
};
|
|
142
|
-
|
|
171
|
+
exports.exchangeEncode = {
|
|
143
172
|
dca(fromToken, toToken, amount, timestamp, interval, network) {
|
|
144
|
-
requireAddresses([fromToken, toToken]);
|
|
173
|
+
(0, utils_1.requireAddresses)([fromToken, toToken]);
|
|
145
174
|
const subData = subDataService.exchangeDcaSubData.encode(fromToken, toToken, amount, interval);
|
|
146
175
|
const triggerData = triggerService.exchangeTimestampTrigger.encode(timestamp, interval);
|
|
147
176
|
const selectedNetwork = network === 1
|
|
@@ -149,23 +178,23 @@ export const exchangeEncode = {
|
|
|
149
178
|
: network === 10
|
|
150
179
|
? 'OptimismIds'
|
|
151
180
|
: 'ArbitrumIds';
|
|
152
|
-
const strategyId = Strategies[selectedNetwork].EXCHANGE_DCA;
|
|
181
|
+
const strategyId = enums_1.Strategies[selectedNetwork].EXCHANGE_DCA;
|
|
153
182
|
return [strategyId, false, triggerData, subData];
|
|
154
183
|
},
|
|
155
184
|
limitOrder(fromToken, toToken, amount, targetPrice, goodUntil, orderType) {
|
|
156
185
|
return subDataService.exchangeLimitOrderSubData.encode(fromToken, toToken, amount, targetPrice, goodUntil, orderType);
|
|
157
186
|
},
|
|
158
187
|
};
|
|
159
|
-
|
|
188
|
+
exports.sparkEncode = {
|
|
160
189
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
161
190
|
let subInput = '0x';
|
|
162
|
-
subInput = subInput.concat(new
|
|
191
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
163
192
|
.padStart(32, '0'));
|
|
164
|
-
subInput = subInput.concat(new
|
|
193
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
165
194
|
.padStart(32, '0'));
|
|
166
|
-
subInput = subInput.concat(new
|
|
195
|
+
subInput = subInput.concat(new decimal_js_1.default(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
167
196
|
.padStart(32, '0'));
|
|
168
|
-
subInput = subInput.concat(new
|
|
197
|
+
subInput = subInput.concat(new decimal_js_1.default(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
169
198
|
.padStart(32, '0'));
|
|
170
199
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
171
200
|
return subInput;
|