@defisaver/positions-sdk 2.1.72-gho-plasma-dev → 2.1.72-gho-plasma-1-dev
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.
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.EligibilityMapping = exports.isEligibleForAaveV3ArbitrumETHLSBorrow = exports.isEligibleForAaveV3ArbitrumEthSupply = exports.isEligibleForEthenaGHORewards = exports.isEligibleForEthenaUSDeRewards = void 0;
|
|
7
7
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
8
8
|
const common_1 = require("../types/common");
|
|
9
|
-
const isEligibleForEthenaPairRewards = (usedAssets, { healthRatio }, { baseSymbol, pairSymbol, allowedBorrowAssets, maxHealthRatio, rewardSymbol,
|
|
9
|
+
const isEligibleForEthenaPairRewards = (usedAssets, { healthRatio }, { baseSymbol, pairSymbol, allowedBorrowAssets, maxHealthRatio, rewardSymbol, }) => {
|
|
10
10
|
var _a, _b, _c;
|
|
11
11
|
const baseSuppliedUsd = ((_a = usedAssets[baseSymbol]) === null || _a === void 0 ? void 0 : _a.suppliedUsd) || '0';
|
|
12
12
|
const pairSuppliedUsd = ((_b = usedAssets[pairSymbol]) === null || _b === void 0 ? void 0 : _b.suppliedUsd) || '0';
|
package/cjs/staking/staking.js
CHANGED
|
@@ -72,7 +72,7 @@ exports.STAKING_ASSETS = [
|
|
|
72
72
|
'cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH',
|
|
73
73
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
74
74
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
75
|
-
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr',
|
|
75
|
+
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
76
76
|
];
|
|
77
77
|
exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaiter(void 0, [asset_1, ...args_1], void 0, function* (asset, network = common_1.NetworkNumber.Eth) {
|
|
78
78
|
try {
|
|
@@ -117,7 +117,7 @@ exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaite
|
|
|
117
117
|
if (asset === 'tETH')
|
|
118
118
|
return yield getApyFromDfsApi('tETH');
|
|
119
119
|
if (asset === 'USDe')
|
|
120
|
-
return yield getApyFromDfsApi('USDe');
|
|
120
|
+
return yield getApyFromDfsApi('USDe', network);
|
|
121
121
|
if (asset === 'PT sUSDe Nov')
|
|
122
122
|
return yield getApyFromDfsApi('PT sUSDe Nov', network);
|
|
123
123
|
if (asset === 'PT USDe Nov')
|
|
@@ -146,6 +146,8 @@ exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaite
|
|
|
146
146
|
return yield getApyFromDfsApi('PT USDe May', network);
|
|
147
147
|
if (asset === 'PT srUSDe Apr')
|
|
148
148
|
return yield getApyFromDfsApi('PT srUSDe Apr', network);
|
|
149
|
+
if (asset === 'GHO')
|
|
150
|
+
return yield getApyFromDfsApi('GHO', network);
|
|
149
151
|
}
|
|
150
152
|
catch (e) {
|
|
151
153
|
console.error(`Failed to fetch APY for ${asset}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Dec from 'decimal.js';
|
|
2
2
|
import { IncentiveEligibilityId } from '../types/common';
|
|
3
|
-
const isEligibleForEthenaPairRewards = (usedAssets, { healthRatio }, { baseSymbol, pairSymbol, allowedBorrowAssets, maxHealthRatio, rewardSymbol,
|
|
3
|
+
const isEligibleForEthenaPairRewards = (usedAssets, { healthRatio }, { baseSymbol, pairSymbol, allowedBorrowAssets, maxHealthRatio, rewardSymbol, }) => {
|
|
4
4
|
var _a, _b, _c;
|
|
5
5
|
const baseSuppliedUsd = ((_a = usedAssets[baseSymbol]) === null || _a === void 0 ? void 0 : _a.suppliedUsd) || '0';
|
|
6
6
|
const pairSuppliedUsd = ((_b = usedAssets[pairSymbol]) === null || _b === void 0 ? void 0 : _b.suppliedUsd) || '0';
|
package/esm/staking/staking.js
CHANGED
|
@@ -66,7 +66,7 @@ export const STAKING_ASSETS = [
|
|
|
66
66
|
'cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH',
|
|
67
67
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
68
68
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
69
|
-
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr',
|
|
69
|
+
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
70
70
|
];
|
|
71
71
|
export const getStakingApy = memoize((asset_1, ...args_1) => __awaiter(void 0, [asset_1, ...args_1], void 0, function* (asset, network = NetworkNumber.Eth) {
|
|
72
72
|
try {
|
|
@@ -111,7 +111,7 @@ export const getStakingApy = memoize((asset_1, ...args_1) => __awaiter(void 0, [
|
|
|
111
111
|
if (asset === 'tETH')
|
|
112
112
|
return yield getApyFromDfsApi('tETH');
|
|
113
113
|
if (asset === 'USDe')
|
|
114
|
-
return yield getApyFromDfsApi('USDe');
|
|
114
|
+
return yield getApyFromDfsApi('USDe', network);
|
|
115
115
|
if (asset === 'PT sUSDe Nov')
|
|
116
116
|
return yield getApyFromDfsApi('PT sUSDe Nov', network);
|
|
117
117
|
if (asset === 'PT USDe Nov')
|
|
@@ -140,6 +140,8 @@ export const getStakingApy = memoize((asset_1, ...args_1) => __awaiter(void 0, [
|
|
|
140
140
|
return yield getApyFromDfsApi('PT USDe May', network);
|
|
141
141
|
if (asset === 'PT srUSDe Apr')
|
|
142
142
|
return yield getApyFromDfsApi('PT srUSDe Apr', network);
|
|
143
|
+
if (asset === 'GHO')
|
|
144
|
+
return yield getApyFromDfsApi('GHO', network);
|
|
143
145
|
}
|
|
144
146
|
catch (e) {
|
|
145
147
|
console.error(`Failed to fetch APY for ${asset}`);
|
package/package.json
CHANGED
|
@@ -7,7 +7,6 @@ type EthenaPairEligibilityConfig = {
|
|
|
7
7
|
allowedBorrowAssets: string[];
|
|
8
8
|
maxHealthRatio: string; // exclusive upper bound
|
|
9
9
|
rewardSymbol: string;
|
|
10
|
-
requirePositiveBorrowSymbol?: string;
|
|
11
10
|
};
|
|
12
11
|
|
|
13
12
|
const isEligibleForEthenaPairRewards = (
|
|
@@ -19,7 +18,6 @@ const isEligibleForEthenaPairRewards = (
|
|
|
19
18
|
allowedBorrowAssets,
|
|
20
19
|
maxHealthRatio,
|
|
21
20
|
rewardSymbol,
|
|
22
|
-
requirePositiveBorrowSymbol,
|
|
23
21
|
}: EthenaPairEligibilityConfig,
|
|
24
22
|
) => {
|
|
25
23
|
const baseSuppliedUsd = usedAssets[baseSymbol]?.suppliedUsd || '0';
|
package/src/staking/staking.ts
CHANGED
|
@@ -64,7 +64,7 @@ export const STAKING_ASSETS = [
|
|
|
64
64
|
'cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH',
|
|
65
65
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
66
66
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
67
|
-
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr',
|
|
67
|
+
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
68
68
|
];
|
|
69
69
|
|
|
70
70
|
export const getStakingApy = memoize(async (asset: string, network: number = NetworkNumber.Eth) => {
|
|
@@ -89,7 +89,7 @@ export const getStakingApy = memoize(async (asset: string, network: number = Net
|
|
|
89
89
|
if (asset === 'PT sUSDe Sep') return await getApyFromDfsApi('PT sUSDe Sep', network);
|
|
90
90
|
if (asset === 'PT USDe Sep') return await getApyFromDfsApi('PT USDe Sep', network);
|
|
91
91
|
if (asset === 'tETH') return await getApyFromDfsApi('tETH');
|
|
92
|
-
if (asset === 'USDe') return await getApyFromDfsApi('USDe');
|
|
92
|
+
if (asset === 'USDe') return await getApyFromDfsApi('USDe', network);
|
|
93
93
|
if (asset === 'PT sUSDe Nov') return await getApyFromDfsApi('PT sUSDe Nov', network);
|
|
94
94
|
if (asset === 'PT USDe Nov') return await getApyFromDfsApi('PT USDe Nov', network);
|
|
95
95
|
if (asset === 'PT USDe Jan') return await getApyFromDfsApi('PT USDe Jan', network);
|
|
@@ -104,6 +104,7 @@ export const getStakingApy = memoize(async (asset: string, network: number = Net
|
|
|
104
104
|
if (asset === 'PT sUSDe May') return await getApyFromDfsApi('PT sUSDe May', network);
|
|
105
105
|
if (asset === 'PT USDe May') return await getApyFromDfsApi('PT USDe May', network);
|
|
106
106
|
if (asset === 'PT srUSDe Apr') return await getApyFromDfsApi('PT srUSDe Apr', network);
|
|
107
|
+
if (asset === 'GHO') return await getApyFromDfsApi('GHO', network);
|
|
107
108
|
} catch (e) {
|
|
108
109
|
console.error(`Failed to fetch APY for ${asset}`);
|
|
109
110
|
}
|