@defisaver/automation-sdk 3.1.1-dev-2 → 3.1.1-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.
|
@@ -658,7 +658,13 @@ function parseLiquityV2CloseOnPrice(position, parseData) {
|
|
|
658
658
|
// - Both
|
|
659
659
|
// TODO: see on frontend what specific data we need here because stop-loss and take-profit is one bundle now
|
|
660
660
|
_position.strategy.strategyId = enums_1.Strategies.Identifiers.CloseOnPrice;
|
|
661
|
-
_position.specific = {
|
|
661
|
+
_position.specific = {
|
|
662
|
+
market: subData.market,
|
|
663
|
+
troveId: subData.troveId,
|
|
664
|
+
stopLossPrice: triggerData.lowerPrice,
|
|
665
|
+
takeProfitPrice: triggerData.upperPrice,
|
|
666
|
+
closeToAssetAddr: triggerData.tokenAddr,
|
|
667
|
+
};
|
|
662
668
|
return _position;
|
|
663
669
|
}
|
|
664
670
|
const parsingMethodsMapping = {
|
package/cjs/types/index.d.ts
CHANGED
|
@@ -134,6 +134,13 @@ export declare namespace Position {
|
|
|
134
134
|
maximumGasPrice: string;
|
|
135
135
|
ratioState: RatioState;
|
|
136
136
|
}
|
|
137
|
+
interface CloseOnPriceLiquityV2 extends Base {
|
|
138
|
+
market: EthereumAddress;
|
|
139
|
+
troveId: string;
|
|
140
|
+
stopLossPrice: string;
|
|
141
|
+
takeProfitPrice: string;
|
|
142
|
+
closeToAssetAddr: EthereumAddress;
|
|
143
|
+
}
|
|
137
144
|
interface TrailingStop extends Base {
|
|
138
145
|
roundId: number;
|
|
139
146
|
triggerPercentage: number;
|
|
@@ -148,7 +155,7 @@ export declare namespace Position {
|
|
|
148
155
|
subHashRepay?: string;
|
|
149
156
|
}
|
|
150
157
|
}
|
|
151
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD;
|
|
158
|
+
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2;
|
|
152
159
|
interface Automated {
|
|
153
160
|
chainId: ChainId;
|
|
154
161
|
positionId: string;
|
|
@@ -632,7 +632,13 @@ function parseLiquityV2CloseOnPrice(position, parseData) {
|
|
|
632
632
|
// - Both
|
|
633
633
|
// TODO: see on frontend what specific data we need here because stop-loss and take-profit is one bundle now
|
|
634
634
|
_position.strategy.strategyId = Strategies.Identifiers.CloseOnPrice;
|
|
635
|
-
_position.specific = {
|
|
635
|
+
_position.specific = {
|
|
636
|
+
market: subData.market,
|
|
637
|
+
troveId: subData.troveId,
|
|
638
|
+
stopLossPrice: triggerData.lowerPrice,
|
|
639
|
+
takeProfitPrice: triggerData.upperPrice,
|
|
640
|
+
closeToAssetAddr: triggerData.tokenAddr,
|
|
641
|
+
};
|
|
636
642
|
return _position;
|
|
637
643
|
}
|
|
638
644
|
const parsingMethodsMapping = {
|
package/esm/types/index.d.ts
CHANGED
|
@@ -134,6 +134,13 @@ export declare namespace Position {
|
|
|
134
134
|
maximumGasPrice: string;
|
|
135
135
|
ratioState: RatioState;
|
|
136
136
|
}
|
|
137
|
+
interface CloseOnPriceLiquityV2 extends Base {
|
|
138
|
+
market: EthereumAddress;
|
|
139
|
+
troveId: string;
|
|
140
|
+
stopLossPrice: string;
|
|
141
|
+
takeProfitPrice: string;
|
|
142
|
+
closeToAssetAddr: EthereumAddress;
|
|
143
|
+
}
|
|
137
144
|
interface TrailingStop extends Base {
|
|
138
145
|
roundId: number;
|
|
139
146
|
triggerPercentage: number;
|
|
@@ -148,7 +155,7 @@ export declare namespace Position {
|
|
|
148
155
|
subHashRepay?: string;
|
|
149
156
|
}
|
|
150
157
|
}
|
|
151
|
-
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD;
|
|
158
|
+
type SpecificAny = Specific.CloseOnPrice | Specific.TrailingStop | Specific.RatioProtection | Specific.CloseOnPriceAave | Specific.BoostOnPriceAave | Specific.CloseOnPriceWithMaximumGasPriceAave | Specific.DebtInFrontRepay | Specific.LeverageManagementCrvUSD | Specific.CloseOnPriceLiquityV2;
|
|
152
159
|
interface Automated {
|
|
153
160
|
chainId: ChainId;
|
|
154
161
|
positionId: string;
|
package/package.json
CHANGED
|
@@ -870,7 +870,13 @@ function parseLiquityV2CloseOnPrice(position: Position.Automated, parseData: Par
|
|
|
870
870
|
// - Both
|
|
871
871
|
// TODO: see on frontend what specific data we need here because stop-loss and take-profit is one bundle now
|
|
872
872
|
_position.strategy.strategyId = Strategies.Identifiers.CloseOnPrice;
|
|
873
|
-
_position.specific = {
|
|
873
|
+
_position.specific = {
|
|
874
|
+
market: subData.market,
|
|
875
|
+
troveId: subData.troveId,
|
|
876
|
+
stopLossPrice: triggerData.lowerPrice,
|
|
877
|
+
takeProfitPrice: triggerData.upperPrice,
|
|
878
|
+
closeToAssetAddr: triggerData.tokenAddr,
|
|
879
|
+
};
|
|
874
880
|
|
|
875
881
|
return _position;
|
|
876
882
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -161,6 +161,14 @@ export declare namespace Position {
|
|
|
161
161
|
ratioState: RatioState,
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
interface CloseOnPriceLiquityV2 extends Base {
|
|
165
|
+
market: EthereumAddress,
|
|
166
|
+
troveId: string,
|
|
167
|
+
stopLossPrice: string,
|
|
168
|
+
takeProfitPrice: string,
|
|
169
|
+
closeToAssetAddr: EthereumAddress,
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
interface TrailingStop extends Base {
|
|
165
173
|
roundId: number,
|
|
166
174
|
triggerPercentage: number,
|
|
@@ -186,7 +194,8 @@ export declare namespace Position {
|
|
|
186
194
|
| Specific.BoostOnPriceAave
|
|
187
195
|
| Specific.CloseOnPriceWithMaximumGasPriceAave
|
|
188
196
|
| Specific.DebtInFrontRepay
|
|
189
|
-
| Specific.LeverageManagementCrvUSD
|
|
197
|
+
| Specific.LeverageManagementCrvUSD
|
|
198
|
+
| Specific.CloseOnPriceLiquityV2;
|
|
190
199
|
|
|
191
200
|
export interface Automated {
|
|
192
201
|
chainId: ChainId,
|