@defisaver/automation-sdk 1.2.25 → 1.2.27
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/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/services/strategiesService.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/services/strategiesService.ts +2 -2
- package/umd/index.js +320 -535
package/esm/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import ArbitrumStrategies from './automation/public/ArbitrumStrategies';
|
|
|
8
8
|
import * as triggerService from './services/triggerService';
|
|
9
9
|
import * as subDataService from './services/subDataService';
|
|
10
10
|
import * as strategySubService from './services/strategySubService';
|
|
11
|
+
import * as strategiesService from './services/strategiesService';
|
|
11
12
|
import * as constants from './constants';
|
|
12
13
|
import * as enums from './types/enums';
|
|
13
14
|
import type * as types from './types';
|
|
@@ -17,5 +18,5 @@ declare const utils: {
|
|
|
17
18
|
compareSubHashes: typeof compareSubHashes;
|
|
18
19
|
encodeSubId: typeof encodeSubId;
|
|
19
20
|
};
|
|
20
|
-
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, };
|
|
21
|
+
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, strategiesService, };
|
|
21
22
|
export type { types };
|
package/esm/index.js
CHANGED
|
@@ -13,10 +13,11 @@ import ArbitrumStrategies from './automation/public/ArbitrumStrategies';
|
|
|
13
13
|
import * as triggerService from './services/triggerService';
|
|
14
14
|
import * as subDataService from './services/subDataService';
|
|
15
15
|
import * as strategySubService from './services/strategySubService';
|
|
16
|
+
import * as strategiesService from './services/strategiesService';
|
|
16
17
|
import * as constants from './constants';
|
|
17
18
|
import * as enums from './types/enums';
|
|
18
19
|
import { getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId } from './services/utils';
|
|
19
20
|
const utils = {
|
|
20
21
|
getRatioStateInfoForAaveCloseStrategy, compareSubHashes, encodeSubId,
|
|
21
22
|
};
|
|
22
|
-
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, };
|
|
23
|
+
export { LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation, EthereumStrategies, OptimismStrategies, ArbitrumStrategies, triggerService, subDataService, strategySubService, utils, enums, constants, strategiesService, };
|
|
@@ -184,7 +184,7 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
184
184
|
price: triggerData.price,
|
|
185
185
|
ratioState: triggerData.ratioState,
|
|
186
186
|
};
|
|
187
|
-
const { ratioState } = getRatioStateInfoForAaveCloseStrategy(_position.specific.ratioState, wethToEthByAddress(_position.specific.collAsset), wethToEthByAddress(_position.specific.debtAsset), parseData.chainId);
|
|
187
|
+
const { ratioState } = getRatioStateInfoForAaveCloseStrategy(_position.specific.ratioState, wethToEthByAddress(_position.specific.collAsset, parseData.chainId), wethToEthByAddress(_position.specific.debtAsset, parseData.chainId), parseData.chainId);
|
|
188
188
|
_position.strategy.strategyId = isRatioStateOver(ratioState) ? Strategies.IdOverrides.TakeProfit : Strategies.IdOverrides.StopLoss;
|
|
189
189
|
return _position;
|
|
190
190
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import ArbitrumStrategies from './automation/public/ArbitrumStrategies';
|
|
|
17
17
|
import * as triggerService from './services/triggerService';
|
|
18
18
|
import * as subDataService from './services/subDataService';
|
|
19
19
|
import * as strategySubService from './services/strategySubService';
|
|
20
|
+
import * as strategiesService from './services/strategiesService';
|
|
20
21
|
import * as constants from './constants';
|
|
21
22
|
|
|
22
23
|
import * as enums from './types/enums';
|
|
@@ -32,7 +33,7 @@ export {
|
|
|
32
33
|
LegacyMakerAutomation, LegacyAaveAutomation, LegacyCompoundAutomation,
|
|
33
34
|
EthereumStrategies, OptimismStrategies, ArbitrumStrategies,
|
|
34
35
|
triggerService, subDataService, strategySubService, utils,
|
|
35
|
-
enums, constants,
|
|
36
|
+
enums, constants, strategiesService,
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export type { types };
|
|
@@ -253,8 +253,8 @@ function parseAaveV3CloseOnPrice(position: Position.Automated, parseData: ParseD
|
|
|
253
253
|
|
|
254
254
|
const { ratioState } = getRatioStateInfoForAaveCloseStrategy(
|
|
255
255
|
_position.specific.ratioState,
|
|
256
|
-
wethToEthByAddress(_position.specific.collAsset),
|
|
257
|
-
wethToEthByAddress(_position.specific.debtAsset),
|
|
256
|
+
wethToEthByAddress(_position.specific.collAsset, parseData.chainId),
|
|
257
|
+
wethToEthByAddress(_position.specific.debtAsset, parseData.chainId),
|
|
258
258
|
parseData.chainId,
|
|
259
259
|
);
|
|
260
260
|
|