@defisaver/automation-sdk 1.2.32 → 2.0.0
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/README.md +36 -0
- package/esm/abis/legacy_AaveV2Subscriptions.json +1 -1
- package/esm/abis/legacy_CompoundV2Subscriptions.json +1 -1
- package/esm/abis/legacy_MakerSubscriptions.json +1 -1
- package/esm/constants/index.js +20 -0
- package/esm/services/strategiesService.js +96 -29
- package/esm/services/strategySubService.d.ts +13 -7
- package/esm/services/strategySubService.js +37 -27
- package/esm/services/subDataService.d.ts +15 -3
- package/esm/services/subDataService.js +45 -11
- package/esm/services/triggerService.d.ts +2 -2
- package/esm/services/triggerService.js +2 -2
- package/esm/types/enums.d.ts +8 -2
- package/esm/types/enums.js +8 -2
- package/esm/types/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/abis/legacy_AaveV2Subscriptions.json +1 -1
- package/src/abis/legacy_CompoundV2Subscriptions.json +1 -1
- package/src/abis/legacy_MakerSubscriptions.json +1 -1
- package/src/constants/index.ts +20 -0
- package/src/services/strategiesService.ts +109 -29
- package/src/services/strategySubService.ts +70 -46
- package/src/services/subDataService.ts +67 -17
- package/src/services/triggerService.ts +4 -4
- package/src/types/contracts/generated/Legacy_AaveV2Subscriptions.ts +8 -8
- package/src/types/contracts/generated/Legacy_CompoundV2Subscriptions.ts +8 -8
- package/src/types/contracts/generated/Legacy_MakerSubscriptions.ts +11 -11
- package/src/types/enums.ts +8 -2
- package/src/types/index.ts +4 -4
- package/umd/index.js +207 -64
|
@@ -33,8 +33,8 @@ export declare namespace CompoundSubscriptions {
|
|
|
33
33
|
]
|
|
34
34
|
| {
|
|
35
35
|
user: string;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
triggerRepayRatio: number | string | BN;
|
|
37
|
+
triggerBoostRatio: number | string | BN;
|
|
38
38
|
optimalRatioBoost: number | string | BN;
|
|
39
39
|
optimalRatioRepay: number | string | BN;
|
|
40
40
|
boostEnabled: boolean;
|
|
@@ -50,8 +50,8 @@ export declare namespace CompoundSubscriptions {
|
|
|
50
50
|
];
|
|
51
51
|
export type CompoundHolderStructOutputStruct = {
|
|
52
52
|
user: string;
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
triggerRepayRatio: string;
|
|
54
|
+
triggerBoostRatio: string;
|
|
55
55
|
optimalRatioBoost: string;
|
|
56
56
|
optimalRatioRepay: string;
|
|
57
57
|
boostEnabled: boolean;
|
|
@@ -122,8 +122,8 @@ export interface Legacy_CompoundV2Subscriptions extends BaseContract {
|
|
|
122
122
|
setOwnerByAdmin(_owner: string): NonPayableTransactionObject<void>;
|
|
123
123
|
|
|
124
124
|
subscribe(
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
_triggerRepayRatio: number | string | BN,
|
|
126
|
+
_triggerBoostRatio: number | string | BN,
|
|
127
127
|
_optimalBoost: number | string | BN,
|
|
128
128
|
_optimalRepay: number | string | BN,
|
|
129
129
|
_boostEnabled: boolean
|
|
@@ -134,8 +134,8 @@ export interface Legacy_CompoundV2Subscriptions extends BaseContract {
|
|
|
134
134
|
): NonPayableTransactionObject<
|
|
135
135
|
[string, string, string, string, string, boolean] & {
|
|
136
136
|
user: string;
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
triggerRepayRatio: string;
|
|
138
|
+
triggerBoostRatio: string;
|
|
139
139
|
optimalRatioBoost: string;
|
|
140
140
|
optimalRatioRepay: string;
|
|
141
141
|
boostEnabled: boolean;
|
|
@@ -67,8 +67,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
67
67
|
getSubscribers(): NonPayableTransactionObject<
|
|
68
68
|
[string, string, string, string, string, string, boolean, boolean] &
|
|
69
69
|
{
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
triggerRepayRatio: string;
|
|
71
|
+
triggerBoostRatio: string;
|
|
72
72
|
optimalRatioBoost: string;
|
|
73
73
|
optimalRatioRepay: string;
|
|
74
74
|
owner: string;
|
|
@@ -90,8 +90,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
90
90
|
[
|
|
91
91
|
boolean,
|
|
92
92
|
[string, string, string, string, string, string, boolean, boolean] & {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
triggerRepayRatio: string;
|
|
94
|
+
triggerBoostRatio: string;
|
|
95
95
|
optimalRatioBoost: string;
|
|
96
96
|
optimalRatioRepay: string;
|
|
97
97
|
owner: string;
|
|
@@ -152,8 +152,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
152
152
|
arg0: number | string | BN
|
|
153
153
|
): NonPayableTransactionObject<
|
|
154
154
|
[string, string, string, string, string, string, boolean, boolean] & {
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
triggerRepayRatio: string;
|
|
156
|
+
triggerBoostRatio: string;
|
|
157
157
|
optimalRatioBoost: string;
|
|
158
158
|
optimalRatioRepay: string;
|
|
159
159
|
owner: string;
|
|
@@ -165,8 +165,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
165
165
|
|
|
166
166
|
subscribe(
|
|
167
167
|
_cdpId: number | string | BN,
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
_triggerRepayRatio: number | string | BN,
|
|
169
|
+
_triggerBoostRatio: number | string | BN,
|
|
170
170
|
_optimalBoost: number | string | BN,
|
|
171
171
|
_optimalRepay: number | string | BN,
|
|
172
172
|
_boostEnabled: boolean,
|
|
@@ -199,8 +199,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
199
199
|
): NonPayableTransactionObject<
|
|
200
200
|
[string, string, string, string, string, string, boolean, boolean] &
|
|
201
201
|
{
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
triggerRepayRatio: string;
|
|
203
|
+
triggerBoostRatio: string;
|
|
204
204
|
optimalRatioBoost: string;
|
|
205
205
|
optimalRatioRepay: string;
|
|
206
206
|
owner: string;
|
|
@@ -277,7 +277,7 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
277
277
|
|
|
278
278
|
saverProxy(): NonPayableTransactionObject<string>;
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
changetriggerRepayRatios(
|
|
281
281
|
_ilk: string | number[],
|
|
282
282
|
_newRatio: number | string | BN
|
|
283
283
|
): NonPayableTransactionObject<void>;
|
package/src/types/enums.ts
CHANGED
|
@@ -27,7 +27,9 @@ export namespace ProtocolIdentifiers {
|
|
|
27
27
|
MakerDAO = 'MakerDAO',
|
|
28
28
|
Liquity = 'Liquity',
|
|
29
29
|
ChickenBonds = 'Chicken Bonds',
|
|
30
|
+
CompoundV2 = 'Compound__V2',
|
|
30
31
|
CompoundV3 = 'Compound__V3',
|
|
32
|
+
AaveV2 = 'Aave__V2',
|
|
31
33
|
AaveV3 = 'Aave__V3',
|
|
32
34
|
MorphoAaveV2 = 'Morpho-Aave__V2',
|
|
33
35
|
Exchange = 'Exchange',
|
|
@@ -113,8 +115,12 @@ export namespace Bundles {
|
|
|
113
115
|
LIQUITY_BOOST = 17,
|
|
114
116
|
SPARK_REPAY = 18,
|
|
115
117
|
SPARK_BOOST = 19,
|
|
116
|
-
SPARK_CLOSE_TO_DEBT =
|
|
117
|
-
SPARK_CLOSE_TO_COLLATERAL =
|
|
118
|
+
SPARK_CLOSE_TO_DEBT = -21231230, // @dev This was never deployed
|
|
119
|
+
SPARK_CLOSE_TO_COLLATERAL = -21231231, // @dev This was never deployed
|
|
120
|
+
AAVE_V2_REPAY = 22,
|
|
121
|
+
AAVE_V2_BOOST = 23,
|
|
122
|
+
COMP_V2_REPAY = 20,
|
|
123
|
+
COMP_V2_BOOST = 21,
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
export enum OptimismIds {
|
package/src/types/index.ts
CHANGED
|
@@ -119,11 +119,11 @@ export declare namespace Position {
|
|
|
119
119
|
mergeWithSameId?: boolean
|
|
120
120
|
}
|
|
121
121
|
interface RatioProtection extends Base {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
triggerRepayRatio?: number,
|
|
123
|
+
targetRepayRatio?: number,
|
|
124
124
|
repayEnabled?: boolean,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
triggerBoostRatio?: number,
|
|
126
|
+
targetBoostRatio?: number,
|
|
127
127
|
boostEnabled?: boolean,
|
|
128
128
|
}
|
|
129
129
|
interface CloseOnPrice extends Base {
|