@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
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SDK for fetching DeFi Saver strategies data from the blockchain.
|
|
2
|
+
|
|
3
|
+
Fetch strategies data from the blockchain, and parse it into a readable format.
|
|
4
|
+
Use one of the following classes to fetch data for strategies: EthereumStrategies, OptimismStrategies, or ArbitrumStrategies.
|
|
5
|
+
Use one of the following classes to fetch data for legacy automation: LegacyMakerAutomation, LegacyAaveAutomation, or LegacyCompoundAutomation.
|
|
6
|
+
Various services and constants also available for use.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
const ethereumStrategies = new EthereumStrategies({
|
|
12
|
+
provider: WEB3_PROVIDER_HERE,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const subscriptions = await ethereumStrategies.getSubscriptionsFor(
|
|
16
|
+
// Pass one or multiple owner addresses, or use getSubscriptions method to fetch all subscriptions
|
|
17
|
+
['0x000000000000000000000000000000000000dEaD'],
|
|
18
|
+
{
|
|
19
|
+
fromBlock: 0,
|
|
20
|
+
toBlock: 'latest',
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// Do what you would like with subscriptions
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Development - How to add new strategies?
|
|
28
|
+
|
|
29
|
+
- Add strategy/bundle ID to `./src/types/enums.ts`, and create `Identifiers` if needed
|
|
30
|
+
- Add strategy/bundle info to `./src/constants/index.ts`
|
|
31
|
+
- Add encoding/decoding to the following files:
|
|
32
|
+
- `./src/services/strategySubService.ts`
|
|
33
|
+
- `./src/services/subDataService.ts`
|
|
34
|
+
- `./src/services/triggerService.ts`
|
|
35
|
+
- Write parsing for the strategy in `./src/services/strategeiesService.ts` and add assign it to `const parsingMethodsMapping`
|
|
36
|
+
- Test it out!
|
|
@@ -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",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"abi": [{ "constant": true, "inputs": [], "name": "WETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getSubscribers", "outputs": [{ "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVINGS_LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "changeIndex", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getCdpHolder", "outputs": [{ "name": "subscribed", "type": "bool" }, { "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PIP_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_owner", "type": "address" }], "name": "setOwnerByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_ETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OTC_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_cdpId", "type": "uint256" }], "name": "getIlkInfo", "outputs": [{ "name": "ilk", "type": "bytes32" }, { "name": "art", "type": "uint256" }, { "name": "rate", "type": "uint256" }, { "name": "spot", "type": "uint256" }, { "name": "line", "type": "uint256" }, { "name": "dust", "type": "uint256" }, { "name": "mat", "type": "uint256" }, { "name": "par", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "spotter", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "GAS_TOKEN_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "vat", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VOX_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MANAGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MONITOR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH2DAI_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "manager", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "STUPID_EXCHANGE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribers", "outputs": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }, { "name": "_minRatio", "type": "uint128" }, { "name": "_maxRatio", "type": "uint128" }, { "name": "_optimalBoost", "type": "uint128" }, { "name": "_optimalRepay", "type": "uint128" }, { "name": "_boostEnabled", "type": "bool" }, { "name": "_nextPriceEnabled", "type": "bool" }], "name": "subscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "MIGRATION_ACTIONS_PROXY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "bytes32" }], "name": "minLimits", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SPOTTER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribersPos", "outputs": [{ "name": "arrPos", "type": "uint256" }, { "name": "subscribed", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_REGISTRY_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_ACTIONS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MKR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "FACTORY_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_page", "type": "uint256" }, { "name": "_perPage", "type": "uint256" }], "name": "getSubscribersByPage", "outputs": [{ "components": [{ "name": "minRatio", "type": "uint128" }, { "name": "maxRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribeByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVER_EXCHANGE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MAKER_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DISCOUNT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "JUG_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SUBSCRIPTION_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "COMPOUND_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getOwner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_FACTORY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OASIS_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getSubscribedInfo", "outputs": [{ "name": "", "type": "bool" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "address" }, { "name": "coll", "type": "uint256" }, { "name": "debt", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_INTERFACE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VAT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ERC20_PROXY_0X", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "WALLET_ID", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SOLO_MARGIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByOwner", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "saverProxy", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_newRatio", "type": "uint256" }], "name": "changeMinRatios", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "TUB_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SCD_MCD_MIGRATION", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "admin", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [{ "name": "_saverProxy", "type": "address" }], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Subscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Unsubscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "boostEnabled", "type": "bool" }], "name": "ParamUpdates", "type": "event" }],
|
|
2
|
+
"abi": [{ "constant": true, "inputs": [], "name": "WETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getSubscribers", "outputs": [{ "components": [{ "name": "triggerRepayRatio", "type": "uint128" }, { "name": "triggerBoostRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVINGS_LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "changeIndex", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getCdpHolder", "outputs": [{ "name": "subscribed", "type": "bool" }, { "components": [{ "name": "triggerRepayRatio", "type": "uint128" }, { "name": "triggerBoostRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PIP_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_owner", "type": "address" }], "name": "setOwnerByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_ETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OTC_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_cdpId", "type": "uint256" }], "name": "getIlkInfo", "outputs": [{ "name": "ilk", "type": "bytes32" }, { "name": "art", "type": "uint256" }, { "name": "rate", "type": "uint256" }, { "name": "spot", "type": "uint256" }, { "name": "line", "type": "uint256" }, { "name": "dust", "type": "uint256" }, { "name": "mat", "type": "uint256" }, { "name": "par", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "spotter", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "GAS_TOKEN_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "vat", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VOX_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MANAGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MONITOR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH2DAI_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "manager", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "STUPID_EXCHANGE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribers", "outputs": [{ "name": "triggerRepayRatio", "type": "uint128" }, { "name": "triggerBoostRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }, { "name": "_triggerRepayRatio", "type": "uint128" }, { "name": "_triggerBoostRatio", "type": "uint128" }, { "name": "_optimalBoost", "type": "uint128" }, { "name": "_optimalRepay", "type": "uint128" }, { "name": "_boostEnabled", "type": "bool" }, { "name": "_nextPriceEnabled", "type": "bool" }], "name": "subscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "MIGRATION_ACTIONS_PROXY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "bytes32" }], "name": "minLimits", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SPOTTER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "uint256" }], "name": "subscribersPos", "outputs": [{ "name": "arrPos", "type": "uint256" }, { "name": "subscribed", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_REGISTRY_INTERFACE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PROXY_ACTIONS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MKR_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "FACTORY_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_page", "type": "uint256" }, { "name": "_perPage", "type": "uint256" }], "name": "getSubscribersByPage", "outputs": [{ "components": [{ "name": "triggerRepayRatio", "type": "uint128" }, { "name": "triggerBoostRatio", "type": "uint128" }, { "name": "optimalRatioBoost", "type": "uint128" }, { "name": "optimalRatioRepay", "type": "uint128" }, { "name": "owner", "type": "address" }, { "name": "cdpId", "type": "uint256" }, { "name": "boostEnabled", "type": "bool" }, { "name": "nextPriceEnabled", "type": "bool" }], "name": "", "type": "tuple[]" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribeByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "LOGGER_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SAVER_EXCHANGE_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MAKER_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DISCOUNT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "JUG_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "unsubscribe", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_CDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SUBSCRIPTION_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "NEW_IDAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "COMPOUND_DAI_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getOwner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_FACTORY", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "OASIS_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PETH_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "_cdpId", "type": "uint256" }], "name": "getSubscribedInfo", "outputs": [{ "name": "", "type": "bool" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "uint128" }, { "name": "", "type": "address" }, { "name": "coll", "type": "uint256" }, { "name": "debt", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "KYBER_INTERFACE", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "VAT_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "DAI_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ERC20_PROXY_0X", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "WALLET_ID", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SOLO_MARGIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNISWAP_WRAPPER", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_admin", "type": "address" }], "name": "setAdminByOwner", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "saverProxy", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_ilk", "type": "bytes32" }, { "name": "_newRatio", "type": "uint256" }], "name": "changetriggerRepayRatios", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "TUB_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ETH_JOIN_ADDRESS", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SCD_MCD_MIGRATION", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "admin", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [{ "name": "_saverProxy", "type": "address" }], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Subscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Unsubscribed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }], "name": "Updated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "cdpId", "type": "uint256" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "", "type": "uint128" }, { "indexed": false, "name": "boostEnabled", "type": "bool" }], "name": "ParamUpdates", "type": "event" }],
|
|
3
3
|
"networks": {
|
|
4
4
|
"1": {
|
|
5
5
|
"createdBlock": 8335635,
|
package/esm/constants/index.js
CHANGED
|
@@ -222,6 +222,26 @@ export const MAINNET_BUNDLES_INFO = {
|
|
|
222
222
|
strategyId: Strategies.Identifiers.CloseToCollateral,
|
|
223
223
|
protocol: PROTOCOLS.Spark,
|
|
224
224
|
},
|
|
225
|
+
[Bundles.MainnetIds.AAVE_V2_REPAY]: {
|
|
226
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V2_REPAY,
|
|
227
|
+
strategyId: Strategies.Identifiers.Repay,
|
|
228
|
+
protocol: PROTOCOLS.AaveV2,
|
|
229
|
+
},
|
|
230
|
+
[Bundles.MainnetIds.AAVE_V2_BOOST]: {
|
|
231
|
+
strategyOrBundleId: Bundles.MainnetIds.AAVE_V2_BOOST,
|
|
232
|
+
strategyId: Strategies.Identifiers.Boost,
|
|
233
|
+
protocol: PROTOCOLS.AaveV2,
|
|
234
|
+
},
|
|
235
|
+
[Bundles.MainnetIds.COMP_V2_REPAY]: {
|
|
236
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V2_REPAY,
|
|
237
|
+
strategyId: Strategies.Identifiers.Repay,
|
|
238
|
+
protocol: PROTOCOLS.CompoundV2,
|
|
239
|
+
},
|
|
240
|
+
[Bundles.MainnetIds.COMP_V2_BOOST]: {
|
|
241
|
+
strategyOrBundleId: Bundles.MainnetIds.COMP_V2_BOOST,
|
|
242
|
+
strategyId: Strategies.Identifiers.Boost,
|
|
243
|
+
protocol: PROTOCOLS.CompoundV2,
|
|
244
|
+
},
|
|
225
245
|
};
|
|
226
246
|
export const OPTIMISM_BUNDLES_INFO = {
|
|
227
247
|
[Bundles.OptimismIds.AAVE_V3_REPAY]: {
|
|
@@ -13,8 +13,8 @@ function parseMakerSavingsLiqProtection(position, parseData) {
|
|
|
13
13
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
14
14
|
_position.strategyData.decoded.subData = subData;
|
|
15
15
|
_position.specific = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
triggerRepayRatio: Number(triggerData.ratio),
|
|
17
|
+
targetRepayRatio: Number(subData.targetRatio),
|
|
18
18
|
repayEnabled: true,
|
|
19
19
|
boostEnabled: false,
|
|
20
20
|
};
|
|
@@ -61,16 +61,16 @@ function parseMakerLeverageManagement(position, parseData) {
|
|
|
61
61
|
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
62
62
|
if (isRepay) {
|
|
63
63
|
_position.specific = {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
triggerRepayRatio: triggerData.ratio,
|
|
65
|
+
targetRepayRatio: subData.targetRatio,
|
|
66
66
|
repayEnabled: true,
|
|
67
67
|
subId1: Number(subId),
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
_position.specific = {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
triggerBoostRatio: triggerData.ratio,
|
|
73
|
+
targetBoostRatio: subData.targetRatio,
|
|
74
74
|
boostEnabled: isEnabled,
|
|
75
75
|
subId2: Number(subId),
|
|
76
76
|
};
|
|
@@ -109,27 +109,56 @@ function parseLiquityTrailingStop(position, parseData) {
|
|
|
109
109
|
};
|
|
110
110
|
return _position;
|
|
111
111
|
}
|
|
112
|
+
function parseAaveV2LeverageManagement(position, parseData) {
|
|
113
|
+
const _position = cloneDeep(position);
|
|
114
|
+
const { subStruct, subId } = parseData.subscriptionEventData;
|
|
115
|
+
const { isEnabled } = parseData.strategiesSubsData;
|
|
116
|
+
const triggerData = triggerService.aaveV2RatioTrigger.decode(subStruct.triggerData);
|
|
117
|
+
const subData = subDataService.aaveV2LeverageManagementSubData.decode(subStruct.subData);
|
|
118
|
+
_position.strategyData.decoded.triggerData = triggerData;
|
|
119
|
+
_position.strategyData.decoded.subData = subData;
|
|
120
|
+
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
121
|
+
if (isRepay) {
|
|
122
|
+
_position.specific = {
|
|
123
|
+
triggerRepayRatio: triggerData.ratio,
|
|
124
|
+
targetRepayRatio: subData.targetRatio,
|
|
125
|
+
repayEnabled: true,
|
|
126
|
+
subId1: Number(subId),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
_position.specific = {
|
|
131
|
+
triggerBoostRatio: triggerData.ratio,
|
|
132
|
+
targetBoostRatio: subData.targetRatio,
|
|
133
|
+
boostEnabled: isEnabled,
|
|
134
|
+
subId2: Number(subId),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
_position.strategy.strategyId = Strategies.IdOverrides.LeverageManagement;
|
|
138
|
+
_position.specific.mergeWithSameId = true;
|
|
139
|
+
return _position;
|
|
140
|
+
}
|
|
112
141
|
function parseAaveV3LeverageManagement(position, parseData) {
|
|
113
142
|
const _position = cloneDeep(position);
|
|
114
143
|
const { subStruct, subId } = parseData.subscriptionEventData;
|
|
115
144
|
const { isEnabled } = parseData.strategiesSubsData;
|
|
116
145
|
const triggerData = triggerService.aaveV3RatioTrigger.decode(subStruct.triggerData);
|
|
117
|
-
const subData = subDataService.
|
|
146
|
+
const subData = subDataService.aaveV3LeverageManagementSubData.decode(subStruct.subData);
|
|
118
147
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
119
148
|
_position.strategyData.decoded.subData = subData;
|
|
120
149
|
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
121
150
|
if (isRepay) {
|
|
122
151
|
_position.specific = {
|
|
123
|
-
|
|
124
|
-
|
|
152
|
+
triggerRepayRatio: triggerData.ratio,
|
|
153
|
+
targetRepayRatio: subData.targetRatio,
|
|
125
154
|
repayEnabled: true,
|
|
126
155
|
subId1: Number(subId),
|
|
127
156
|
};
|
|
128
157
|
}
|
|
129
158
|
else {
|
|
130
159
|
_position.specific = {
|
|
131
|
-
|
|
132
|
-
|
|
160
|
+
triggerBoostRatio: triggerData.ratio,
|
|
161
|
+
targetBoostRatio: subData.targetRatio,
|
|
133
162
|
boostEnabled: isEnabled,
|
|
134
163
|
subId2: Number(subId),
|
|
135
164
|
};
|
|
@@ -149,16 +178,16 @@ function parseMorphoAaveV2LeverageManagement(position, parseData) {
|
|
|
149
178
|
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
150
179
|
if (isRepay) {
|
|
151
180
|
_position.specific = {
|
|
152
|
-
|
|
153
|
-
|
|
181
|
+
triggerRepayRatio: triggerData.ratio,
|
|
182
|
+
targetRepayRatio: subData.targetRatio,
|
|
154
183
|
repayEnabled: true,
|
|
155
184
|
subId1: Number(subId),
|
|
156
185
|
};
|
|
157
186
|
}
|
|
158
187
|
else {
|
|
159
188
|
_position.specific = {
|
|
160
|
-
|
|
161
|
-
|
|
189
|
+
triggerBoostRatio: triggerData.ratio,
|
|
190
|
+
targetBoostRatio: subData.targetRatio,
|
|
162
191
|
boostEnabled: isEnabled,
|
|
163
192
|
subId2: Number(subId),
|
|
164
193
|
};
|
|
@@ -188,6 +217,36 @@ function parseAaveV3CloseOnPrice(position, parseData) {
|
|
|
188
217
|
_position.strategy.strategyId = isRatioStateOver(ratioState) ? Strategies.IdOverrides.TakeProfit : Strategies.IdOverrides.StopLoss;
|
|
189
218
|
return _position;
|
|
190
219
|
}
|
|
220
|
+
function parseCompoundV2LeverageManagement(position, parseData) {
|
|
221
|
+
const _position = cloneDeep(position);
|
|
222
|
+
const { subStruct, subId } = parseData.subscriptionEventData;
|
|
223
|
+
const { isEnabled } = parseData.strategiesSubsData;
|
|
224
|
+
const triggerData = triggerService.compoundV2RatioTrigger.decode(subStruct.triggerData);
|
|
225
|
+
const subData = subDataService.compoundV2LeverageManagementSubData.decode(subStruct.subData);
|
|
226
|
+
_position.strategyData.decoded.triggerData = triggerData;
|
|
227
|
+
_position.strategyData.decoded.subData = subData;
|
|
228
|
+
_position.owner = triggerData.owner;
|
|
229
|
+
const isRepay = [Strategies.Identifiers.Repay, Strategies.Identifiers.EoaRepay].includes(_position.strategy.strategyId);
|
|
230
|
+
if (isRepay) {
|
|
231
|
+
_position.specific = {
|
|
232
|
+
triggerRepayRatio: triggerData.ratio,
|
|
233
|
+
targetRepayRatio: subData.targetRatio,
|
|
234
|
+
repayEnabled: true,
|
|
235
|
+
subId1: Number(subId),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
_position.specific = {
|
|
240
|
+
triggerBoostRatio: triggerData.ratio,
|
|
241
|
+
targetBoostRatio: subData.targetRatio,
|
|
242
|
+
boostEnabled: isEnabled,
|
|
243
|
+
subId2: Number(subId),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
_position.strategy.strategyId = Strategies.IdOverrides.LeverageManagement;
|
|
247
|
+
_position.specific.mergeWithSameId = true;
|
|
248
|
+
return _position;
|
|
249
|
+
}
|
|
191
250
|
function parseCompoundV3LeverageManagement(position, parseData) {
|
|
192
251
|
const _position = cloneDeep(position);
|
|
193
252
|
const { subStruct, subId } = parseData.subscriptionEventData;
|
|
@@ -200,16 +259,16 @@ function parseCompoundV3LeverageManagement(position, parseData) {
|
|
|
200
259
|
const isRepay = [Strategies.Identifiers.Repay, Strategies.Identifiers.EoaRepay].includes(_position.strategy.strategyId);
|
|
201
260
|
if (isRepay) {
|
|
202
261
|
_position.specific = {
|
|
203
|
-
|
|
204
|
-
|
|
262
|
+
triggerRepayRatio: triggerData.ratio,
|
|
263
|
+
targetRepayRatio: subData.targetRatio,
|
|
205
264
|
repayEnabled: true,
|
|
206
265
|
subId1: Number(subId),
|
|
207
266
|
};
|
|
208
267
|
}
|
|
209
268
|
else {
|
|
210
269
|
_position.specific = {
|
|
211
|
-
|
|
212
|
-
|
|
270
|
+
triggerBoostRatio: triggerData.ratio,
|
|
271
|
+
targetBoostRatio: subData.targetRatio,
|
|
213
272
|
boostEnabled: isEnabled,
|
|
214
273
|
subId2: Number(subId),
|
|
215
274
|
};
|
|
@@ -233,8 +292,8 @@ function parseLiquityBondProtection(position, parseData) {
|
|
|
233
292
|
_position.strategyData.decoded.subData = subDataService.liquityPaybackUsingChickenBondSubData.decode(subStruct.subData);
|
|
234
293
|
_position.strategyData.decoded.triggerData = triggerData;
|
|
235
294
|
_position.specific = {
|
|
236
|
-
|
|
237
|
-
|
|
295
|
+
triggerRepayRatio: Number(triggerData.ratio),
|
|
296
|
+
targetRepayRatio: Infinity,
|
|
238
297
|
repayEnabled: true,
|
|
239
298
|
};
|
|
240
299
|
return _position;
|
|
@@ -266,16 +325,16 @@ function parseLiquityLeverageManagement(position, parseData) {
|
|
|
266
325
|
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
267
326
|
if (isRepay) {
|
|
268
327
|
_position.specific = {
|
|
269
|
-
|
|
270
|
-
|
|
328
|
+
triggerRepayRatio: triggerData.ratio,
|
|
329
|
+
targetRepayRatio: subData.targetRatio,
|
|
271
330
|
repayEnabled: true,
|
|
272
331
|
subId1: Number(subId),
|
|
273
332
|
};
|
|
274
333
|
}
|
|
275
334
|
else {
|
|
276
335
|
_position.specific = {
|
|
277
|
-
|
|
278
|
-
|
|
336
|
+
triggerBoostRatio: triggerData.ratio,
|
|
337
|
+
targetBoostRatio: subData.targetRatio,
|
|
279
338
|
boostEnabled: isEnabled,
|
|
280
339
|
subId2: Number(subId),
|
|
281
340
|
};
|
|
@@ -295,16 +354,16 @@ function parseSparkLeverageManagement(position, parseData) {
|
|
|
295
354
|
const isRepay = _position.strategy.strategyId === Strategies.Identifiers.Repay;
|
|
296
355
|
if (isRepay) {
|
|
297
356
|
_position.specific = {
|
|
298
|
-
|
|
299
|
-
|
|
357
|
+
triggerRepayRatio: triggerData.ratio,
|
|
358
|
+
targetRepayRatio: subData.targetRatio,
|
|
300
359
|
repayEnabled: true,
|
|
301
360
|
subId1: Number(subId),
|
|
302
361
|
};
|
|
303
362
|
}
|
|
304
363
|
else {
|
|
305
364
|
_position.specific = {
|
|
306
|
-
|
|
307
|
-
|
|
365
|
+
triggerBoostRatio: triggerData.ratio,
|
|
366
|
+
targetBoostRatio: subData.targetRatio,
|
|
308
367
|
boostEnabled: isEnabled,
|
|
309
368
|
subId2: Number(subId),
|
|
310
369
|
};
|
|
@@ -351,12 +410,20 @@ const parsingMethodsMapping = {
|
|
|
351
410
|
[Strategies.Identifiers.Repay]: parseLiquityLeverageManagement,
|
|
352
411
|
[Strategies.Identifiers.Boost]: parseLiquityLeverageManagement,
|
|
353
412
|
},
|
|
413
|
+
[ProtocolIdentifiers.StrategiesAutomation.AaveV2]: {
|
|
414
|
+
[Strategies.Identifiers.Repay]: parseAaveV2LeverageManagement,
|
|
415
|
+
[Strategies.Identifiers.Boost]: parseAaveV2LeverageManagement,
|
|
416
|
+
},
|
|
354
417
|
[ProtocolIdentifiers.StrategiesAutomation.AaveV3]: {
|
|
355
418
|
[Strategies.Identifiers.Repay]: parseAaveV3LeverageManagement,
|
|
356
419
|
[Strategies.Identifiers.Boost]: parseAaveV3LeverageManagement,
|
|
357
420
|
[Strategies.Identifiers.CloseToDebt]: parseAaveV3CloseOnPrice,
|
|
358
421
|
[Strategies.Identifiers.CloseToCollateral]: parseAaveV3CloseOnPrice,
|
|
359
422
|
},
|
|
423
|
+
[ProtocolIdentifiers.StrategiesAutomation.CompoundV2]: {
|
|
424
|
+
[Strategies.Identifiers.Repay]: parseCompoundV2LeverageManagement,
|
|
425
|
+
[Strategies.Identifiers.Boost]: parseCompoundV2LeverageManagement,
|
|
426
|
+
},
|
|
360
427
|
[ProtocolIdentifiers.StrategiesAutomation.CompoundV3]: {
|
|
361
428
|
[Strategies.Identifiers.Repay]: parseCompoundV3LeverageManagement,
|
|
362
429
|
[Strategies.Identifiers.Boost]: parseCompoundV3LeverageManagement,
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { Bundles, ChainId, RatioState, Strategies } from '../types/enums';
|
|
2
2
|
import type { EthereumAddress, StrategyOrBundleIds } from '../types';
|
|
3
3
|
export declare const makerEncode: {
|
|
4
|
-
repayFromSavings(bundleId: StrategyOrBundleIds, vaultId: number,
|
|
4
|
+
repayFromSavings(bundleId: StrategyOrBundleIds, vaultId: number, triggerRepayRatio: number, targetRepayRatio: number, isBundle?: boolean, chainId?: ChainId, daiAddr?: EthereumAddress, mcdCdpManagerAddr?: EthereumAddress): (boolean | string[])[];
|
|
5
5
|
closeOnPrice(vaultId: number, ratioState: RatioState, price: string, closeToAssetAddr: EthereumAddress, chainlinkCollAddress: EthereumAddress, chainId?: ChainId, daiAddr?: EthereumAddress, mcdCdpManagerAddr?: EthereumAddress): (boolean | string[] | Strategies.MainnetIds)[];
|
|
6
6
|
trailingStop(vaultId: number, triggerPercentage: number, closeToAssetAddr: EthereumAddress, chainlinkCollAddress: EthereumAddress, roundId: number, chainId?: ChainId, daiAddr?: EthereumAddress, mcdCdpManagerAddr?: EthereumAddress): (boolean | string[] | Strategies.MainnetIds)[];
|
|
7
|
-
leverageManagement(vaultId: number,
|
|
7
|
+
leverageManagement(vaultId: number, triggerRepayRatio: string, triggerBoostRatio: string, targetBoostRatio: string, targetRepayRatio: string, boostEnabled: boolean): (string | number | boolean)[];
|
|
8
8
|
};
|
|
9
9
|
export declare const liquityEncode: {
|
|
10
10
|
closeOnPrice(priceOverOrUnder: RatioState, price: string, closeToAssetAddr: EthereumAddress, chainlinkCollAddress: EthereumAddress, chainId?: ChainId, collAddr?: EthereumAddress, debtAddr?: EthereumAddress): (boolean | string[] | Strategies.MainnetIds)[];
|
|
11
11
|
trailingStop(triggerPercentage: number, closeToAssetAddr: EthereumAddress, chainlinkCollAddress: EthereumAddress, roundId: number, chainId?: ChainId, collAddr?: EthereumAddress, debtAddr?: EthereumAddress): (boolean | string[] | Strategies.MainnetIds)[];
|
|
12
12
|
paybackFromChickenBondStrategySub(proxyAddress: EthereumAddress, ratio: number, sourceId: string, sourceType: number, ratioState?: RatioState): (boolean | string[] | Bundles.MainnetIds)[];
|
|
13
|
-
leverageManagement(
|
|
13
|
+
leverageManagement(triggerRepayRatio: string, triggerBoostRatio: string, targetBoostRatio: string, targetRepayRatio: string, boostEnabled: boolean): (string | boolean)[];
|
|
14
14
|
};
|
|
15
15
|
export declare const chickenBondsEncode: {
|
|
16
16
|
rebond(bondId: number): string[];
|
|
17
17
|
};
|
|
18
|
+
export declare const aaveV2Encode: {
|
|
19
|
+
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
20
|
+
};
|
|
18
21
|
export declare const aaveV3Encode: {
|
|
19
|
-
leverageManagement(
|
|
22
|
+
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string;
|
|
20
23
|
closeToAsset(strategyOrBundleId: number, isBundle: boolean | undefined, triggerData: {
|
|
21
24
|
baseTokenAddress: EthereumAddress;
|
|
22
25
|
quoteTokenAddress: EthereumAddress;
|
|
@@ -29,18 +32,21 @@ export declare const aaveV3Encode: {
|
|
|
29
32
|
debtAssetId: number;
|
|
30
33
|
}): (number | boolean | string[])[];
|
|
31
34
|
};
|
|
35
|
+
export declare const compoundV2Encode: {
|
|
36
|
+
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
37
|
+
};
|
|
32
38
|
export declare const compoundV3Encode: {
|
|
33
|
-
leverageManagement(market: EthereumAddress, baseToken: EthereumAddress,
|
|
39
|
+
leverageManagement(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string[];
|
|
34
40
|
};
|
|
35
41
|
export declare const morphoAaveV2Encode: {
|
|
36
|
-
leverageManagement(
|
|
42
|
+
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
37
43
|
};
|
|
38
44
|
export declare const exchangeEncode: {
|
|
39
45
|
dca(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, timestamp: number, interval: number, network: number): (boolean | string[] | Strategies.MainnetIds | Strategies.OptimismIds | Strategies.ArbitrumIds)[];
|
|
40
46
|
limitOrder(fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, targetPrice: string, goodUntil: string, orderType: number): string[];
|
|
41
47
|
};
|
|
42
48
|
export declare const sparkEncode: {
|
|
43
|
-
leverageManagement(
|
|
49
|
+
leverageManagement(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string;
|
|
44
50
|
closeToAsset(strategyOrBundleId: number, isBundle: boolean | undefined, triggerData: {
|
|
45
51
|
baseTokenAddress: EthereumAddress;
|
|
46
52
|
quoteTokenAddress: EthereumAddress;
|