@1delta/margin-fetcher 0.0.244 → 0.0.245
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 +7 -9
- package/dist/index.js.map +1 -1
- package/dist/prices/oracle-prices/fetchOraclePrices.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/index.d.ts +1 -1
- package/dist/prices/oracle-prices/fetchers/index.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts +9 -0
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -30953,6 +30953,7 @@ function morphoApiAvailable(chainId) {
|
|
|
30953
30953
|
if (chainId === Chain.BERACHAIN) return false;
|
|
30954
30954
|
if (chainId === Chain.SEI_NETWORK) return false;
|
|
30955
30955
|
if (chainId === Chain.CELO_MAINNET) return false;
|
|
30956
|
+
if (chainId === Chain.LISK) return false;
|
|
30956
30957
|
return true;
|
|
30957
30958
|
}
|
|
30958
30959
|
function generateMarketId(oracle, loanAsset, collateralAsset) {
|
|
@@ -32680,7 +32681,9 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
32680
32681
|
() => aaveV4Fetcher.getCalls(chainId),
|
|
32681
32682
|
getCallsErrors
|
|
32682
32683
|
) : [];
|
|
32683
|
-
const
|
|
32684
|
+
const morphoUseApi = isActive("morpho") && morphoApiAvailable(chainId);
|
|
32685
|
+
const morphoUseOnChain = isActive("morpho") && !morphoUseApi;
|
|
32686
|
+
const morphoResults = morphoUseOnChain ? safeGetCalls(
|
|
32684
32687
|
"morpho",
|
|
32685
32688
|
() => morphoFetcher.getCalls(chainId, {
|
|
32686
32689
|
marketOverrides: morphoMarketOverrides
|
|
@@ -32802,7 +32805,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
32802
32805
|
return { chainId, data: chainResult, diagnostic: diag2 };
|
|
32803
32806
|
}
|
|
32804
32807
|
const chainBatchSize = batchSize?.[chainId];
|
|
32805
|
-
const morphoGqlPromise =
|
|
32808
|
+
const morphoGqlPromise = morphoUseApi ? fetchMorphoGraphQLPrices(chainId) : Promise.resolve(null);
|
|
32806
32809
|
const siloV2GqlPromise = isActive("silov2") ? fetchSiloV2GraphQLPrices(chainId, basePrices, tokenList) : Promise.resolve(null);
|
|
32807
32810
|
const siloV3GqlPromise = isActive("silov3") ? fetchSiloV3GraphQLPrices(chainId, basePrices, tokenList) : Promise.resolve(null);
|
|
32808
32811
|
const [
|
|
@@ -32912,19 +32915,14 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
32912
32915
|
allowFailure,
|
|
32913
32916
|
rpcOverrides
|
|
32914
32917
|
);
|
|
32915
|
-
|
|
32916
|
-
console.warn(
|
|
32917
|
-
`[prices] chain ${chainId}: Morpho GraphQL returned null, falling back to on-chain (${morphoGroup.trackers.length} trackers)`
|
|
32918
|
-
);
|
|
32919
|
-
}
|
|
32920
|
-
const morphoData = morphoGqlEntries != null ? { results: [], error: void 0 } : await executeGroup(
|
|
32918
|
+
const morphoData = morphoUseOnChain ? await executeGroup(
|
|
32921
32919
|
morphoGroup,
|
|
32922
32920
|
chainId,
|
|
32923
32921
|
chainBatchSize,
|
|
32924
32922
|
retries,
|
|
32925
32923
|
allowFailure,
|
|
32926
32924
|
rpcOverrides
|
|
32927
|
-
);
|
|
32925
|
+
) : { results: [], error: void 0 };
|
|
32928
32926
|
const useMorphoGql = morphoGqlEntries != null;
|
|
32929
32927
|
const groupResults = [
|
|
32930
32928
|
{ group: aaveGroup, data: aaveData },
|