@defisaver/automation-sdk 1.2.33 → 2.0.1
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/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/services/strategiesService.js +36 -36
- package/esm/services/strategySubService.d.ts +9 -9
- package/esm/services/strategySubService.js +31 -31
- package/esm/services/subDataService.d.ts +4 -4
- package/esm/services/subDataService.js +20 -20
- package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.d.ts +7 -7
- package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.d.ts +7 -7
- package/esm/types/contracts/generated/Legacy_MakerSubscriptions.d.ts +10 -10
- package/esm/types/index.d.ts +4 -4
- package/package.json +4 -4
- 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/services/strategiesService.ts +36 -36
- package/src/services/strategySubService.ts +56 -56
- package/src/services/subDataService.ts +32 -32
- 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/index.ts +4 -4
- package/umd/index.js +73 -73
- package/yarn-error.log +7233 -0
|
@@ -5,9 +5,9 @@ import * as subDataService from './subDataService';
|
|
|
5
5
|
import * as triggerService from './triggerService';
|
|
6
6
|
import { compareAddresses, requireAddress, requireAddresses } from './utils';
|
|
7
7
|
export const makerEncode = {
|
|
8
|
-
repayFromSavings(bundleId, vaultId,
|
|
9
|
-
const subData = subDataService.makerRepayFromSavingsSubData.encode(vaultId,
|
|
10
|
-
const triggerData = triggerService.makerRatioTrigger.encode(vaultId,
|
|
8
|
+
repayFromSavings(bundleId, vaultId, triggerRepayRatio, targetRepayRatio, isBundle = true, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
9
|
+
const subData = subDataService.makerRepayFromSavingsSubData.encode(vaultId, targetRepayRatio, chainId, daiAddr, mcdCdpManagerAddr);
|
|
10
|
+
const triggerData = triggerService.makerRatioTrigger.encode(vaultId, triggerRepayRatio, RatioState.UNDER);
|
|
11
11
|
return [bundleId, isBundle, triggerData, subData];
|
|
12
12
|
},
|
|
13
13
|
closeOnPrice(vaultId, ratioState, price, closeToAssetAddr, chainlinkCollAddress, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
@@ -30,13 +30,13 @@ export const makerEncode = {
|
|
|
30
30
|
const isBundle = false;
|
|
31
31
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
32
32
|
},
|
|
33
|
-
leverageManagement(vaultId,
|
|
33
|
+
leverageManagement(vaultId, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
34
34
|
return [
|
|
35
35
|
vaultId,
|
|
36
|
-
new Dec(
|
|
37
|
-
new Dec(
|
|
38
|
-
new Dec(
|
|
39
|
-
new Dec(
|
|
36
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
37
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
38
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
39
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
40
40
|
boostEnabled,
|
|
41
41
|
];
|
|
42
42
|
},
|
|
@@ -66,12 +66,12 @@ export const liquityEncode = {
|
|
|
66
66
|
const isBundle = true;
|
|
67
67
|
return [strategyId, isBundle, triggerData, subData];
|
|
68
68
|
},
|
|
69
|
-
leverageManagement(
|
|
69
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
70
70
|
return [
|
|
71
|
-
new Dec(
|
|
72
|
-
new Dec(
|
|
73
|
-
new Dec(
|
|
74
|
-
new Dec(
|
|
71
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
72
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
73
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
74
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
75
75
|
boostEnabled,
|
|
76
76
|
];
|
|
77
77
|
},
|
|
@@ -82,20 +82,20 @@ export const chickenBondsEncode = {
|
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
export const aaveV2Encode = {
|
|
85
|
-
leverageManagement(
|
|
86
|
-
return subDataService.aaveV2LeverageManagementSubData.encode(
|
|
85
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
86
|
+
return subDataService.aaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
87
87
|
},
|
|
88
88
|
};
|
|
89
89
|
export const aaveV3Encode = {
|
|
90
|
-
leverageManagement(
|
|
90
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
91
91
|
let subInput = '0x';
|
|
92
|
-
subInput = subInput.concat(new Dec(
|
|
92
|
+
subInput = subInput.concat(new Dec(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
93
93
|
.padStart(32, '0'));
|
|
94
|
-
subInput = subInput.concat(new Dec(
|
|
94
|
+
subInput = subInput.concat(new Dec(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
95
95
|
.padStart(32, '0'));
|
|
96
|
-
subInput = subInput.concat(new Dec(
|
|
96
|
+
subInput = subInput.concat(new Dec(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
97
97
|
.padStart(32, '0'));
|
|
98
|
-
subInput = subInput.concat(new Dec(
|
|
98
|
+
subInput = subInput.concat(new Dec(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
99
99
|
.padStart(32, '0'));
|
|
100
100
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
101
101
|
return subInput;
|
|
@@ -109,18 +109,18 @@ export const aaveV3Encode = {
|
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
111
|
export const compoundV2Encode = {
|
|
112
|
-
leverageManagement(
|
|
113
|
-
return subDataService.compoundV2LeverageManagementSubData.encode(
|
|
112
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
113
|
+
return subDataService.compoundV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
114
114
|
},
|
|
115
115
|
};
|
|
116
116
|
export const compoundV3Encode = {
|
|
117
|
-
leverageManagement(market, baseToken,
|
|
118
|
-
return subDataService.compoundV3LeverageManagementSubData.encode(market, baseToken,
|
|
117
|
+
leverageManagement(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
118
|
+
return subDataService.compoundV3LeverageManagementSubData.encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA);
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
121
|
export const morphoAaveV2Encode = {
|
|
122
|
-
leverageManagement(
|
|
123
|
-
return subDataService.morphoAaveV2LeverageManagementSubData.encode(
|
|
122
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
123
|
+
return subDataService.morphoAaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
126
|
export const exchangeEncode = {
|
|
@@ -141,15 +141,15 @@ export const exchangeEncode = {
|
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
143
|
export const sparkEncode = {
|
|
144
|
-
leverageManagement(
|
|
144
|
+
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
145
145
|
let subInput = '0x';
|
|
146
|
-
subInput = subInput.concat(new Dec(
|
|
146
|
+
subInput = subInput.concat(new Dec(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
147
147
|
.padStart(32, '0'));
|
|
148
|
-
subInput = subInput.concat(new Dec(
|
|
148
|
+
subInput = subInput.concat(new Dec(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
149
149
|
.padStart(32, '0'));
|
|
150
|
-
subInput = subInput.concat(new Dec(
|
|
150
|
+
subInput = subInput.concat(new Dec(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
151
151
|
.padStart(32, '0'));
|
|
152
|
-
subInput = subInput.concat(new Dec(
|
|
152
|
+
subInput = subInput.concat(new Dec(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
153
153
|
.padStart(32, '0'));
|
|
154
154
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
155
155
|
return subInput;
|
|
@@ -35,7 +35,7 @@ export declare const liquityCloseSubData: {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
export declare const aaveV2LeverageManagementSubData: {
|
|
38
|
-
encode(
|
|
38
|
+
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
39
39
|
decode(subData: string[]): {
|
|
40
40
|
targetRatio: number;
|
|
41
41
|
};
|
|
@@ -55,19 +55,19 @@ export declare const aaveV3QuotePriceSubData: {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
export declare const compoundV2LeverageManagementSubData: {
|
|
58
|
-
encode(
|
|
58
|
+
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
59
59
|
decode(subData: string[]): {
|
|
60
60
|
targetRatio: number;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
export declare const compoundV3LeverageManagementSubData: {
|
|
64
|
-
encode(market: EthereumAddress, baseToken: EthereumAddress,
|
|
64
|
+
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string[];
|
|
65
65
|
decode(subData: string[]): {
|
|
66
66
|
targetRatio: number;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
export declare const morphoAaveV2LeverageManagementSubData: {
|
|
70
|
-
encode(
|
|
70
|
+
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
71
71
|
decode(subData: string[]): {
|
|
72
72
|
targetRatio: number;
|
|
73
73
|
};
|
|
@@ -97,12 +97,12 @@ export const liquityCloseSubData = {
|
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
99
|
export const aaveV2LeverageManagementSubData = {
|
|
100
|
-
encode(
|
|
100
|
+
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
101
101
|
return [
|
|
102
|
-
new Dec(
|
|
103
|
-
new Dec(
|
|
104
|
-
new Dec(
|
|
105
|
-
new Dec(
|
|
102
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
103
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
104
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
105
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
106
106
|
// @ts-ignore // TODO
|
|
107
107
|
boostEnabled,
|
|
108
108
|
];
|
|
@@ -140,12 +140,12 @@ export const aaveV3QuotePriceSubData = {
|
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
142
|
export const compoundV2LeverageManagementSubData = {
|
|
143
|
-
encode(
|
|
143
|
+
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
144
144
|
return [
|
|
145
|
-
new Dec(
|
|
146
|
-
new Dec(
|
|
147
|
-
new Dec(
|
|
148
|
-
new Dec(
|
|
145
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
146
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
147
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
148
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
149
149
|
// @ts-ignore // TODO
|
|
150
150
|
boostEnabled,
|
|
151
151
|
];
|
|
@@ -157,14 +157,14 @@ export const compoundV2LeverageManagementSubData = {
|
|
|
157
157
|
},
|
|
158
158
|
};
|
|
159
159
|
export const compoundV3LeverageManagementSubData = {
|
|
160
|
-
encode(market, baseToken,
|
|
160
|
+
encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
161
161
|
return [
|
|
162
162
|
market,
|
|
163
163
|
baseToken,
|
|
164
|
-
new Dec(
|
|
165
|
-
new Dec(
|
|
166
|
-
new Dec(
|
|
167
|
-
new Dec(
|
|
164
|
+
new Dec(triggerRepayRatio).mul(1e16).toString(),
|
|
165
|
+
new Dec(triggerBoostRatio).mul(1e16).toString(),
|
|
166
|
+
new Dec(targetBoostRatio).mul(1e16).toString(),
|
|
167
|
+
new Dec(targetRepayRatio).mul(1e16).toString(),
|
|
168
168
|
// @ts-ignore // TODO
|
|
169
169
|
boostEnabled, isEOA,
|
|
170
170
|
];
|
|
@@ -176,12 +176,12 @@ export const compoundV3LeverageManagementSubData = {
|
|
|
176
176
|
},
|
|
177
177
|
};
|
|
178
178
|
export const morphoAaveV2LeverageManagementSubData = {
|
|
179
|
-
encode(
|
|
179
|
+
encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
180
180
|
return [
|
|
181
|
-
ratioPercentageToWei(
|
|
182
|
-
ratioPercentageToWei(
|
|
183
|
-
ratioPercentageToWei(
|
|
184
|
-
ratioPercentageToWei(
|
|
181
|
+
ratioPercentageToWei(triggerRepayRatio),
|
|
182
|
+
ratioPercentageToWei(triggerBoostRatio),
|
|
183
|
+
ratioPercentageToWei(targetBoostRatio),
|
|
184
|
+
ratioPercentageToWei(targetRepayRatio),
|
|
185
185
|
// @ts-ignore
|
|
186
186
|
boostEnabled,
|
|
187
187
|
];
|
|
@@ -19,8 +19,8 @@ export declare namespace AaveSubscriptionsV2 {
|
|
|
19
19
|
boolean
|
|
20
20
|
] | {
|
|
21
21
|
user: string;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
triggerRepayRatio: number | string | BN;
|
|
23
|
+
triggerBoostRatio: number | string | BN;
|
|
24
24
|
optimalRatioBoost: number | string | BN;
|
|
25
25
|
optimalRatioRepay: number | string | BN;
|
|
26
26
|
boostEnabled: boolean;
|
|
@@ -35,8 +35,8 @@ export declare namespace AaveSubscriptionsV2 {
|
|
|
35
35
|
];
|
|
36
36
|
type AaveHolderStructOutputStruct = {
|
|
37
37
|
user: string;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
triggerRepayRatio: string;
|
|
39
|
+
triggerBoostRatio: string;
|
|
40
40
|
optimalRatioBoost: string;
|
|
41
41
|
optimalRatioRepay: string;
|
|
42
42
|
boostEnabled: boolean;
|
|
@@ -80,7 +80,7 @@ export interface Legacy_AaveV2Subscriptions extends BaseContract {
|
|
|
80
80
|
setAdminByAdmin(_admin: string): NonPayableTransactionObject<void>;
|
|
81
81
|
setAdminByOwner(_admin: string): NonPayableTransactionObject<void>;
|
|
82
82
|
setOwnerByAdmin(_owner: string): NonPayableTransactionObject<void>;
|
|
83
|
-
subscribe(
|
|
83
|
+
subscribe(_triggerRepayRatio: number | string | BN, _triggerBoostRatio: number | string | BN, _optimalBoost: number | string | BN, _optimalRepay: number | string | BN, _boostEnabled: boolean): NonPayableTransactionObject<void>;
|
|
84
84
|
subscribers(arg0: number | string | BN): NonPayableTransactionObject<[
|
|
85
85
|
string,
|
|
86
86
|
string,
|
|
@@ -90,8 +90,8 @@ export interface Legacy_AaveV2Subscriptions extends BaseContract {
|
|
|
90
90
|
boolean
|
|
91
91
|
] & {
|
|
92
92
|
user: string;
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
triggerRepayRatio: string;
|
|
94
|
+
triggerBoostRatio: string;
|
|
95
95
|
optimalRatioBoost: string;
|
|
96
96
|
optimalRatioRepay: string;
|
|
97
97
|
boostEnabled: boolean;
|
|
@@ -19,8 +19,8 @@ export declare namespace CompoundSubscriptions {
|
|
|
19
19
|
boolean
|
|
20
20
|
] | {
|
|
21
21
|
user: string;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
triggerRepayRatio: number | string | BN;
|
|
23
|
+
triggerBoostRatio: number | string | BN;
|
|
24
24
|
optimalRatioBoost: number | string | BN;
|
|
25
25
|
optimalRatioRepay: number | string | BN;
|
|
26
26
|
boostEnabled: boolean;
|
|
@@ -35,8 +35,8 @@ export declare namespace CompoundSubscriptions {
|
|
|
35
35
|
];
|
|
36
36
|
type CompoundHolderStructOutputStruct = {
|
|
37
37
|
user: string;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
triggerRepayRatio: string;
|
|
39
|
+
triggerBoostRatio: string;
|
|
40
40
|
optimalRatioBoost: string;
|
|
41
41
|
optimalRatioRepay: string;
|
|
42
42
|
boostEnabled: boolean;
|
|
@@ -79,7 +79,7 @@ export interface Legacy_CompoundV2Subscriptions extends BaseContract {
|
|
|
79
79
|
setAdminByAdmin(_admin: string): NonPayableTransactionObject<void>;
|
|
80
80
|
setAdminByOwner(_admin: string): NonPayableTransactionObject<void>;
|
|
81
81
|
setOwnerByAdmin(_owner: string): NonPayableTransactionObject<void>;
|
|
82
|
-
subscribe(
|
|
82
|
+
subscribe(_triggerRepayRatio: number | string | BN, _triggerBoostRatio: number | string | BN, _optimalBoost: number | string | BN, _optimalRepay: number | string | BN, _boostEnabled: boolean): NonPayableTransactionObject<void>;
|
|
83
83
|
subscribers(arg0: number | string | BN): NonPayableTransactionObject<[
|
|
84
84
|
string,
|
|
85
85
|
string,
|
|
@@ -89,8 +89,8 @@ export interface Legacy_CompoundV2Subscriptions extends BaseContract {
|
|
|
89
89
|
boolean
|
|
90
90
|
] & {
|
|
91
91
|
user: string;
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
triggerRepayRatio: string;
|
|
93
|
+
triggerBoostRatio: string;
|
|
94
94
|
optimalRatioBoost: string;
|
|
95
95
|
optimalRatioRepay: string;
|
|
96
96
|
boostEnabled: boolean;
|
|
@@ -55,8 +55,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
55
55
|
boolean,
|
|
56
56
|
boolean
|
|
57
57
|
] & {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
triggerRepayRatio: string;
|
|
59
|
+
triggerBoostRatio: string;
|
|
60
60
|
optimalRatioBoost: string;
|
|
61
61
|
optimalRatioRepay: string;
|
|
62
62
|
owner: string;
|
|
@@ -79,8 +79,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
79
79
|
boolean,
|
|
80
80
|
boolean
|
|
81
81
|
] & {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
triggerRepayRatio: string;
|
|
83
|
+
triggerBoostRatio: string;
|
|
84
84
|
optimalRatioBoost: string;
|
|
85
85
|
optimalRatioRepay: string;
|
|
86
86
|
owner: string;
|
|
@@ -135,8 +135,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
135
135
|
boolean,
|
|
136
136
|
boolean
|
|
137
137
|
] & {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
triggerRepayRatio: string;
|
|
139
|
+
triggerBoostRatio: string;
|
|
140
140
|
optimalRatioBoost: string;
|
|
141
141
|
optimalRatioRepay: string;
|
|
142
142
|
owner: string;
|
|
@@ -144,7 +144,7 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
144
144
|
boostEnabled: boolean;
|
|
145
145
|
nextPriceEnabled: boolean;
|
|
146
146
|
}>;
|
|
147
|
-
subscribe(_cdpId: number | string | BN,
|
|
147
|
+
subscribe(_cdpId: number | string | BN, _triggerRepayRatio: number | string | BN, _triggerBoostRatio: number | string | BN, _optimalBoost: number | string | BN, _optimalRepay: number | string | BN, _boostEnabled: boolean, _nextPriceEnabled: boolean): NonPayableTransactionObject<void>;
|
|
148
148
|
MIGRATION_ACTIONS_PROXY(): NonPayableTransactionObject<string>;
|
|
149
149
|
minLimits(arg0: string | number[]): NonPayableTransactionObject<string>;
|
|
150
150
|
SPOTTER_ADDRESS(): NonPayableTransactionObject<string>;
|
|
@@ -169,8 +169,8 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
169
169
|
boolean,
|
|
170
170
|
boolean
|
|
171
171
|
] & {
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
triggerRepayRatio: string;
|
|
173
|
+
triggerBoostRatio: string;
|
|
174
174
|
optimalRatioBoost: string;
|
|
175
175
|
optimalRatioRepay: string;
|
|
176
176
|
owner: string;
|
|
@@ -218,7 +218,7 @@ export interface Legacy_MakerSubscriptions extends BaseContract {
|
|
|
218
218
|
UNISWAP_WRAPPER(): NonPayableTransactionObject<string>;
|
|
219
219
|
setAdminByOwner(_admin: string): NonPayableTransactionObject<void>;
|
|
220
220
|
saverProxy(): NonPayableTransactionObject<string>;
|
|
221
|
-
|
|
221
|
+
changetriggerRepayRatios(_ilk: string | number[], _newRatio: number | string | BN): NonPayableTransactionObject<void>;
|
|
222
222
|
TUB_ADDRESS(): NonPayableTransactionObject<string>;
|
|
223
223
|
ETH_JOIN_ADDRESS(): NonPayableTransactionObject<string>;
|
|
224
224
|
SCD_MCD_MIGRATION(): NonPayableTransactionObject<string>;
|
package/esm/types/index.d.ts
CHANGED
|
@@ -95,11 +95,11 @@ export declare namespace Position {
|
|
|
95
95
|
mergeWithSameId?: boolean;
|
|
96
96
|
}
|
|
97
97
|
interface RatioProtection extends Base {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
triggerRepayRatio?: number;
|
|
99
|
+
targetRepayRatio?: number;
|
|
100
100
|
repayEnabled?: boolean;
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
triggerBoostRatio?: number;
|
|
102
|
+
targetBoostRatio?: number;
|
|
103
103
|
boostEnabled?: boolean;
|
|
104
104
|
}
|
|
105
105
|
interface CloseOnPrice extends Base {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/automation-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./umd/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@defisaver/eslint-config": "^1.0.0",
|
|
24
|
-
"@defisaver/sdk": "^1.0.
|
|
25
|
-
"@defisaver/tokens": "^1.4.
|
|
24
|
+
"@defisaver/sdk": "^1.0.43",
|
|
25
|
+
"@defisaver/tokens": "^1.4.55",
|
|
26
26
|
"@ethersproject/address": "^5.0.10",
|
|
27
27
|
"@ethersproject/solidity": "^5.0.9",
|
|
28
28
|
"decimal.js": "^10.4.3",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
|
-
"web3": "^1.
|
|
30
|
+
"web3": "^1.10.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/core": "^7.12.10",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"abi": [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"ParamUpdates","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Subscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Unsubscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Updated","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changeIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getHolder","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"
|
|
2
|
+
"abi": [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"ParamUpdates","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Subscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Unsubscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Updated","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changeIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getHolder","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct AaveSubscriptionsV2.AaveHolder","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubscribers","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct AaveSubscriptionsV2.AaveHolder[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_page","type":"uint256"},{"internalType":"uint256","name":"_perPage","type":"uint256"}],"name":"getSubscribersByPage","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct AaveSubscriptionsV2.AaveHolder[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isSubscribed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdminByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdminByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwnerByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"_triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"_optimalBoost","type":"uint128"},{"internalType":"uint128","name":"_optimalRepay","type":"uint128"},{"internalType":"bool","name":"_boostEnabled","type":"bool"}],"name":"subscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"subscribers","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"subscribersPos","outputs":[{"internalType":"uint256","name":"arrPos","type":"uint256"},{"internalType":"bool","name":"subscribed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unsubscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"unsubscribeByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawStuckFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}],
|
|
3
3
|
"networks": {
|
|
4
4
|
"1": {
|
|
5
5
|
"address": "0x6B25043BF08182d8e86056C6548847aF607cd7CD"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"abi": [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"ParamUpdates","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Subscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Unsubscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Updated","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changeIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getHolder","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"
|
|
2
|
+
"abi": [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"","type":"uint128"},{"indexed":false,"internalType":"bool","name":"","type":"bool"}],"name":"ParamUpdates","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Subscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Unsubscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Updated","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changeIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getHolder","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct CompoundSubscriptions.CompoundHolder","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubscribers","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct CompoundSubscriptions.CompoundHolder[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_page","type":"uint256"},{"internalType":"uint256","name":"_perPage","type":"uint256"}],"name":"getSubscribersByPage","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"internalType":"struct CompoundSubscriptions.CompoundHolder[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isSubscribed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdminByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdminByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwnerByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"_triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"_optimalBoost","type":"uint128"},{"internalType":"uint128","name":"_optimalRepay","type":"uint128"},{"internalType":"bool","name":"_boostEnabled","type":"bool"}],"name":"subscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"subscribers","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"triggerRepayRatio","type":"uint128"},{"internalType":"uint128","name":"triggerBoostRatio","type":"uint128"},{"internalType":"uint128","name":"optimalRatioBoost","type":"uint128"},{"internalType":"uint128","name":"optimalRatioRepay","type":"uint128"},{"internalType":"bool","name":"boostEnabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"subscribersPos","outputs":[{"internalType":"uint256","name":"arrPos","type":"uint256"},{"internalType":"bool","name":"subscribed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unsubscribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"unsubscribeByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawStuckFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}],
|
|
3
3
|
"networks": {
|
|
4
4
|
"1": {
|
|
5
5
|
"address": "0x52015EFFD577E08f498a0CCc11905925D58D6207",
|