@1delta/margin-fetcher 0.0.193 → 0.0.194

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
@@ -8055,7 +8055,7 @@ var calculateRateForCompoundType2 = (n) => {
8055
8055
  const rate = Number(formatEther(BigInt(n)));
8056
8056
  return (Math.pow(rate * 60 * 60 * 24 / 12 + 1, 365) - 1) * 100;
8057
8057
  };
8058
- var calculateRateForCompoundType = (n, chainId, scale = 1 /* MS */) => {
8058
+ var calculateRateForCompoundType = (n, chainId, scale = 1 /* SECOND */) => {
8059
8059
  const rate = Number(formatEther(BigInt(n)));
8060
8060
  if (scale === 0 /* BLOCK */)
8061
8061
  return (Math.pow(
@@ -13743,18 +13743,19 @@ function readSumerCTokenMetadata(meta, token) {
13743
13743
  },
13744
13744
  // borrow is allowed if listed (no explicit pause field)
13745
13745
  isBorrowAllowed: meta.isListed ?? true,
13746
+ // Sumer's JumpRateModelV2 stores per-second rates (not per-block)
13746
13747
  depositRate: apyToApr(
13747
13748
  calculateRateForCompoundType(
13748
13749
  (meta.supplyRatePerBlock ?? 0n).toString(),
13749
13750
  token.chainId,
13750
- 0 /* BLOCK */
13751
+ 1 /* SECOND */
13751
13752
  ) / 100
13752
13753
  ) * 100,
13753
13754
  variableBorrowRate: apyToApr(
13754
13755
  calculateRateForCompoundType(
13755
13756
  (meta.borrowRatePerBlock ?? 0n).toString(),
13756
13757
  token.chainId,
13757
- 0 /* BLOCK */
13758
+ 1 /* SECOND */
13758
13759
  ) / 100
13759
13760
  ) * 100
13760
13761
  };
@@ -15515,14 +15516,14 @@ function parseMoonwellMarket(input, token) {
15515
15516
  calculateRateForCompoundType(
15516
15517
  toBigInt(field(input, "supplyRate", 15)).toString() ?? "0",
15517
15518
  "1",
15518
- 1 /* MS */
15519
+ 1 /* SECOND */
15519
15520
  ) / 100
15520
15521
  ) * 100,
15521
15522
  variableBorrowRate: apyToApr(
15522
15523
  calculateRateForCompoundType(
15523
15524
  toBigInt(field(input, "borrowRate", 15)).toString() ?? "0",
15524
15525
  "1",
15525
- 1 /* MS */
15526
+ 1 /* SECOND */
15526
15527
  ) / 100
15527
15528
  ) * 100,
15528
15529
  isBorrowAllowed: true,