impermax-sdk 2.1.6 → 2.1.7
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/lib/config/subgraphs.d.ts +1 -1
- package/lib/config/subgraphs.js +173 -116
- package/lib/offchain/offchainTypes.d.ts +8 -0
- package/lib/offchain/queries/apis/ponder/index.d.ts +1 -1
- package/lib/offchain/queries/apis/ponder/index.js +42 -23
- package/lib/offchain/vault/offchainLendingVault.d.ts +3 -3
- package/lib/offchain/vault/offchainLendingVault.js +5 -2
- package/lib/offchain/vault/offchainVault.d.ts +2 -2
- package/lib/offchain/vault/offchainVault.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, NetworkFactoryIndex, NetworkIndex, NetworkVaultTypeIndex } from
|
|
1
|
+
import { Address, NetworkFactoryIndex, NetworkIndex, NetworkVaultTypeIndex } from "./types";
|
|
2
2
|
export declare const IMPERMAX_SUBGRAPH_URL: NetworkFactoryIndex<Address[]>;
|
|
3
3
|
export declare const VAULT_SUBGRAPH_URL: NetworkVaultTypeIndex<Address[]>;
|
|
4
4
|
export declare const IMPERMAX_CHEF_SUBGRAPH_URL: NetworkIndex<string>;
|
package/lib/config/subgraphs.js
CHANGED
|
@@ -5,77 +5,125 @@ const types_1 = require("./types");
|
|
|
5
5
|
exports.IMPERMAX_SUBGRAPH_URL = {
|
|
6
6
|
[types_1.Networks.Ropsten]: {},
|
|
7
7
|
[types_1.Networks.Mainnet]: {
|
|
8
|
-
[types_1.Factory.V2V1]: [
|
|
8
|
+
[types_1.Factory.V2V1]: [
|
|
9
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/Dn5WZv53V1K8LrKqqYn29hhuhpwfuFfmsrsTqMgFjrD3",
|
|
10
|
+
],
|
|
9
11
|
},
|
|
10
12
|
[types_1.Networks.Polygon]: {
|
|
11
|
-
[types_1.Factory.V2V1_1]: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[types_1.Factory.
|
|
13
|
+
[types_1.Factory.V2V1_1]: [
|
|
14
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/F3BfecWo2by5QKrwhkXwuXjyLZnQqJ1wqoejwe67KuyG",
|
|
15
|
+
],
|
|
16
|
+
[types_1.Factory.V2V2]: [
|
|
17
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/5JbuAaWwyRm78yWpRCJJS217hXXft59g9MbsjTTZnYQa",
|
|
18
|
+
],
|
|
19
|
+
[types_1.Factory.SOLV2]: [
|
|
20
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/Giwg5N4SCehmUzNwXtAQZnZvUuTjcp7cr3nzUZosRDFU",
|
|
21
|
+
],
|
|
22
|
+
[types_1.Factory.SOL_STABLE]: [
|
|
23
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/EWckMdMiZeDSGHxq2V8gZBDF549Xjr9iKkPvisqckF11",
|
|
24
|
+
],
|
|
15
25
|
},
|
|
16
26
|
[types_1.Networks.Arbitrum]: {
|
|
17
|
-
[types_1.Factory.V2V1_1]: [
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
[types_1.Factory.V2V1_1]: [
|
|
28
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/3PMyaq269mDMwhJ7E285RYD1r43x996b6xZmJSCGvtkm",
|
|
29
|
+
],
|
|
30
|
+
[types_1.Factory.V2V2]: [
|
|
31
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BkMRb8mR5zgCbjFSgau6s27pnANhR6k64RGVKUbWaZdY",
|
|
32
|
+
],
|
|
33
|
+
[types_1.Factory.SOLV2]: [
|
|
34
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/AdLbcSfG6JnpZ7RDdHNHq3bJ21waGnRi7AJ5x3YFGYFo",
|
|
35
|
+
],
|
|
20
36
|
},
|
|
21
37
|
[types_1.Networks.Avalanche]: {
|
|
22
|
-
[types_1.Factory.V2V1_2]: [
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
[types_1.Factory.V2V1_2]: [
|
|
39
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/HXhHppWXhFqgLfdmTahFj2x7F5Xq8BwADxGY3nbCUAwr",
|
|
40
|
+
],
|
|
41
|
+
[types_1.Factory.V2V2]: [
|
|
42
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/8Gz5ZGyRkSA7WBrSteeyez39AgZQsoEbtXe8GtHD7JMQ",
|
|
43
|
+
],
|
|
44
|
+
[types_1.Factory.SOLV2]: [
|
|
45
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/78e6cZp11r2coLx8YYo5y4AqzEhQXYT6sw3Bg5Tiy5XU",
|
|
46
|
+
],
|
|
25
47
|
},
|
|
26
48
|
[types_1.Networks.Mantle]: {
|
|
27
|
-
[types_1.Factory.V2V2]: [
|
|
49
|
+
[types_1.Factory.V2V2]: [
|
|
50
|
+
"https://subgraph-api.mantle.xyz/subgraphs/name/impermax-finance/impermax-mantle-v2",
|
|
51
|
+
],
|
|
28
52
|
},
|
|
29
53
|
[types_1.Networks.Moonriver]: {
|
|
30
|
-
[types_1.Factory.V2V1_2]: [
|
|
54
|
+
[types_1.Factory.V2V1_2]: [
|
|
55
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/6NqkDBwiybbB3BjErF6QGGYJCqzyhVFKpNYHQTN2j8Jn",
|
|
56
|
+
],
|
|
31
57
|
},
|
|
32
58
|
[types_1.Networks.Aurora]: {},
|
|
33
59
|
[types_1.Networks.Cronos]: {},
|
|
34
60
|
[types_1.Networks.Fantom]: {
|
|
35
|
-
[types_1.Factory.SOLV1_2]: [
|
|
36
|
-
|
|
37
|
-
|
|
61
|
+
[types_1.Factory.SOLV1_2]: [
|
|
62
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/8vssJypWas5oenzsjjQq1yLqMe7FRt2evcqZdzCNEWt7",
|
|
63
|
+
],
|
|
64
|
+
[types_1.Factory.SOLV2]: [
|
|
65
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/DJ2bTPinDji7Kwev3WjyfxRo487tJHiEEMEo8kmTMT8F",
|
|
66
|
+
],
|
|
67
|
+
[types_1.Factory.V2V2]: [
|
|
68
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/DPk9E2c9fLKF8N6rN3jcyvSrEq4VEgjdeeJcnaEKAngG",
|
|
69
|
+
],
|
|
38
70
|
},
|
|
39
71
|
[types_1.Networks.Canto]: {
|
|
40
|
-
[types_1.Factory.SOLV2]: [
|
|
72
|
+
[types_1.Factory.SOLV2]: [
|
|
73
|
+
"https://api.impermax.finance/subgraphs/name/impermax-finance/impermax-canto-solv2",
|
|
74
|
+
],
|
|
41
75
|
},
|
|
42
76
|
[types_1.Networks.ZksyncEra]: {
|
|
43
|
-
[types_1.Factory.SOLV2]: [
|
|
77
|
+
[types_1.Factory.SOLV2]: [
|
|
78
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/8YSS88X8ChDw1QvuAMtxjezSXNiYer9k9d3Uu8XFLHzX",
|
|
79
|
+
],
|
|
44
80
|
},
|
|
45
81
|
[types_1.Networks.Harmony]: {},
|
|
46
82
|
[types_1.Networks.Moonbeam]: {},
|
|
47
83
|
[types_1.Networks.Sxnetwork]: {},
|
|
48
84
|
[types_1.Networks.Blast]: {
|
|
49
|
-
[types_1.Factory.SOLV2]: [
|
|
50
|
-
|
|
85
|
+
[types_1.Factory.SOLV2]: [
|
|
86
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/4FDikpVjE2XnDJ5QcpQ1YJXWcUDiAgE7x8ErtsHh33UB",
|
|
87
|
+
],
|
|
88
|
+
[types_1.Factory.V2V2]: [
|
|
89
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/6xkrXFPJ4wqh9cy9ayP19WGr2wZVSMP3FniMjcW2LUG4",
|
|
90
|
+
],
|
|
51
91
|
},
|
|
52
92
|
[types_1.Networks.Base]: {
|
|
53
93
|
[types_1.Factory.SOLV2]: [
|
|
54
|
-
|
|
55
|
-
|
|
94
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/EjB7Dsb7WnfFf1NPPr5rbGnGmk2Jqs42nWPVHjv9997u",
|
|
95
|
+
"https://base-start-production.up.railway.app/",
|
|
56
96
|
],
|
|
57
97
|
[types_1.Factory.SOL_STABLE]: [
|
|
58
|
-
|
|
59
|
-
|
|
98
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/9wN7xinUXf8RP8dbwpkzSmCNQKfz31FDpvPEvTQyT8SL",
|
|
99
|
+
"https://base-start-production.up.railway.app/",
|
|
60
100
|
],
|
|
61
101
|
[types_1.Factory.V2V2]: [
|
|
62
|
-
|
|
63
|
-
|
|
102
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/B7xsBeef3FohKaFPcsAsviyLKaWXTqcSELjAsPj2B7iW",
|
|
103
|
+
"https://base-start-production.up.railway.app/",
|
|
64
104
|
],
|
|
65
105
|
},
|
|
66
106
|
[types_1.Networks.Scroll]: {
|
|
67
|
-
[types_1.Factory.SOLV2]: [
|
|
68
|
-
|
|
107
|
+
[types_1.Factory.SOLV2]: [
|
|
108
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/9HL6kLRt3AbQsprTvk7KZdaHunJ5GGsLdYWd27nNfCFC",
|
|
109
|
+
],
|
|
110
|
+
[types_1.Factory.SOL_STABLE]: [
|
|
111
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/C42ymmkDArE1T5wdYKwao6mntqNSjP2E34TeGusiF3sk",
|
|
112
|
+
],
|
|
69
113
|
},
|
|
70
114
|
[types_1.Networks.Optimism]: {
|
|
71
115
|
[types_1.Factory.SOLV2]: [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]
|
|
116
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/74C2pMzH3wNKf38PNheGZfSiY4FzmJoKiGtHLYa7oD2s",
|
|
117
|
+
"https://optimism-factory-production.up.railway.app/",
|
|
118
|
+
],
|
|
75
119
|
},
|
|
76
120
|
[types_1.Networks.Real]: {
|
|
77
|
-
[types_1.Factory.SOL_STABLE]: [
|
|
78
|
-
|
|
121
|
+
[types_1.Factory.SOL_STABLE]: [
|
|
122
|
+
"https://api.goldsky.com/api/public/project_cm2d5q4l4w31601vz4swb3vmi/subgraphs/impermax-finance/impermax-real-v2-stable/gn",
|
|
123
|
+
],
|
|
124
|
+
[types_1.Factory.SOLV2]: [
|
|
125
|
+
"https://api.goldsky.com/api/public/project_cm2rhb30ot9wu01to8c9h9e37/subgraphs/impermax-real-solv2/3.0/gn",
|
|
126
|
+
],
|
|
79
127
|
},
|
|
80
128
|
};
|
|
81
129
|
// TODO: Since these are part of core we should add redundancy like above, left arrays to fill
|
|
@@ -83,14 +131,18 @@ exports.VAULT_SUBGRAPH_URL = {
|
|
|
83
131
|
[types_1.Networks.Ropsten]: {},
|
|
84
132
|
[types_1.Networks.Mainnet]: {},
|
|
85
133
|
[types_1.Networks.Polygon]: {
|
|
86
|
-
[types_1.VaultType.LENDING]: [
|
|
134
|
+
[types_1.VaultType.LENDING]: [
|
|
135
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BNWJQpKBT24mYzLYZ7hdBiJpvfBoEwjSemNkQ1Rryknp",
|
|
136
|
+
],
|
|
87
137
|
[types_1.VaultType.HEDGED]: [],
|
|
88
|
-
[types_1.VaultType.LEVERAGED]: []
|
|
138
|
+
[types_1.VaultType.LEVERAGED]: [],
|
|
89
139
|
},
|
|
90
140
|
[types_1.Networks.Arbitrum]: {
|
|
91
|
-
[types_1.VaultType.LENDING]: [
|
|
141
|
+
[types_1.VaultType.LENDING]: [
|
|
142
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BhmcL1CZmw9hftXPviiTeMY7kghbbkpHZtpiHXWVhNNN",
|
|
143
|
+
],
|
|
92
144
|
[types_1.VaultType.HEDGED]: [],
|
|
93
|
-
[types_1.VaultType.LEVERAGED]: []
|
|
145
|
+
[types_1.VaultType.LEVERAGED]: [],
|
|
94
146
|
},
|
|
95
147
|
[types_1.Networks.Avalanche]: {},
|
|
96
148
|
[types_1.Networks.Moonriver]: {},
|
|
@@ -103,102 +155,107 @@ exports.VAULT_SUBGRAPH_URL = {
|
|
|
103
155
|
[types_1.Networks.Canto]: {},
|
|
104
156
|
[types_1.Networks.ZksyncEra]: {},
|
|
105
157
|
[types_1.Networks.Base]: {
|
|
106
|
-
[types_1.VaultType.LENDING]: [
|
|
158
|
+
[types_1.VaultType.LENDING]: [
|
|
159
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/2TdbQKGWPRHUwuHJgxQzh8kZ7FVpBgZaFtnbjTS6iYng",
|
|
160
|
+
"https://base-lendingvaults-production.up.railway.app/",
|
|
161
|
+
],
|
|
107
162
|
[types_1.VaultType.HEDGED]: [],
|
|
108
|
-
[types_1.VaultType.LEVERAGED]: []
|
|
163
|
+
[types_1.VaultType.LEVERAGED]: [],
|
|
109
164
|
},
|
|
110
165
|
[types_1.Networks.Mantle]: {},
|
|
111
166
|
[types_1.Networks.Scroll]: {
|
|
112
|
-
[types_1.VaultType.LENDING]: [
|
|
167
|
+
[types_1.VaultType.LENDING]: [
|
|
168
|
+
"https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BaPMX2ubiRZ4ujqTFmWyrk72fPo6yFLQ7A5Z4BLXCTFU",
|
|
169
|
+
],
|
|
113
170
|
[types_1.VaultType.HEDGED]: [],
|
|
114
|
-
[types_1.VaultType.LEVERAGED]: []
|
|
171
|
+
[types_1.VaultType.LEVERAGED]: [],
|
|
115
172
|
},
|
|
116
173
|
[types_1.Networks.Optimism]: {},
|
|
117
174
|
[types_1.Networks.Real]: {},
|
|
118
175
|
[types_1.Networks.Blast]: {},
|
|
119
176
|
};
|
|
120
177
|
exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
|
|
121
|
-
[types_1.Networks.Ropsten]:
|
|
122
|
-
[types_1.Networks.Mainnet]:
|
|
123
|
-
[types_1.Networks.Polygon]:
|
|
178
|
+
[types_1.Networks.Ropsten]: "",
|
|
179
|
+
[types_1.Networks.Mainnet]: "",
|
|
180
|
+
[types_1.Networks.Polygon]: "https://api.studio.thegraph.com/query/46041/impermax-chef-polygon/v0.0.1",
|
|
124
181
|
//[Networks.Arbitrum]: 'https://api.thegraph.com/subgraphs/name/impermax-finance/impermax-chef-arbitrum',
|
|
125
|
-
[types_1.Networks.Arbitrum]:
|
|
126
|
-
[types_1.Networks.Avalanche]:
|
|
127
|
-
[types_1.Networks.Moonriver]:
|
|
128
|
-
[types_1.Networks.Fantom]:
|
|
129
|
-
[types_1.Networks.Aurora]:
|
|
130
|
-
[types_1.Networks.Cronos]:
|
|
131
|
-
[types_1.Networks.Harmony]:
|
|
132
|
-
[types_1.Networks.Moonbeam]:
|
|
133
|
-
[types_1.Networks.Sxnetwork]:
|
|
134
|
-
[types_1.Networks.Canto]:
|
|
135
|
-
[types_1.Networks.ZksyncEra]:
|
|
136
|
-
[types_1.Networks.Blast]:
|
|
137
|
-
[types_1.Networks.Base]:
|
|
138
|
-
[types_1.Networks.Mantle]:
|
|
139
|
-
[types_1.Networks.Scroll]:
|
|
140
|
-
[types_1.Networks.Optimism]:
|
|
141
|
-
[types_1.Networks.Real]:
|
|
182
|
+
[types_1.Networks.Arbitrum]: "https://api.studio.thegraph.com/query/46041/impermax-chef-arbitrum-ibex/v0.0.1",
|
|
183
|
+
[types_1.Networks.Avalanche]: "https://api.studio.thegraph.com/query/46041/impermax-chef-avalanche/v0.0.1",
|
|
184
|
+
[types_1.Networks.Moonriver]: "https://api.studio.thegraph.com/query/46041/impermax-chef-moonriver/v0.0.1",
|
|
185
|
+
[types_1.Networks.Fantom]: "https://api.studio.thegraph.com/query/46041/impermax-chef-fantom/v0.0.1",
|
|
186
|
+
[types_1.Networks.Aurora]: "",
|
|
187
|
+
[types_1.Networks.Cronos]: "",
|
|
188
|
+
[types_1.Networks.Harmony]: "",
|
|
189
|
+
[types_1.Networks.Moonbeam]: "",
|
|
190
|
+
[types_1.Networks.Sxnetwork]: "",
|
|
191
|
+
[types_1.Networks.Canto]: "",
|
|
192
|
+
[types_1.Networks.ZksyncEra]: "",
|
|
193
|
+
[types_1.Networks.Blast]: "",
|
|
194
|
+
[types_1.Networks.Base]: "",
|
|
195
|
+
[types_1.Networks.Mantle]: "",
|
|
196
|
+
[types_1.Networks.Scroll]: "",
|
|
197
|
+
[types_1.Networks.Optimism]: "",
|
|
198
|
+
[types_1.Networks.Real]: "",
|
|
142
199
|
};
|
|
143
200
|
exports.BLOCKS_SUBGRAPH_URL = {
|
|
144
|
-
[types_1.Networks.Ropsten]:
|
|
145
|
-
[types_1.Networks.Mainnet]:
|
|
146
|
-
[types_1.Networks.Polygon]:
|
|
147
|
-
[types_1.Networks.Arbitrum]:
|
|
148
|
-
[types_1.Networks.Avalanche]:
|
|
149
|
-
[types_1.Networks.Moonriver]:
|
|
150
|
-
[types_1.Networks.Aurora]:
|
|
151
|
-
[types_1.Networks.Cronos]:
|
|
152
|
-
[types_1.Networks.Fantom]:
|
|
153
|
-
[types_1.Networks.Canto]:
|
|
154
|
-
[types_1.Networks.ZksyncEra]:
|
|
155
|
-
[types_1.Networks.Blast]:
|
|
156
|
-
[types_1.Networks.Harmony]:
|
|
157
|
-
[types_1.Networks.Moonbeam]:
|
|
158
|
-
[types_1.Networks.Sxnetwork]:
|
|
159
|
-
[types_1.Networks.Base]:
|
|
160
|
-
[types_1.Networks.Mantle]:
|
|
161
|
-
[types_1.Networks.Scroll]:
|
|
162
|
-
[types_1.Networks.Real]:
|
|
163
|
-
[types_1.Networks.Optimism]:
|
|
201
|
+
[types_1.Networks.Ropsten]: "",
|
|
202
|
+
[types_1.Networks.Mainnet]: "https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks",
|
|
203
|
+
[types_1.Networks.Polygon]: "https://api.thegraph.com/subgraphs/name/matthewlilley/polygon-blocks",
|
|
204
|
+
[types_1.Networks.Arbitrum]: "https://api.thegraph.com/subgraphs/name/sushiswap/arbitrum-blocks",
|
|
205
|
+
[types_1.Networks.Avalanche]: "https://api.thegraph.com/subgraphs/name/dasconnor/avalanche-blocks",
|
|
206
|
+
[types_1.Networks.Moonriver]: "https://api.thegraph.com/subgraphs/name/sushiswap/moonriver-blocks",
|
|
207
|
+
[types_1.Networks.Aurora]: "",
|
|
208
|
+
[types_1.Networks.Cronos]: "",
|
|
209
|
+
[types_1.Networks.Fantom]: "https://gateway.thegraph.com/api/031cf65e6bf1e03a781f69aeba9770d2/subgraphs/id/3drjZDpA9hAuYGA19ttEkhW432mVe2XHy5YarBDVYHbz",
|
|
210
|
+
[types_1.Networks.Canto]: "https://api.impermax.finance/subgraphs/name/blocklytics/canto-blocks",
|
|
211
|
+
[types_1.Networks.ZksyncEra]: "https://api.impermax.finance/subgraphs/name/blocklytics/canto-blocks",
|
|
212
|
+
[types_1.Networks.Blast]: "",
|
|
213
|
+
[types_1.Networks.Harmony]: "",
|
|
214
|
+
[types_1.Networks.Moonbeam]: "",
|
|
215
|
+
[types_1.Networks.Sxnetwork]: "",
|
|
216
|
+
[types_1.Networks.Base]: "https://api.thegraph.com/subgraphs/name/blocklytics/base-blocks",
|
|
217
|
+
[types_1.Networks.Mantle]: "",
|
|
218
|
+
[types_1.Networks.Scroll]: "",
|
|
219
|
+
[types_1.Networks.Real]: "",
|
|
220
|
+
[types_1.Networks.Optimism]: "",
|
|
164
221
|
};
|
|
165
222
|
exports.XIMX_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/impermax-finance/imx-staking";
|
|
166
223
|
exports.CONFIG_MANAGER_SUBGRAPH_URL = {
|
|
167
|
-
[types_1.Networks.Ropsten]:
|
|
168
|
-
[types_1.Networks.Mainnet]:
|
|
169
|
-
[types_1.Networks.Polygon]:
|
|
170
|
-
[types_1.Networks.Arbitrum]:
|
|
171
|
-
[types_1.Networks.Avalanche]:
|
|
172
|
-
[types_1.Networks.Moonriver]:
|
|
173
|
-
[types_1.Networks.Aurora]:
|
|
174
|
-
[types_1.Networks.Cronos]:
|
|
175
|
-
[types_1.Networks.Fantom]:
|
|
176
|
-
[types_1.Networks.Canto]:
|
|
177
|
-
[types_1.Networks.ZksyncEra]:
|
|
178
|
-
[types_1.Networks.Harmony]:
|
|
179
|
-
[types_1.Networks.Moonbeam]:
|
|
180
|
-
[types_1.Networks.Sxnetwork]:
|
|
181
|
-
[types_1.Networks.Blast]:
|
|
182
|
-
[types_1.Networks.Scroll]:
|
|
183
|
-
[types_1.Networks.Base]:
|
|
184
|
-
[types_1.Networks.Optimism]:
|
|
185
|
-
[types_1.Networks.Real]:
|
|
224
|
+
[types_1.Networks.Ropsten]: "",
|
|
225
|
+
[types_1.Networks.Mainnet]: "",
|
|
226
|
+
[types_1.Networks.Polygon]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/42W3457WecJ4foXk3tBeVpmX8MUHS3L8qXvUvhDSE6p2",
|
|
227
|
+
[types_1.Networks.Arbitrum]: "",
|
|
228
|
+
[types_1.Networks.Avalanche]: "",
|
|
229
|
+
[types_1.Networks.Moonriver]: "",
|
|
230
|
+
[types_1.Networks.Aurora]: "",
|
|
231
|
+
[types_1.Networks.Cronos]: "",
|
|
232
|
+
[types_1.Networks.Fantom]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/D6WHTfFEaUkHyLavPQM5BcivWYMe41Aj6PbdaKhKdfUm",
|
|
233
|
+
[types_1.Networks.Canto]: "",
|
|
234
|
+
[types_1.Networks.ZksyncEra]: "",
|
|
235
|
+
[types_1.Networks.Harmony]: "",
|
|
236
|
+
[types_1.Networks.Moonbeam]: "",
|
|
237
|
+
[types_1.Networks.Sxnetwork]: "",
|
|
238
|
+
[types_1.Networks.Blast]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/2ARmGYURb2DAHxfJeA1fhVUDeJpHSvCoJTDiBfmTvESN",
|
|
239
|
+
[types_1.Networks.Scroll]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/9vmJatgwfrm7MMWXy3MhAZ2bsbrbbHzik9q9f5hfzZE9",
|
|
240
|
+
[types_1.Networks.Base]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/6y4Bb2KSFsqyjbARM8EpKkqFRt62ELasVCVckg2bv7jB",
|
|
241
|
+
[types_1.Networks.Optimism]: "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/GWFrv8MNg5fpD19fxdu32G1Wt6om8qb1wbacpgHDyvC8",
|
|
242
|
+
[types_1.Networks.Real]: "https://api.goldsky.com/api/public/project_cm2d5q4l4w31601vz4swb3vmi/subgraphs/impermax-config-manager-real/1.0/gn",
|
|
186
243
|
};
|
|
187
244
|
exports.WHITELIST_SUBGRAPH_URL = {
|
|
188
|
-
[types_1.Networks.Ropsten]:
|
|
189
|
-
[types_1.Networks.Mainnet]:
|
|
190
|
-
[types_1.Networks.Polygon]:
|
|
191
|
-
[types_1.Networks.Arbitrum]:
|
|
192
|
-
[types_1.Networks.Avalanche]:
|
|
193
|
-
[types_1.Networks.Moonriver]:
|
|
194
|
-
[types_1.Networks.Aurora]:
|
|
195
|
-
[types_1.Networks.Cronos]:
|
|
196
|
-
[types_1.Networks.Fantom]:
|
|
197
|
-
[types_1.Networks.Canto]:
|
|
198
|
-
[types_1.Networks.ZksyncEra]:
|
|
199
|
-
[types_1.Networks.Harmony]:
|
|
200
|
-
[types_1.Networks.Moonbeam]:
|
|
201
|
-
[types_1.Networks.Sxnetwork]:
|
|
202
|
-
[types_1.Networks.Mantle]:
|
|
203
|
-
[types_1.Networks.Base]:
|
|
245
|
+
[types_1.Networks.Ropsten]: "",
|
|
246
|
+
[types_1.Networks.Mainnet]: "",
|
|
247
|
+
[types_1.Networks.Polygon]: "https://api.studio.thegraph.com/query/46041/impermax-whitelist-polygon/v0.0.1",
|
|
248
|
+
[types_1.Networks.Arbitrum]: "",
|
|
249
|
+
[types_1.Networks.Avalanche]: "",
|
|
250
|
+
[types_1.Networks.Moonriver]: "",
|
|
251
|
+
[types_1.Networks.Aurora]: "",
|
|
252
|
+
[types_1.Networks.Cronos]: "",
|
|
253
|
+
[types_1.Networks.Fantom]: "",
|
|
254
|
+
[types_1.Networks.Canto]: "",
|
|
255
|
+
[types_1.Networks.ZksyncEra]: "",
|
|
256
|
+
[types_1.Networks.Harmony]: "",
|
|
257
|
+
[types_1.Networks.Moonbeam]: "",
|
|
258
|
+
[types_1.Networks.Sxnetwork]: "",
|
|
259
|
+
[types_1.Networks.Mantle]: "",
|
|
260
|
+
[types_1.Networks.Base]: "https://api.studio.thegraph.com/query/46041/impermax-whitelist-base/v0.0.1",
|
|
204
261
|
};
|
|
@@ -159,6 +159,13 @@ export interface XimxData {
|
|
|
159
159
|
/**
|
|
160
160
|
* Lending vault
|
|
161
161
|
**/
|
|
162
|
+
export interface VaultBorrowable {
|
|
163
|
+
pair: string;
|
|
164
|
+
address: Address;
|
|
165
|
+
pairAddress: Address;
|
|
166
|
+
token0: Address;
|
|
167
|
+
token1: Address;
|
|
168
|
+
}
|
|
162
169
|
export interface LendingVaultData extends PoolTokenData {
|
|
163
170
|
underlying: TokenData;
|
|
164
171
|
supplyRate: string;
|
|
@@ -166,6 +173,7 @@ export interface LendingVaultData extends PoolTokenData {
|
|
|
166
173
|
availableLiquidity: string;
|
|
167
174
|
lastUpdate: string;
|
|
168
175
|
vaultType: VaultType.LENDING;
|
|
176
|
+
borrowables: VaultBorrowable[];
|
|
169
177
|
}
|
|
170
178
|
export interface HedgedVaultData extends PoolTokenData {
|
|
171
179
|
vaultType: VaultType.HEDGED;
|
|
@@ -6,8 +6,8 @@ export declare class PonderQueryBuilder implements IQueryBuilder {
|
|
|
6
6
|
lendingPoolsQuery(factory: Factory, addressesFilter: Address[], network: Networks): import("graphql").DocumentNode;
|
|
7
7
|
userQuery(account: Address, network: Networks, factory: Factory): import("graphql").DocumentNode;
|
|
8
8
|
tvlQuery(): import("graphql").DocumentNode;
|
|
9
|
-
vaultsUserQuery(account: Address): import("graphql").DocumentNode;
|
|
10
9
|
vaultsQuery(vaultType: VaultType, addressesFilter: Address[]): import("graphql").DocumentNode;
|
|
10
|
+
vaultsUserQuery(account: Address): import("graphql").DocumentNode;
|
|
11
11
|
proposalsMetaQuery(rangeBegin: any, rangeLength: any, descending: any): import("graphql").DocumentNode;
|
|
12
12
|
proposalQuery(id: number): import("graphql").DocumentNode;
|
|
13
13
|
ximxQuery(): import("graphql").DocumentNode;
|
|
@@ -181,31 +181,18 @@ class PonderQueryBuilder {
|
|
|
181
181
|
/*-----------------------------*
|
|
182
182
|
* Lending vaults
|
|
183
183
|
*-----------------------------*/
|
|
184
|
-
vaultsUserQuery(account) {
|
|
185
|
-
return (0, graphql_tag_1.default) `{
|
|
186
|
-
user(id: "${account.toLowerCase()}") {
|
|
187
|
-
positions(first:1000) {
|
|
188
|
-
tokenBalance
|
|
189
|
-
lastExchangeRate
|
|
190
|
-
cumulativeEarnings
|
|
191
|
-
lendingVault {
|
|
192
|
-
id
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}`;
|
|
197
|
-
}
|
|
198
184
|
vaultsQuery(vaultType, addressesFilter) {
|
|
199
185
|
// do something here for difference kind of vault type, currently only lending
|
|
200
186
|
const id_in_string = addressesFilter.length > 0 ? `where: {id_in: ["${addressesFilter.join('","').toLowerCase()}"]}` : "";
|
|
201
187
|
return (0, graphql_tag_1.default) `{
|
|
202
|
-
lendingVaults(
|
|
188
|
+
lendingVaults(limit: 1000, ${id_in_string}) {
|
|
189
|
+
items {
|
|
203
190
|
id
|
|
204
191
|
underlying {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
192
|
+
id
|
|
193
|
+
symbol
|
|
194
|
+
name
|
|
195
|
+
decimals
|
|
209
196
|
}
|
|
210
197
|
totalBalance
|
|
211
198
|
totalSupply
|
|
@@ -214,14 +201,46 @@ class PonderQueryBuilder {
|
|
|
214
201
|
exchangeRate
|
|
215
202
|
availableLiquidity
|
|
216
203
|
lastUpdate
|
|
204
|
+
borrowables {
|
|
205
|
+
items {
|
|
206
|
+
address
|
|
207
|
+
pair
|
|
208
|
+
pairAddress
|
|
209
|
+
token0
|
|
210
|
+
token1
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
217
214
|
}
|
|
218
215
|
_meta {
|
|
219
|
-
|
|
220
|
-
number
|
|
221
|
-
}
|
|
222
|
-
hasIndexingErrors
|
|
216
|
+
status
|
|
223
217
|
}
|
|
224
218
|
}`;
|
|
219
|
+
}
|
|
220
|
+
vaultsUserQuery(account) {
|
|
221
|
+
return (0, graphql_tag_1.default) `{
|
|
222
|
+
user(id: "${account.toLowerCase()}") {
|
|
223
|
+
positions(limit: 1000) {
|
|
224
|
+
items {
|
|
225
|
+
cumulativeEarnings
|
|
226
|
+
tokenBalance
|
|
227
|
+
lastExchangeRate
|
|
228
|
+
lendingVault {
|
|
229
|
+
id
|
|
230
|
+
borrowables {
|
|
231
|
+
items {
|
|
232
|
+
id
|
|
233
|
+
pair
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
_meta {
|
|
241
|
+
status
|
|
242
|
+
}
|
|
243
|
+
}`;
|
|
225
244
|
}
|
|
226
245
|
/*-----------------------------*
|
|
227
246
|
* Config Manager
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Offchain from "../index";
|
|
2
|
-
import { Address } from
|
|
2
|
+
import { Address } from "../../config/types";
|
|
3
3
|
import OffchainVault from "./offchainVault";
|
|
4
|
-
import {
|
|
4
|
+
import { VaultBorrowable } from "../offchainTypes";
|
|
5
5
|
export declare enum RiskLevel {
|
|
6
6
|
LOW = 0,
|
|
7
7
|
MEDIUM = 1,
|
|
@@ -12,5 +12,5 @@ export default class OffchainLendingVault extends OffchainVault {
|
|
|
12
12
|
getRiskLevel(): Promise<RiskLevel>;
|
|
13
13
|
getAvailableLiquidity(): Promise<number>;
|
|
14
14
|
getAvailableLiquidityUSD(): Promise<number>;
|
|
15
|
-
getBorrowables(): Promise<Array<
|
|
15
|
+
getBorrowables(): Promise<Array<VaultBorrowable>>;
|
|
16
16
|
}
|
|
@@ -44,10 +44,13 @@ class OffchainLendingVault extends offchainVault_1.default {
|
|
|
44
44
|
return availableLiquidity * tokenPrice;
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
//
|
|
47
|
+
// See the LendingVaultData type in ../offchainTypes.ts
|
|
48
48
|
getBorrowables() {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
|
|
50
|
+
const vaultData = (yield this.getPoolTokenData());
|
|
51
|
+
if (!vaultData.borrowables)
|
|
52
|
+
return [];
|
|
53
|
+
return vaultData.borrowables;
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Offchain from "../index";
|
|
2
2
|
import { Address, VaultType } from '../../config/types';
|
|
3
3
|
import OffchainPoolToken from '../offchainPoolToken';
|
|
4
|
-
import {
|
|
4
|
+
import { VaultData } from '../offchainTypes';
|
|
5
5
|
export declare enum VaultRisk {
|
|
6
6
|
VERY_LOW = "very-low",
|
|
7
7
|
LOW = "low",
|
|
@@ -26,7 +26,7 @@ export default class OffchainVault extends OffchainPoolToken {
|
|
|
26
26
|
getVaultType: () => VaultType;
|
|
27
27
|
getVaultRisk: () => VaultRisk;
|
|
28
28
|
getVaultStatus: () => VaultStatus;
|
|
29
|
-
getPoolTokenData(): Promise<
|
|
29
|
+
getPoolTokenData(): Promise<VaultData>;
|
|
30
30
|
private getTotalSupply;
|
|
31
31
|
private getLastUpdate;
|
|
32
32
|
private getAccrueFactor;
|
|
@@ -40,6 +40,7 @@ class OffchainVault extends offchainPoolToken_1.default {
|
|
|
40
40
|
this.offchain = offchain;
|
|
41
41
|
this.vaultAddress = vaultAddress;
|
|
42
42
|
}
|
|
43
|
+
// NOTE: Rename this to `getVaultData` ?
|
|
43
44
|
getPoolTokenData() {
|
|
44
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
46
|
return this.offchain.getVaultData(this.vaultAddress);
|