@defisaver/automation-sdk 3.3.2-dev.1 → 3.3.2-dev.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.
|
@@ -192,6 +192,7 @@ function parseAaveV3LeverageManagement(position, parseData) {
|
|
|
192
192
|
const { subStruct, subId, subHash } = parseData.subscriptionEventData;
|
|
193
193
|
const { isEnabled } = parseData.strategiesSubsData;
|
|
194
194
|
const triggerData = triggerService.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
195
|
+
// TODO -> should change this?
|
|
195
196
|
const subData = subDataService.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
196
197
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
197
198
|
_position.strategyData.decoded.subData = subData;
|
|
@@ -257,7 +258,9 @@ function parseMorphoAaveV2LeverageManagement(position, parseData) {
|
|
|
257
258
|
function parseAaveV3CloseOnPrice(position, parseData) {
|
|
258
259
|
const _position = (0, lodash_1.cloneDeep)(position);
|
|
259
260
|
const { subStruct } = parseData.subscriptionEventData;
|
|
261
|
+
// TODO -> should prob be quote price range trigger?
|
|
260
262
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
263
|
+
// TODO -> should change this?
|
|
261
264
|
const subData = subDataService.aaveV3QuotePriceSubData.decode(subStruct.subData);
|
|
262
265
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
263
266
|
_position.strategyData.decoded.subData = subData;
|
|
@@ -710,7 +713,7 @@ function parseAaveV3LeverageManagementOnPrice(position, parseData) {
|
|
|
710
713
|
const _position = (0, lodash_1.cloneDeep)(position);
|
|
711
714
|
const { subStruct } = parseData.subscriptionEventData;
|
|
712
715
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
713
|
-
const subData = subDataService.
|
|
716
|
+
const subData = subDataService.aaveV3LeverageManagementOnPriceGeneric.decode(subStruct.subData);
|
|
714
717
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
715
718
|
_position.strategyData.decoded.subData = subData;
|
|
716
719
|
_position.positionId = (0, utils_1.getPositionId)(_position.chainId, _position.protocol.id, _position.owner, Math.random());
|
|
@@ -725,9 +728,9 @@ function parseAaveV3LeverageManagementOnPrice(position, parseData) {
|
|
|
725
728
|
collAssetId: subData.collAssetId,
|
|
726
729
|
ratio: subData.targetRatio,
|
|
727
730
|
};
|
|
728
|
-
// TODO -> check if this change breaks something?
|
|
729
|
-
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
730
|
-
_position.strategy.strategyId = isEOA ?
|
|
731
|
+
// // TODO -> check if this change breaks something?
|
|
732
|
+
// const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
733
|
+
// _position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagementOnPrice : Strategies.IdOverrides.LeverageManagementOnPrice;
|
|
731
734
|
return _position;
|
|
732
735
|
}
|
|
733
736
|
function parseLiquityV2CloseOnPrice(position, parseData) {
|
|
@@ -163,6 +163,7 @@ function parseAaveV3LeverageManagement(position, parseData) {
|
|
|
163
163
|
const { subStruct, subId, subHash } = parseData.subscriptionEventData;
|
|
164
164
|
const { isEnabled } = parseData.strategiesSubsData;
|
|
165
165
|
const triggerData = triggerService.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
166
|
+
// TODO -> should change this?
|
|
166
167
|
const subData = subDataService.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
167
168
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
168
169
|
_position.strategyData.decoded.subData = subData;
|
|
@@ -228,7 +229,9 @@ function parseMorphoAaveV2LeverageManagement(position, parseData) {
|
|
|
228
229
|
function parseAaveV3CloseOnPrice(position, parseData) {
|
|
229
230
|
const _position = cloneDeep(position);
|
|
230
231
|
const { subStruct } = parseData.subscriptionEventData;
|
|
232
|
+
// TODO -> should prob be quote price range trigger?
|
|
231
233
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
234
|
+
// TODO -> should change this?
|
|
232
235
|
const subData = subDataService.aaveV3QuotePriceSubData.decode(subStruct.subData);
|
|
233
236
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
234
237
|
_position.strategyData.decoded.subData = subData;
|
|
@@ -681,7 +684,7 @@ function parseAaveV3LeverageManagementOnPrice(position, parseData) {
|
|
|
681
684
|
const _position = cloneDeep(position);
|
|
682
685
|
const { subStruct } = parseData.subscriptionEventData;
|
|
683
686
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
684
|
-
const subData = subDataService.
|
|
687
|
+
const subData = subDataService.aaveV3LeverageManagementOnPriceGeneric.decode(subStruct.subData);
|
|
685
688
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
686
689
|
_position.strategyData.decoded.subData = subData;
|
|
687
690
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, Math.random());
|
|
@@ -696,9 +699,9 @@ function parseAaveV3LeverageManagementOnPrice(position, parseData) {
|
|
|
696
699
|
collAssetId: subData.collAssetId,
|
|
697
700
|
ratio: subData.targetRatio,
|
|
698
701
|
};
|
|
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;
|
|
702
|
+
// // TODO -> check if this change breaks something?
|
|
703
|
+
// const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
704
|
+
// _position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagementOnPrice : Strategies.IdOverrides.LeverageManagementOnPrice;
|
|
702
705
|
return _position;
|
|
703
706
|
}
|
|
704
707
|
function parseLiquityV2CloseOnPrice(position, parseData) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/automation-sdk",
|
|
3
|
-
"version": "3.3.2-dev.
|
|
3
|
+
"version": "3.3.2-dev.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"repository": "https://github.com/defisaver/automation-sdk",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@defisaver/sdk": "1.3.
|
|
26
|
+
"@defisaver/sdk": "1.3.6-dev.1",
|
|
27
27
|
"@defisaver/tokens": "^1.6.19",
|
|
28
28
|
"@ethersproject/address": "^5.0.10",
|
|
29
29
|
"@ethersproject/solidity": "^5.0.9",
|
|
@@ -235,6 +235,7 @@ function parseAaveV3LeverageManagement(position: Position.Automated, parseData:
|
|
|
235
235
|
const { isEnabled } = parseData.strategiesSubsData;
|
|
236
236
|
|
|
237
237
|
const triggerData = triggerService.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
238
|
+
// TODO -> should change this?
|
|
238
239
|
const subData = subDataService.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
239
240
|
|
|
240
241
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
@@ -316,7 +317,9 @@ function parseAaveV3CloseOnPrice(position: Position.Automated, parseData: ParseD
|
|
|
316
317
|
|
|
317
318
|
const { subStruct } = parseData.subscriptionEventData;
|
|
318
319
|
|
|
320
|
+
// TODO -> should prob be quote price range trigger?
|
|
319
321
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
322
|
+
// TODO -> should change this?
|
|
320
323
|
const subData = subDataService.aaveV3QuotePriceSubData.decode(subStruct.subData);
|
|
321
324
|
|
|
322
325
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
@@ -932,7 +935,7 @@ function parseAaveV3LeverageManagementOnPrice(position: Position.Automated, pars
|
|
|
932
935
|
const { subStruct } = parseData.subscriptionEventData;
|
|
933
936
|
|
|
934
937
|
const triggerData = triggerService.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
|
|
935
|
-
const subData = subDataService.
|
|
938
|
+
const subData = subDataService.aaveV3LeverageManagementOnPriceGeneric.decode(subStruct.subData);
|
|
936
939
|
|
|
937
940
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
938
941
|
_position.strategyData.decoded.subData = subData;
|
|
@@ -950,9 +953,9 @@ function parseAaveV3LeverageManagementOnPrice(position: Position.Automated, pars
|
|
|
950
953
|
ratio: subData.targetRatio,
|
|
951
954
|
};
|
|
952
955
|
|
|
953
|
-
// TODO -> check if this change breaks something?
|
|
954
|
-
const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
955
|
-
_position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagementOnPrice : Strategies.IdOverrides.LeverageManagementOnPrice;
|
|
956
|
+
// // TODO -> check if this change breaks something?
|
|
957
|
+
// const isEOA = _position.strategy.strategyId.includes('eoa');
|
|
958
|
+
// _position.strategy.strategyId = isEOA ? Strategies.IdOverrides.EoaLeverageManagementOnPrice : Strategies.IdOverrides.LeverageManagementOnPrice;
|
|
956
959
|
|
|
957
960
|
return _position;
|
|
958
961
|
}
|