@defisaver/automation-sdk 3.1.8-dev-1 → 3.1.8-dev-2
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.
|
@@ -730,6 +730,13 @@ function parseLiquityV2Payback(position, parseData) {
|
|
|
730
730
|
_position.strategyData.decoded.subData = subData;
|
|
731
731
|
_position.positionId = (0, utils_1.getPositionId)(_position.chainId, _position.protocol.id, _position.owner, triggerData.troveId, triggerData.market);
|
|
732
732
|
_position.strategy.strategyId = enums_1.Strategies.Identifiers.Payback;
|
|
733
|
+
_position.specific = {
|
|
734
|
+
subHash: _position.subHash,
|
|
735
|
+
market: subData.market,
|
|
736
|
+
troveId: subData.troveId,
|
|
737
|
+
targetRatio: subData.targetRatio,
|
|
738
|
+
triggerRatio: triggerData.ratio,
|
|
739
|
+
};
|
|
733
740
|
return _position;
|
|
734
741
|
}
|
|
735
742
|
const parsingMethodsMapping = {
|
package/cjs/types/index.d.ts
CHANGED
|
@@ -152,6 +152,12 @@ export declare namespace Position {
|
|
|
152
152
|
troveId: string;
|
|
153
153
|
subHash: string;
|
|
154
154
|
}
|
|
155
|
+
interface PaybackLiquityV2 extends Base {
|
|
156
|
+
market: EthereumAddress;
|
|
157
|
+
troveId: string;
|
|
158
|
+
targetRatio: number;
|
|
159
|
+
triggerRatio: number;
|
|
160
|
+
}
|
|
155
161
|
interface TrailingStop extends Base {
|
|
156
162
|
roundId: number;
|
|
157
163
|
triggerPercentage: number;
|
|
@@ -166,7 +172,7 @@ export declare namespace Position {
|
|
|
166
172
|
subHashRepay?: string;
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho | Specific.BoostOnPriceLiquityV2;
|
|
175
|
+
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho | Specific.BoostOnPriceLiquityV2 | Specific.PaybackLiquityV2;
|
|
170
176
|
interface Automated {
|
|
171
177
|
chainId: ChainId;
|
|
172
178
|
positionId: string;
|
|
@@ -701,6 +701,13 @@ function parseLiquityV2Payback(position, parseData) {
|
|
|
701
701
|
_position.strategyData.decoded.subData = subData;
|
|
702
702
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, triggerData.troveId, triggerData.market);
|
|
703
703
|
_position.strategy.strategyId = Strategies.Identifiers.Payback;
|
|
704
|
+
_position.specific = {
|
|
705
|
+
subHash: _position.subHash,
|
|
706
|
+
market: subData.market,
|
|
707
|
+
troveId: subData.troveId,
|
|
708
|
+
targetRatio: subData.targetRatio,
|
|
709
|
+
triggerRatio: triggerData.ratio,
|
|
710
|
+
};
|
|
704
711
|
return _position;
|
|
705
712
|
}
|
|
706
713
|
const parsingMethodsMapping = {
|
package/esm/types/index.d.ts
CHANGED
|
@@ -152,6 +152,12 @@ export declare namespace Position {
|
|
|
152
152
|
troveId: string;
|
|
153
153
|
subHash: string;
|
|
154
154
|
}
|
|
155
|
+
interface PaybackLiquityV2 extends Base {
|
|
156
|
+
market: EthereumAddress;
|
|
157
|
+
troveId: string;
|
|
158
|
+
targetRatio: number;
|
|
159
|
+
triggerRatio: number;
|
|
160
|
+
}
|
|
155
161
|
interface TrailingStop extends Base {
|
|
156
162
|
roundId: number;
|
|
157
163
|
triggerPercentage: number;
|
|
@@ -166,7 +172,7 @@ export declare namespace Position {
|
|
|
166
172
|
subHashRepay?: string;
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho | Specific.BoostOnPriceLiquityV2;
|
|
175
|
+
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho | Specific.BoostOnPriceLiquityV2 | Specific.PaybackLiquityV2;
|
|
170
176
|
interface Automated {
|
|
171
177
|
chainId: ChainId;
|
|
172
178
|
positionId: string;
|
package/package.json
CHANGED
|
@@ -962,6 +962,14 @@ function parseLiquityV2Payback(position: Position.Automated, parseData: ParseDat
|
|
|
962
962
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, triggerData.troveId, triggerData.market);
|
|
963
963
|
_position.strategy.strategyId = Strategies.Identifiers.Payback;
|
|
964
964
|
|
|
965
|
+
_position.specific = {
|
|
966
|
+
subHash: _position.subHash,
|
|
967
|
+
market: subData.market,
|
|
968
|
+
troveId: subData.troveId,
|
|
969
|
+
targetRatio: subData.targetRatio,
|
|
970
|
+
triggerRatio: triggerData.ratio,
|
|
971
|
+
};
|
|
972
|
+
|
|
965
973
|
return _position;
|
|
966
974
|
}
|
|
967
975
|
|
package/src/types/index.ts
CHANGED
|
@@ -183,6 +183,13 @@ export declare namespace Position {
|
|
|
183
183
|
subHash: string;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
interface PaybackLiquityV2 extends Base {
|
|
187
|
+
market: EthereumAddress,
|
|
188
|
+
troveId: string,
|
|
189
|
+
targetRatio: number;
|
|
190
|
+
triggerRatio: number;
|
|
191
|
+
}
|
|
192
|
+
|
|
186
193
|
interface TrailingStop extends Base {
|
|
187
194
|
roundId: number,
|
|
188
195
|
triggerPercentage: number,
|
|
@@ -211,7 +218,8 @@ export declare namespace Position {
|
|
|
211
218
|
| Specific.LeverageManagementCrvUSD
|
|
212
219
|
| Specific.CloseOnPriceLiquityV2
|
|
213
220
|
| Specific.BoostOnPriceMorpho
|
|
214
|
-
| Specific.BoostOnPriceLiquityV2
|
|
221
|
+
| Specific.BoostOnPriceLiquityV2
|
|
222
|
+
| Specific.PaybackLiquityV2;
|
|
215
223
|
|
|
216
224
|
export interface Automated {
|
|
217
225
|
chainId: ChainId,
|