impermax-sdk 2.1.71 → 2.1.72
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.
|
@@ -128,6 +128,8 @@ class OffchainLendingPool {
|
|
|
128
128
|
const rewards = [];
|
|
129
129
|
const stakedTotalSupply = parseFloat(lendingPoolData.pair.stakedTotalSupply);
|
|
130
130
|
const underlyingLPPrice = yield this.getUnderlyingLPPrice(true);
|
|
131
|
+
if (!lendingPoolData.pair.rewards)
|
|
132
|
+
return rewards;
|
|
131
133
|
for (const reward of lendingPoolData.pair.rewards) {
|
|
132
134
|
const multiplier = farm === farms_1.Farms.traderJoeV2 ? 0.5 : 1;
|
|
133
135
|
const periodFinish = parseInt(reward.periodFinish);
|
|
@@ -164,8 +164,10 @@ class OffchainPriceHelper {
|
|
|
164
164
|
const lendingPool = lendingPoolsData[factory][id];
|
|
165
165
|
this.addPriceIfMissing(offchainTokenPrice, lendingPool.borrowable0.underlying);
|
|
166
166
|
this.addPriceIfMissing(offchainTokenPrice, lendingPool.borrowable1.underlying);
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
if (lendingPool.pair.rewards) {
|
|
168
|
+
for (const reward of lendingPool.pair.rewards) {
|
|
169
|
+
this.addPriceIfMissing(offchainTokenPrice, reward.rewardsToken);
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
}
|
|
@@ -34,17 +34,6 @@ class PonderQueryBuilder {
|
|
|
34
34
|
name
|
|
35
35
|
decimals
|
|
36
36
|
derivedUSD
|
|
37
|
-
}`;
|
|
38
|
-
const distributorStr = `{
|
|
39
|
-
id
|
|
40
|
-
}`;
|
|
41
|
-
const farmingPoolStr = `{
|
|
42
|
-
epochAmount
|
|
43
|
-
epochBegin
|
|
44
|
-
segmentLength
|
|
45
|
-
vestingBegin
|
|
46
|
-
sharePercentage
|
|
47
|
-
distributor ${distributorStr}
|
|
48
37
|
}`;
|
|
49
38
|
const borrowableStr = `{
|
|
50
39
|
id
|
|
@@ -60,7 +49,6 @@ class PonderQueryBuilder {
|
|
|
60
49
|
accrualTimestamp
|
|
61
50
|
exchangeRate
|
|
62
51
|
borrowTracker
|
|
63
|
-
farmingPool ${farmingPoolStr}
|
|
64
52
|
}`;
|
|
65
53
|
const collateralStr = `{
|
|
66
54
|
id
|
|
@@ -74,14 +62,6 @@ class PonderQueryBuilder {
|
|
|
74
62
|
dexFactory
|
|
75
63
|
token1Price
|
|
76
64
|
token0Price
|
|
77
|
-
rewards {
|
|
78
|
-
items {
|
|
79
|
-
id
|
|
80
|
-
rewardRate
|
|
81
|
-
rewardsToken ${tokenStr}
|
|
82
|
-
periodFinish
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
65
|
}`;
|
|
86
66
|
const id_in_string = (addressesFilter === null || addressesFilter === void 0 ? void 0 : addressesFilter.length) > 0 ? `id_in: ["${addressesFilter.join('","').toLowerCase()}"]` : "";
|
|
87
67
|
return (0, graphql_tag_1.default) `{
|