@gearbox-protocol/periphery-v3 1.5.3 → 1.6.1
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.
|
@@ -254,22 +254,29 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
|
|
|
254
254
|
// uint256 quotedTokensMask;
|
|
255
255
|
// address[] quotedTokens;
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
257
|
+
for (uint256 i = 0; i < 2;) {
|
|
258
|
+
try creditManager.calcDebtAndCollateral(
|
|
259
|
+
_creditAccount, i == 0 ? CollateralCalcTask.DEBT_ONLY : CollateralCalcTask.DEBT_COLLATERAL
|
|
260
|
+
) returns (CollateralDebtData memory collateralDebtData) {
|
|
261
|
+
result.accruedInterest = collateralDebtData.accruedInterest;
|
|
262
|
+
result.accruedFees = collateralDebtData.accruedFees;
|
|
263
|
+
|
|
264
|
+
result.totalDebtUSD = collateralDebtData.totalDebtUSD;
|
|
265
|
+
result.totalValueUSD = collateralDebtData.totalValueUSD;
|
|
266
|
+
result.twvUSD = collateralDebtData.twvUSD;
|
|
267
|
+
result.healthFactor = collateralDebtData.totalDebtUSD != 0
|
|
268
|
+
? collateralDebtData.twvUSD * PERCENTAGE_FACTOR / collateralDebtData.totalDebtUSD
|
|
269
|
+
: type(uint16).max;
|
|
270
|
+
result.totalValue = collateralDebtData.totalValue;
|
|
271
|
+
result.isSuccessful = true;
|
|
272
|
+
} catch {
|
|
273
|
+
result.priceFeedsNeeded = _getPriceFeedFailedList(_cm, result.balances);
|
|
274
|
+
result.isSuccessful = false;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
unchecked {
|
|
278
|
+
++i;
|
|
279
|
+
}
|
|
273
280
|
}
|
|
274
281
|
|
|
275
282
|
(result.debt, result.cumulativeIndexLastUpdate, result.cumulativeQuotaInterest,,,, result.since,) =
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// Gearbox Protocol. Generalized leverage for DeFi protocols
|
|
3
|
+
// (c) Gearbox Foundation, 2024.
|
|
4
|
+
pragma solidity ^0.8.17;
|
|
5
|
+
|
|
6
|
+
/// @title ERC20Metadata
|
|
7
|
+
contract ERC20Metadata {
|
|
8
|
+
string public name;
|
|
9
|
+
string public symbol;
|
|
10
|
+
uint8 public immutable decimals;
|
|
11
|
+
|
|
12
|
+
constructor(string memory name_, string memory symbol_, uint8 decimals_) {
|
|
13
|
+
name = name_;
|
|
14
|
+
symbol = symbol_;
|
|
15
|
+
decimals = decimals_;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED