@defisaver/automation-sdk 2.0.3 → 2.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/automation-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/index.js",
@@ -535,8 +535,8 @@ function parseLiquitySavingsLiqProtection(position: Position.Automated, parseDat
535
535
 
536
536
  const { subStruct } = parseData.subscriptionEventData;
537
537
 
538
- const triggerData = triggerService.makerRatioTrigger.decode(subStruct.triggerData);
539
- const subData = subDataService.makerRepayFromSavingsSubData.decode(subStruct.subData);
538
+ const triggerData = triggerService.liquityRatioTrigger.decode(subStruct.triggerData);
539
+ const subData = subDataService.liquityRepayFromSavingsSubData.decode(subStruct.subData);
540
540
 
541
541
  _position.strategyData.decoded.triggerData = triggerData;
542
542
  _position.strategyData.decoded.subData = subData;
@@ -45,6 +45,15 @@ export const makerRepayFromSavingsSubData = {
45
45
  },
46
46
  };
47
47
 
48
+ export const liquityRepayFromSavingsSubData = {
49
+ decode(subData: SubData): { targetRatio: number } {
50
+ const weiRatio = AbiCoder.decodeParameter('uint256', subData[1]) as any as string;
51
+ const targetRatio = weiToRatioPercentage(weiRatio);
52
+
53
+ return { targetRatio };
54
+ },
55
+ };
56
+
48
57
  export const makerCloseSubData = {
49
58
  encode(
50
59
  vaultId: number,