@1delta/margin-fetcher 0.0.71 → 0.0.72
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/dist/index.js
CHANGED
|
@@ -8763,22 +8763,39 @@ var getInitReservesDataConverter = (lender, chainId, prices, additionalYields, t
|
|
|
8763
8763
|
INIT_MODES.forEach((mode, index) => {
|
|
8764
8764
|
data[index]?.forEach((multicallData) => {
|
|
8765
8765
|
const asset = multicallData?.underlying.toLowerCase();
|
|
8766
|
-
const cf = parseRawAmount(multicallData.collateralFactor, 18);
|
|
8766
|
+
const cf = Number(parseRawAmount(multicallData.collateralFactor, 18));
|
|
8767
8767
|
const modeData = {
|
|
8768
8768
|
category: mode,
|
|
8769
8769
|
label: INIT_EMODE_LABELS[mode],
|
|
8770
8770
|
borrowCollateralFactor: cf,
|
|
8771
8771
|
collateralFactor: cf,
|
|
8772
|
-
borrowFactor:
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8772
|
+
borrowFactor: Number(
|
|
8773
|
+
parseRawAmount(multicallData.borrowFactor, 18)
|
|
8774
|
+
),
|
|
8775
|
+
maxHealthAfterLiq: Number(
|
|
8776
|
+
parseRawAmount(multicallData.maxHealthAfterLiq, 18)
|
|
8776
8777
|
)
|
|
8777
8778
|
};
|
|
8778
8779
|
if (!eModes[mode]) eModes[mode] = modeData;
|
|
8779
8780
|
result[asset].config[mode] = modeData;
|
|
8780
8781
|
});
|
|
8781
8782
|
});
|
|
8783
|
+
Object.entries(eModes).forEach(([modeId, data2]) => {
|
|
8784
|
+
Object.entries(result)?.forEach(([key, _2]) => {
|
|
8785
|
+
if (!result[key].config[modeId]) {
|
|
8786
|
+
let mode = {
|
|
8787
|
+
...data2,
|
|
8788
|
+
debtDisabled: true,
|
|
8789
|
+
collateralDisabled: true,
|
|
8790
|
+
collateralFactor: 0,
|
|
8791
|
+
borrowCollateralFactor: 0,
|
|
8792
|
+
borrowFactor: 3402823669209385e5
|
|
8793
|
+
// disabled flag
|
|
8794
|
+
};
|
|
8795
|
+
result[key].config[modeId] = mode;
|
|
8796
|
+
}
|
|
8797
|
+
});
|
|
8798
|
+
});
|
|
8782
8799
|
return { data: result, eModes, chainId };
|
|
8783
8800
|
},
|
|
8784
8801
|
expectedNumberOfCalls
|