@gearbox-protocol/periphery-v3 1.7.0-next.7 → 1.7.0-next.8
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.
|
@@ -263,14 +263,14 @@ contract CreditAccountCompressor is IVersion, SanityCheckTrait {
|
|
|
263
263
|
// collateral is computed separately since it might revert on `balanceOf` and `latestRoundData` calls
|
|
264
264
|
try ICreditManagerV3(creditManager).calcDebtAndCollateral(creditAccount, CollateralCalcTask.DEBT_COLLATERAL)
|
|
265
265
|
returns (CollateralDebtData memory cdd_) {
|
|
266
|
-
data.totalDebtUSD =
|
|
266
|
+
data.totalDebtUSD = cdd_.totalDebtUSD;
|
|
267
267
|
data.totalValueUSD = cdd_.totalValueUSD;
|
|
268
268
|
data.twvUSD = cdd_.twvUSD;
|
|
269
|
-
data.totalValue =
|
|
269
|
+
data.totalValue = cdd_.totalValue;
|
|
270
270
|
|
|
271
|
-
data.healthFactor =
|
|
271
|
+
data.healthFactor = cdd_.twvUSD * PERCENTAGE_FACTOR >= type(uint16).max * cdd_.totalDebtUSD
|
|
272
272
|
? type(uint16).max
|
|
273
|
-
: uint16(
|
|
273
|
+
: uint16(cdd_.twvUSD * PERCENTAGE_FACTOR / cdd_.totalDebtUSD);
|
|
274
274
|
data.success = true;
|
|
275
275
|
} catch {}
|
|
276
276
|
|
package/package.json
CHANGED