@1delta/margin-fetcher 0.0.336 → 0.0.337

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
@@ -20464,6 +20464,16 @@ var getGearboxV3PublicDataConverter = (_lender, chainId, prices, additionalYield
20464
20464
  0
20465
20465
  );
20466
20466
  const poolUtilization = poolExpectedLiquidity > 0 ? poolIrmDebt / poolExpectedLiquidity : 0;
20467
+ const quotaRatePctByToken = {};
20468
+ const quotaSrc = Array.isArray(m?.quotaKeeper?.quotas) && m.quotaKeeper.quotas || Array.isArray(m?.rateKeeper?.rates) && m.rateKeeper.rates || [];
20469
+ for (const q of quotaSrc) {
20470
+ const t = (q?.token ?? "").toString().toLowerCase();
20471
+ if (!t) continue;
20472
+ if (q?.isActive === false) continue;
20473
+ const rate = Number(q?.rate ?? 0);
20474
+ if (!(rate > 0)) continue;
20475
+ quotaRatePctByToken[t] = rate / 100;
20476
+ }
20467
20477
  for (const cm of m.creditManagers ?? []) {
20468
20478
  const facade = cm?.creditFacade;
20469
20479
  const manager = cm?.creditManager;
@@ -20561,6 +20571,8 @@ var getGearboxV3PublicDataConverter = (_lender, chainId, prices, additionalYield
20561
20571
  const ctPriceKey = toOracleKey(ctMeta?.assetGroup) ?? toGenericPriceKey(token, chainId);
20562
20572
  const colMarketUid = createMarketUid(chainId, lender, token);
20563
20573
  if (colMarketUid === loanMarketUid) continue;
20574
+ const quotaRate = quotaRatePctByToken[token] ?? 0;
20575
+ const grossIntrinsic = additionalYields?.intrinsicYields?.[ctPriceKey] ?? 0;
20564
20576
  data2[colMarketUid] = {
20565
20577
  marketUid: colMarketUid,
20566
20578
  name: "Collateral " + (ctMeta?.symbol ?? ""),
@@ -20581,7 +20593,8 @@ var getGearboxV3PublicDataConverter = (_lender, chainId, prices, additionalYield
20581
20593
  depositRate: 0,
20582
20594
  variableBorrowRate: 0,
20583
20595
  stableBorrowRate: 0,
20584
- intrinsicYield: additionalYields?.intrinsicYields?.[ctPriceKey] ?? 0,
20596
+ intrinsicYield: grossIntrinsic - quotaRate,
20597
+ quotaRate,
20585
20598
  rewards: [],
20586
20599
  decimals: ctDecimals,
20587
20600
  config: {