@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.
@@ -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] || { collateralAssets: [], collateralFactor: '0', liquidationRatio: '0' };
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) => {
@@ -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 ({
@@ -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[],