@defisaver/positions-sdk 2.1.46 → 2.1.48
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/compound/marketsAssets.js +1 -1
- package/cjs/spark/index.js +1 -0
- 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/compound/marketsAssets.js +1 -1
- package/esm/spark/index.js +1 -0
- package/esm/types/aave.d.ts +2 -0
- package/package.json +1 -1
- 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/compound/marketsAssets.ts +1 -1
- package/src/spark/index.ts +1 -0
- package/src/types/aave.ts +2 -0
package/cjs/aaveV3/index.js
CHANGED
|
@@ -74,21 +74,31 @@ function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
|
74
74
|
(0, merit_1.getMeritCampaigns)(network, market.value),
|
|
75
75
|
]);
|
|
76
76
|
isBorrowAllowed = (0, utils_1.isLayer2Network)(network) ? isBorrowAllowed : true;
|
|
77
|
+
// same break logic as view contract
|
|
78
|
+
let missCounter = 0;
|
|
77
79
|
const eModeCategoriesData = {};
|
|
78
80
|
for (let i = 0; i < eModesInfo.length; i++) {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
if (eModesInfo[i].liquidationThreshold !== 0) {
|
|
82
|
+
eModeCategoriesData[i + 1] = {
|
|
83
|
+
label: eModesInfo[i].label,
|
|
84
|
+
id: i + 1,
|
|
85
|
+
liquidationBonus: new decimal_js_1.default(eModesInfo[i].liquidationBonus).div(10000).toString(),
|
|
86
|
+
liquidationRatio: new decimal_js_1.default(eModesInfo[i].liquidationThreshold).div(10000).toString(),
|
|
87
|
+
collateralFactor: new decimal_js_1.default(eModesInfo[i].ltv).div(10000).toString(),
|
|
88
|
+
borrowableBitmap: eModesInfo[i].borrowableBitmap.toString(),
|
|
89
|
+
collateralBitmap: eModesInfo[i].collateralBitmap.toString(),
|
|
90
|
+
ltvzeroBitmap: eModesInfo[i].ltvzeroBitmap.toString(),
|
|
91
|
+
borrowAssets: [],
|
|
92
|
+
collateralAssets: [],
|
|
93
|
+
ltvZeroAssets: [],
|
|
94
|
+
};
|
|
95
|
+
missCounter = 0;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
++missCounter;
|
|
99
|
+
if (missCounter > 2)
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
92
102
|
}
|
|
93
103
|
if (networksWithIncentives.includes(network) && rewardInfo) {
|
|
94
104
|
rewardInfo = rewardInfo.reduce((all, _market) => {
|
|
@@ -106,6 +116,8 @@ function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
|
106
116
|
eModeCategoriesData[eModeIndex].collateralAssets.push(symbol);
|
|
107
117
|
if ((0, utils_1.isEnabledOnBitmap)(Number(eModeCategoriesData[eModeIndex].borrowableBitmap), Number(tokenMarket.assetId)))
|
|
108
118
|
eModeCategoriesData[eModeIndex].borrowAssets.push(symbol);
|
|
119
|
+
if ((0, utils_1.isEnabledOnBitmap)(Number(eModeCategoriesData[eModeIndex].ltvzeroBitmap), Number(tokenMarket.assetId)))
|
|
120
|
+
eModeCategoriesData[eModeIndex].ltvZeroAssets.push(symbol);
|
|
109
121
|
}
|
|
110
122
|
const borrowCap = tokenMarket.borrowCap.toString();
|
|
111
123
|
const borrowCapInWei = new decimal_js_1.default((0, tokens_1.assetAmountInWei)(borrowCap, symbol));
|
|
@@ -290,6 +302,7 @@ function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
|
290
302
|
collateralFactor: '0',
|
|
291
303
|
collateralAssets: assetsData.map((a) => a.symbol),
|
|
292
304
|
borrowAssets: assetsData.map((a) => a.symbol),
|
|
305
|
+
ltvZeroAssets: [],
|
|
293
306
|
};
|
|
294
307
|
return { assetsData: payload, eModeCategoriesData };
|
|
295
308
|
});
|