@1delta/margin-fetcher 0.0.318 → 0.0.319

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
@@ -20925,7 +20925,9 @@ function convertMidnightMarketsToResponse(raw, chainId, prices = {}, _additional
20925
20925
  }
20926
20926
  ] : void 0;
20927
20927
  const loanAddr = config.loanToken.toLowerCase();
20928
- const loanPrice = prices[loanAddr] ?? 0;
20928
+ const loanAsset = tokens[loanAddr];
20929
+ const loanKey = toOracleKey(loanAsset?.assetGroup) ?? toGenericPriceKey(loanAsset?.address ?? config.loanToken, chainId);
20930
+ const loanPrice = prices[loanKey] ?? 0;
20929
20931
  const supplyLiquidity = formatNr(top?.supplyDepthAssets ?? 0n, config.loanDecimals);
20930
20932
  const borrowLiquidity = formatNr(top?.borrowDepthAssets ?? 0n, config.loanDecimals);
20931
20933
  const entry = { data: {} };