@1delta/margin-fetcher 0.0.300 → 0.0.303

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
@@ -38370,7 +38370,7 @@ async function isEulerEarnSubgraphStale(chainId, subgraphUrl) {
38370
38370
  fetchSubgraphHead(subgraphUrl),
38371
38371
  getEvmClientUniversal({ chain: chainId, rpcId: 0 }).getBlockNumber().then((b) => Number(b)).catch(() => null)
38372
38372
  ]);
38373
- if (subHead == null || chainHead == null) return false;
38373
+ if (subHead == null || chainHead == null) return true;
38374
38374
  const lagBlocks = chainHead - subHead;
38375
38375
  if (lagBlocks <= 0) return false;
38376
38376
  const lagSeconds = lagBlocks * (BLOCK_TIME_SEC[chainId] ?? DEFAULT_BLOCK_TIME_SEC);
@@ -46106,6 +46106,25 @@ var fetchHypercoreVaults = async (options) => {
46106
46106
 
46107
46107
  // src/vaults/classification.ts
46108
46108
  var VOLATILE_PROVIDERS = /* @__PURE__ */ new Set(["hypercore", "gmx"]);
46109
+ var SYNC_REDEMPTION_PROVIDERS = /* @__PURE__ */ new Set([
46110
+ "morpho",
46111
+ "lista",
46112
+ "euler-earn",
46113
+ "fluid",
46114
+ "gearbox",
46115
+ "silo",
46116
+ "yearn"
46117
+ ]);
46118
+ var ASYNC_REDEMPTION_PROVIDERS = /* @__PURE__ */ new Set(["lagoon", "upshift"]);
46119
+ var classifyRedemption = (provider, v) => {
46120
+ if (ASYNC_REDEMPTION_PROVIDERS.has(provider)) return "async";
46121
+ if (SYNC_REDEMPTION_PROVIDERS.has(provider)) return "sync";
46122
+ if (provider === "lst") return "async";
46123
+ if (provider === "savings") {
46124
+ return v.withdrawalMode === "instant" && !v.withdrawalCooldownSeconds ? "sync" : "async";
46125
+ }
46126
+ return "sync";
46127
+ };
46109
46128
  var VOLATILE_VAULT_OVERRIDES = /* @__PURE__ */ new Set([
46110
46129
  // '1-0x…', // <chain>-<address> of a known volatile strategy vault
46111
46130
  ]);
@@ -46223,6 +46242,7 @@ var stampVaultClassification = (data, chainId, tokenList = {}) => {
46223
46242
  });
46224
46243
  v.yieldProfile = c.yieldProfile;
46225
46244
  v.denomination = c.denomination;
46245
+ v.redemptionType = classifyRedemption(provider, v);
46226
46246
  const raw = v.convertToAssets ?? v.pricePerShare;
46227
46247
  if (raw != null) {
46228
46248
  v.sharePriceRaw = raw;