@defisaver/sdk 0.3.26 → 0.3.28
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/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const Action = require("../../Action");
|
|
2
|
+
const {getAddr} = require("../../addresses.js");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CompoundV3RatioCheckAction - Checks comp V3 ratio for users proxy position and reverts if faulty
|
|
6
|
+
*/
|
|
7
|
+
class CompoundV3RatioCheckAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param ratioState {uint8} If it should lower/higher
|
|
10
|
+
* @param targetRatio {string} The ratio user want to be at
|
|
11
|
+
* @param market {address} Address of compV3 market
|
|
12
|
+
*/
|
|
13
|
+
constructor(ratioState, targetRatio, market) {
|
|
14
|
+
super("CompV3RatioCheck", getAddr("CompV3RatioCheck"), ["uint8","uint256","address"], [ratioState, targetRatio, market]);
|
|
15
|
+
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2]
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = CompoundV3RatioCheckAction;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const MakerRatioCheckAction = require('./MakerRatioCheckAction');
|
|
2
2
|
const AaveV3RatioCheckAction = require('./AaveV3RatioCheckAction');
|
|
3
|
+
const CompoundV3RatioCheckAction = require('./CompoundV3RatioCheckAction');
|
|
3
4
|
|
|
4
5
|
module.exports = {
|
|
5
6
|
MakerRatioCheckAction,
|
|
6
7
|
AaveV3RatioCheckAction,
|
|
8
|
+
CompoundV3RatioCheckAction,
|
|
7
9
|
};
|
package/src/addresses.js
CHANGED
|
@@ -134,7 +134,7 @@ const actionAddresses = {
|
|
|
134
134
|
CurveWithdraw: '0xA2A6D75417807ebAf8364613018D697f88021771',
|
|
135
135
|
|
|
136
136
|
// Euler
|
|
137
|
-
FLEuler: '
|
|
137
|
+
FLEuler: '0x66DC6444CdC099153f89332e0d4C87af5C966A75',
|
|
138
138
|
|
|
139
139
|
TrailingStopTrigger: '0x0000000000000000000000000000000000000000',
|
|
140
140
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const Action = require("../Action");
|
|
2
|
+
const { getAddr } = require("../addresses.js");
|
|
3
|
+
|
|
4
|
+
class CompV3RatioTrigger extends Action {
|
|
5
|
+
|
|
6
|
+
constructor(user, market, ratio, state) {
|
|
7
|
+
super("CompV3RatioTrigger", getAddr("CompV3RatioTrigger"), [["address", "address", "uint256", "uint8"]], [[...arguments]]);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CompV3RatioTrigger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const Action = require("../Action");
|
|
2
|
+
const { getAddr } = require("../addresses.js");
|
|
3
|
+
|
|
4
|
+
class CompV3RatioTrigger extends Action {
|
|
5
|
+
|
|
6
|
+
constructor(user, market, ratio, state) {
|
|
7
|
+
super("CompV3RatioTrigger", getAddr("CompV3RatioTrigger"), [["address", "address", "uint256", "uint8"]], [[...arguments]]);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CompV3RatioTrigger;
|
package/src/triggers/index.js
CHANGED
|
@@ -7,8 +7,10 @@ const CompoundRatioTrigger = require('./CompoundRatioTrigger');
|
|
|
7
7
|
const ReflexerRatioTrigger = require('./ReflexerRatioTrigger');
|
|
8
8
|
const LiquityRatioTrigger = require('./LiquityRatioTrigger');
|
|
9
9
|
const AaveV3RatioTrigger = require('./AaveV3RatioTrigger');
|
|
10
|
+
const CompV3RatioTrigger = require('./CompV3RatioTrigger');
|
|
10
11
|
const TrailingStopTrigger = require('./TrailingStopTrigger');
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
module.exports = {
|
|
13
15
|
MakerRatioTrigger,
|
|
14
16
|
ChainLinkPriceTrigger,
|
|
@@ -19,5 +21,6 @@ module.exports = {
|
|
|
19
21
|
ReflexerRatioTrigger,
|
|
20
22
|
LiquityRatioTrigger,
|
|
21
23
|
AaveV3RatioTrigger,
|
|
24
|
+
CompV3RatioTrigger,
|
|
22
25
|
TrailingStopTrigger,
|
|
23
26
|
}
|