@1delta/margin-fetcher 0.0.272 → 0.0.273

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
@@ -36576,6 +36576,87 @@ var fetchMorphoVaults = async (chainId, multicallRetry, prices = {}, tokenList =
36576
36576
  }
36577
36577
  return fetchMorphoVaultsFromApi(chainId, prices, tokenList);
36578
36578
  };
36579
+
36580
+ // src/vaults/curatorName.ts
36581
+ var STOP_WORDS = /* @__PURE__ */ new Set([
36582
+ "vault",
36583
+ "vaults",
36584
+ "savings",
36585
+ "yield",
36586
+ "exclusive",
36587
+ "dao",
36588
+ "x",
36589
+ "pt",
36590
+ "prime",
36591
+ "staked",
36592
+ "core",
36593
+ "lista",
36594
+ // protocol brand; a bare "Lista …" vault has no distinct curator
36595
+ "moolah"
36596
+ ]);
36597
+ var ASSET_TOKENS = /* @__PURE__ */ new Set([
36598
+ "usdc",
36599
+ "usdt",
36600
+ "usd1",
36601
+ "usds",
36602
+ "dai",
36603
+ "usde",
36604
+ "susde",
36605
+ "lisusd",
36606
+ "gho",
36607
+ "frax",
36608
+ "pyusd",
36609
+ "rusd",
36610
+ "usr",
36611
+ "rlp",
36612
+ "eth",
36613
+ "weth",
36614
+ "wsteth",
36615
+ "reth",
36616
+ "steth",
36617
+ "cbeth",
36618
+ "weeth",
36619
+ "ezeth",
36620
+ "btc",
36621
+ "wbtc",
36622
+ "btcb",
36623
+ "cbbtc",
36624
+ "tbtc",
36625
+ "xaut",
36626
+ "xrp",
36627
+ "bnb",
36628
+ "wbnb",
36629
+ "sol",
36630
+ "op",
36631
+ "arb",
36632
+ "avax",
36633
+ "pol",
36634
+ "matic",
36635
+ "sei",
36636
+ "celo",
36637
+ "hype",
36638
+ "plume",
36639
+ "s"
36640
+ ]);
36641
+ function curatorNameFromVaultName(name, assetSymbol) {
36642
+ if (!name) return void 0;
36643
+ const cleaned = name.replace(/\([^)]*\)\s*$/, "").trim();
36644
+ if (!cleaned) return void 0;
36645
+ const tokens = cleaned.split(/[\s/]+/).flatMap((t) => t.split("-")).filter(Boolean);
36646
+ const asset = (assetSymbol ?? "").toLowerCase();
36647
+ const out = [];
36648
+ for (const tok of tokens) {
36649
+ const tl = tok.toLowerCase();
36650
+ if (STOP_WORDS.has(tl)) break;
36651
+ if (asset && tl === asset || ASSET_TOKENS.has(tl)) break;
36652
+ out.push(tok);
36653
+ if (out.length >= 3) break;
36654
+ }
36655
+ const curator = out.join(" ").trim();
36656
+ return curator.length >= 2 ? curator : void 0;
36657
+ }
36658
+
36659
+ // src/vaults/morpho/fetchListaFromChain.ts
36579
36660
  var { chunk: chunk6 } = lodash;
36580
36661
  var LISTA_PROTOCOL = "LISTA_DAO";
36581
36662
  var LISTA_LENS_ABI = parseAbi([
@@ -36830,6 +36911,9 @@ function parseVault5(entry, results, curatorAddrRaw, chainId, prices, tokenList,
36830
36911
  whitelisted: true,
36831
36912
  owner: void 0,
36832
36913
  curator: lcOrUndefined2(curatorAddrRaw),
36914
+ // Moolah exposes only the curator address; derive a display name from the
36915
+ // (curator-branded) vault name as a best-effort fallback.
36916
+ curatorName: curatorNameFromVaultName(fallbackName, assetMeta?.symbol),
36833
36917
  guardian: void 0,
36834
36918
  asset: assetMeta,
36835
36919
  priceUsd: priceUsd || void 0,
@@ -37208,6 +37292,7 @@ function parseVault7(v, chainId, prices, tokenList, evkIndex) {
37208
37292
  fee,
37209
37293
  owner: readAddress2(v.owner),
37210
37294
  curator: readAddress2(v.curator),
37295
+ curatorName: curatorNameFromVaultName(v.name, assetMeta?.symbol),
37211
37296
  guardian: readAddress2(v.guardian),
37212
37297
  feeRecipient: v.feeReceiver?.toLowerCase() || void 0,
37213
37298
  asset: assetMeta,
@@ -43500,6 +43585,10 @@ query LagoonVaults($where: VaultFilterInput!, $first: Int!, $skip: Int!) {
43500
43585
  name
43501
43586
  symbol
43502
43587
  decimals
43588
+ curators {
43589
+ id
43590
+ name
43591
+ }
43503
43592
  isVisible
43504
43593
  asset {
43505
43594
  address
@@ -43572,8 +43661,7 @@ var pickApr = (apr) => {
43572
43661
  if (apr.monthly != null) return { rate: apr.monthly, window: "monthly" };
43573
43662
  if (apr.weekly != null) return { rate: apr.weekly, window: "weekly" };
43574
43663
  if (apr.yearly != null) return { rate: apr.yearly, window: "yearly" };
43575
- if (apr.inception != null)
43576
- return { rate: apr.inception, window: "inception" };
43664
+ if (apr.inception != null) return { rate: apr.inception, window: "inception" };
43577
43665
  return { rate: 0, window: "none" };
43578
43666
  };
43579
43667
  var num = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
@@ -43606,12 +43694,14 @@ function parseVault8(v, chainId, prices, tokenList) {
43606
43694
  const name = (v.name ?? "").trim();
43607
43695
  const symbol = (v.symbol ?? "").trim();
43608
43696
  const displayName = name || composeVaultDisplayName(BRAND, void 0, assetMeta, symbol);
43697
+ const curatorName = v.curators?.find((c) => c?.name)?.name ?? void 0;
43609
43698
  return {
43610
43699
  address,
43611
43700
  underlying: assetAddr,
43612
43701
  symbol,
43613
43702
  name: name || symbol,
43614
43703
  displayName,
43704
+ ...curatorName ? { curatorName } : {},
43615
43705
  decimals,
43616
43706
  assetDecimals,
43617
43707
  totalAssets: totalAssetsRaw,