@defisaver/positions-sdk 2.1.47 → 2.1.49-pt-apr-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/aaveV3/index.js +26 -13
- package/cjs/config/contracts.d.ts +8395 -2636
- package/cjs/config/contracts.js +39 -14
- package/cjs/contracts.d.ts +5267 -255
- package/cjs/helpers/aaveHelpers/index.js +5 -1
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/spark/index.js +1 -0
- package/cjs/staking/staking.js +5 -1
- package/cjs/types/aave.d.ts +2 -0
- package/esm/aaveV3/index.js +26 -13
- package/esm/config/contracts.d.ts +8395 -2636
- package/esm/config/contracts.js +39 -14
- package/esm/contracts.d.ts +5267 -255
- package/esm/helpers/aaveHelpers/index.js +5 -1
- package/esm/markets/aave/marketAssets.js +1 -1
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/spark/index.js +1 -0
- package/esm/staking/staking.js +5 -1
- package/esm/types/aave.d.ts +2 -0
- package/package.json +2 -2
- package/src/aaveV3/index.ts +23 -13
- package/src/config/contracts.ts +39 -14
- package/src/helpers/aaveHelpers/index.ts +5 -1
- package/src/markets/aave/marketAssets.ts +1 -1
- package/src/moneymarket/moneymarketCommonService.ts +1 -1
- package/src/spark/index.ts +1 -0
- package/src/staking/staking.ts +3 -1
- package/src/types/aave.ts +2 -0
|
@@ -60,7 +60,9 @@ export const aaveAnyGetEmodeMutableProps = (
|
|
|
60
60
|
const asset = getNativeAssetFromWrapped(_asset);
|
|
61
61
|
|
|
62
62
|
const assetData = assetsData[asset];
|
|
63
|
-
const eModeCategoryData: { collateralAssets: string[], collateralFactor: string, liquidationRatio: string } = eModeCategoriesData?.[eModeCategory] || {
|
|
63
|
+
const eModeCategoryData: { collateralAssets: string[], collateralFactor: string, liquidationRatio: string, ltvZeroAssets: string[] } = eModeCategoriesData?.[eModeCategory] || {
|
|
64
|
+
collateralAssets: [], ltvZeroAssets: [], collateralFactor: '0', liquidationRatio: '0',
|
|
65
|
+
};
|
|
64
66
|
|
|
65
67
|
if (
|
|
66
68
|
eModeCategory === 0
|
|
@@ -70,6 +72,8 @@ export const aaveAnyGetEmodeMutableProps = (
|
|
|
70
72
|
const { liquidationRatio, collateralFactor } = assetData;
|
|
71
73
|
return ({ liquidationRatio, collateralFactor });
|
|
72
74
|
}
|
|
75
|
+
if (eModeCategoryData.ltvZeroAssets.includes(asset)) return ({ liquidationRatio: '0', collateralFactor: '0' });
|
|
76
|
+
|
|
73
77
|
const { liquidationRatio, collateralFactor } = eModeCategoryData;
|
|
74
78
|
return ({ liquidationRatio, collateralFactor });
|
|
75
79
|
};
|
|
@@ -20,7 +20,7 @@ export const aaveV3AssetsDefaultMarketBase = ['ETH', 'cbETH', 'USDbC', 'wstETH',
|
|
|
20
20
|
|
|
21
21
|
export const aaveV3AssetsDefaultMarketLinea = ['ETH', 'USDC', 'weETH', 'ezETH', 'USDT', 'wstETH', 'wrsETH', 'WBTC', 'mUSD'];
|
|
22
22
|
|
|
23
|
-
export const aaveV3AssetsDefaultMarketPlasma = ['ETH', 'USDT', 'sUSDe', 'USDe', 'weETH', 'XAUt', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'XPL'];
|
|
23
|
+
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'];
|
|
24
24
|
|
|
25
25
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
26
26
|
export const aaveV3AssetsDefaultMarket = {
|
|
@@ -24,7 +24,7 @@ export const STABLE_ASSETS = [
|
|
|
24
24
|
'DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'USDA',
|
|
25
25
|
'USDe', 'sUSDe', 'USDS', 'sUSDS', 'USR', 'EURC', 'BOLD', 'BOLD Legacy', 'RLUSD', 'PT sUSDe July', 'PT eUSDe May',
|
|
26
26
|
'USDtb', 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'PT sUSDe Sep', 'PT USDe Sep', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Jan', 'PT USDe Jan',
|
|
27
|
-
'PT sUSDe Feb', 'PT USDe Feb',
|
|
27
|
+
'PT sUSDe Feb', 'PT USDe Feb', 'PT USDe Apr', 'PT sUSDe Apr',
|
|
28
28
|
];
|
|
29
29
|
|
|
30
30
|
export const isLeveragedPos = (usedAssets: MMUsedAssets, dustLimit = 5) => {
|
package/src/spark/index.ts
CHANGED
|
@@ -107,6 +107,7 @@ export const _getSparkMarketsData = async (provider: Client, network: NetworkNum
|
|
|
107
107
|
collateralFactor: new Dec(market.ltv).div(10000).toString(),
|
|
108
108
|
collateralAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
109
109
|
borrowAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
110
|
+
ltvZeroAssets: [],
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
return ({
|
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',
|
|
67
|
+
'PT sUSDe Feb', 'PT USDe Feb', 'PT USDe Apr', 'PT sUSDe Apr',
|
|
68
68
|
];
|
|
69
69
|
|
|
70
70
|
export const getStakingApy = memoize(async (asset: string, network: number = NetworkNumber.Eth) => {
|
|
@@ -99,6 +99,8 @@ export const getStakingApy = memoize(async (asset: string, network: number = Net
|
|
|
99
99
|
if (asset === 'wstUSR') return await getApyFromDfsApi('wstUSR');
|
|
100
100
|
if (asset === 'PT sUSDe Feb') return await getApyFromDfsApi('PT sUSDe Feb', network);
|
|
101
101
|
if (asset === 'PT USDe Feb') return await getApyFromDfsApi('PT USDe Feb', network);
|
|
102
|
+
if (asset === 'PT sUSDe Apr') return await getApyFromDfsApi('PT sUSDe Apr', network);
|
|
103
|
+
if (asset === 'PT USDe Apr') return await getApyFromDfsApi('PT USDe Apr', network);
|
|
102
104
|
} catch (e) {
|
|
103
105
|
console.error(`Failed to fetch APY for ${asset}`);
|
|
104
106
|
}
|
package/src/types/aave.ts
CHANGED
|
@@ -45,6 +45,8 @@ export interface EModeCategoryData {
|
|
|
45
45
|
collateralBitmap?: string,
|
|
46
46
|
collateralAssets: string[],
|
|
47
47
|
borrowAssets: string[],
|
|
48
|
+
ltvzeroBitmap?: string,
|
|
49
|
+
ltvZeroAssets: string[],
|
|
48
50
|
}
|
|
49
51
|
export interface EModeCategoryDataMapping {
|
|
50
52
|
enteringTerms: boolean[],
|