@1delta/margin-fetcher 5.0.99 → 5.0.100

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.d.ts CHANGED
@@ -12275,8 +12275,15 @@ declare const fetchSiloVaults: (chainId: string, prices?: {
12275
12275
  * read each earn vault's real `decimals()` on-chain
12276
12276
  * (the Data API's `decimals` field is unreliable)
12277
12277
  *
12278
- * @returns `EulerEarnVaults` keyed by lowercased vault address — `{}` when
12279
- * neither source returns data.
12278
+ * @returns `EulerEarnVaults` keyed by lowercased vault address — `{}` only
12279
+ * when a source ANSWERED with zero vaults. When every source
12280
+ * FAILED (API request error / chain unsupported, subgraph gone),
12281
+ * this throws so the dispatcher records it in `result.failed`
12282
+ * instead of serving a silent empty. Sonic (146) froze for 80
12283
+ * days exactly this way: the Data API 404s the chain, the Goldsky
12284
+ * subgraph was deleted, both failures were swallowed into `{}`,
12285
+ * and the cron logged "providers ok" while stale rows sat in
12286
+ * `vaults_latest` untouched.
12280
12287
  */
12281
12288
  declare const fetchEulerEarnVaults: (chainId: string, prices?: {
12282
12289
  [asset: string]: number;
package/dist/index.js CHANGED
@@ -19996,7 +19996,7 @@ var getSiloV2ReservesDataConverter = (lender, chainId, prices, additionalYields,
19996
19996
  }
19997
19997
  };
19998
19998
  }
19999
- return { data: out, chainId };
19999
+ return { [lender]: { data: out, chainId } };
20000
20000
  },
20001
20001
  SILO_V2_CALLS_PER_PAIR
20002
20002
  ];
@@ -20156,7 +20156,7 @@ var getSiloV3ReservesDataConverter = (lender, chainId, prices, additionalYields,
20156
20156
  }
20157
20157
  };
20158
20158
  }
20159
- return { data: out, chainId };
20159
+ return { [lender]: { data: out, chainId } };
20160
20160
  },
20161
20161
  SILO_V3_CALLS_PER_PAIR
20162
20162
  ];
@@ -64810,14 +64810,18 @@ var fetchEulerEarnVaults = async (chainId, prices = {}, tokenList = {}, multical
64810
64810
  ).catch(() => void 0);
64811
64811
  if (isNonEmpty(fromApi)) return fromApi;
64812
64812
  const subgraphUrl = getEulerEarnSubgraphUrl(chainId);
64813
- if (!subgraphUrl) return fromApi ?? {};
64814
- const fromSubgraph = await fetchEulerEarnVaultsFromSubgraph(
64813
+ const fromSubgraph = subgraphUrl ? await fetchEulerEarnVaultsFromSubgraph(
64815
64814
  chainId,
64816
64815
  prices,
64817
64816
  tokenList,
64818
64817
  multicallRetry
64819
- ).catch(() => void 0);
64820
- return isNonEmpty(fromSubgraph) ? fromSubgraph : fromApi ?? {};
64818
+ ).catch(() => void 0) : void 0;
64819
+ if (isNonEmpty(fromSubgraph)) return fromSubgraph;
64820
+ if (fromSubgraph !== void 0) return fromSubgraph;
64821
+ if (fromApi !== void 0) return fromApi;
64822
+ throw new Error(
64823
+ `euler-earn: no data source answered for chain ${chainId} (Data API failed or does not serve the chain; ${subgraphUrl ? "subgraph fallback also failed" : "no subgraph fallback configured"})`
64824
+ );
64821
64825
  };
64822
64826
  var warn6 = (...args) => {
64823
64827
  };