@defisaver/positions-sdk 2.1.71 → 2.1.72-aave-v4-3-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.
- package/cjs/aaveV4/index.d.ts +7 -0
- package/cjs/aaveV4/index.js +293 -0
- package/cjs/aaveV4/lend.d.ts +45 -0
- package/cjs/aaveV4/lend.js +141 -0
- package/cjs/config/contracts.d.ts +1551 -0
- package/cjs/config/contracts.js +9 -0
- package/cjs/contracts.d.ts +32741 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/aaveV4Helpers/index.d.ts +12 -0
- package/cjs/helpers/aaveV4Helpers/index.js +117 -0
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/cjs/markets/aaveV4/index.d.ts +28 -0
- package/cjs/markets/aaveV4/index.js +140 -0
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/portfolio/index.js +20 -0
- package/cjs/staking/eligibility.d.ts +6 -0
- package/cjs/staking/eligibility.js +37 -19
- package/cjs/staking/staking.js +4 -2
- package/cjs/types/aaveV4.d.ts +153 -0
- package/cjs/types/aaveV4.js +19 -0
- package/cjs/types/common.d.ts +2 -1
- package/cjs/types/common.js +1 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/portfolio.d.ts +4 -0
- package/esm/aaveV4/index.d.ts +7 -0
- package/esm/aaveV4/index.js +250 -0
- package/esm/aaveV4/lend.d.ts +45 -0
- package/esm/aaveV4/lend.js +134 -0
- package/esm/config/contracts.d.ts +1551 -0
- package/esm/config/contracts.js +8 -0
- package/esm/contracts.d.ts +32741 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/aaveV4Helpers/index.d.ts +12 -0
- package/esm/helpers/aaveV4Helpers/index.js +108 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/markets/aave/marketAssets.js +1 -1
- package/esm/markets/aaveV4/index.d.ts +28 -0
- package/esm/markets/aaveV4/index.js +122 -0
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/portfolio/index.js +21 -1
- package/esm/staking/eligibility.d.ts +6 -0
- package/esm/staking/eligibility.js +35 -18
- package/esm/staking/staking.js +4 -2
- package/esm/types/aaveV4.d.ts +153 -0
- package/esm/types/aaveV4.js +16 -0
- package/esm/types/common.d.ts +2 -1
- package/esm/types/common.js +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/portfolio.d.ts +4 -0
- package/package.json +2 -2
- package/src/aaveV4/index.ts +286 -0
- package/src/aaveV4/lend.ts +180 -0
- package/src/config/contracts.ts +9 -1
- package/src/contracts.ts +3 -1
- package/src/helpers/aaveV4Helpers/index.ts +133 -0
- package/src/helpers/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/markets/aave/marketAssets.ts +1 -1
- package/src/markets/aaveV4/index.ts +149 -0
- package/src/markets/index.ts +6 -1
- package/src/portfolio/index.ts +20 -0
- package/src/staking/eligibility.ts +67 -15
- package/src/staking/staking.ts +3 -2
- package/src/types/aaveV4.ts +169 -0
- package/src/types/common.ts +1 -0
- package/src/types/index.ts +2 -1
- package/src/types/portfolio.ts +4 -0
package/esm/contracts.js
CHANGED
|
@@ -132,3 +132,4 @@ export const StkAAVEViem = createViemContractFromConfigFunc('StkAAVE');
|
|
|
132
132
|
export const YearnViewContractViem = createViemContractFromConfigFunc('YearnView');
|
|
133
133
|
export const MakerDsrContractViem = createViemContractFromConfigFunc('MakerDsr');
|
|
134
134
|
export const SkySavingsContractView = createViemContractFromConfigFunc('SkySavings');
|
|
135
|
+
export const AaveV4ViewContractViem = createViemContractFromConfigFunc('AaveV4View');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AaveV4AggregatedPositionData, AaveV4AssetsData, AaveV4ReserveAssetData, AaveV4UsedReserveAsset, AaveV4UsedReserveAssets, LeverageType, NetworkNumber } from '../../types';
|
|
2
|
+
export declare const aaveV4GetCollateralFactor: (assetData: AaveV4ReserveAssetData, usedAssetData: AaveV4UsedReserveAsset, useUserCollateralFactor?: boolean) => number;
|
|
3
|
+
export declare const isLeveragedPosAaveV4: (usedAssets: AaveV4UsedReserveAssets, dustLimit?: number) => {
|
|
4
|
+
leveragedType: LeverageType;
|
|
5
|
+
leveragedAsset: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const aaveV4GetAggregatedPositionData: ({ usedAssets, assetsData, network, useUserCollateralFactor, }: {
|
|
8
|
+
usedAssets: AaveV4UsedReserveAssets;
|
|
9
|
+
assetsData: AaveV4AssetsData;
|
|
10
|
+
network: NetworkNumber;
|
|
11
|
+
useUserCollateralFactor?: boolean;
|
|
12
|
+
}) => AaveV4AggregatedPositionData;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import Dec from 'decimal.js';
|
|
2
|
+
import { calcLeverageLiqPrice, getAssetsTotal, STABLE_ASSETS } from '../../moneymarket';
|
|
3
|
+
import { LeverageType, } from '../../types';
|
|
4
|
+
export const aaveV4GetCollateralFactor = (assetData, usedAssetData, useUserCollateralFactor = false) => (useUserCollateralFactor ? usedAssetData.collateralFactor : assetData.collateralFactor);
|
|
5
|
+
export const isLeveragedPosAaveV4 = (usedAssets, dustLimit = 5) => {
|
|
6
|
+
let borrowUnstable = 0;
|
|
7
|
+
let supplyStable = 0;
|
|
8
|
+
let borrowStable = 0;
|
|
9
|
+
let supplyUnstable = 0;
|
|
10
|
+
let longAsset = '';
|
|
11
|
+
let shortAsset = '';
|
|
12
|
+
Object.values(usedAssets).forEach(({ symbol, suppliedUsd, borrowedUsd, collateral, reserveId, }) => {
|
|
13
|
+
const spokeAsset = `${symbol}-${reserveId}`;
|
|
14
|
+
const isSupplied = (+suppliedUsd) > dustLimit; // ignore dust like <limit leftover supply
|
|
15
|
+
const isBorrowed = (+borrowedUsd) > dustLimit; // ignore dust like <limit leftover supply
|
|
16
|
+
if (isSupplied && STABLE_ASSETS.includes(symbol) && collateral)
|
|
17
|
+
supplyStable += 1;
|
|
18
|
+
if (isBorrowed && STABLE_ASSETS.includes(symbol))
|
|
19
|
+
borrowStable += 1;
|
|
20
|
+
if (isBorrowed && !STABLE_ASSETS.includes(symbol)) {
|
|
21
|
+
borrowUnstable += 1;
|
|
22
|
+
shortAsset = spokeAsset;
|
|
23
|
+
}
|
|
24
|
+
if (isSupplied && !STABLE_ASSETS.includes(symbol) && collateral) {
|
|
25
|
+
supplyUnstable += 1;
|
|
26
|
+
longAsset = spokeAsset;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const isLong = borrowStable > 0 && borrowUnstable === 0 && supplyUnstable === 1 && supplyStable === 0;
|
|
30
|
+
const isShort = supplyStable > 0 && supplyUnstable === 0 && borrowUnstable === 1 && borrowStable === 0;
|
|
31
|
+
const isVolatilePair = supplyUnstable === 1 && borrowUnstable === 1 && supplyStable === 0 && borrowStable === 0;
|
|
32
|
+
if (isLong) {
|
|
33
|
+
return {
|
|
34
|
+
leveragedType: LeverageType.Long,
|
|
35
|
+
leveragedAsset: longAsset,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (isShort) {
|
|
39
|
+
return {
|
|
40
|
+
leveragedType: LeverageType.Short,
|
|
41
|
+
leveragedAsset: shortAsset,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (isVolatilePair) {
|
|
45
|
+
return {
|
|
46
|
+
leveragedType: LeverageType.VolatilePair,
|
|
47
|
+
leveragedAsset: longAsset,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
leveragedType: LeverageType.None,
|
|
52
|
+
leveragedAsset: '',
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export const aaveV4GetAggregatedPositionData = ({ usedAssets, assetsData, network, useUserCollateralFactor = false, }) => {
|
|
56
|
+
const payload = {};
|
|
57
|
+
payload.suppliedUsd = getAssetsTotal(usedAssets, ({ isSupplied }) => isSupplied, ({ suppliedUsd }) => suppliedUsd);
|
|
58
|
+
payload.suppliedCollateralUsd = getAssetsTotal(usedAssets, ({ isSupplied, collateral }) => isSupplied && collateral, ({ suppliedUsd }) => suppliedUsd);
|
|
59
|
+
payload.borrowLimitUsd = getAssetsTotal(usedAssets, ({ isSupplied, collateral }) => isSupplied && collateral, ({ symbol, suppliedUsd, reserveId }) => new Dec(suppliedUsd).mul(aaveV4GetCollateralFactor(assetsData[`${symbol}-${reserveId}`], usedAssets[`${symbol}-${reserveId}`], useUserCollateralFactor)));
|
|
60
|
+
payload.liquidationLimitUsd = payload.borrowLimitUsd;
|
|
61
|
+
payload.borrowedUsd = getAssetsTotal(usedAssets, ({ isBorrowed }) => isBorrowed, ({ borrowedUsd }) => borrowedUsd);
|
|
62
|
+
payload.drawnUsd = getAssetsTotal(usedAssets, ({ isBorrowed }) => isBorrowed, ({ drawnUsd }) => drawnUsd);
|
|
63
|
+
payload.premiumUsd = getAssetsTotal(usedAssets, ({ isBorrowed }) => isBorrowed, ({ premiumUsd }) => premiumUsd);
|
|
64
|
+
const leftToBorrowUsd = new Dec(payload.borrowLimitUsd).sub(payload.borrowedUsd);
|
|
65
|
+
payload.leftToBorrowUsd = leftToBorrowUsd.lte('0') ? '0' : leftToBorrowUsd.toString();
|
|
66
|
+
payload.ratio = +payload.suppliedUsd ? new Dec(payload.borrowLimitUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
|
|
67
|
+
payload.collRatio = +payload.suppliedUsd ? new Dec(payload.suppliedCollateralUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
|
|
68
|
+
payload.liqRatio = new Dec(payload.borrowLimitUsd).div(payload.liquidationLimitUsd).toString();
|
|
69
|
+
payload.liqPercent = new Dec(payload.borrowLimitUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
70
|
+
const { leveragedType, leveragedAsset } = isLeveragedPosAaveV4(usedAssets);
|
|
71
|
+
payload.leveragedType = leveragedType;
|
|
72
|
+
payload.leveragedAsset = leveragedAsset;
|
|
73
|
+
payload.liquidationPrice = '';
|
|
74
|
+
if (leveragedType !== '') {
|
|
75
|
+
const leveragedAssetData = assetsData[leveragedAsset];
|
|
76
|
+
let assetPrice = (leveragedAssetData === null || leveragedAssetData === void 0 ? void 0 : leveragedAssetData.price) || '0';
|
|
77
|
+
if (leveragedType === LeverageType.VolatilePair) {
|
|
78
|
+
const borrowedAsset = Object.values(usedAssets).find(({ borrowedUsd }) => +borrowedUsd > 0);
|
|
79
|
+
const borrowedAssetPrice = assetsData[`${borrowedAsset.symbol}-${borrowedAsset.reserveId}`].price;
|
|
80
|
+
const leveragedAssetPrice = assetsData[leveragedAsset].price;
|
|
81
|
+
const isReverse = new Dec(leveragedAssetPrice).lt(borrowedAssetPrice);
|
|
82
|
+
if (isReverse) {
|
|
83
|
+
payload.leveragedType = LeverageType.VolatilePairReverse;
|
|
84
|
+
payload.currentVolatilePairRatio = new Dec(borrowedAssetPrice).div(leveragedAssetPrice).toDP(18).toString();
|
|
85
|
+
assetPrice = new Dec(borrowedAssetPrice).div(assetPrice).toString();
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
assetPrice = new Dec(assetPrice).div(borrowedAssetPrice).toString();
|
|
89
|
+
payload.currentVolatilePairRatio = new Dec(leveragedAssetPrice).div(borrowedAssetPrice).toDP(18).toString();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
payload.liquidationPrice = calcLeverageLiqPrice(payload.leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
93
|
+
}
|
|
94
|
+
payload.minCollRatio = new Dec(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
95
|
+
payload.collLiquidationRatio = new Dec(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
96
|
+
// payload.healthRatio = new Dec(payload.liquidationLimitUsd).div(payload.borrowedUsd).toDP(4).toString();
|
|
97
|
+
payload.minHealthRatio = new Dec(payload.liquidationLimitUsd).div(payload.borrowLimitUsd).toDP(4).toString();
|
|
98
|
+
// TODO: Re-implement netApy calculation
|
|
99
|
+
// const { netApy, incentiveUsd, totalInterestUsd } = calculateNetApy({
|
|
100
|
+
// usedAssets,
|
|
101
|
+
// assetsData,
|
|
102
|
+
// optionalData: { healthRatio: payload.healthRatio },
|
|
103
|
+
// });
|
|
104
|
+
payload.netApy = '0';
|
|
105
|
+
payload.incentiveUsd = '0';
|
|
106
|
+
payload.totalInterestUsd = '0';
|
|
107
|
+
return payload;
|
|
108
|
+
};
|
package/esm/helpers/index.d.ts
CHANGED
package/esm/helpers/index.js
CHANGED
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './setup';
|
|
2
2
|
import * as fluid from './fluid';
|
|
3
|
+
import * as aaveV4 from './aaveV4';
|
|
3
4
|
import * as aaveV3 from './aaveV3';
|
|
4
5
|
import * as aaveV2 from './aaveV2';
|
|
5
6
|
import * as compoundV3 from './compoundV3';
|
|
@@ -21,4 +22,4 @@ import * as portfolio from './portfolio';
|
|
|
21
22
|
import * as claiming from './claiming';
|
|
22
23
|
import * as savings from './savings';
|
|
23
24
|
export * from './types';
|
|
24
|
-
export { aaveV2, aaveV3, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
|
25
|
+
export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './setup';
|
|
2
2
|
import * as fluid from './fluid';
|
|
3
|
+
import * as aaveV4 from './aaveV4';
|
|
3
4
|
import * as aaveV3 from './aaveV3';
|
|
4
5
|
import * as aaveV2 from './aaveV2';
|
|
5
6
|
import * as compoundV3 from './compoundV3';
|
|
@@ -21,4 +22,4 @@ import * as portfolio from './portfolio';
|
|
|
21
22
|
import * as claiming from './claiming';
|
|
22
23
|
import * as savings from './savings';
|
|
23
24
|
export * from './types';
|
|
24
|
-
export { aaveV2, aaveV3, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
|
25
|
+
export { aaveV2, aaveV3, aaveV4, compoundV2, compoundV3, spark, curveUsd, liquity, liquityV2, maker, exchange, staking, moneymarket, markets, helpers, morphoBlue, llamaLend, eulerV2, fluid, portfolio, claiming, savings, };
|
|
@@ -15,7 +15,7 @@ export const aaveV3AssetsDefaultMarketOpt = [
|
|
|
15
15
|
export const aaveV3AssetsDefaultMarketArb = ['DAI', 'LINK', 'USDC.e', 'WBTC', 'ETH', 'USDT', 'AAVE', 'EURS', 'wstETH', 'MAI', 'rETH', 'LUSD', 'USDC', 'FRAX', 'ARB', 'weETH', 'GHO', 'ezETH', 'rsETH', 'tBTC'];
|
|
16
16
|
export const aaveV3AssetsDefaultMarketBase = ['ETH', 'cbETH', 'USDbC', 'wstETH', 'USDC', 'weETH', 'cbBTC', 'ezETH', 'GHO', 'wrsETH', 'LBTC', 'EURC', 'AAVE', 'tBTC', 'syrupUSDC'];
|
|
17
17
|
export const aaveV3AssetsDefaultMarketLinea = ['ETH', 'USDC', 'weETH', 'ezETH', 'USDT', 'wstETH', 'wrsETH', 'WBTC', 'mUSD'];
|
|
18
|
-
export const aaveV3AssetsDefaultMarketPlasma = ['ETH', 'USDT', 'sUSDe', 'USDe', 'weETH', 'XAUt', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'XPL', 'PT USDe Apr', 'PT sUSDe Apr'];
|
|
18
|
+
export const aaveV3AssetsDefaultMarketPlasma = ['ETH', 'USDT', 'sUSDe', 'USDe', 'weETH', 'XAUt', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'XPL', 'PT USDe Apr', 'PT sUSDe Apr', 'GHO'];
|
|
19
19
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
20
20
|
export const aaveV3AssetsDefaultMarket = {
|
|
21
21
|
[NetworkNumber.Eth]: aaveV3AssetsDefaultMarketEth,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AaveV4HubInfo, AaveV4HubsType, AaveV4SpokeInfo, AaveV4SpokesType, NetworkNumber } from '../../types';
|
|
2
|
+
export declare const AAVE_V4_CORE_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
3
|
+
export declare const AAVE_V4_PLUS_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
4
|
+
export declare const AAVE_V4_PRIME_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
5
|
+
export declare const AaveV4Hubs: (networkId: NetworkNumber) => {
|
|
6
|
+
readonly aave_v4_core_hub: AaveV4HubInfo;
|
|
7
|
+
readonly aave_v4_plus_hub: AaveV4HubInfo;
|
|
8
|
+
readonly aave_v4_prime_hub: AaveV4HubInfo;
|
|
9
|
+
};
|
|
10
|
+
export declare const getAaveV4HubTypeInfo: (type: AaveV4HubsType, network?: NetworkNumber) => AaveV4HubInfo;
|
|
11
|
+
export declare const getAaveV4HubByAddress: (networkId: NetworkNumber, address: string) => AaveV4HubInfo | undefined;
|
|
12
|
+
export declare const AAVE_V4_BLUECHIP_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
13
|
+
export declare const AAVE_V4_ETHENA_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
14
|
+
export declare const AAVE_V4_ETHERFI_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
15
|
+
export declare const AAVE_V4_GOLD_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
16
|
+
export declare const AAVE_V4_KELP_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
17
|
+
export declare const AAVE_V4_LIDO_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
18
|
+
export declare const AAVE_V4_MAIN_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
19
|
+
export declare const AaveV4Spokes: (networkId: NetworkNumber) => {
|
|
20
|
+
readonly aave_v4_bluechip_spoke: AaveV4SpokeInfo;
|
|
21
|
+
readonly aave_v4_ethena_spoke: AaveV4SpokeInfo;
|
|
22
|
+
readonly aave_v4_etherfi_spoke: AaveV4SpokeInfo;
|
|
23
|
+
readonly aave_v4_gold_spoke: AaveV4SpokeInfo;
|
|
24
|
+
readonly aave_v4_kelp_spoke: AaveV4SpokeInfo;
|
|
25
|
+
readonly aave_v4_lido_spoke: AaveV4SpokeInfo;
|
|
26
|
+
readonly aave_v4_main_spoke: AaveV4SpokeInfo;
|
|
27
|
+
};
|
|
28
|
+
export declare const getAaveV4SpokeTypeInfo: (type: AaveV4SpokesType, network?: NetworkNumber) => AaveV4SpokeInfo;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { AaveV4HubsType, AaveV4SpokesType, NetworkNumber, } from '../../types';
|
|
2
|
+
// HUBS
|
|
3
|
+
export const AAVE_V4_CORE_HUB = (networkId) => ({
|
|
4
|
+
chainIds: [NetworkNumber.Eth],
|
|
5
|
+
label: 'Core Hub',
|
|
6
|
+
value: AaveV4HubsType.AaveV4CoreHub,
|
|
7
|
+
address: '0x3Ed2C9829FBCab6015E331a0352F8ae148217D70',
|
|
8
|
+
});
|
|
9
|
+
export const AAVE_V4_PLUS_HUB = (networkId) => ({
|
|
10
|
+
chainIds: [NetworkNumber.Eth],
|
|
11
|
+
label: 'Plus Hub',
|
|
12
|
+
value: AaveV4HubsType.AaveV4PlusHub,
|
|
13
|
+
address: '0xcb8C80026248f92c6DE735264c23c8e22922C562',
|
|
14
|
+
});
|
|
15
|
+
export const AAVE_V4_PRIME_HUB = (networkId) => ({
|
|
16
|
+
chainIds: [NetworkNumber.Eth],
|
|
17
|
+
label: 'Prime Hub',
|
|
18
|
+
value: AaveV4HubsType.AaveV4PrimeHub,
|
|
19
|
+
address: '0xea40581231Ca775e6A3d7c129cF231D292B85f20',
|
|
20
|
+
});
|
|
21
|
+
export const AaveV4Hubs = (networkId) => ({
|
|
22
|
+
[AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
|
|
23
|
+
[AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
|
|
24
|
+
[AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
|
|
25
|
+
});
|
|
26
|
+
export const getAaveV4HubTypeInfo = (type, network) => (Object.assign({}, AaveV4Hubs(network !== null && network !== void 0 ? network : NetworkNumber.Eth))[type]);
|
|
27
|
+
export const getAaveV4HubByAddress = (networkId, address) => Object.values(AaveV4Hubs(networkId)).find(hub => hub.address.toLowerCase() === address.toLowerCase());
|
|
28
|
+
// SPOKES
|
|
29
|
+
export const AAVE_V4_BLUECHIP_SPOKE = (networkId) => ({
|
|
30
|
+
chainIds: [NetworkNumber.Eth],
|
|
31
|
+
label: 'Bluechip Spoke',
|
|
32
|
+
value: AaveV4SpokesType.AaveV4BluechipSpoke,
|
|
33
|
+
url: 'bluechip',
|
|
34
|
+
address: '0x637F9E189332a2821e5B046E2d7EEFae2405d6c5',
|
|
35
|
+
hubs: [
|
|
36
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
37
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
38
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
export const AAVE_V4_ETHENA_SPOKE = (networkId) => ({
|
|
42
|
+
chainIds: [NetworkNumber.Eth],
|
|
43
|
+
label: 'Ethena Spoke',
|
|
44
|
+
value: AaveV4SpokesType.AaveV4EthenaSpoke,
|
|
45
|
+
url: 'ethena',
|
|
46
|
+
address: '0x4054a9EbfcdB692599a8dF61eb0b3484F2d279D4',
|
|
47
|
+
hubs: [
|
|
48
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
49
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
50
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
export const AAVE_V4_ETHERFI_SPOKE = (networkId) => ({
|
|
54
|
+
chainIds: [NetworkNumber.Eth],
|
|
55
|
+
label: 'Etherfi Spoke',
|
|
56
|
+
value: AaveV4SpokesType.AaveV4EtherfiSpoke,
|
|
57
|
+
url: 'etherfi',
|
|
58
|
+
address: '0x4054a9EbfcdB692599a8dF61eb0b3484F2d279D4',
|
|
59
|
+
hubs: [
|
|
60
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
61
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
62
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
export const AAVE_V4_GOLD_SPOKE = (networkId) => ({
|
|
66
|
+
chainIds: [NetworkNumber.Eth],
|
|
67
|
+
label: 'Gold Spoke',
|
|
68
|
+
value: AaveV4SpokesType.AaveV4GoldSpoke,
|
|
69
|
+
url: 'gold',
|
|
70
|
+
address: '0x0DC7ccE912Afab8B49031A0A95DB74531741C2c4',
|
|
71
|
+
hubs: [
|
|
72
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
73
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
74
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
export const AAVE_V4_KELP_SPOKE = (networkId) => ({
|
|
78
|
+
chainIds: [NetworkNumber.Eth],
|
|
79
|
+
label: 'Kelp Spoke',
|
|
80
|
+
value: AaveV4SpokesType.AaveV4KelpSpoke,
|
|
81
|
+
url: 'kelp',
|
|
82
|
+
address: '0x8aC76d950a3D03F9E1d857b5AAFFdA3f86C1e9AA',
|
|
83
|
+
hubs: [
|
|
84
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
85
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
86
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
export const AAVE_V4_LIDO_SPOKE = (networkId) => ({
|
|
90
|
+
chainIds: [NetworkNumber.Eth],
|
|
91
|
+
label: 'Lido Spoke',
|
|
92
|
+
value: AaveV4SpokesType.AaveV4LidoSpoke,
|
|
93
|
+
url: 'lido',
|
|
94
|
+
address: '0x4D4a7b3Ce709b4362D7095a4A0105bDFDb5dA2a7',
|
|
95
|
+
hubs: [
|
|
96
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
97
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
98
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
99
|
+
],
|
|
100
|
+
});
|
|
101
|
+
export const AAVE_V4_MAIN_SPOKE = (networkId) => ({
|
|
102
|
+
chainIds: [NetworkNumber.Eth],
|
|
103
|
+
label: 'Main Spoke',
|
|
104
|
+
value: AaveV4SpokesType.AaveV4MainSpoke,
|
|
105
|
+
url: 'main',
|
|
106
|
+
address: '0x46539e9123A18c427e6b4DFF114c28CF405Cb023',
|
|
107
|
+
hubs: [
|
|
108
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
109
|
+
AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
|
|
110
|
+
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
111
|
+
],
|
|
112
|
+
});
|
|
113
|
+
export const AaveV4Spokes = (networkId) => ({
|
|
114
|
+
[AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
|
|
115
|
+
[AaveV4SpokesType.AaveV4EthenaSpoke]: AAVE_V4_ETHENA_SPOKE(networkId),
|
|
116
|
+
[AaveV4SpokesType.AaveV4EtherfiSpoke]: AAVE_V4_ETHERFI_SPOKE(networkId),
|
|
117
|
+
[AaveV4SpokesType.AaveV4GoldSpoke]: AAVE_V4_GOLD_SPOKE(networkId),
|
|
118
|
+
[AaveV4SpokesType.AaveV4KelpSpoke]: AAVE_V4_KELP_SPOKE(networkId),
|
|
119
|
+
[AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
|
|
120
|
+
[AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
|
|
121
|
+
});
|
|
122
|
+
export const getAaveV4SpokeTypeInfo = (type, network) => (Object.assign({}, AaveV4Spokes(network !== null && network !== void 0 ? network : NetworkNumber.Eth))[type]);
|
package/esm/markets/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { LlamaLendMarkets } from './llamaLend';
|
|
|
7
7
|
export { LiquityV2Markets, findLiquityV2MarketByAddress } from './liquityV2';
|
|
8
8
|
export { EulerV2Markets } from './euler';
|
|
9
9
|
export { FluidMarkets, getFluidVersionsDataForNetwork, getFluidMarketInfoById, getFTokenAddress, getFluidMarketInfoByAddress, } from './fluid';
|
|
10
|
+
export { AaveV4Spokes } from './aaveV4';
|
package/esm/markets/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { LlamaLendMarkets } from './llamaLend';
|
|
|
7
7
|
export { LiquityV2Markets, findLiquityV2MarketByAddress } from './liquityV2';
|
|
8
8
|
export { EulerV2Markets } from './euler';
|
|
9
9
|
export { FluidMarkets, getFluidVersionsDataForNetwork, getFluidMarketInfoById, getFTokenAddress, getFluidMarketInfoByAddress, } from './fluid';
|
|
10
|
+
export { AaveV4Spokes } from './aaveV4';
|
package/esm/portfolio/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import Dec from 'decimal.js';
|
|
11
11
|
import { NetworkNumber } from '../types/common';
|
|
12
|
-
import { AaveMarkets, CompoundMarkets, CrvUsdMarkets, EulerV2Markets, LiquityV2Markets, LlamaLendMarkets, MorphoBlueMarkets, SparkMarkets, } from '../markets';
|
|
12
|
+
import { AaveMarkets, AaveV4Spokes, CompoundMarkets, CrvUsdMarkets, EulerV2Markets, LiquityV2Markets, LlamaLendMarkets, MorphoBlueMarkets, SparkMarkets, } from '../markets';
|
|
13
13
|
import { _getMorphoBlueAccountData, _getMorphoBlueMarketData, getMorphoEarn } from '../morphoBlue';
|
|
14
14
|
import { AaveVersions, CompoundVersions, } from '../types';
|
|
15
15
|
import { _getCompoundV3AccountData, _getCompoundV3MarketsData } from '../compoundV3';
|
|
@@ -34,6 +34,7 @@ import { fetchSparkAirdropRewards, fetchSparkRewards } from '../claiming/spark';
|
|
|
34
34
|
import { fetchMorphoBlueRewards } from '../claiming/morphoBlue';
|
|
35
35
|
import { getKingRewards } from '../claiming/king';
|
|
36
36
|
import { fetchEthenaAirdropRewards } from '../claiming/ethena';
|
|
37
|
+
import { _getAaveV4AccountData, _getAaveV4SpokeData } from '../aaveV4';
|
|
37
38
|
export function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1) {
|
|
38
39
|
return __awaiter(this, arguments, void 0, function* (provider, network, defaultProvider, addresses, isSim = false) {
|
|
39
40
|
const isMainnet = network === NetworkNumber.Eth;
|
|
@@ -50,6 +51,7 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
50
51
|
const llamaLendMarkets = [NetworkNumber.Eth, NetworkNumber.Arb].includes(network) ? Object.values(LlamaLendMarkets(network)).filter((market) => market.chainIds.includes(network)) : [];
|
|
51
52
|
const liquityV2Markets = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)) : [];
|
|
52
53
|
const liquityV2MarketsStaking = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)).filter(market => !market.isLegacy) : [];
|
|
54
|
+
const aaveV4Spokes = Object.values(AaveV4Spokes(network)).filter((market) => market.chainIds.includes(network));
|
|
53
55
|
const args = [network, { batch: { multicall: { batchSize: isSim ? 500000 : 2500000 } } }];
|
|
54
56
|
const client = getViemProvider(provider, ...args);
|
|
55
57
|
const defaultClient = getViemProvider(defaultProvider, ...args);
|
|
@@ -64,6 +66,7 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
64
66
|
const crvUsdMarketsData = {};
|
|
65
67
|
const llamaLendMarketsData = {};
|
|
66
68
|
const liquityV2MarketsData = {};
|
|
69
|
+
const aaveV4SpokesData = {};
|
|
67
70
|
const markets = {
|
|
68
71
|
morphoMarketsData,
|
|
69
72
|
compoundV3MarketsData,
|
|
@@ -75,6 +78,7 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
75
78
|
crvUsdMarketsData,
|
|
76
79
|
llamaLendMarketsData,
|
|
77
80
|
liquityV2MarketsData,
|
|
81
|
+
aaveV4SpokesData,
|
|
78
82
|
};
|
|
79
83
|
const positions = {};
|
|
80
84
|
const stakingPositions = {};
|
|
@@ -83,6 +87,7 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
83
87
|
for (const address of allAddresses) {
|
|
84
88
|
positions[address.toLowerCase()] = {
|
|
85
89
|
aaveV3: {},
|
|
90
|
+
aaveV4: {},
|
|
86
91
|
morphoBlue: {},
|
|
87
92
|
compoundV3: {},
|
|
88
93
|
spark: {},
|
|
@@ -148,6 +153,10 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
148
153
|
const marketData = yield _getAaveV3MarketData(client, network, market);
|
|
149
154
|
aaveV3MarketsData[market.value] = marketData;
|
|
150
155
|
})),
|
|
156
|
+
...aaveV4Spokes.map((spoke) => __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const spokeData = yield _getAaveV4SpokeData(client, network, spoke);
|
|
158
|
+
aaveV4SpokesData[spoke.value] = spokeData;
|
|
159
|
+
})),
|
|
151
160
|
...aaveV2Markets.map((market) => __awaiter(this, void 0, void 0, function* () {
|
|
152
161
|
const marketData = yield _getAaveV2MarketsData(client, network, market);
|
|
153
162
|
aaveV2MarketsData[market.value] = marketData;
|
|
@@ -417,6 +426,17 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
|
|
|
417
426
|
positions[address.toLowerCase()].aaveV3[market.value] = { error: `Error fetching AaveV3 account data for address ${address} on market ${market.value}`, data: null };
|
|
418
427
|
}
|
|
419
428
|
}))).flat(),
|
|
429
|
+
...aaveV4Spokes.map((spoke) => allAddresses.map((address) => __awaiter(this, void 0, void 0, function* () {
|
|
430
|
+
try {
|
|
431
|
+
const accData = yield _getAaveV4AccountData(client, network, aaveV4SpokesData[spoke.value], address);
|
|
432
|
+
if (new Dec(accData.suppliedUsd).gt(0))
|
|
433
|
+
positions[address.toLowerCase()].aaveV4[spoke.value] = { error: '', data: accData };
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
console.error(`Error fetching AaveV4 account data for address ${address} on spoke ${spoke.value}:`, error);
|
|
437
|
+
positions[address.toLowerCase()].aaveV4[spoke.value] = { error: `Error fetching AaveV4 account data for address ${address} on spoke ${spoke.value}`, data: null };
|
|
438
|
+
}
|
|
439
|
+
}))).flat(),
|
|
420
440
|
...morphoMarkets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
|
|
421
441
|
try {
|
|
422
442
|
const [accDataPromise, earnDataPromise] = yield Promise.allSettled([
|
|
@@ -5,6 +5,12 @@ export declare const isEligibleForEthenaUSDeRewards: (usedAssets: MMUsedAssets,
|
|
|
5
5
|
isEligible: boolean;
|
|
6
6
|
eligibleUSDAmount: string;
|
|
7
7
|
};
|
|
8
|
+
export declare const isEligibleForEthenaGHORewards: (usedAssets: MMUsedAssets, { healthRatio }: {
|
|
9
|
+
healthRatio: string;
|
|
10
|
+
}) => {
|
|
11
|
+
isEligible: boolean;
|
|
12
|
+
eligibleUSDAmount: string;
|
|
13
|
+
};
|
|
8
14
|
export declare const isEligibleForAaveV3ArbitrumEthSupply: (usedAssets: MMUsedAssets) => {
|
|
9
15
|
isEligible: boolean;
|
|
10
16
|
eligibleUSDAmount: string;
|
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
import Dec from 'decimal.js';
|
|
2
2
|
import { IncentiveEligibilityId } from '../types/common';
|
|
3
|
-
|
|
4
|
-
var _a, _b;
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const anythingElseSupplied = Object.values(usedAssets).some((asset) => asset.
|
|
3
|
+
const isEligibleForEthenaPairRewards = (usedAssets, { healthRatio }, { baseSymbol, pairSymbol, allowedBorrowAssets, maxHealthRatio, rewardSymbol, }) => {
|
|
4
|
+
var _a, _b, _c;
|
|
5
|
+
const baseSuppliedUsd = ((_a = usedAssets[baseSymbol]) === null || _a === void 0 ? void 0 : _a.suppliedUsd) || '0';
|
|
6
|
+
const pairSuppliedUsd = ((_b = usedAssets[pairSymbol]) === null || _b === void 0 ? void 0 : _b.suppliedUsd) || '0';
|
|
7
|
+
const anythingElseSupplied = Object.values(usedAssets).some((asset) => asset.isSupplied && asset.symbol !== baseSymbol && asset.symbol !== pairSymbol);
|
|
8
8
|
if (anythingElseSupplied)
|
|
9
9
|
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
10
|
-
const totalAmountSupplied = new Dec(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const totalAmountSupplied = new Dec(baseSuppliedUsd).add(pairSuppliedUsd);
|
|
11
|
+
if (totalAmountSupplied.eq(0))
|
|
12
|
+
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
13
|
+
const percentageInBase = new Dec(baseSuppliedUsd).div(totalAmountSupplied).toNumber();
|
|
14
|
+
if (percentageInBase < 0.45 || percentageInBase > 0.55)
|
|
15
|
+
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
16
|
+
const percentageInPair = new Dec(pairSuppliedUsd).div(totalAmountSupplied).toNumber();
|
|
17
|
+
if (percentageInPair < 0.45 || percentageInPair > 0.55)
|
|
18
|
+
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
18
19
|
const anythingBorrowedNotAllowed = Object.values(usedAssets).some((asset) => asset.isBorrowed && !allowedBorrowAssets.includes(asset.symbol));
|
|
19
20
|
if (anythingBorrowedNotAllowed)
|
|
20
21
|
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
21
|
-
if (new Dec(healthRatio).gte(
|
|
22
|
-
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
23
|
-
const halfAmountSupplied =
|
|
24
|
-
const
|
|
25
|
-
|
|
22
|
+
if (new Dec(healthRatio).gte(maxHealthRatio))
|
|
23
|
+
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
24
|
+
const halfAmountSupplied = totalAmountSupplied.div(2);
|
|
25
|
+
const rewardSuppliedUsd = ((_c = usedAssets[rewardSymbol]) === null || _c === void 0 ? void 0 : _c.suppliedUsd) || '0';
|
|
26
|
+
const eligibleUSDAmount = Dec.min(rewardSuppliedUsd, halfAmountSupplied).toString();
|
|
27
|
+
return { isEligible: true, eligibleUSDAmount };
|
|
26
28
|
};
|
|
29
|
+
export const isEligibleForEthenaUSDeRewards = (usedAssets, { healthRatio }) => isEligibleForEthenaPairRewards(usedAssets, { healthRatio }, {
|
|
30
|
+
baseSymbol: 'USDe',
|
|
31
|
+
pairSymbol: 'sUSDe',
|
|
32
|
+
allowedBorrowAssets: ['USDC', 'USDT', 'USDS'],
|
|
33
|
+
maxHealthRatio: '2.5',
|
|
34
|
+
rewardSymbol: 'USDe',
|
|
35
|
+
});
|
|
36
|
+
export const isEligibleForEthenaGHORewards = (usedAssets, { healthRatio }) => isEligibleForEthenaPairRewards(usedAssets, { healthRatio }, {
|
|
37
|
+
baseSymbol: 'syrupUSDT',
|
|
38
|
+
pairSymbol: 'GHO',
|
|
39
|
+
allowedBorrowAssets: ['USDT'],
|
|
40
|
+
maxHealthRatio: '2',
|
|
41
|
+
rewardSymbol: 'GHO',
|
|
42
|
+
});
|
|
27
43
|
export const isEligibleForAaveV3ArbitrumEthSupply = (usedAssets) => {
|
|
28
44
|
var _a, _b;
|
|
29
45
|
const ETHAmountSupplied = ((_a = usedAssets.ETH) === null || _a === void 0 ? void 0 : _a.suppliedUsd) || '0';
|
|
@@ -49,4 +65,5 @@ export const EligibilityMapping = {
|
|
|
49
65
|
[IncentiveEligibilityId.AaveV3ArbitrumEthSupply]: isEligibleForAaveV3ArbitrumEthSupply,
|
|
50
66
|
[IncentiveEligibilityId.AaveV3ArbitrumETHLSBorrow]: isEligibleForAaveV3ArbitrumETHLSBorrow,
|
|
51
67
|
[IncentiveEligibilityId.AaveV3EthenaLiquidLeveragePlasma]: isEligibleForEthenaUSDeRewards,
|
|
68
|
+
[IncentiveEligibilityId.AaveV3EthenaLiquidLeveragePlasmaGHO]: isEligibleForEthenaGHORewards,
|
|
52
69
|
};
|
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}`);
|