@1delta/margin-fetcher 5.0.100 → 5.0.101
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 +12 -15
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -7186,10 +7186,7 @@ var calculateRateForCompoundType = (n, chainId, scale3 = 1 /* SECOND */, unitSec
|
|
|
7186
7186
|
const perUnit = unitSeconds && unitSeconds > 0 ? unitSeconds : scale3 === 0 /* BLOCK */ ? Number(BLOCK_TIMES[chainId] ?? 1) : 1;
|
|
7187
7187
|
return (Math.pow(rate * 60 * 60 * 24 / perUnit + 1, 365) - 1) * 100;
|
|
7188
7188
|
};
|
|
7189
|
-
var
|
|
7190
|
-
const apy = formatAaveYieldToNumber(raw);
|
|
7191
|
-
return apyToApr(apy / 100) * 100;
|
|
7192
|
-
};
|
|
7189
|
+
var formatAaveRayToApr = (raw) => formatAaveYieldToNumber(raw);
|
|
7193
7190
|
var convertRateToApr = (ratePerSecond) => {
|
|
7194
7191
|
const rps = Number(ratePerSecond);
|
|
7195
7192
|
if (isNaN(rps)) return 0;
|
|
@@ -7277,13 +7274,13 @@ var getAaveV2ReservesDataConverter = (lender, chainId, prices, additionalYields,
|
|
|
7277
7274
|
reserveData?.[8 /* variableBorrowIndex */]
|
|
7278
7275
|
),
|
|
7279
7276
|
// rates
|
|
7280
|
-
depositRate:
|
|
7277
|
+
depositRate: formatAaveRayToApr(
|
|
7281
7278
|
reserveData?.[3 /* liquidityRate */]?.toString()
|
|
7282
7279
|
),
|
|
7283
|
-
variableBorrowRate:
|
|
7280
|
+
variableBorrowRate: formatAaveRayToApr(
|
|
7284
7281
|
reserveData?.[4 /* variableBorrowRate */]?.toString()
|
|
7285
7282
|
),
|
|
7286
|
-
stableBorrowRate:
|
|
7283
|
+
stableBorrowRate: formatAaveRayToApr(
|
|
7287
7284
|
reserveData?.[5 /* stableBorrowRate */]?.toString()
|
|
7288
7285
|
),
|
|
7289
7286
|
intrinsicYield: additionalYields?.intrinsicYields?.[oracleKey] ?? 0,
|
|
@@ -7504,13 +7501,13 @@ var getAaveV3ReservesDataConverter = (lender, chainId, prices, additionalYields,
|
|
|
7504
7501
|
reserveData?.[10 /* variableBorrowIndex */]
|
|
7505
7502
|
),
|
|
7506
7503
|
// rates
|
|
7507
|
-
depositRate:
|
|
7504
|
+
depositRate: formatAaveRayToApr(
|
|
7508
7505
|
reserveData?.[5 /* liquidityRate */]?.toString()
|
|
7509
7506
|
),
|
|
7510
|
-
variableBorrowRate:
|
|
7507
|
+
variableBorrowRate: formatAaveRayToApr(
|
|
7511
7508
|
reserveData?.[6 /* variableBorrowRate */]?.toString()
|
|
7512
7509
|
),
|
|
7513
|
-
stableBorrowRate:
|
|
7510
|
+
stableBorrowRate: formatAaveRayToApr(
|
|
7514
7511
|
reserveData?.[7 /* stableBorrowRate */]?.toString()
|
|
7515
7512
|
),
|
|
7516
7513
|
intrinsicYield: additionalYields?.intrinsicYields?.[toOracleKey(assetMeta?.assetGroup)] ?? 0,
|
|
@@ -7766,10 +7763,10 @@ function parseYLDRCall(chainId, lender, additionalYields, prices, tokenList) {
|
|
|
7766
7763
|
reserveData?.[6 /* variableBorrowIndex */]
|
|
7767
7764
|
),
|
|
7768
7765
|
// rates
|
|
7769
|
-
depositRate:
|
|
7766
|
+
depositRate: formatAaveRayToApr(
|
|
7770
7767
|
reserveData?.[3 /* liquidityRate */]?.toString()
|
|
7771
7768
|
),
|
|
7772
|
-
variableBorrowRate:
|
|
7769
|
+
variableBorrowRate: formatAaveRayToApr(
|
|
7773
7770
|
reserveData?.[4 /* variableBorrowRate */]?.toString()
|
|
7774
7771
|
),
|
|
7775
7772
|
stableBorrowRate: 0,
|
|
@@ -7941,13 +7938,13 @@ function parseAave32(chainId, lender, prices, additionalYields, tokenList) {
|
|
|
7941
7938
|
reserveData?.[10 /* variableBorrowIndex */]
|
|
7942
7939
|
),
|
|
7943
7940
|
// rates
|
|
7944
|
-
depositRate:
|
|
7941
|
+
depositRate: formatAaveRayToApr(
|
|
7945
7942
|
reserveData?.[5 /* liquidityRate */]?.toString()
|
|
7946
7943
|
),
|
|
7947
|
-
variableBorrowRate:
|
|
7944
|
+
variableBorrowRate: formatAaveRayToApr(
|
|
7948
7945
|
reserveData?.[6 /* variableBorrowRate */]?.toString()
|
|
7949
7946
|
),
|
|
7950
|
-
stableBorrowRate:
|
|
7947
|
+
stableBorrowRate: formatAaveRayToApr(
|
|
7951
7948
|
reserveData?.[7 /* stableBorrowRate */]?.toString()
|
|
7952
7949
|
),
|
|
7953
7950
|
intrinsicYield: additionalYields?.intrinsicYields?.[toOracleKey(assetMeta?.assetGroup)] ?? 0,
|