@defisaver/automation-sdk 3.3.2-dev.8 → 3.3.2-dev.9
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.
|
@@ -268,6 +268,7 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
268
268
|
if (isEOA) {
|
|
269
269
|
const triggerData = triggerService.aaveV3QuotePriceRangeTrigger.decode(subStruct.triggerData);
|
|
270
270
|
const subData = subDataService.aaveV3CloseGenericSubData.decode(subStruct.subData);
|
|
271
|
+
const { takeProfitType, stopLossType } = (0, utils_1.getStopLossAndTakeProfitTypeByCloseStrategyType)(+subData.closeType);
|
|
271
272
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
272
273
|
_position.strategyData.decoded.subData = subData;
|
|
273
274
|
_position.specific = {
|
|
@@ -279,6 +280,8 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
279
280
|
quoteToken: triggerData.debtToken,
|
|
280
281
|
stopLossPrice: triggerData.lowerPrice,
|
|
281
282
|
takeProfitPrice: triggerData.upperPrice,
|
|
283
|
+
stopLossType,
|
|
284
|
+
takeProfitType,
|
|
282
285
|
};
|
|
283
286
|
_position.strategy.strategyId = enums_1.Strategies.Identifiers.EoaCloseOnPrice;
|
|
284
287
|
}
|
|
@@ -239,6 +239,7 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
239
239
|
if (isEOA) {
|
|
240
240
|
const triggerData = triggerService.aaveV3QuotePriceRangeTrigger.decode(subStruct.triggerData);
|
|
241
241
|
const subData = subDataService.aaveV3CloseGenericSubData.decode(subStruct.subData);
|
|
242
|
+
const { takeProfitType, stopLossType } = getStopLossAndTakeProfitTypeByCloseStrategyType(+subData.closeType);
|
|
242
243
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
243
244
|
_position.strategyData.decoded.subData = subData;
|
|
244
245
|
_position.specific = {
|
|
@@ -250,6 +251,8 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
250
251
|
quoteToken: triggerData.debtToken,
|
|
251
252
|
stopLossPrice: triggerData.lowerPrice,
|
|
252
253
|
takeProfitPrice: triggerData.upperPrice,
|
|
254
|
+
stopLossType,
|
|
255
|
+
takeProfitType,
|
|
253
256
|
};
|
|
254
257
|
_position.strategy.strategyId = Strategies.Identifiers.EoaCloseOnPrice;
|
|
255
258
|
}
|
package/package.json
CHANGED
|
@@ -323,6 +323,8 @@ function parseAaveV3CloseOnPrice(position: Position.Automated, parseData: ParseD
|
|
|
323
323
|
const triggerData = triggerService.aaveV3QuotePriceRangeTrigger.decode(subStruct.triggerData);
|
|
324
324
|
const subData = subDataService.aaveV3CloseGenericSubData.decode(subStruct.subData);
|
|
325
325
|
|
|
326
|
+
const { takeProfitType, stopLossType } = getStopLossAndTakeProfitTypeByCloseStrategyType(+subData.closeType);
|
|
327
|
+
|
|
326
328
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
327
329
|
_position.strategyData.decoded.subData = subData;
|
|
328
330
|
|
|
@@ -335,6 +337,8 @@ function parseAaveV3CloseOnPrice(position: Position.Automated, parseData: ParseD
|
|
|
335
337
|
quoteToken: triggerData.debtToken,
|
|
336
338
|
stopLossPrice: triggerData.lowerPrice,
|
|
337
339
|
takeProfitPrice: triggerData.upperPrice,
|
|
340
|
+
stopLossType,
|
|
341
|
+
takeProfitType,
|
|
338
342
|
};
|
|
339
343
|
|
|
340
344
|
_position.strategy.strategyId = Strategies.Identifiers.EoaCloseOnPrice;
|