@defisaver/automation-sdk 3.1.7 → 3.1.8
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.
|
@@ -709,16 +709,16 @@ function parseLiquityV2LeverageManagementOnPrice(position, parseData) {
|
|
|
709
709
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
710
710
|
_position.strategyData.decoded.subData = subData;
|
|
711
711
|
_position.positionId = (0, utils_1.getPositionId)(_position.chainId, _position.protocol.id, _position.owner, Math.random());
|
|
712
|
-
/// @TODO: what does even go here
|
|
713
|
-
/*
|
|
714
712
|
_position.specific = {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
713
|
+
subHash: _position.subHash,
|
|
714
|
+
market: subData.market,
|
|
715
|
+
troveId: subData.troveId,
|
|
716
|
+
collAsset: subData.collToken,
|
|
717
|
+
debtAsset: subData.boldToken,
|
|
718
|
+
price: triggerData.price,
|
|
719
|
+
ratio: subData.targetRatio,
|
|
720
|
+
ratioState: triggerData.ratioState,
|
|
720
721
|
};
|
|
721
|
-
*/
|
|
722
722
|
return _position;
|
|
723
723
|
}
|
|
724
724
|
const parsingMethodsMapping = {
|
|
@@ -745,7 +745,7 @@ const parsingMethodsMapping = {
|
|
|
745
745
|
[enums_1.Strategies.Identifiers.Repay]: parseLiquityV2LeverageManagement,
|
|
746
746
|
[enums_1.Strategies.Identifiers.Boost]: parseLiquityV2LeverageManagement,
|
|
747
747
|
[enums_1.Strategies.Identifiers.CloseOnPrice]: parseLiquityV2CloseOnPrice,
|
|
748
|
-
[enums_1.Strategies.Identifiers.
|
|
748
|
+
[enums_1.Strategies.Identifiers.BoostOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
749
749
|
[enums_1.Strategies.Identifiers.RepayOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
750
750
|
},
|
|
751
751
|
[enums_1.ProtocolIdentifiers.StrategiesAutomation.AaveV2]: {
|
package/cjs/types/index.d.ts
CHANGED
|
@@ -147,6 +147,11 @@ export declare namespace Position {
|
|
|
147
147
|
stopLossType: CloseToAssetType | undefined;
|
|
148
148
|
takeProfitType: CloseToAssetType | undefined;
|
|
149
149
|
}
|
|
150
|
+
interface BoostOnPriceLiquityV2 extends Base {
|
|
151
|
+
market: EthereumAddress;
|
|
152
|
+
troveId: string;
|
|
153
|
+
subHash: string;
|
|
154
|
+
}
|
|
150
155
|
interface TrailingStop extends Base {
|
|
151
156
|
roundId: number;
|
|
152
157
|
triggerPercentage: number;
|
|
@@ -161,7 +166,7 @@ export declare namespace Position {
|
|
|
161
166
|
subHashRepay?: string;
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho;
|
|
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;
|
|
165
170
|
interface Automated {
|
|
166
171
|
chainId: ChainId;
|
|
167
172
|
positionId: string;
|
|
@@ -680,16 +680,16 @@ function parseLiquityV2LeverageManagementOnPrice(position, parseData) {
|
|
|
680
680
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
681
681
|
_position.strategyData.decoded.subData = subData;
|
|
682
682
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, Math.random());
|
|
683
|
-
/// @TODO: what does even go here
|
|
684
|
-
/*
|
|
685
683
|
_position.specific = {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
684
|
+
subHash: _position.subHash,
|
|
685
|
+
market: subData.market,
|
|
686
|
+
troveId: subData.troveId,
|
|
687
|
+
collAsset: subData.collToken,
|
|
688
|
+
debtAsset: subData.boldToken,
|
|
689
|
+
price: triggerData.price,
|
|
690
|
+
ratio: subData.targetRatio,
|
|
691
|
+
ratioState: triggerData.ratioState,
|
|
691
692
|
};
|
|
692
|
-
*/
|
|
693
693
|
return _position;
|
|
694
694
|
}
|
|
695
695
|
const parsingMethodsMapping = {
|
|
@@ -716,7 +716,7 @@ const parsingMethodsMapping = {
|
|
|
716
716
|
[Strategies.Identifiers.Repay]: parseLiquityV2LeverageManagement,
|
|
717
717
|
[Strategies.Identifiers.Boost]: parseLiquityV2LeverageManagement,
|
|
718
718
|
[Strategies.Identifiers.CloseOnPrice]: parseLiquityV2CloseOnPrice,
|
|
719
|
-
[Strategies.Identifiers.
|
|
719
|
+
[Strategies.Identifiers.BoostOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
720
720
|
[Strategies.Identifiers.RepayOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
721
721
|
},
|
|
722
722
|
[ProtocolIdentifiers.StrategiesAutomation.AaveV2]: {
|
package/esm/types/index.d.ts
CHANGED
|
@@ -147,6 +147,11 @@ export declare namespace Position {
|
|
|
147
147
|
stopLossType: CloseToAssetType | undefined;
|
|
148
148
|
takeProfitType: CloseToAssetType | undefined;
|
|
149
149
|
}
|
|
150
|
+
interface BoostOnPriceLiquityV2 extends Base {
|
|
151
|
+
market: EthereumAddress;
|
|
152
|
+
troveId: string;
|
|
153
|
+
subHash: string;
|
|
154
|
+
}
|
|
150
155
|
interface TrailingStop extends Base {
|
|
151
156
|
roundId: number;
|
|
152
157
|
triggerPercentage: number;
|
|
@@ -161,7 +166,7 @@ export declare namespace Position {
|
|
|
161
166
|
subHashRepay?: string;
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2 | Specific.BoostOnPriceMorpho;
|
|
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;
|
|
165
170
|
interface Automated {
|
|
166
171
|
chainId: ChainId;
|
|
167
172
|
positionId: string;
|
package/package.json
CHANGED
|
@@ -935,16 +935,17 @@ function parseLiquityV2LeverageManagementOnPrice(position: Position.Automated, p
|
|
|
935
935
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
936
936
|
_position.strategyData.decoded.subData = subData;
|
|
937
937
|
_position.positionId = getPositionId(_position.chainId, _position.protocol.id, _position.owner, Math.random());
|
|
938
|
-
|
|
939
|
-
/*
|
|
938
|
+
|
|
940
939
|
_position.specific = {
|
|
940
|
+
subHash: _position.subHash,
|
|
941
941
|
market: subData.market,
|
|
942
942
|
troveId: subData.troveId,
|
|
943
|
-
|
|
943
|
+
collAsset: subData.collToken,
|
|
944
|
+
debtAsset: subData.boldToken,
|
|
944
945
|
price: triggerData.price,
|
|
946
|
+
ratio: subData.targetRatio,
|
|
945
947
|
ratioState: triggerData.ratioState,
|
|
946
948
|
};
|
|
947
|
-
*/
|
|
948
949
|
|
|
949
950
|
return _position;
|
|
950
951
|
}
|
|
@@ -973,7 +974,7 @@ const parsingMethodsMapping: StrategiesToProtocolVersionMapping = {
|
|
|
973
974
|
[Strategies.Identifiers.Repay]: parseLiquityV2LeverageManagement,
|
|
974
975
|
[Strategies.Identifiers.Boost]: parseLiquityV2LeverageManagement,
|
|
975
976
|
[Strategies.Identifiers.CloseOnPrice]: parseLiquityV2CloseOnPrice,
|
|
976
|
-
[Strategies.Identifiers.
|
|
977
|
+
[Strategies.Identifiers.BoostOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
977
978
|
[Strategies.Identifiers.RepayOnPrice]: parseLiquityV2LeverageManagementOnPrice,
|
|
978
979
|
},
|
|
979
980
|
[ProtocolIdentifiers.StrategiesAutomation.AaveV2]: {
|
package/src/types/index.ts
CHANGED
|
@@ -177,6 +177,12 @@ export declare namespace Position {
|
|
|
177
177
|
takeProfitType: CloseToAssetType | undefined,
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
interface BoostOnPriceLiquityV2 extends Base {
|
|
181
|
+
market: EthereumAddress,
|
|
182
|
+
troveId: string,
|
|
183
|
+
subHash: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
180
186
|
interface TrailingStop extends Base {
|
|
181
187
|
roundId: number,
|
|
182
188
|
triggerPercentage: number,
|
|
@@ -204,7 +210,8 @@ export declare namespace Position {
|
|
|
204
210
|
| Specific.DebtInFrontRepay
|
|
205
211
|
| Specific.LeverageManagementCrvUSD
|
|
206
212
|
| Specific.CloseOnPriceLiquityV2
|
|
207
|
-
| Specific.BoostOnPriceMorpho
|
|
213
|
+
| Specific.BoostOnPriceMorpho
|
|
214
|
+
| Specific.BoostOnPriceLiquityV2;
|
|
208
215
|
|
|
209
216
|
export interface Automated {
|
|
210
217
|
chainId: ChainId,
|