impermax-sdk 1.1.14 → 1.1.16
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.
|
@@ -24,6 +24,8 @@ const coingecko_ids = {
|
|
|
24
24
|
"0xe80772eaf6e2e18b651f160bc9158b2a5cafca65": "usd",
|
|
25
25
|
// Avalanche
|
|
26
26
|
"0x3712871408a829c5cd4e86da1f4ce727efcd28f6": "glacier",
|
|
27
|
+
//ZkSync
|
|
28
|
+
"0x503234f203fc7eb888eec8513210612a43cf6115": "liquity-usd",
|
|
27
29
|
};
|
|
28
30
|
class PriceHelper {
|
|
29
31
|
constructor(subgraph) {
|
|
@@ -176,6 +178,9 @@ class PriceHelper {
|
|
|
176
178
|
if (tokenAddress.toLowerCase() === '0x3712871408a829c5cd4e86da1f4ce727efcd28f6') { // fix for GLCR
|
|
177
179
|
return 0.03;
|
|
178
180
|
}
|
|
181
|
+
if (tokenAddress.toLowerCase() === '0x5756a28e2aae01f600fc2c01358395f5c1f8ad3a') { // fix for VS
|
|
182
|
+
return 0.025;
|
|
183
|
+
}
|
|
179
184
|
// try fallback on subgraph
|
|
180
185
|
const subgraphTokenPrice = yield this.getSubgraphTokenPrice();
|
|
181
186
|
return subgraphTokenPrice[tokenAddress] ? subgraphTokenPrice[tokenAddress] : 0;
|
|
@@ -431,7 +431,8 @@ function initializeTvlData() {
|
|
|
431
431
|
types_1.Networks.Avalanche,
|
|
432
432
|
types_1.Networks.Moonriver,
|
|
433
433
|
types_1.Networks.Fantom,
|
|
434
|
-
|
|
434
|
+
types_1.Networks.Canto,
|
|
435
|
+
types_1.Networks.ZksyncEra,
|
|
435
436
|
]; // exclude ropsten
|
|
436
437
|
const calls = [];
|
|
437
438
|
for (const network of networks) {
|
|
@@ -440,7 +441,19 @@ function initializeTvlData() {
|
|
|
440
441
|
calls.push(this.apolloFetcher(subgraph, query.tvlQuery()));
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
|
-
|
|
444
|
+
let results;
|
|
445
|
+
try {
|
|
446
|
+
results = yield Promise.all(calls);
|
|
447
|
+
}
|
|
448
|
+
catch (e) {
|
|
449
|
+
console.log("can't initialize TVL data");
|
|
450
|
+
return {
|
|
451
|
+
crossChainTVLUSD: 0,
|
|
452
|
+
totalBalanceUSD: 0,
|
|
453
|
+
totalSupplyUSD: 0,
|
|
454
|
+
totalBorrowsUSD: 0,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
444
457
|
let crossChainTVLUSD = 0;
|
|
445
458
|
let thisChainTVLUSD = 0;
|
|
446
459
|
let thisChainSupplyUSD = 0;
|