@defisaver/positions-sdk 2.1.45 → 2.1.46-aave-v3-6-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
  };
@@ -10,7 +10,7 @@ export const aaveV2AssetsDefaultMarket = ['USDT', 'WBTC', 'ETH', 'YFI', 'ZRX', '
10
10
 
11
11
  export const aaveV3AssetsDefaultMarketEth = [
12
12
  'ETH', 'wstETH', 'WBTC', 'USDC', 'DAI', 'LINK', 'AAVE', 'cbETH', 'USDT', 'rETH', 'LUSD', 'CRV', 'MKR', 'SNX', 'BAL', 'UNI', 'LDO', 'ENS', '1INCH', 'FRAX', 'GHO', 'RPL', 'sDAI', 'STG', 'KNC', 'FXS', 'crvUSD', 'PYUSD', 'weETH', 'osETH', 'USDe', 'ETHx', 'sUSDe', 'tBTC', 'cbBTC', 'USDS', 'rsETH', 'LBTC', 'eBTC', 'RLUSD', 'PT eUSDe May', 'PT sUSDe July', 'USDtb',
13
- 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'EURC', 'FBTC', 'PT sUSDe Sep', 'PT USDe Sep', 'tETH', 'ezETH', 'XAUt', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Feb', 'PT USDe Feb', 'mUSD', 'syrupUSDT',
13
+ 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'EURC', 'FBTC', 'PT sUSDe Sep', 'PT USDe Sep', 'tETH', 'ezETH', 'XAUt', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Feb', 'PT USDe Feb', 'mUSD', 'syrupUSDT', 'USDG',
14
14
  ];
15
15
  export const aaveV3AssetsDefaultMarketOpt = [
16
16
  'DAI', 'USDC.e', 'USDT', 'SUSD', 'AAVE', 'LINK', 'WBTC', 'ETH', 'OP', 'wstETH', 'LUSD', 'MAI', 'rETH', 'USDC',
@@ -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/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[],