@1delta/margin-fetcher 0.0.60 → 0.0.62

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
@@ -11846,6 +11846,7 @@ var getLenderPublicData = async (chainId, lenders, prices, additionalYields, mul
11846
11846
  ),
11847
11847
  await tokenList()
11848
11848
  ]);
11849
+ const invalidLenders = [];
11849
11850
  let lenderData = {};
11850
11851
  let currentSlice = 0;
11851
11852
  for (const lender of lenders) {
@@ -11857,16 +11858,24 @@ var getLenderPublicData = async (chainId, lenders, prices, additionalYields, mul
11857
11858
  list
11858
11859
  );
11859
11860
  if (sliceLength > 0) {
11860
- const data = rawResults.slice(currentSlice, currentSlice + sliceLength);
11861
- const convertedData = converter(data);
11862
- if (isMultiMarket(lender)) {
11863
- if (!convertedData) ; else {
11864
- lenderData = { ...lenderData, ...convertedData };
11865
- }
11866
- } else {
11867
- if (!convertedData) ; else {
11868
- lenderData[lender] = convertedData;
11861
+ try {
11862
+ const data = rawResults.slice(currentSlice, currentSlice + sliceLength);
11863
+ const convertedData = converter(data);
11864
+ if (isMultiMarket(lender)) {
11865
+ if (!convertedData) {
11866
+ invalidLenders.push(lender);
11867
+ } else {
11868
+ lenderData = { ...lenderData, ...convertedData };
11869
+ }
11870
+ } else {
11871
+ if (!convertedData) {
11872
+ invalidLenders.push(lender);
11873
+ } else {
11874
+ lenderData[lender] = convertedData;
11875
+ }
11869
11876
  }
11877
+ } catch {
11878
+ console.log("error for chain/lender", chainId, lender);
11870
11879
  }
11871
11880
  currentSlice += sliceLength;
11872
11881
  }
@@ -18348,6 +18357,8 @@ var prefixManta = "manta:";
18348
18357
  var manta = "0x95cef13441be50d20ca4558cc0a27b601ac544e5";
18349
18358
  var prefixbsc = "bsc:";
18350
18359
  var xpl = "0x405FBc9004D857903bFD6b3357792D71a50726b0";
18360
+ var prefixmoonbeam = "moonbeam:";
18361
+ var glmr = "0xacc15dc74880c9944775448304b263d191c6077f";
18351
18362
  var datasAvalanche = [WAVAX, SAVAX].map((d) => prefixAvalanche + d).join(",");
18352
18363
  var datasArbitrum = [GMX].map((d) => prefixArbitrum + d).join(",");
18353
18364
  var datasOptimism = [OP, SUSD, WRSETH].map((d) => prefixOptimism + d).join(",");
@@ -18365,6 +18376,7 @@ var datasCronos = [WCRO].map((d) => prefixCronos + d).join(",");
18365
18376
  var datasManta = [manta].map((d) => prefixManta + d).join(",");
18366
18377
  var datasTelos = [wtlos].map((d) => prefixTelos + d).join(",");
18367
18378
  var datasbsc = [xpl].map((d) => prefixbsc + d).join(",");
18379
+ var datasmoonbeam = [glmr].map((d) => prefixmoonbeam + d).join(",");
18368
18380
  var URL = `https://coins.llama.fi/prices/current/${[
18369
18381
  datasEthereum,
18370
18382
  datasAvalanche,
@@ -18376,6 +18388,7 @@ var URL = `https://coins.llama.fi/prices/current/${[
18376
18388
  datasFantom,
18377
18389
  datasHyperEvm,
18378
18390
  // datasKaia,
18391
+ datasmoonbeam,
18379
18392
  datasSonic,
18380
18393
  datasPolygon,
18381
18394
  datasSolana,
@@ -18396,6 +18409,7 @@ var URL_HIST = (ref) => `https://coins.llama.fi/prices/historical/${ref}/${[
18396
18409
  datasMetis,
18397
18410
  datasFantom,
18398
18411
  // datasKaia,
18412
+ datasmoonbeam,
18399
18413
  datasHyperEvm,
18400
18414
  datasPolygon,
18401
18415
  datasSonic,
@@ -18477,7 +18491,8 @@ var SYMBOL_MAP = {
18477
18491
  wxdc: "WXDC",
18478
18492
  wbera: "WBERA",
18479
18493
  wtlos: "WTLOS",
18480
- xpl: "WXPL"
18494
+ xpl: "WXPL",
18495
+ wglmr: "WGLMR"
18481
18496
  };
18482
18497
  async function fetchDefillamaData() {
18483
18498
  try {
@@ -18501,6 +18516,7 @@ async function fetchDefillamaData() {
18501
18516
  prices["BERA"] = prices["WBERA"];
18502
18517
  prices["TLOS"] = prices["WTLOS"];
18503
18518
  prices["XPL"] = prices["WXPL"];
18519
+ prices["GLMR"] = prices["WGLMR"];
18504
18520
  prices["USDBC"] = prices["USDC"];
18505
18521
  prices["BTCB"] = prices["WBTC"];
18506
18522
  prices["CBBTC"] = prices["WBTC"];
@@ -18543,6 +18559,7 @@ async function fetchDefillamaHistData() {
18543
18559
  histPrices["XDC"] = histPrices["WXDC"];
18544
18560
  histPrices["TLOS"] = histPrices["WTLOS"];
18545
18561
  histPrices["XPL"] = histPrices["WXPL"];
18562
+ histPrices["GLMR"] = histPrices["WGLMR"];
18546
18563
  histPrices["LUSD"] = histPrices["USDT"];
18547
18564
  histPrices["XDAI"] = histPrices["DAI"];
18548
18565
  histPrices["WXDAI"] = histPrices["DAI"];
@@ -20151,7 +20168,11 @@ var RWA_DYNAMIC_ORACLE = "0xA96abbe61AfEdEB0D14a20440Ae7100D9aB4882f";
20151
20168
  var fetchMainPrices = async (chainIds, rpcOverrides, lists = {}) => {
20152
20169
  const aaves = getAavesForChain();
20153
20170
  const multicallPromises = chainIds.map(async (chainId) => {
20154
- const aaveForks = aaves?.[chainId];
20171
+ let aaveForks = aaves?.[chainId];
20172
+ if (chainId === Chain.KAIA_MAINNET)
20173
+ aaveForks = aaveForks.filter((a) => a !== Lender.KLAYBANK);
20174
+ if (chainId === Chain.GNOSIS)
20175
+ aaveForks = aaveForks.filter((a) => a !== Lender.AGAVE);
20155
20176
  const reservesToQuery = aaveForks?.map((a) => ({
20156
20177
  fork: a,
20157
20178
  assets: getAaveAssets(chainId, a)