@1delta/margin-fetcher 5.0.53 → 5.0.55

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
@@ -9,7 +9,7 @@ import { Chain } from '@1delta/chain-registry';
9
9
  import { multicallRetryUniversal, getEvmClient, getEvmChain, getEvmClientUniversal } from '@1delta/providers';
10
10
  import { LiquityTroveManagerAbi, LiquityActivePoolAbi, LiquityStabilityPoolAbi, LiquityPriceFeedAbi, LiquitySortedTrovesAbi, RiverTroveManagerAbi, RiverStabilityPoolAbi, TellerMarketRegistryAbi, TellerV2Abi, InverseMarketAbi, InverseOracleAbi, InverseDbrAbi, Erc20Abi, LlamaLendControllerAbi, LlamaLendControllerV1Abi, LlamaLendControllerV2Abi, LlamaLendVaultAbi, LlamaLendAmmAbi, MetaMorphoAbi, FluidDexResolverAbi, ExactlyPreviewerAbi, ExactlyAuditorAbi, 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, TwyneCollateralVaultAbi, 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, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, bandLtvCurve, InitMarginAddresses } from '@1delta/calldata-sdk';
12
+ import { prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getLstAcceptedInputs, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, findSavingsWithdrawEntry, bandLtvCurve, InitMarginAddresses } 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
 
@@ -6501,6 +6501,10 @@ var getCompoundV3Assets = (chainId, lendingProtocol) => {
6501
6501
  function getAaveTypePoolDataProviderAddress(chainId, lender) {
6502
6502
  return aavePools()?.[lender]?.[chainId]?.protocolDataProvider;
6503
6503
  }
6504
+ function getAaveTypeEModeCount(chainId, lender) {
6505
+ const count = aavePools()?.[lender]?.[chainId]?.eModeCount;
6506
+ return typeof count === "number" && Number.isFinite(count) && count >= 0 ? count : void 0;
6507
+ }
6504
6508
  function getAaveTypePoolAddress(chainId, lender) {
6505
6509
  return aavePools()?.[lender]?.[chainId]?.pool;
6506
6510
  }
@@ -6556,18 +6560,21 @@ function range(n) {
6556
6560
  return Array.from({ length: n + 1 }, (_3, i) => i);
6557
6561
  }
6558
6562
  var AAVE_V3_EMODES = (chain, lender) => {
6563
+ const eModeCount = getAaveTypeEModeCount(chain, lender);
6564
+ if (eModeCount !== void 0) return range(eModeCount);
6559
6565
  if (chain === Chain.ETHEREUM_MAINNET) {
6560
6566
  if (lender === Lender.AAVE_V3) return range(50);
6561
6567
  if (lender === Lender.AAVE_V3_PRIME) return range(12);
6568
+ if (lender === Lender.AAVE_V3_HORIZON) return range(12);
6562
6569
  }
6563
6570
  if (chain === Chain.ARBITRUM_ONE) {
6564
6571
  if (lender === Lender.AAVE_V3) return range(12);
6565
6572
  }
6566
6573
  if (chain === Chain.BASE) {
6567
- if (lender === Lender.AAVE_V3) return range(15);
6574
+ if (lender === Lender.AAVE_V3) return range(18);
6568
6575
  }
6569
6576
  if (chain === Chain.PLASMA_MAINNET) {
6570
- if (lender === Lender.AAVE_V3) return range(25);
6577
+ if (lender === Lender.AAVE_V3) return range(30);
6571
6578
  }
6572
6579
  return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
6573
6580
  };
@@ -19476,6 +19483,10 @@ function parseVault(vault, chainId, prices, additionalYields, tokenList, liquidi
19476
19483
  }
19477
19484
  return value > 0 ? weighted / value : legs[0]?.rate ?? 0;
19478
19485
  };
19486
+ const smartLegTokens = /* @__PURE__ */ new Set([
19487
+ ...isSmartCol ? colLegs.map((l) => l.token.toLowerCase()) : [],
19488
+ ...isSmartDebt ? debtLegs.map((l) => l.token.toLowerCase()) : []
19489
+ ]);
19479
19490
  const basketSupplyRate = isSmartCol ? basketRate(colLegs) : void 0;
19480
19491
  const basketBorrowRate = isSmartDebt ? basketRate(debtLegs) : void 0;
19481
19492
  const irmTotals = (state, decimals) => state ? {
@@ -19564,7 +19575,7 @@ function parseVault(vault, chainId, prices, additionalYields, tokenList, liquidi
19564
19575
  * NOT the position's rate (use the basket rate); and an exit has to be
19565
19576
  * sized in shares rather than in this token.
19566
19577
  */
19567
- ...isSmartVault ? { autoBalanced: true } : {},
19578
+ ...smartLegTokens.has(leg.token.toLowerCase()) ? { autoBalanced: true } : {},
19568
19579
  fluid: isSmartVault ? {
19569
19580
  vaultType,
19570
19581
  /**
@@ -24647,6 +24658,7 @@ async function fetchTwyneMarkets(lender, chainId) {
24647
24658
  allowFailure: true
24648
24659
  });
24649
24660
  const out = [];
24661
+ const pendingDebtBalances = [];
24650
24662
  markets.forEach((m, i) => {
24651
24663
  const c = i * 8;
24652
24664
  const creditTotalAssets = big3(creditReads[c]);
@@ -24660,6 +24672,7 @@ async function fetchTwyneMarkets(lender, chainId) {
24660
24672
  let externalSupplyRate;
24661
24673
  let externalBorrowRate;
24662
24674
  let externalBorrowLiquidity;
24675
+ let debtAToken;
24663
24676
  if (aaveIdx >= 0) {
24664
24677
  const emode = aaveEmode[aaveIdx];
24665
24678
  const collReserve = aaveReserves6[aaveIdx * 2];
@@ -24669,6 +24682,12 @@ async function fetchTwyneMarkets(lender, chainId) {
24669
24682
  externalSupplyRate = Number(collReserve.currentLiquidityRate) / RAY4;
24670
24683
  if (ok(debtReserve) && debtReserve?.currentVariableBorrowRate !== void 0)
24671
24684
  externalBorrowRate = Number(debtReserve.currentVariableBorrowRate) / RAY4;
24685
+ if (ok(debtReserve)) {
24686
+ const virtual = big3(debtReserve.virtualUnderlyingBalance);
24687
+ if (virtual !== void 0 && virtual > 0n) externalBorrowLiquidity = virtual;
24688
+ else if (typeof debtReserve.aTokenAddress === "string")
24689
+ debtAToken = debtReserve.aTokenAddress;
24690
+ }
24672
24691
  } else if (eulerIdx >= 0) {
24673
24692
  const e = eulerIdx * 7;
24674
24693
  externalLiqLtv = big3(eulerReads[e]);
@@ -24685,7 +24704,10 @@ async function fetchTwyneMarkets(lender, chainId) {
24685
24704
  }
24686
24705
  }
24687
24706
  const s = i * 3;
24688
- if (externalBorrowLiquidity === void 0) externalBorrowLiquidity = big3(scaleReads[s + 2]);
24707
+ if (externalBorrowLiquidity === void 0 && !debtAToken) {
24708
+ externalBorrowLiquidity = big3(scaleReads[s + 2]);
24709
+ }
24710
+ if (debtAToken) pendingDebtBalances.push({ index: out.length, token: m.targetAsset, holder: debtAToken });
24689
24711
  out.push({
24690
24712
  market: m,
24691
24713
  creditTotalAssets,
@@ -24711,6 +24733,22 @@ async function fetchTwyneMarkets(lender, chainId) {
24711
24733
  paused
24712
24734
  });
24713
24735
  });
24736
+ if (pendingDebtBalances.length > 0) {
24737
+ const balances = await multicallRetryUniversal({
24738
+ chain: chainId,
24739
+ calls: pendingDebtBalances.map((p) => ({
24740
+ address: p.token,
24741
+ name: "balanceOf",
24742
+ args: [p.holder]
24743
+ })),
24744
+ abi: ERC20_ABI,
24745
+ allowFailure: true
24746
+ });
24747
+ pendingDebtBalances.forEach((p, i) => {
24748
+ const v = big3(balances[i]);
24749
+ if (v !== void 0 && out[p.index]) out[p.index].externalBorrowLiquidity = v;
24750
+ });
24751
+ }
24714
24752
  if (out.length === 0) return void 0;
24715
24753
  return { lender, chainId, config, markets: out };
24716
24754
  }
@@ -46920,19 +46958,29 @@ var reUsdGroup = {
46920
46958
  symbol: "reUSD",
46921
46959
  solvency: "tranched-senior",
46922
46960
  brand: "Re Protocol",
46923
- description: "Senior tranche of Re's reinsurance capital stack: deposits back insurance-linked programs and earn underwriting premium (the junior reUSDe absorbs losses first). The token is a bare ERC-20 priced by a daily NAV oracle; exits are instant (small fee) only while the redemption buffer holds, otherwise they queue \u2014 quarterly in the worst case.",
46961
+ description: "Senior tranche of Re's reinsurance capital stack: deposits back insurance-linked programs and earn underwriting premium (the junior reUSDe absorbs losses first). A bare ERC-20 priced by a daily NAV oracle. Minting and redeeming at NAV need Re's KYC approval; without it the position is entered and exited by TRADING reUSD (deepest venue: Curve reUSD/USDC on Ethereum), at whatever discount or premium to NAV the market pays. For KYC'd holders redemption is instant (small fee) while the buffer holds, otherwise it queues \u2014 quarterly in the worst case.",
46924
46962
  decimals: 18,
46925
46963
  underlyingDecimals: 6,
46926
46964
  isRebasing: false,
46927
46965
  isMintable: false,
46966
+ secondaryMarketOnly: true,
46928
46967
  withdrawalMode: "request-based",
46929
46968
  // Quarterly queue — the documented worst case, and the live case
46930
- // wherever the buffer sits under 1 % of supply.
46969
+ // wherever the buffer sits under 1 % of supply. It describes the KYC
46970
+ // holder's exit; ours is the sale (`secondaryMarketOnly`).
46931
46971
  withdrawalCooldownSeconds: 90 * 86400,
46932
46972
  yieldFetcher: reProtocolFetcher,
46933
46973
  yieldKey: REUSD_KEY
46934
46974
  },
46935
46975
  chains: {
46976
+ // TRAP, per chain: the ICL is a DIFFERENT contract from the token, and
46977
+ // the address that looks like a queue is not one. Re's address book
46978
+ // labels `0x5c454f55…` and its siblings "Daily Instant Redemption Vault
46979
+ // — payout token custody", which is `inventoryContract`'s definition,
46980
+ // not `withdrawQueue`'s. Only Ethereum publishes an actual delayed-
46981
+ // redemption module (`WindowRedemption`, the quarterly window); the
46982
+ // other three name none, so they carry none rather than a plausible
46983
+ // address a caller might try to request against.
46936
46984
  "1": {
46937
46985
  address: "0x5086bf358635b81d8c47c66d1c8b9e567db70c72",
46938
46986
  underlying: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
@@ -46940,29 +46988,34 @@ var reUsdGroup = {
46940
46988
  priceOracle: "0x72b5760cfbe437dd01409f44055fdfb8f8121b46",
46941
46989
  mintContract: "0x4691c475be804fa85f91c2d6d0adf03114de3093",
46942
46990
  // ICL
46943
- withdrawQueue: "0x5c454f5526e41fbe917b63475cd8ca7e4631b147"
46991
+ withdrawQueue: "0xd2e077d945ec77b45fbe4622e01f4c79e4ba389a",
46992
+ // WindowRedemption
46993
+ inventoryContract: "0x5c454f5526e41fbe917b63475cd8ca7e4631b147"
46944
46994
  },
46945
46995
  "8453": {
46946
46996
  address: "0x7d214438d0f27afccc23b3d1e1a53906ace5cfea",
46947
46997
  underlying: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
46948
46998
  priceOracle: "0x67a3226e69a1a8316ef1807a44f077af80071926",
46949
- // On Base the ICL is the token itself.
46950
- mintContract: "0x7d214438d0f27afccc23b3d1e1a53906ace5cfea",
46951
- withdrawQueue: "0x9ab62aebabe738ab233c447eedce88d1d0a61fe3"
46999
+ // NOT the token that was wrong. `0x7d214438…` is a plain
47000
+ // `ShareToken`: role-gated `mint(address,uint256)`, no `kycRegistry()`,
47001
+ // no `deposit` of any arity. Base's ICL is its own contract, and
47002
+ // answers `kycRegistry() = 0xd4326b16…` / `shareToken() = 0x7d214438…`.
47003
+ mintContract: "0xd75ea2fd3d00399df7b7241ab7a189085ab2ede9",
47004
+ inventoryContract: "0x9ab62aebabe738ab233c447eedce88d1d0a61fe3"
46952
47005
  },
46953
47006
  "42161": {
46954
47007
  address: "0x76ce01f0ef25aa66cc5f1e546a005e4a63b25609",
46955
47008
  underlying: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
46956
47009
  priceOracle: "0x48abcc5a711ac23d3730bf627415dc898cbc5967",
46957
47010
  mintContract: "0x802edbb1ec20548a4388abc337e4011718eb0291",
46958
- withdrawQueue: "0xfd4016ea13ca8acc04a11a99702df076a4d3b852"
47011
+ inventoryContract: "0xfd4016ea13ca8acc04a11a99702df076a4d3b852"
46959
47012
  },
46960
47013
  "43114": {
46961
47014
  address: "0x180af87b47bf272b2df59dccf2d76a6eafa625bf",
46962
47015
  underlying: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
46963
47016
  priceOracle: "0x4c558694f16484e5c7a4a52bd210d471860ce7bc",
46964
47017
  mintContract: "0xb22a8533e6cd81598f82514a42f0b3161745fbe1",
46965
- withdrawQueue: "0xe13292f97e38da0c64398de5e0bfc95180de9d23"
47018
+ inventoryContract: "0xe13292f97e38da0c64398de5e0bfc95180de9d23"
46966
47019
  }
46967
47020
  // NB: our token list also carries reUSD on BNB (0xba9425ec…) and Ink
46968
47021
  // (0x5bcf6b00…), but Re publishes no NAV oracle for either, so there
@@ -48070,7 +48123,8 @@ var SINGLE_CHAIN_ENTRIES = {
48070
48123
  {
48071
48124
  // Re Protocol reUSDe — the JUNIOR tranche of the same reinsurance
48072
48125
  // capital stack as reUSD (see `reUsdGroup` for the model, the
48073
- // liquidity caveat and why `isMintable` is false). Ethereum only,
48126
+ // liquidity caveat, why `isMintable` is false and why the row is
48127
+ // therefore `secondaryMarketOnly`). Ethereum only,
48074
48128
  // ~$18.8M, and it earns roughly double reUSD's rate precisely
48075
48129
  // because it absorbs losses first. Underlying is USDe, so unlike
48076
48130
  // reUSD the share and underlying decimals align at 18.
@@ -48084,11 +48138,15 @@ var SINGLE_CHAIN_ENTRIES = {
48084
48138
  symbol: "reUSDe",
48085
48139
  solvency: "tranched-junior",
48086
48140
  brand: "Re Protocol",
48087
- description: "Junior tranche of Re's reinsurance capital stack, denominated in USDe: it pays roughly double the senior reUSD rate because it absorbs underwriting losses first. Bare ERC-20 priced by a daily NAV oracle; exits are request-based, with a quarterly queue in the worst case.",
48141
+ description: "Junior tranche of Re's reinsurance capital stack, denominated in USDe: it pays roughly double the senior reUSD rate because it absorbs underwriting losses first. Bare ERC-20 priced by a daily NAV oracle. Minting and redeeming at NAV require Re's KYC/AML approval; without it the only way in and out is trading reUSDe on the secondary market (Curve reUSDe/sUSDe, thinner than the reUSD book). For KYC'd holders exits are request-based, with a quarterly queue in the worst case.",
48088
48142
  decimals: 18,
48089
48143
  underlyingDecimals: 18,
48090
48144
  isRebasing: false,
48091
48145
  isMintable: false,
48146
+ // Its Curve venue (reUSDe/sUSDe) is materially thinner than reUSD's:
48147
+ // quoted -0.64 % at $14k and -2.17 % at $140k. Still the only route
48148
+ // without KYC, and the reason the leg refuses to build unbounded.
48149
+ secondaryMarketOnly: true,
48092
48150
  withdrawalMode: "request-based",
48093
48151
  withdrawalCooldownSeconds: 90 * 86400,
48094
48152
  yieldFetcher: reProtocolFetcher,
@@ -48232,12 +48290,15 @@ var SINGLE_CHAIN_ENTRIES = {
48232
48290
  // - The Midas periphery the DOCS still list is RETIRED: both its
48233
48291
  // instant paths revert `Pausable: paused` and its NAV aggregators
48234
48292
  // last updated 2025-12-22. Never build against the docs' addresses.
48235
- // - Exit is two-legged (`fee-or-queued`): `instantWithdraw` at the
48236
- // queue's `instantWithdrawalFee` (30 bps live — the docs' 0.5% is
48237
- // the retired stack), capped by the queue's own baseAsset balance
48238
- // (ops-topped, often 0); or a free `createWithdrawalRequest`
48239
- // processed by ops and PAID OUT AUTOMATICALLY no claim step, but
48240
- // cancellable while pending.
48293
+ // - Exit is two-legged (`fee-or-queued`), FORK-PROVEN 2026-08-18:
48294
+ // `instantWithdraw` at the queue's `instantWithdrawalFee` (30 bps
48295
+ // live — the docs' 0.5% is the retired stack), paid from the vault's
48296
+ // depositReceiver wallet (`inventoryContract` below NOT the queue,
48297
+ // whose balance can read 0 while the instant leg still pays); or a
48298
+ // free `createWithdrawalRequest` processed by ops and PAID OUT
48299
+ // AUTOMATICALLY — no claim step. Cancel exists but only fires AFTER
48300
+ // the request's deadline (`WithdrawalRequestDeadlineNotMet` before
48301
+ // it): it is the reclaim path for an expired request, not an abort.
48241
48302
  // - Deposits are permissionless and uncapped (`isPaused` false,
48242
48303
  // `depositCap` 0 = uncapped, no fee), via the Depositor
48243
48304
  // (`mintContract`) — NOT the share token.
@@ -48267,7 +48328,7 @@ var SINGLE_CHAIN_ENTRIES = {
48267
48328
  withdrawalMode: "fee-or-queued",
48268
48329
  withdrawalCooldownSeconds: 86400,
48269
48330
  withdrawQueue: "0x240e0b2cb615ded2fe90fde265b15988dc45b1c6",
48270
- inventoryContract: "0x240e0b2cb615ded2fe90fde265b15988dc45b1c6",
48331
+ inventoryContract: "0xfd1fd829e4e89cae8190596698e84754c3fec16c",
48271
48332
  priceOracle: "0x3636a26ec1d512c5ecff42f7adaa5ce7964c6579",
48272
48333
  yieldFetcher: hyperbeatVaultsFetcher,
48273
48334
  yieldKey: "Hyperbeat USDT::hbUSDT"
@@ -48288,7 +48349,7 @@ var SINGLE_CHAIN_ENTRIES = {
48288
48349
  withdrawalMode: "fee-or-queued",
48289
48350
  withdrawalCooldownSeconds: 86400,
48290
48351
  withdrawQueue: "0x10024239474120ce410dd7ce203793c81d438be3",
48291
- inventoryContract: "0x10024239474120ce410dd7ce203793c81d438be3",
48352
+ inventoryContract: "0x7abf6da6c2c131b58c1f4cb3947b0cfe2edc1c2a",
48292
48353
  priceOracle: "0xe0995a641d454c149e6c808baa37cb2b38763316",
48293
48354
  yieldFetcher: hyperbeatVaultsFetcher,
48294
48355
  yieldKey: "Hyperbeat USDC::hbUSDC"
@@ -48308,7 +48369,7 @@ var SINGLE_CHAIN_ENTRIES = {
48308
48369
  withdrawalMode: "fee-or-queued",
48309
48370
  withdrawalCooldownSeconds: 259200,
48310
48371
  withdrawQueue: "0x8b04cd6561abf2de78112da30ccb919fe8d09d98",
48311
- inventoryContract: "0x8b04cd6561abf2de78112da30ccb919fe8d09d98",
48372
+ inventoryContract: "0xa980d98de0fff436e1a3e7d9a06999b03c8aa59e",
48312
48373
  priceOracle: "0x5ed0ec0b0643dab621dc814c8d058e161b9b884b",
48313
48374
  yieldFetcher: hyperbeatVaultsFetcher,
48314
48375
  yieldKey: "Hyperbeat LST Vault::lstHYPE"
@@ -48331,7 +48392,7 @@ var SINGLE_CHAIN_ENTRIES = {
48331
48392
  withdrawalMode: "fee-or-queued",
48332
48393
  withdrawalCooldownSeconds: 259200,
48333
48394
  withdrawQueue: "0xa03e0e3b7e6204c9a8d237c4fbd30793555a84fe",
48334
- inventoryContract: "0xa03e0e3b7e6204c9a8d237c4fbd30793555a84fe",
48395
+ inventoryContract: "0xb3f15e41fc1536e47ee7de20c7b44fb1eec70aec",
48335
48396
  priceOracle: "0x90a0a650f0c403a92ae22f162b3e61818d6f8f11",
48336
48397
  yieldFetcher: hyperbeatVaultsFetcher,
48337
48398
  yieldKey: "Liquid HYPE Yield::liquidHYPE"
@@ -48414,6 +48475,15 @@ var savingsBalanceKind = (chainId, address) => {
48414
48475
  const lc = address.toLowerCase();
48415
48476
  return (SAVINGS_REGISTRY[chainId] ?? []).find((e) => e.address === lc)?.balanceKind;
48416
48477
  };
48478
+ var isSecondaryMarketOnly = (chainId, address) => (SAVINGS_REGISTRY[chainId] ?? []).some(
48479
+ (e) => e.address === address.toLowerCase() && e.secondaryMarketOnly === true
48480
+ );
48481
+ var secondaryMarketVault = (chainId, address) => {
48482
+ const e = (SAVINGS_REGISTRY[chainId] ?? []).find(
48483
+ (x) => x.address === address.toLowerCase() && x.secondaryMarketOnly === true
48484
+ );
48485
+ return e ? { underlying: e.underlying, symbol: e.symbol } : void 0;
48486
+ };
48417
48487
  var savingsAddresses = (chainId) => (SAVINGS_REGISTRY[chainId] ?? []).map((e) => e.address);
48418
48488
  var getSavingsRegistry = (chainId) => SAVINGS_REGISTRY[chainId] ?? [];
48419
48489
 
@@ -63562,7 +63632,7 @@ var readerFrankencoinSavings = (entry) => ({
63562
63632
 
63563
63633
  // src/vaults/savings/readers/hyperbeatVault.ts
63564
63634
  var readerHyperbeatVault = (entry) => {
63565
- const { address, underlying, priceOracle, withdrawQueue } = entry;
63635
+ const { address, underlying, priceOracle, withdrawQueue, inventoryContract } = entry;
63566
63636
  const pricer = priceOracle ?? address;
63567
63637
  const queue = withdrawQueue ?? address;
63568
63638
  const shareUnit = 10n ** BigInt(entry.decimals);
@@ -63572,7 +63642,13 @@ var readerHyperbeatVault = (entry) => {
63572
63642
  { address, name: "totalSupply", params: [] },
63573
63643
  { address: pricer, name: "getRate", params: [] },
63574
63644
  { address: pricer, name: "decimals", params: [] },
63575
- { address: underlying, name: "balanceOf", params: [queue] },
63645
+ // Falls back to the queue when no depositReceiver is pinned — yields
63646
+ // a 0 capacity rather than a malformed call.
63647
+ {
63648
+ address: underlying,
63649
+ name: "balanceOf",
63650
+ params: [inventoryContract ?? queue]
63651
+ },
63576
63652
  { address: queue, name: "instantWithdrawalFee", params: [] },
63577
63653
  { address: queue, name: "isInstantWithdrawalPaused", params: [] }
63578
63654
  ],
@@ -63908,6 +63984,9 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
63908
63984
  isRebasing: entry.isRebasing,
63909
63985
  isMintable: entry.isMintable,
63910
63986
  mintContract: entry.mintContract?.toLowerCase() ?? addressLc,
63987
+ // Only emitted when true — an absent field is the ordinary vault, and
63988
+ // `false` on 200 rows would read as a claim nobody made.
63989
+ ...entry.secondaryMarketOnly ? { secondaryMarketOnly: true } : {},
63911
63990
  withdrawalMode: entry.withdrawalMode,
63912
63991
  // On-chain wins over the registry's pinned fallback — Native's
63913
63992
  // queue window is per-asset and governance-mutable.
@@ -72456,7 +72535,10 @@ var twyneAdapter = {
72456
72535
  description: [
72457
72536
  `Your collateral stays in ${externalName}; Twyne only reserves other lenders\u2019 unused borrowing power so the same collateral supports a larger loan.`,
72458
72537
  bandNote,
72459
- creditApr != null ? `On top of ${externalName}\u2019s borrow rate you pay ${creditApr.toFixed(3)} % a year on the RESERVED CREDIT only \u2014 not on your debt \u2014 and it is charged in the collateral asset.` : void 0
72538
+ creditApr != null ? `On top of ${externalName}\u2019s borrow rate you pay ${creditApr.toFixed(3)} % a year on the RESERVED CREDIT only \u2014 not on your debt \u2014 and it is charged in the collateral asset.` : void 0,
72539
+ // The loan is perpetual; the COLLATERAL is what expires. Said here
72540
+ // rather than in `maturity`, which would mis-type the loan itself.
72541
+ maturity != null && matured ? "This market\u2019s collateral has already matured. Existing positions can still be repaid and closed, but nothing new should be opened against it." : maturity != null ? `Your loan has no end date, but the collateral is a fixed-maturity token that stops accreting on ${new Date(maturity * 1e3).toISOString().slice(0, 10)}, and ${externalName}\u2019s risk parameters move as that date approaches.` : void 0
72460
72542
  ].filter(Boolean).join(" ")
72461
72543
  },
72462
72544
  availability: {
@@ -72490,21 +72572,20 @@ var twyneAdapter = {
72490
72572
  description: `Twyne liquidates first, above your chosen LTV. ${externalName}\u2019s own threshold of ${pct2(externalLiqLtv)} is the backstop, and reaching it is the bad case.`
72491
72573
  } : {}
72492
72574
  },
72493
- // The collateral has a maturity even though the loan does not — a PT
72494
- // stops accreting at expiry and the external threshold ramps out from
72495
- // under it, so this is a date the borrower has to act on.
72496
- ...maturity ? {
72497
- maturity: {
72498
- kind: "fixed-date",
72499
- maturity,
72500
- maturityIso: new Date(maturity * 1e3).toISOString(),
72501
- ...matured ? {
72502
- description: "This market\u2019s collateral has already matured. Existing positions can still be repaid and closed, but no new borrowing should be opened against it."
72503
- } : {
72504
- description: "The collateral is a fixed-maturity token. The loan itself has no end date, but the collateral stops accreting at maturity and the underlying market\u2019s risk parameters move as that date approaches."
72505
- }
72506
- }
72507
- } : {}
72575
+ // THE LOAN IS PERPETUAL. Only the COLLATERAL expires.
72576
+ //
72577
+ // The first version of this adapter put the PT's expiry on
72578
+ // `borrow.maturity` with `kind: 'fixed-date'`, and that is wrong in a
72579
+ // way that shows up immediately in a UI: every consumer reads that field
72580
+ // as "this is a fixed-TERM loan", so the market rendered with a `Fixed`
72581
+ // borrow-rate badge and no APR — a fixed-rate product Twyne does not
72582
+ // offer. A Twyne loan has no end date, no rollover and no settlement;
72583
+ // it accrues at the external market's variable rate until repaid.
72584
+ //
72585
+ // What the collateral's expiry actually means is carried where it
72586
+ // belongs: `twyne.collateralMaturity` / `collateralMatured` on the
72587
+ // market descriptor (computed at read time), and stated in prose here.
72588
+ maturity: { kind: "perpetual" }
72508
72589
  }
72509
72590
  };
72510
72591
  }
@@ -73109,6 +73190,10 @@ function resolveBasket(row) {
73109
73190
  const f = row.fluid;
73110
73191
  if (f && f.isSmartCol !== true) return void 0;
73111
73192
  const legs = (f?.collateralPair ?? []).map((a) => addr3(a)).filter((a) => !!a).map((address) => ({ address }));
73193
+ if (legs.length > 0) {
73194
+ const rowAsset = addr3(row.underlying) ?? addr3(row.asset?.address);
73195
+ if (!rowAsset || !legs.some((l) => l.address === rowAsset)) return void 0;
73196
+ }
73112
73197
  return {
73113
73198
  // Fluid emits one row PER LEG of the pool, so this row is a leg and a
73114
73199
  // consumer that sums the listing without deduping counts the position
@@ -73342,10 +73427,50 @@ function lendingCapabilities(row) {
73342
73427
  }
73343
73428
  return caps;
73344
73429
  }
73345
- var SWAP_ROUTED_PROVIDERS = /* @__PURE__ */ new Set(["pendle", "spectra"]);
73346
- function swapRoutedCapabilities(row) {
73430
+ var SWAP_ROUTED_PROVIDERS = /* @__PURE__ */ new Set([
73431
+ "pendle",
73432
+ "spectra"
73433
+ ]);
73434
+ var ZAP_EXCLUDED_PROVIDERS = /* @__PURE__ */ new Set([
73435
+ "lst",
73436
+ "gmx",
73437
+ "hypercore",
73438
+ "lagoon"
73439
+ ]);
73440
+ var NON_4626_DEPOSIT_KINDS = /* @__PURE__ */ new Set([
73441
+ "frankencoin",
73442
+ "yieldbasis",
73443
+ "wren",
73444
+ "hyperbeat",
73445
+ "native-wnlp"
73446
+ ]);
73447
+ function acceptsVaultZap(row, provider) {
73448
+ if (ZAP_EXCLUDED_PROVIDERS.has(provider)) return false;
73449
+ const share = row.shareToken?.address ?? row.ref;
73450
+ if (!share) return false;
73451
+ try {
73452
+ const entry = findSavingsWithdrawEntry(row.chainId, share);
73453
+ if (entry && NON_4626_DEPOSIT_KINDS.has(entry.kind)) return false;
73454
+ } catch {
73455
+ return false;
73456
+ }
73457
+ return true;
73458
+ }
73459
+ function isSecondaryMarketRow(row) {
73460
+ const meta = row.providerMeta ?? {};
73461
+ if (meta.secondaryMarketOnly === true) return true;
73462
+ const share = row.shareToken?.address ?? row.ref;
73463
+ if (!share || !row.chainId) return false;
73464
+ try {
73465
+ return isSecondaryMarketOnly(String(row.chainId), share);
73466
+ } catch {
73467
+ return false;
73468
+ }
73469
+ }
73470
+ function swapRoutedCapabilities(row, opts) {
73347
73471
  const caps = [];
73348
- if (row.availability.canDeposit) {
73472
+ const entryOpen = row.availability.canDeposit || opts?.ignoreMintPermission === true && row.availability.gating === "allowlist-contract" && (row.providerMeta ?? {}).paused !== true;
73473
+ if (entryOpen) {
73349
73474
  caps.push({
73350
73475
  action: "deposit",
73351
73476
  via: "swap",
@@ -73368,17 +73493,20 @@ function vaultCapabilities(row) {
73368
73493
  const meta = row.providerMeta ?? {};
73369
73494
  const caps = [];
73370
73495
  if (SWAP_ROUTED_PROVIDERS.has(provider)) return swapRoutedCapabilities(row);
73496
+ if (isSecondaryMarketRow(row))
73497
+ return swapRoutedCapabilities(row, { ignoreMintPermission: true });
73371
73498
  if (row.availability.canDeposit) {
73372
73499
  const inputs = depositInputs(row, provider);
73373
73500
  caps.push({
73374
73501
  action: "deposit",
73375
73502
  inputs,
73376
73503
  requires: depositRequires(provider, meta, inputs),
73377
- // Phase 3 flips this to `true` once the `vault.*` venues are registered
73378
- // with the conversion solver. Advertising it before the route can serve
73379
- // it would be worse than the current gap a client would build a zap
73380
- // input that 400s.
73381
- acceptsPayAsset: false
73504
+ // Phase 3 (EARN_ENDPOINT_PLAN §5.3): `/v1/actions/earn/deposit` routes
73505
+ // a mismatched `payAsset` through an aggregator swap + composed 4626
73506
+ // deposit but ONLY for rows whose deposit is a plain synchronous
73507
+ // ERC-4626 call. Advertising it anywhere else builds a zap input that
73508
+ // 400s at submit, which is exactly what this flag existed to prevent.
73509
+ acceptsPayAsset: acceptsVaultZap(row, provider)
73382
73510
  });
73383
73511
  }
73384
73512
  if (!row.availability.canWithdraw) return caps;
@@ -73675,6 +73803,6 @@ function earnPositionTotals(items) {
73675
73803
  };
73676
73804
  }
73677
73805
 
73678
- export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EARN_DESCRIPTIONS, EARN_LABELS, EMPTY_BALANCE, EXACTLY_LENDER_KEY, FRACTION_RATE_PROVIDERS, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dexResolverFor, disambiguateEarnNames, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidDexState, fetchFluidFTokens, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isStablecoinSymbol, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseEarnUid, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveEarnIdentity, resolveModeConfig, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, selectAssetGroupPrices, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, supplyDescription, supplyFindings, supplyHeadline, swapRoutedProvidersArePriceConsistent, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
73806
+ export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EARN_DESCRIPTIONS, EARN_LABELS, EMPTY_BALANCE, EXACTLY_LENDER_KEY, FRACTION_RATE_PROVIDERS, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dexResolverFor, disambiguateEarnNames, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidDexState, fetchFluidFTokens, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isSecondaryMarketOnly, isStablecoinSymbol, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseEarnUid, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveEarnIdentity, resolveModeConfig, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, secondaryMarketVault, selectAssetGroupPrices, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, supplyDescription, supplyFindings, supplyHeadline, swapRoutedProvidersArePriceConsistent, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
73679
73807
  //# sourceMappingURL=index.js.map
73680
73808
  //# sourceMappingURL=index.js.map