@1delta/margin-fetcher 5.0.103 → 5.0.105

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
@@ -7787,7 +7787,8 @@ interface LstWithdrawalRegistryEntry {
7787
7787
  * - Renzo: WithdrawQueue
7788
7788
  * - BENQI sAVAX: the sAVAX contract itself
7789
7789
  * - Beets stS: the SonicStaking proxy itself
7790
- * - Hyperbeat hbHYPE: the share token itself (ERC-7540 surface) */
7790
+ * - Hyperbeat hbHYPE: the share token itself (ERC-7540 surface)
7791
+ * - Nest: the per-asset NestVault (ERC-7540 requests live there) */
7791
7792
  withdrawalContract?: string;
7792
7793
  /** Polygon IStakeManager — only for `staderMaticXQueue`. The
7793
7794
  * finalization check requires `epoch()` + `withdrawalDelay()`. */
package/dist/index.js CHANGED
@@ -5,11 +5,11 @@ import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao,
5
5
  export { hasCrossMarginRisk, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isMultiMarket, isYLDR } from '@1delta/lender-registry';
6
6
  import { fetchTokenLists, fetchTokenList, aavePools, compoundV3Pools, initConfig, morphoPools, compoundV2Pools, eulerVaults, siloMarkets, siloV2LenderKey, siloMarketsV3, siloV3LenderKey, aaveV4Spokes, aaveV4SpokeLenderKey, fluidResolvers, gearboxResolvers, dolomiteConfigs, midnightConfig, termConfig, termMarketsByChain, exactlyConfig, flyingTulipLendersByChain, liquityLendersByChain, riverLendersByChain, inverseLendersByChain, coolerLendersByChain, llamaLendLendersByChain, usddLendersByChain, skyLendersByChain, frankencoinLendersByChain, resupplyLendersByChain, curvanceLendersByChain, fraxlendLendersByChain, twyneLendersByChain, tellerConfigByChain, tellerPoolsByChain, termMaxConfigByChain, aaveReserves, compoundV3Reserves, dolomiteIsolationMarket, morphoTypeMarkets, resolveTermApiBase, flyingTulipConfigFor, flyingTulipAssetsFor, liquityConfigFor, liquityBranchesByChain, riverConfigFor, riverChainData, termMaxApiBaseUrl, termMaxLenderKey, inverseConfigFor, inverseChainData, coolerConfigFor, llamaLendConfigFor, llamaLendChainData, llamaLendApiBaseUrl, resupplyConfigFor, fraxlendConfigFor, dssConfigFor, dssChainData, dssDebtToken, dssDebtJoin, frankencoinConfigFor, frankencoinChainData, aaveTokens, compoundV3BaseData, compoundV2TokenArray, morphoTypeVaults, eulerConfigs, fluidVaultEntries, gearboxMarketConfigurators, dolomiteIsolation, liquityMarkets, riverMarkets, tellerConfig, tellerPools, termMarkets, termMaxConfig, midnightMarkets, midnightCollateralRef, llamaLendMarkets, fraxlendPairsFor, inverseMarkets, curvanceConfig, frankencoinMarkets, twyneMarkets, twyneConfigFor, exactlyMarkets, aaveOracles, resolveMidnightApiBase, llamaLendMarketByVault, getSiloV2MarketEntry, getSiloV3MarketEntry, dolomiteEmode, curvanceConfigFor, listaCollateralProvider, gearboxMarketCompressor, gearboxV3LenderKey, midnightMarketsByChain, twyneChainData, parseAaveV4SpokeLenderKey, gearboxAccountCompressor, compoundV2Tokens, exactlyMarketsByChain, aaveOraclesConfig, compoundV2Oracles, compoundV2OraclesConfig, compoundV3OraclesData, compoundV2Reserves, aaveV4Oracles, morphoTypeOracles } from '@1delta/data-sdk';
7
7
  import lodash from 'lodash';
8
- import { Chain, isEvmChainId } from '@1delta/chain-registry';
8
+ import { Chain, isEvmChainId, isSvmChainId } from '@1delta/chain-registry';
9
9
  import { multicallRetryUniversal, getEvmClient, getEvmChain, createMulticallRetryUniversal, LIST_OVERRIDES, getEvmClientUniversal } from '@1delta/providers';
10
10
  import { LiquityTroveManagerAbi, LiquityActivePoolAbi, LiquityStabilityPoolAbi, LiquityPriceFeedAbi, LiquitySortedTrovesAbi, RiverTroveManagerAbi, RiverStabilityPoolAbi, TellerMarketRegistryAbi, TellerV2Abi, InverseMarketAbi, InverseOracleAbi, InverseDbrAbi, CurveTricryptoOracleAbi, Erc20Abi, CoolerMonoAbi, CoolerLtvOracleAbi, LlamaLendControllerAbi, LlamaLendControllerV1Abi, LlamaLendControllerV2Abi, LlamaLendVaultAbi, LlamaLendAmmAbi, TwyneCollateralVaultAbi, MetaMorphoAbi, FluidDexResolverAbi, ExactlyPreviewerAbi, ExactlyAuditorAbi, FlyingTulipLendingLensAbi, LenderCommitmentGroupAbi, ResupplyRegistryAbi, ResupplyPairAbi, ResupplyUtilitiesAbi, ResupplyRewardHandlerAbi, ResupplyPairEmissionsAbi, ConvexPoolUtilAbi, FraxlendPairAbi, FraxlendLeverAbi, FrankencoinPositionAbi, FluidLendingResolverAbi, FluidVaultResolverAbi, FluidLiquidityResolverAbi, MoolahVaultAbi, UsddVatAbi, UsddJugAbi, UsddSpotAbi, MorphoLensAbi, AaveV4SpokeAbi, AaveV4OracleAbi, AaveV4HubAbi, DolomiteMarginAbi, GearboxMarketCompressorV310Abi, MorphoBlueAbi, MidnightAbi, TermRepoTokenAbi, TermRepoServicerAbi, TermRepoCollateralManagerAbi, LiquityTroveNFTAbi, LiquityCollSurplusPoolAbi, TellerCollateralManagerAbi, TermMaxViewerAbi, InverseEscrowAbi, CurvanceMarketManagerAbi, CurvanceCTokenAbi, GearboxCreditAccountCompressorV310Abi, TwyneVaultManagerAbi, TwyneCollateralVaultFactoryAbi, AaveV2V3Abi, TwyneATokenWrapperAbi, UsddCdpManagerAbi, UsddProxyRegistryAbi, CurvanceProtocolReaderAbi, CurvanceCentralRegistryAbi, TermPriceConsumerAbi, CurvanceOracleManagerAbi, TermMaxOracleAggregatorV2Abi } from '@1delta/abis';
11
11
  export { MorphoLensAbi } from '@1delta/abis';
12
- import { prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getLstAcceptedInputs, savingsVerbRequires, savingsSupportsVerb, getCompoundV2Comptroller as getCompoundV2Comptroller$1, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, FLUID_VAULT_FACTORY, getAaveStyleLenderTokenAddress, LendingMode, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, findSavingsWithdrawEntry, bandLtvCurve, InitMarginAddresses, ignoresReceiver, buildLstWithdrawRequest, SAVINGS_RECEIVER_CAPABILITY } from '@1delta/calldata-sdk';
12
+ import { NEST_SAVINGS_VAULTS, NEST_PREDICATE_PROXY, NEST_USDC, prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getLstAcceptedInputs, savingsVerbRequires, savingsSupportsVerb, getCompoundV2Comptroller as getCompoundV2Comptroller$1, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, FLUID_VAULT_FACTORY, getAaveStyleLenderTokenAddress, LendingMode, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, findSavingsWithdrawEntry, bandLtvCurve, InitMarginAddresses, ignoresReceiver, buildLstWithdrawRequest, SAVINGS_RECEIVER_CAPABILITY } from '@1delta/calldata-sdk';
13
13
  import { proxyNativeFetch } from '@1delta/proxy-fetch';
14
14
  import { BALANCER_V2_FORKS, BALANCER_V3_FORKS, UNISWAP_V4_FORKS, isFlashLoanSourceExcluded, FLASH_LOAN_IDS } from '@1delta/dex-registry';
15
15
  import { getNativeDecimals, getWrappedNativeAddressSafe, isNativeWrapOneToOne } from '@1delta/wnative';
@@ -51558,6 +51558,164 @@ var VENUS_HUB_ENTRIES = {
51558
51558
  [Chain.BNB_SMART_CHAIN_MAINNET]: "0x6d93fd479f2d37445cfbe132412e316a0364acc2"
51559
51559
  });
51560
51560
 
51561
+ // src/yields/intrinsic/fetchers/nest.ts
51562
+ var NEST_API_URL = "https://api.nest.credit/v1";
51563
+ var NEST_VAULT_GROUPS = {
51564
+ "0x119dd7daff816f29d7ee47596ae5e4bdc4299165": "Nest BlackOpal LiquidStone II Vault::nOPAL",
51565
+ "0x2a3e301dbd45c143dfbb7b1ce1c55bf0bbf161cb": "Nest Apollo ACRDX Vault::nACRDX",
51566
+ "0xe72fe64840f4ef80e3ec73a1c749491b5c938cb9": "Nest Treasuries Vault::nTBILL",
51567
+ "0x29bf22381a5811dec89dc7b46a5ce57ad02c0240": "Nest WisdomTree Vault::nWISDOM",
51568
+ "0x593ccca4c4bf58b7526a4c164ceef4003c6388db": "Nest Alpha Vault::nALPHA",
51569
+ "0x11113ff3a60c2450f4b22515cb760417259ee94b": "Nest Basis Vault::nBASIS",
51570
+ "0xa5f78b2a0ab85429d2dfbf8b60abc70f4cec066c": "Nest Credit Vault::nCREDIT",
51571
+ "0x7488b23f4c26b44eef2e0766896be47443e86d79": "Nest AXI Vault::nAXI",
51572
+ "0xd99076fcfd61b3695c5a00740364a84ac8c46cba": "Nest Perena Vault::nPERENA",
51573
+ "0xdf45b8322ea4ce898331602e2d1f3d1a67ae0ee8": "Nest Liquid Credit Vault::nLCRD",
51574
+ "0x770c2d6b16c8f8ab5535ae719a5475411c120f6e": "Nest Hamilton Lane SCOPE Vault::nSCOPE",
51575
+ "0x066d10e240999aea6798b2e2ca0bdac2923cbdff": "Nest FalconX CLO::nFALCON",
51576
+ "0x63810d7f1c7b4dbfb60c173ba120a2be98b59e13": "Nest BlackRock iShares AAA CLO Active ETF Vault::nCLOA",
51577
+ "0x6fec234e8801ed88964bc058a0f9fbcc9fcbd2eb": "Prime Vault::nPRIME",
51578
+ "0x1f37620a0e0660db3cdbb8cdbf62d8099f959925": "Plume Factor Vault::FACTOR"
51579
+ };
51580
+ var NEST_GROUP_ALIASES = {
51581
+ "Nest Alpha Vault::nALPHA": ["Nest ALPHA Vault::nALPHA"],
51582
+ "Nest AXI Vault::nAXI": ["Nest USDC PayFi Lending Vault::nAXI"],
51583
+ "Nest BlackRock iShares AAA CLO Active ETF Vault::nCLOA": [
51584
+ "Nest BlackRock iShares AAA CLO Active ETF Vault::NCLOA"
51585
+ ]
51586
+ };
51587
+ var NEST_RWA_SLUGS = [
51588
+ {
51589
+ slug: "janus-henderson-fund",
51590
+ group: "Janus Henderson Anemoy Treasury Fund::JTRSY"
51591
+ },
51592
+ {
51593
+ slug: "superstate-ustb",
51594
+ group: "Superstate Short Duration US Government Securities Fund::USTB"
51595
+ },
51596
+ {
51597
+ slug: "superstate-uscc",
51598
+ group: "Superstate Crypto Carry Fund::USCC"
51599
+ },
51600
+ {
51601
+ slug: "apollo-acrdx",
51602
+ group: "Anemoy Tokenized Apollo Diversified Credit Fund::ACRDX"
51603
+ },
51604
+ {
51605
+ slug: "blackstone-srln",
51606
+ group: "Dinari SRLN::SRLN.D"
51607
+ }
51608
+ ];
51609
+ var pickApy = (apy) => {
51610
+ if (!apy) return void 0;
51611
+ if (typeof apy.rolling30d === "number" && apy.rolling30d > 0)
51612
+ return apy.rolling30d;
51613
+ if (typeof apy.rolling7d === "number" && apy.rolling7d > 0)
51614
+ return apy.rolling7d;
51615
+ return void 0;
51616
+ };
51617
+ var toApr = (apy) => apyToAprPercent(apy * 100);
51618
+ var nestFetcher = {
51619
+ label: "NEST",
51620
+ fetch: async () => {
51621
+ const [unified, ...rwa] = await Promise.all([
51622
+ fetch(`${NEST_API_URL}/vaults/apy`).then(
51623
+ (r) => r.json()
51624
+ ),
51625
+ ...NEST_RWA_SLUGS.map(
51626
+ ({ slug }) => fetch(`${NEST_API_URL}/assets/${slug}/apy`).then(
51627
+ (r) => r.json()
51628
+ )
51629
+ )
51630
+ ]);
51631
+ const result = {};
51632
+ for (const v of unified?.data ?? []) {
51633
+ const group = NEST_VAULT_GROUPS[v.vaultAddress.toLowerCase()];
51634
+ if (!group) continue;
51635
+ const apy = pickApy(v.navApy);
51636
+ if (apy === void 0) continue;
51637
+ result[group] = toApr(apy);
51638
+ for (const alias of NEST_GROUP_ALIASES[group] ?? [])
51639
+ result[alias] = result[group];
51640
+ }
51641
+ for (let i = 0; i < NEST_RWA_SLUGS.length; i++) {
51642
+ const apy = pickApy(rwa[i]?.data?.tokens?.[0]?.apy);
51643
+ if (apy === void 0) continue;
51644
+ result[NEST_RWA_SLUGS[i].group] = toApr(apy);
51645
+ }
51646
+ return result;
51647
+ }
51648
+ };
51649
+
51650
+ // src/vaults/savings/registryNest.ts
51651
+ var EXIT = "Deposits go through Nest\u2019s compliance-screened proxy. Exit instantly for a fee, up to the USDC held idle on this chain, or request a redemption Nest fulfils (hours to days; longer for credit) and claim it. The price is an operator-published NAV.";
51652
+ var NEST_VAULT_PROSE = {
51653
+ nOPAL: {
51654
+ yieldKey: "Nest BlackOpal LiquidStone II Vault::nOPAL",
51655
+ description: "Nest\u2019s largest vault: BlackOpal\u2019s LiquidStone II \u2014 short-term receivables financing \u2014 with a Treasury and basis sleeve."
51656
+ },
51657
+ nPRIME: {
51658
+ yieldKey: "Prime Vault::nPRIME",
51659
+ description: "A single-strategy vault holding Hastra PRIME, a tokenized home-equity credit fund; almost all of it sits on Ethereum with a handful of holders."
51660
+ },
51661
+ nFALCON: {
51662
+ yieldKey: "Nest FalconX CLO::nFALCON",
51663
+ description: "A single-strategy vault holding OpenTrade\u2019s XDLF, a FalconX-linked credit facility; concentrated among few holders."
51664
+ },
51665
+ nALPHA: {
51666
+ yieldKey: "Nest Alpha Vault::nALPHA",
51667
+ description: "A fund of Nest vaults \u2014 receivables, Treasuries, private credit and CLOs \u2014 allocated by Cicada."
51668
+ },
51669
+ FACTOR: {
51670
+ yieldKey: "Plume Factor Vault::FACTOR",
51671
+ description: "Plume\u2019s asset-backed-finance vault: residential solar loans, private credit deals and Hastra PRIME, with a Treasury sleeve. Its fees are the highest here \u2014 2 % to exit instantly, 0.5 % on a queued redemption."
51672
+ },
51673
+ nAXI: {
51674
+ yieldKey: "Nest AXI Vault::nAXI",
51675
+ description: "A single-strategy vault lending USDC to Axiym\u2019s cross-border payment (PayFi) book; concentrated among few holders."
51676
+ },
51677
+ nTBILL: {
51678
+ yieldKey: "Nest Treasuries Vault::nTBILL",
51679
+ description: "Short-dated US Treasuries through Janus Henderson\u2019s Anemoy fund (JTRSY) and Superstate\u2019s USTB."
51680
+ },
51681
+ nCLOA: {
51682
+ yieldKey: "Nest BlackRock iShares AAA CLO Active ETF Vault::nCLOA",
51683
+ description: "AAA CLO tranches through a tokenized BlackRock iShares AAA CLO ETF and OpenTrade\u2019s xUSCLO."
51684
+ },
51685
+ nLCRD: {
51686
+ yieldKey: "Nest Liquid Credit Vault::nLCRD",
51687
+ description: "A liquid private-credit strategy with a Treasury sleeve; concentrated among few holders."
51688
+ }
51689
+ };
51690
+ var NEST_ENTRIES = (() => {
51691
+ const out = {};
51692
+ for (const v of NEST_SAVINGS_VAULTS) {
51693
+ const prose = NEST_VAULT_PROSE[v.symbol];
51694
+ if (!prose) continue;
51695
+ for (const chainId of v.chains) {
51696
+ (out[chainId] ??= []).push({
51697
+ reader: "nest-vault",
51698
+ address: v.share,
51699
+ underlying: NEST_USDC[chainId],
51700
+ symbol: v.symbol,
51701
+ brand: "Nest",
51702
+ description: `${prose.description} ${EXIT}`,
51703
+ decimals: 6,
51704
+ underlyingDecimals: 6,
51705
+ isRebasing: false,
51706
+ isMintable: true,
51707
+ mintContract: NEST_PREDICATE_PROXY,
51708
+ withdrawQueue: v.nestVault,
51709
+ withdrawalMode: "fee-or-queued",
51710
+ solvency: "nav-attested",
51711
+ yieldFetcher: nestFetcher,
51712
+ yieldKey: prose.yieldKey
51713
+ });
51714
+ }
51715
+ }
51716
+ return out;
51717
+ })();
51718
+
51561
51719
  // src/vaults/savings/registry.ts
51562
51720
  var stUsdGroup = {
51563
51721
  base: {
@@ -53617,6 +53775,10 @@ var SAVINGS_REGISTRY = (() => {
53617
53775
  if (!out[chainId]) out[chainId] = [];
53618
53776
  out[chainId].push(...entries);
53619
53777
  }
53778
+ for (const [chainId, entries] of Object.entries(NEST_ENTRIES)) {
53779
+ if (!out[chainId]) out[chainId] = [];
53780
+ out[chainId].push(...entries);
53781
+ }
53620
53782
  return out;
53621
53783
  })();
53622
53784
  var savingsBalanceKind = (chainId, address) => {
@@ -55805,18 +55967,13 @@ var pendleFetcher = {
55805
55967
  };
55806
55968
 
55807
55969
  // src/yields/intrinsic/fetchers/usdai.ts
55808
- var USDAI_APY_URL = "https://api.usd.ai/usdai/dashboard/current-apy";
55970
+ var USDAI_DEFILLAMA_POOL = "712ce948-bd9e-4f4a-8916-b72c447f7578";
55809
55971
  var usdai = "sUSDai::SUSDAI";
55810
55972
  var usdaiFetcher = {
55811
55973
  label: "USDai",
55812
55974
  fetch: async () => {
55813
- const res = await fetch(USDAI_APY_URL, {
55814
- headers: {
55815
- origin: "https://app.usd.ai",
55816
- referer: "https://app.usd.ai/"
55817
- }
55818
- }).then((r) => r.json());
55819
- return { [usdai]: apyToAprPercent(Number(res.result)) };
55975
+ const apy = await fetchDefiLlamaApy(USDAI_DEFILLAMA_POOL);
55976
+ return { [usdai]: apyToAprPercent(apy) };
55820
55977
  }
55821
55978
  };
55822
55979
 
@@ -55935,82 +56092,6 @@ var midasFetcher = {
55935
56092
  return result;
55936
56093
  }
55937
56094
  };
55938
-
55939
- // src/yields/intrinsic/fetchers/nest.ts
55940
- var NEST_API_URL = "https://api.nest.credit/v1";
55941
- var NEST_VAULT_GROUPS = {
55942
- "0x119dd7daff816f29d7ee47596ae5e4bdc4299165": "Nest BlackOpal LiquidStone II Vault::nOPAL",
55943
- "0x2a3e301dbd45c143dfbb7b1ce1c55bf0bbf161cb": "Nest Apollo ACRDX Vault::nACRDX",
55944
- "0xe72fe64840f4ef80e3ec73a1c749491b5c938cb9": "Nest Treasuries Vault::nTBILL",
55945
- "0x29bf22381a5811dec89dc7b46a5ce57ad02c0240": "Nest WisdomTree Vault::nWISDOM",
55946
- "0x593ccca4c4bf58b7526a4c164ceef4003c6388db": "Nest Alpha Vault::nALPHA",
55947
- "0x11113ff3a60c2450f4b22515cb760417259ee94b": "Nest Basis Vault::nBASIS",
55948
- "0xa5f78b2a0ab85429d2dfbf8b60abc70f4cec066c": "Nest Credit Vault::nCREDIT",
55949
- "0x7488b23f4c26b44eef2e0766896be47443e86d79": "Nest USDC PayFi Lending Vault::nAXI",
55950
- "0xd99076fcfd61b3695c5a00740364a84ac8c46cba": "Nest Perena Vault::nPERENA",
55951
- "0xdf45b8322ea4ce898331602e2d1f3d1a67ae0ee8": "Nest Liquid Credit Vault::nLCRD",
55952
- "0x770c2d6b16c8f8ab5535ae719a5475411c120f6e": "Nest Hamilton Lane SCOPE Vault::nSCOPE"
55953
- };
55954
- var NEST_RWA_SLUGS = [
55955
- {
55956
- slug: "janus-henderson-fund",
55957
- group: "Janus Henderson Anemoy Treasury Fund::JTRSY"
55958
- },
55959
- {
55960
- slug: "superstate-ustb",
55961
- group: "Superstate Short Duration US Government Securities Fund::USTB"
55962
- },
55963
- {
55964
- slug: "superstate-uscc",
55965
- group: "Superstate Crypto Carry Fund::USCC"
55966
- },
55967
- {
55968
- slug: "apollo-acrdx",
55969
- group: "Anemoy Tokenized Apollo Diversified Credit Fund::ACRDX"
55970
- },
55971
- {
55972
- slug: "blackstone-srln",
55973
- group: "Dinari SRLN::SRLN.D"
55974
- }
55975
- ];
55976
- var pickApy = (apy) => {
55977
- if (!apy) return void 0;
55978
- if (typeof apy.rolling30d === "number" && apy.rolling30d > 0)
55979
- return apy.rolling30d;
55980
- if (typeof apy.rolling7d === "number" && apy.rolling7d > 0)
55981
- return apy.rolling7d;
55982
- return void 0;
55983
- };
55984
- var toApr = (apy) => apyToAprPercent(apy * 100);
55985
- var nestFetcher = {
55986
- label: "NEST",
55987
- fetch: async () => {
55988
- const [unified, ...rwa] = await Promise.all([
55989
- fetch(`${NEST_API_URL}/vaults/apy`).then(
55990
- (r) => r.json()
55991
- ),
55992
- ...NEST_RWA_SLUGS.map(
55993
- ({ slug }) => fetch(`${NEST_API_URL}/assets/${slug}/apy`).then(
55994
- (r) => r.json()
55995
- )
55996
- )
55997
- ]);
55998
- const result = {};
55999
- for (const v of unified?.data ?? []) {
56000
- const group = NEST_VAULT_GROUPS[v.vaultAddress.toLowerCase()];
56001
- if (!group) continue;
56002
- const apy = pickApy(v.navApy);
56003
- if (apy === void 0) continue;
56004
- result[group] = toApr(apy);
56005
- }
56006
- for (let i = 0; i < NEST_RWA_SLUGS.length; i++) {
56007
- const apy = pickApy(rwa[i]?.data?.tokens?.[0]?.apy);
56008
- if (apy === void 0) continue;
56009
- result[NEST_RWA_SLUGS[i].group] = toApr(apy);
56010
- }
56011
- return result;
56012
- }
56013
- };
56014
56095
  var ACCOUNTABLE_LIST_URL = "https://yield.accountable.capital/api/loan";
56015
56096
  async function symbolToAssetGroup(chainId) {
56016
56097
  const list = await fetchTokenList(chainId);
@@ -67310,7 +67391,7 @@ var deriveProtocolExitRoutes = (i) => {
67310
67391
  // term-sheet rules call out for `fees: []`.
67311
67392
  ...i.withdrawFeeBps == null ? { feeUnknown: true, label: "Instant (fee)" } : {}
67312
67393
  },
67313
- { ...queuedRoute(i), feeBps: 0 }
67394
+ { ...queuedRoute(i), feeBps: i.queuedFeeBps ?? 0 }
67314
67395
  ];
67315
67396
  // Same split with no fee on either leg — the instant leg is bounded by
67316
67397
  // inventory instead.
@@ -68282,7 +68363,7 @@ var Erc7540Abi = [
68282
68363
  // src/vaults/lst/withdrawals/readers/erc7540.ts
68283
68364
  var readerErc7540 = {
68284
68365
  fetch: async (user, multicallRetry, chainId, entry) => {
68285
- const requestContract = entry.lst;
68366
+ const requestContract = entry.withdrawalContract ?? entry.lst;
68286
68367
  const stage1 = await multicallRetry({
68287
68368
  chain: chainId,
68288
68369
  calls: [
@@ -70268,8 +70349,6 @@ var buildWithdrawalReader = (entry) => {
70268
70349
  return readerEmpty;
70269
70350
  }
70270
70351
  };
70271
-
70272
- // src/vaults/lst/withdrawals/registry.ts
70273
70352
  var LST_WITHDRAWAL_REGISTRY = {
70274
70353
  "1": [
70275
70354
  {
@@ -71031,8 +71110,24 @@ var LST_WITHDRAWAL_REGISTRY = {
71031
71110
  }
71032
71111
  ]
71033
71112
  };
71113
+ var NEST_WITHDRAWAL_ENTRIES = (() => {
71114
+ const out = {};
71115
+ for (const v of NEST_SAVINGS_VAULTS)
71116
+ for (const chainId of v.chains)
71117
+ (out[chainId] ??= []).push({
71118
+ lst: v.share,
71119
+ brand: "Nest",
71120
+ symbol: v.symbol,
71121
+ reader: "erc7540",
71122
+ withdrawalContract: v.nestVault
71123
+ });
71124
+ return out;
71125
+ })();
71034
71126
  var getLstWithdrawalRegistry = (chainId, extraEntries) => {
71035
- const base = LST_WITHDRAWAL_REGISTRY[chainId] ?? [];
71127
+ const base = [
71128
+ ...LST_WITHDRAWAL_REGISTRY[chainId] ?? [],
71129
+ ...NEST_WITHDRAWAL_ENTRIES[chainId] ?? []
71130
+ ];
71036
71131
  if (!extraEntries || extraEntries.length === 0) return base;
71037
71132
  const seen = new Set(base.map((e) => e.lst.toLowerCase()));
71038
71133
  const extra = extraEntries.filter((e) => !seen.has(e.lst.toLowerCase()));
@@ -71891,6 +71986,46 @@ var SaturnPreviewDepositAbi = [
71891
71986
  }
71892
71987
  ];
71893
71988
 
71989
+ // src/vaults/savings/abis/nest.ts
71990
+ var NestVaultReadAbi = [
71991
+ {
71992
+ inputs: [],
71993
+ name: "totalAssets",
71994
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
71995
+ stateMutability: "view",
71996
+ type: "function"
71997
+ },
71998
+ {
71999
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
72000
+ name: "convertToAssets",
72001
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
72002
+ stateMutability: "view",
72003
+ type: "function"
72004
+ },
72005
+ {
72006
+ inputs: [{ internalType: "uint8", name: "_f", type: "uint8" }],
72007
+ name: "fees",
72008
+ outputs: [
72009
+ { internalType: "uint32", name: "_rate", type: "uint32" },
72010
+ { internalType: "uint256", name: "_flat", type: "uint256" }
72011
+ ],
72012
+ stateMutability: "view",
72013
+ type: "function"
72014
+ }
72015
+ ];
72016
+ var NestPredicateProxyReadAbi = [
72017
+ {
72018
+ inputs: [],
72019
+ name: "paused",
72020
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
72021
+ stateMutability: "view",
72022
+ type: "function"
72023
+ }
72024
+ ];
72025
+ var NEST_FEE_INSTANT_REDEMPTION = 0;
72026
+ var NEST_FEE_DEPOSIT = 1;
72027
+ var NEST_FEE_REDEMPTION = 2;
72028
+
71894
72029
  // src/vaults/savings/readers/erc4626Idle.ts
71895
72030
  var readerErc4626Idle = (entry) => {
71896
72031
  const shareUnit = 10n ** BigInt(entry.decimals);
@@ -72274,6 +72409,81 @@ var readerNavOracle = (entry) => {
72274
72409
  };
72275
72410
  };
72276
72411
 
72412
+ // src/vaults/savings/readers/nestVault.ts
72413
+ var ppmToBps = (v) => {
72414
+ if (!Array.isArray(v)) return void 0;
72415
+ const rate = toBigInt16(v[0]);
72416
+ const flat = toBigInt16(v[1]);
72417
+ if (rate === void 0 || flat === void 0 || flat !== 0n) return void 0;
72418
+ return Number(rate) / 100;
72419
+ };
72420
+ var readerNestVault = (entry) => {
72421
+ const { address, underlying, withdrawQueue, mintContract } = entry;
72422
+ const nestVault = withdrawQueue ?? address;
72423
+ const shareUnit = 10n ** BigInt(entry.decimals);
72424
+ const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
72425
+ const calls = [
72426
+ { address: nestVault, name: "totalAssets", params: [] },
72427
+ { address, name: "totalSupply", params: [] },
72428
+ { address: nestVault, name: "convertToAssets", params: [shareUnit] },
72429
+ {
72430
+ address: nestVault,
72431
+ name: "fees",
72432
+ params: [NEST_FEE_INSTANT_REDEMPTION]
72433
+ },
72434
+ { address: nestVault, name: "fees", params: [NEST_FEE_DEPOSIT] },
72435
+ { address: nestVault, name: "fees", params: [NEST_FEE_REDEMPTION] },
72436
+ {
72437
+ address: underlying,
72438
+ name: "balanceOf",
72439
+ params: [entry.inventoryContract ?? address]
72440
+ },
72441
+ { address: mintContract ?? nestVault, name: "paused", params: [] }
72442
+ ];
72443
+ return {
72444
+ calls,
72445
+ abis: [
72446
+ NestVaultReadAbi,
72447
+ TotalSupplyAbi2,
72448
+ NestVaultReadAbi,
72449
+ NestVaultReadAbi,
72450
+ NestVaultReadAbi,
72451
+ NestVaultReadAbi,
72452
+ BalanceOfAbi,
72453
+ NestPredicateProxyReadAbi
72454
+ ],
72455
+ parse: ([
72456
+ assets,
72457
+ supply,
72458
+ perShare,
72459
+ instFee,
72460
+ depFee,
72461
+ redFee,
72462
+ idle,
72463
+ paused
72464
+ ]) => {
72465
+ const totalAssets = toBigInt16(assets);
72466
+ const totalSupply = toBigInt16(supply);
72467
+ const conv = toBigInt16(perShare);
72468
+ if (totalAssets === void 0 || totalSupply === void 0 || conv === void 0 || conv === 0n)
72469
+ return void 0;
72470
+ return {
72471
+ totalAssets,
72472
+ totalSupply,
72473
+ exchangeRate: conv * ONE_E1815 / underlyingUnit,
72474
+ withdrawFeeBps: ppmToBps(instFee),
72475
+ depositFeeBps: ppmToBps(depFee),
72476
+ queuedFeeBps: ppmToBps(redFee),
72477
+ instantRedeemCapacity: toBigInt16(idle),
72478
+ withdrawQueue: nestVault.toLowerCase(),
72479
+ // A paused proxy refuses every deposit — the row says so as a full
72480
+ // vault rather than by flipping a permission it does not change.
72481
+ ...paused === true ? { depositCapacity: 0n } : {}
72482
+ };
72483
+ }
72484
+ };
72485
+ };
72486
+
72277
72487
  // src/vaults/savings/readers/nativeWnlp.ts
72278
72488
  var readerNativeWnlp = (entry) => {
72279
72489
  const { address, underlying, inventoryContract, withdrawQueue } = entry;
@@ -72670,6 +72880,8 @@ var buildReader2 = (entry) => {
72670
72880
  return readerVenusHub(entry);
72671
72881
  case "saturn-vault":
72672
72882
  return readerSaturnVault(entry);
72883
+ case "nest-vault":
72884
+ return readerNestVault(entry);
72673
72885
  case "erc4626-cooldown":
72674
72886
  return readerErc4626Cooldown(entry);
72675
72887
  case "erc4626-idle":
@@ -72866,6 +73078,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
72866
73078
  ) ?? deriveExitRoutes({
72867
73079
  withdrawalMode: entry.withdrawalMode,
72868
73080
  withdrawFeeBps: state.withdrawFeeBps,
73081
+ queuedFeeBps: state.queuedFeeBps,
72869
73082
  withdrawalCooldownSeconds: state.withdrawalCooldownSeconds ?? entry.withdrawalCooldownSeconds,
72870
73083
  liquidity: liquidityRaw,
72871
73084
  liquidityFormatted,
@@ -83909,7 +84122,10 @@ var NON_4626_DEPOSIT_KINDS = /* @__PURE__ */ new Set([
83909
84122
  "vesper",
83910
84123
  "hyperbeat",
83911
84124
  "native-wnlp",
83912
- "bitway"
84125
+ "bitway",
84126
+ // Nest — the NestVault's own `deposit` is role-gated; entry is the predicate
84127
+ // proxy with an attestation bound to the sender, which a composer zap is not.
84128
+ "nest"
83913
84129
  ]);
83914
84130
  function acceptsVaultZap(row, provider) {
83915
84131
  if (ZAP_EXCLUDED_PROVIDERS.has(provider)) return false;
@@ -84122,8 +84338,6 @@ function supportsCancel(row, provider) {
84122
84338
  return false;
84123
84339
  }
84124
84340
  }
84125
-
84126
- // src/earn/positions.ts
84127
84341
  function buildLendingPositionUid(lender, chainId) {
84128
84342
  if (!lender || !chainId) {
84129
84343
  throw new Error(
@@ -84156,10 +84370,15 @@ function num18(v) {
84156
84370
  }
84157
84371
  function legAsset(pos) {
84158
84372
  const asset = pos.underlyingInfo?.asset ?? {};
84159
- const address = typeof asset.address === "string" ? asset.address.toLowerCase() : (
84373
+ const [, chain, ref] = pos.marketUid?.split(":") ?? [];
84374
+ const raw = typeof asset.address === "string" ? asset.address : void 0;
84375
+ const address = !raw ? (
84160
84376
  // Fall back to the uid's third segment, which IS the underlying for
84161
84377
  // the default-format lenders and merely a harmless label for the rest.
84162
- pos.marketUid?.split(":")[2] ?? ""
84378
+ ref ?? ""
84379
+ ) : !isSvmChainId(chain) ? raw.toLowerCase() : (
84380
+ // An upstream that lower-cased the mint is repaired from the uid when the two agree but for case.
84381
+ ref && ref !== raw && ref.toLowerCase() === raw.toLowerCase() ? ref : raw
84163
84382
  );
84164
84383
  const decimals = typeof asset.decimals === "number" ? asset.decimals : void 0;
84165
84384
  const symbol = typeof asset.symbol === "string" ? asset.symbol : void 0;