@1delta/margin-fetcher 5.0.65 → 5.0.67

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
@@ -1,13 +1,13 @@
1
1
  import { parseAbi, keccak256, encodeAbiParameters, formatEther, BaseError, erc20Abi, stringToHex, isAddress, pad, encodeFunctionData, formatUnits, getAddress, decodeFunctionResult, decodeAbiParameters, concat, parseAbiParameters, AbiEncodingLengthMismatchError, concatHex, toBytes, slice, hexToString, InvalidAddressError, boolToHex, integerRegex, numberToHex, bytesRegex, BytesSizeMismatchError, arrayRegex, UnsupportedPackedAbiType } from './chunk-JUYF2XLF.js';
2
2
  import './chunk-BYTNVMX7.js';
3
3
  import './chunk-PR4QN5HX.js';
4
- import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isCooler, isDssType, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, isFrankencoin, isResupply, isCurvance, isTwyne, isFraxlend, isAaveV4Type, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isCompoundV2Type, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite, isMorphoType, isUsdd, isSky, hasCrossMarginRisk, isEulerType, isInit, isVenusType, isSumerType, AAVE_V3_LENDERS, AAVE_V2_LENDERS, isMorphoBlue, isAaveV2Type, isAaveV32Type, isAaveV3Type, isYLDR, isLista, hasSubAccounts, isTectonicType, isKineticType, isBenqiType } from '@1delta/lender-registry';
4
+ import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isCooler, isDssType, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, isFrankencoin, isResupply, isCurvance, isFlyingTulip, isTwyne, isFraxlend, isAaveV4Type, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isCompoundV2Type, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite, isMorphoType, isUsdd, isSky, hasCrossMarginRisk, isEulerType, isInit, isVenusType, isSumerType, AAVE_V3_LENDERS, AAVE_V2_LENDERS, isMorphoBlue, isAaveV2Type, isAaveV32Type, isAaveV3Type, isYLDR, isLista, hasSubAccounts, isTectonicType, isKineticType, isBenqiType } from '@1delta/lender-registry';
5
5
  export { hasCrossMarginRisk, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isMultiMarket, isYLDR } from '@1delta/lender-registry';
6
- import { fetchTokenLists, fetchTokenList, aavePools, compoundV3Pools, initConfig, morphoPools, compoundV2Pools, eulerVaults, siloMarkets, siloV2LenderKey, siloMarketsV3, siloV3LenderKey, aaveV4Spokes, aaveV4SpokeLenderKey, fluidResolvers, gearboxResolvers, dolomiteConfigs, midnightConfig, termConfig, termMarketsByChain, exactlyConfig, liquityLendersByChain, riverLendersByChain, inverseLendersByChain, coolerLendersByChain, llamaLendLendersByChain, usddLendersByChain, skyLendersByChain, frankencoinLendersByChain, resupplyLendersByChain, curvanceLendersByChain, fraxlendLendersByChain, twyneLendersByChain, tellerConfigByChain, tellerPoolsByChain, termMaxConfigByChain, aaveReserves, compoundV3Reserves, resolveTermApiBase, liquityConfigFor, liquityBranchesByChain, riverConfigFor, riverChainData, termMaxApiBaseUrl, termMaxLenderKey, inverseConfigFor, inverseChainData, coolerConfigFor, llamaLendConfigFor, llamaLendChainData, llamaLendApiBaseUrl, resupplyConfigFor, fraxlendConfigFor, dssConfigFor, dssChainData, dssDebtToken, dssDebtJoin, frankencoinConfigFor, frankencoinChainData, aaveOracles, morphoTypeMarkets, resolveMidnightApiBase, llamaLendMarketByVault, getSiloV2MarketEntry, getSiloV3MarketEntry, dolomiteEmode, curvanceConfigFor, aaveTokens, morphoTypeVaults, listaCollateralProvider, eulerConfigs, gearboxMarketCompressor, gearboxMarketConfigurators, compoundV2TokenArray, gearboxV3LenderKey, midnightMarketsByChain, twyneConfigFor, twyneChainData, parseAaveV4SpokeLenderKey, fraxlendPairsFor, gearboxAccountCompressor, compoundV2Tokens, exactlyMarketsByChain, aaveOraclesConfig, compoundV2Oracles, compoundV2OraclesConfig, compoundV3OraclesData, compoundV3BaseData, compoundV2Reserves, aaveV4Oracles, morphoTypeOracles } from '@1delta/data-sdk';
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, resolveTermApiBase, flyingTulipConfigFor, flyingTulipAssetsFor, liquityConfigFor, liquityBranchesByChain, riverConfigFor, riverChainData, termMaxApiBaseUrl, termMaxLenderKey, inverseConfigFor, inverseChainData, coolerConfigFor, llamaLendConfigFor, llamaLendChainData, llamaLendApiBaseUrl, resupplyConfigFor, fraxlendConfigFor, dssConfigFor, dssChainData, dssDebtToken, dssDebtJoin, frankencoinConfigFor, frankencoinChainData, aaveOracles, morphoTypeMarkets, resolveMidnightApiBase, llamaLendMarketByVault, getSiloV2MarketEntry, getSiloV3MarketEntry, dolomiteEmode, curvanceConfigFor, aaveTokens, morphoTypeVaults, listaCollateralProvider, eulerConfigs, gearboxMarketCompressor, gearboxMarketConfigurators, compoundV2TokenArray, gearboxV3LenderKey, midnightMarketsByChain, twyneConfigFor, twyneChainData, parseAaveV4SpokeLenderKey, fraxlendPairsFor, gearboxAccountCompressor, compoundV2Tokens, exactlyMarketsByChain, aaveOraclesConfig, compoundV2Oracles, compoundV2OraclesConfig, compoundV3OraclesData, compoundV3BaseData, compoundV2Reserves, aaveV4Oracles, morphoTypeOracles } from '@1delta/data-sdk';
7
7
  import lodash from 'lodash';
8
8
  import { Chain } from '@1delta/chain-registry';
9
9
  import { multicallRetryUniversal, getEvmClient, getEvmChain, getEvmClientUniversal } from '@1delta/providers';
10
- import { LiquityTroveManagerAbi, LiquityActivePoolAbi, LiquityStabilityPoolAbi, LiquityPriceFeedAbi, LiquitySortedTrovesAbi, RiverTroveManagerAbi, RiverStabilityPoolAbi, TellerMarketRegistryAbi, TellerV2Abi, InverseMarketAbi, InverseOracleAbi, InverseDbrAbi, Erc20Abi, CoolerMonoAbi, CoolerLtvOracleAbi, LlamaLendControllerAbi, LlamaLendControllerV1Abi, LlamaLendControllerV2Abi, LlamaLendVaultAbi, LlamaLendAmmAbi, TwyneCollateralVaultAbi, 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, GearboxCreditAccountCompressorV310Abi, TwyneVaultManagerAbi, TwyneCollateralVaultFactoryAbi, AaveV2V3Abi, TwyneATokenWrapperAbi, UsddCdpManagerAbi, UsddProxyRegistryAbi, CurvanceProtocolReaderAbi, CurvanceCentralRegistryAbi, TermPriceConsumerAbi, CurvanceOracleManagerAbi, TermMaxOracleAggregatorV2Abi } from '@1delta/abis';
10
+ import { LiquityTroveManagerAbi, LiquityActivePoolAbi, LiquityStabilityPoolAbi, LiquityPriceFeedAbi, LiquitySortedTrovesAbi, RiverTroveManagerAbi, RiverStabilityPoolAbi, TellerMarketRegistryAbi, TellerV2Abi, InverseMarketAbi, InverseOracleAbi, InverseDbrAbi, 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
12
  import { prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getLstAcceptedInputs, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, findSavingsWithdrawEntry, bandLtvCurve, InitMarginAddresses, ignoresReceiver, buildLstWithdrawRequest, SAVINGS_RECEIVER_CAPABILITY } from '@1delta/calldata-sdk';
13
13
  import { proxyNativeFetch } from '@1delta/proxy-fetch';
@@ -6444,6 +6444,9 @@ var getLendersForChain = (c) => {
6444
6444
  if (exactlyConfig()?.[c]?.previewer) {
6445
6445
  lenders.push(Lender.EXACTLY);
6446
6446
  }
6447
+ for (const l of flyingTulipLendersByChain(c)) {
6448
+ lenders.push(l);
6449
+ }
6447
6450
  for (const l of liquityLendersByChain(c)) {
6448
6451
  lenders.push(l);
6449
6452
  }
@@ -16661,13 +16664,13 @@ var REPAIR_BACKOFF_JITTER_MS = 60;
16661
16664
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
16662
16665
  var backoffForRound = (round) => REPAIR_BACKOFF_BASE_MS * 2 ** round + Math.random() * REPAIR_BACKOFF_JITTER_MS;
16663
16666
  var endpointUrl = (client, rpcId) => client?.transport?.url ?? `rpc#${rpcId}`;
16664
- var resolveEndpoint = (chainId, getEvmClient19, startRpcId, tried, maxProbe = 12, timeoutMs) => {
16667
+ var resolveEndpoint = (chainId, getEvmClient20, startRpcId, tried, maxProbe = 12, timeoutMs) => {
16665
16668
  let fallback = null;
16666
16669
  for (let probe = 0; probe < maxProbe; probe++) {
16667
16670
  const rpcId = startRpcId + probe;
16668
16671
  let client;
16669
16672
  try {
16670
- client = getEvmClient19(chainId, rpcId, { timeoutMs });
16673
+ client = getEvmClient20(chainId, rpcId, { timeoutMs });
16671
16674
  } catch {
16672
16675
  break;
16673
16676
  }
@@ -16696,7 +16699,7 @@ var recordPermanentFailures = (slots, offset, collector) => {
16696
16699
  if (slots[i].permanent) collector.add(offset + i);
16697
16700
  }
16698
16701
  };
16699
- var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
16702
+ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient20, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
16700
16703
  let searchFrom = nextRpcId;
16701
16704
  for (let round = 0; round < rounds; round++) {
16702
16705
  const failedIdx = [];
@@ -16706,7 +16709,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRp
16706
16709
  if (failedIdx.length === 0) return slots;
16707
16710
  const endpoint = resolveEndpoint(
16708
16711
  chainId,
16709
- getEvmClient19,
16712
+ getEvmClient20,
16710
16713
  searchFrom,
16711
16714
  options?.tried
16712
16715
  );
@@ -16758,7 +16761,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRp
16758
16761
  }
16759
16762
  return slots;
16760
16763
  };
16761
- var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
16764
+ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
16762
16765
  const abiIsArray = isArray(abi[0]);
16763
16766
  const contracts = calls.map(({ address, name, params }, i) => ({
16764
16767
  abi: abiIsArray ? abi?.[i] : abi,
@@ -16832,7 +16835,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16832
16835
  const attemptHedged = async (items, startRpcId, tried) => {
16833
16836
  const primary = resolveEndpoint(
16834
16837
  chainId,
16835
- getEvmClient19,
16838
+ getEvmClient20,
16836
16839
  startRpcId,
16837
16840
  tried,
16838
16841
  12,
@@ -16856,7 +16859,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16856
16859
  clearTimeout(timer);
16857
16860
  const alt = resolveEndpoint(
16858
16861
  chainId,
16859
- getEvmClient19,
16862
+ getEvmClient20,
16860
16863
  primary.rpcId + 1,
16861
16864
  tried,
16862
16865
  12,
@@ -16908,7 +16911,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16908
16911
  chainId,
16909
16912
  batch.items,
16910
16913
  slots,
16911
- getEvmClient19,
16914
+ getEvmClient20,
16912
16915
  won.rpcId + 1,
16913
16916
  requestBytes,
16914
16917
  logs,
@@ -16930,7 +16933,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16930
16933
  const tried = /* @__PURE__ */ new Set();
16931
16934
  const start = resolveEndpoint(
16932
16935
  chainId,
16933
- getEvmClient19,
16936
+ getEvmClient20,
16934
16937
  workerId,
16935
16938
  void 0,
16936
16939
  12,
@@ -22658,6 +22661,231 @@ function convertExactlyMarketsToResponse(raw, chainId, prices = {}, _additionalY
22658
22661
  out[lenderKey] = entry;
22659
22662
  return out;
22660
22663
  }
22664
+
22665
+ // src/lending/public-data/flying-tulip/convertPublic.ts
22666
+ var FLYING_TULIP_LENDER_KEY = "FLYING_TULIP";
22667
+ function toHuman2(raw, decimals) {
22668
+ return Number(raw) / 10 ** decimals;
22669
+ }
22670
+ function currencyFor4(address, decimals, symbol, name, tokens) {
22671
+ const lower4 = address.toLowerCase();
22672
+ return tokens[lower4] ?? { address: lower4, symbol, name, decimals };
22673
+ }
22674
+ function convertFlyingTulipMarketsToResponse(raw, chainId, prices = {}, _additionalYields = {
22675
+ intrinsicYields: {},
22676
+ lenderRewards: {},
22677
+ loaded: true
22678
+ }, tokens = {}) {
22679
+ const out = {};
22680
+ const assets = raw?.assets ?? [];
22681
+ if (assets.length === 0) return out;
22682
+ const lenderKey = FLYING_TULIP_LENDER_KEY;
22683
+ const hfSafe = raw.hfSafeBps / 1e4;
22684
+ const hfTgt = raw.hfTargetBps / 1e4;
22685
+ const entry = { data: {} };
22686
+ for (const a of assets) {
22687
+ const assetAddr = a.address;
22688
+ const decimals = a.decimals;
22689
+ const token = tokens[assetAddr];
22690
+ const priceKey = toOracleKey(token?.assetGroup) || toGenericPriceKey(assetAddr, chainId);
22691
+ const price2 = (a.priceWad != null ? Number(a.priceWad) / 1e18 : 0) || (prices[priceKey] ?? 0);
22692
+ const totalDeposits = toHuman2(a.cash + a.borrows - a.reserves, decimals);
22693
+ const totalDebt = toHuman2(a.borrows, decimals);
22694
+ const borrowLiquidity = toHuman2(a.cash, decimals);
22695
+ const utilization = Number(a.utilWad) / 1e18;
22696
+ const mm = a.mmBps / 1e4;
22697
+ const borrowCollateralFactor = Math.max(0, 1 - hfSafe * mm);
22698
+ const collateralFactor = Math.max(0, 1 - hfTgt * mm);
22699
+ const borrowFactor = 1 / (1 + hfSafe * mm);
22700
+ const variableBorrowRate = a.borrowAprWad != null ? Number(a.borrowAprWad) / 1e18 * 100 : 0;
22701
+ const borrowingEnabled = a.enabled && a.borrowable && !a.borrowPaused;
22702
+ const collateralActive = a.enabled && a.isCollateral;
22703
+ const loanUid = createMarketUid(chainId, lenderKey, assetAddr);
22704
+ entry.data[loanUid] = {
22705
+ marketUid: loanUid,
22706
+ name: a.symbol,
22707
+ poolId: raw.positionsManager,
22708
+ underlying: assetAddr,
22709
+ asset: currencyFor4(assetAddr, decimals, a.symbol, a.name, tokens),
22710
+ totalDeposits,
22711
+ totalDebtStable: 0,
22712
+ totalDebt,
22713
+ totalLiquidity: borrowLiquidity,
22714
+ borrowLiquidity,
22715
+ totalLiquidityUSD: borrowLiquidity * price2,
22716
+ borrowLiquidityUSD: borrowLiquidity * price2,
22717
+ totalDepositsUSD: totalDeposits * price2,
22718
+ totalDebtStableUSD: 0,
22719
+ totalDebtUSD: totalDebt * price2,
22720
+ utilization,
22721
+ // Supply leg = borrow × utilization, no reserve factor. Reproduces Flying
22722
+ // Tulip's own "Deposit APY" column exactly — see the doc comment for the
22723
+ // 6/6 verification and for why this is an APR despite their label.
22724
+ depositRate: variableBorrowRate * utilization,
22725
+ variableBorrowRate,
22726
+ stableBorrowRate: 0,
22727
+ intrinsicYield: 0,
22728
+ rewards: void 0,
22729
+ decimals,
22730
+ config: {
22731
+ 0: {
22732
+ category: 0,
22733
+ borrowCollateralFactor,
22734
+ collateralFactor,
22735
+ borrowFactor,
22736
+ // Liquidation is a permissioned RFQ fill (no fixed on-chain bonus).
22737
+ liquidationPenalty: 0,
22738
+ closeFactor: 1,
22739
+ collateralDisabled: !collateralActive,
22740
+ debtDisabled: !borrowingEnabled
22741
+ }
22742
+ },
22743
+ closeFactor: 1,
22744
+ collateralActive,
22745
+ borrowingEnabled,
22746
+ depositsEnabled: a.enabled && !a.depositPaused,
22747
+ hasStable: false,
22748
+ variableBorrowDisabled: !borrowingEnabled,
22749
+ isActive: a.enabled,
22750
+ isFrozen: !a.enabled,
22751
+ // Per-asset Flying Tulip extras (caps are raw base units).
22752
+ flyingTulip: {
22753
+ irm: a.irm,
22754
+ mmBps: a.mmBps,
22755
+ supplyCap: a.supplyCap.toString(),
22756
+ borrowCap: a.borrowCap.toString(),
22757
+ withdrawPaused: a.withdrawPaused,
22758
+ // FT itself: oracle-unpriceable, `collateral: false, mmBps: 0` — it
22759
+ // contributes nothing to equity/maintenance and must never become a
22760
+ // collateral row.
22761
+ unpriceable: !a.priceable
22762
+ }
22763
+ };
22764
+ }
22765
+ entry.params = {
22766
+ market: {
22767
+ lender: lenderKey,
22768
+ name: "Flying Tulip",
22769
+ id: raw.positionsManager,
22770
+ // No market-level LLTV: risk is per-asset and pair LTV multiplicative.
22771
+ lltv: "0",
22772
+ oracle: raw.oracleRouter || zeroAddress,
22773
+ irm: zeroAddress,
22774
+ collateralAddress: zeroAddress,
22775
+ loanAddress: zeroAddress,
22776
+ flyingTulip: {
22777
+ hfSafeBps: raw.hfSafeBps,
22778
+ hfTargetBps: raw.hfTargetBps,
22779
+ // PER CHAIN ($250 Ethereum / $10 Sonic) — read, never pinned.
22780
+ minEquityUSDWad: raw.minEquityUSDWad
22781
+ }
22782
+ }
22783
+ };
22784
+ entry.chainId = chainId;
22785
+ out[lenderKey] = entry;
22786
+ return out;
22787
+ }
22788
+
22789
+ // src/lending/public-data/flying-tulip/fetchPublic.ts
22790
+ var EMPTY = {
22791
+ hfSafeBps: 0,
22792
+ hfTargetBps: 0,
22793
+ minEquityUSDWad: "0",
22794
+ positionsManager: "",
22795
+ oracleRouter: "",
22796
+ assets: []
22797
+ };
22798
+ var big = (v) => {
22799
+ try {
22800
+ return v == null ? null : BigInt(v);
22801
+ } catch {
22802
+ return null;
22803
+ }
22804
+ };
22805
+ async function fetchFlyingTulipMarkets(chainId) {
22806
+ const lender = FLYING_TULIP_LENDER_KEY;
22807
+ const cfg = flyingTulipConfigFor(lender, chainId);
22808
+ const roster = flyingTulipAssetsFor(lender, chainId);
22809
+ const lens = cfg?.lendingLens;
22810
+ const assets = roster?.assets ?? [];
22811
+ if (!lens || assets.length === 0) return EMPTY;
22812
+ const CALLS_PER_ASSET = 8;
22813
+ const calls = assets.flatMap((a) => [
22814
+ { address: lens, name: "assetState", params: [a.address] },
22815
+ { address: lens, name: "assetCfg", params: [a.address] },
22816
+ { address: lens, name: "supplyCap", params: [a.address] },
22817
+ { address: lens, name: "borrowCap", params: [a.address] },
22818
+ { address: lens, name: "depositPaused", params: [a.address] },
22819
+ { address: lens, name: "withdrawPaused", params: [a.address] },
22820
+ { address: lens, name: "borrowPaused", params: [a.address] },
22821
+ { address: lens, name: "priceAndDecimals", params: [a.address] }
22822
+ ]);
22823
+ let results;
22824
+ try {
22825
+ results = await multicallRetryUniversal({
22826
+ chain: chainId,
22827
+ calls,
22828
+ abi: FlyingTulipLendingLensAbi,
22829
+ allowFailure: true
22830
+ });
22831
+ } catch {
22832
+ return EMPTY;
22833
+ }
22834
+ const rows = assets.map((a, i) => {
22835
+ const o = i * CALLS_PER_ASSET;
22836
+ const state = results[o];
22837
+ const acfg = results[o + 1];
22838
+ const px = results[o + 7];
22839
+ return {
22840
+ address: a.address.toLowerCase(),
22841
+ symbol: a.symbol,
22842
+ name: a.name,
22843
+ decimals: a.decimals,
22844
+ irm: (acfg?.[0] ? String(acfg[0]) : a.irm).toLowerCase(),
22845
+ mmBps: acfg ? Number(acfg[1]) : a.mmBps,
22846
+ enabled: acfg ? Boolean(acfg[2]) : a.enabled,
22847
+ borrowable: acfg ? Boolean(acfg[3]) : a.borrowable,
22848
+ isCollateral: acfg ? Boolean(acfg[4]) : a.collateral,
22849
+ supplyCap: big(results[o + 2]) ?? BigInt(a.supplyCap),
22850
+ borrowCap: big(results[o + 3]) ?? BigInt(a.borrowCap),
22851
+ depositPaused: results[o + 4] == null ? a.depositPaused : Boolean(results[o + 4]),
22852
+ withdrawPaused: results[o + 5] == null ? a.withdrawPaused : Boolean(results[o + 5]),
22853
+ borrowPaused: results[o + 6] == null ? a.borrowPaused : Boolean(results[o + 6]),
22854
+ priceable: a.priceable,
22855
+ priceWad: big(px?.[0]),
22856
+ cash: big(state?.[0]) ?? 0n,
22857
+ borrows: big(state?.[1]) ?? 0n,
22858
+ reserves: big(state?.[2]) ?? 0n,
22859
+ utilWad: big(state?.[3]) ?? 0n,
22860
+ borrowAprWad: null
22861
+ };
22862
+ });
22863
+ try {
22864
+ const aprResults = await multicallRetryUniversal({
22865
+ chain: chainId,
22866
+ calls: rows.map((r) => ({
22867
+ address: lens,
22868
+ name: "irmSampleAPR",
22869
+ params: [r.irm, [r.utilWad]]
22870
+ })),
22871
+ abi: FlyingTulipLendingLensAbi,
22872
+ allowFailure: true
22873
+ });
22874
+ rows.forEach((r, i) => {
22875
+ const arr = aprResults[i];
22876
+ r.borrowAprWad = Array.isArray(arr) ? big(arr[0]) : null;
22877
+ });
22878
+ } catch {
22879
+ }
22880
+ return {
22881
+ hfSafeBps: roster?.marginHfSafeBps ?? 15e3,
22882
+ hfTargetBps: roster?.marginHfTargetBps ?? 12500,
22883
+ minEquityUSDWad: roster?.marginMinEquityUSDWad ?? "0",
22884
+ positionsManager: (cfg?.positionsManager ?? "").toLowerCase(),
22885
+ oracleRouter: (cfg?.oracleRouter ?? "").toLowerCase(),
22886
+ assets: rows
22887
+ };
22888
+ }
22661
22889
  var READS_PER_BRANCH = 8;
22662
22890
  var LIQUITY_PUBLIC_READ_ABI = [
22663
22891
  ...LiquityTroveManagerAbi,
@@ -22736,10 +22964,10 @@ function liquityCollateralPrice(raw, collDecimals, priceDecimals) {
22736
22964
  const adjusted = Number(raw) / 10 ** (36 - collDecimals);
22737
22965
  return adjusted <= MAX_PLAUSIBLE_UNIT_USD ? adjusted : 0;
22738
22966
  }
22739
- function toHuman2(raw, decimals) {
22967
+ function toHuman3(raw, decimals) {
22740
22968
  return Number(raw) / 10 ** decimals;
22741
22969
  }
22742
- function currencyFor4(address, decimals, symbol, tokens) {
22970
+ function currencyFor5(address, decimals, symbol, tokens) {
22743
22971
  const lower4 = address.toLowerCase();
22744
22972
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
22745
22973
  }
@@ -22768,9 +22996,9 @@ function convertLiquityMarketsToResponse(raw, chainId, prices = {}, _additionalY
22768
22996
  const marketName2 = branch.name ?? `${stableSymbol} / ${collSymbol}`;
22769
22997
  const collPriceKey = toOracleKey(collToken?.assetGroup) || toGenericPriceKey(collAddr, chainId);
22770
22998
  const collPrice = liquityCollateralPrice(b.collPrice, collDecimals, branch.priceDecimals) || (prices[collPriceKey] ?? 0);
22771
- const entireDebt = b.entireDebt !== null ? toHuman2(b.entireDebt, stableDecimals) : 0;
22772
- const entireColl = b.entireColl !== null ? toHuman2(b.entireColl, collDecimals) : 0;
22773
- const spDeposits = b.spDeposits !== null ? toHuman2(b.spDeposits, stableDecimals) : 0;
22999
+ const entireDebt = b.entireDebt !== null ? toHuman3(b.entireDebt, stableDecimals) : 0;
23000
+ const entireColl = b.entireColl !== null ? toHuman3(b.entireColl, collDecimals) : 0;
23001
+ const spDeposits = b.spDeposits !== null ? toHuman3(b.spDeposits, stableDecimals) : 0;
22774
23002
  const shutdown = b.shutdownTime !== null && b.shutdownTime > 0n;
22775
23003
  const avgRate = b.aggWeightedDebtSum !== null && b.aggRecordedDebt !== null && b.aggRecordedDebt > 0n ? Number(b.aggWeightedDebtSum / b.aggRecordedDebt) / WAD6 : 0;
22776
23004
  const annualInterest = b.aggWeightedDebtSum !== null ? Number(b.aggWeightedDebtSum) / WAD6 / 10 ** stableDecimals : 0;
@@ -22807,7 +23035,7 @@ function convertLiquityMarketsToResponse(raw, chainId, prices = {}, _additionalY
22807
23035
  name: "Collateral " + collSymbol,
22808
23036
  poolId: branch.troveManager.toLowerCase(),
22809
23037
  underlying: collAddr,
22810
- asset: currencyFor4(collAddr, collDecimals, collSymbol, tokens),
23038
+ asset: currencyFor5(collAddr, collDecimals, collSymbol, tokens),
22811
23039
  totalDeposits: entireColl,
22812
23040
  totalDebtStable: 0,
22813
23041
  totalDebt: 0,
@@ -22862,7 +23090,7 @@ function convertLiquityMarketsToResponse(raw, chainId, prices = {}, _additionalY
22862
23090
  name: stableSymbol,
22863
23091
  poolId: branch.stabilityPool.toLowerCase(),
22864
23092
  underlying: stableAddr,
22865
- asset: currencyFor4(stableAddr, stableDecimals, stableSymbol, tokens),
23093
+ asset: currencyFor5(stableAddr, stableDecimals, stableSymbol, tokens),
22866
23094
  totalDeposits: spDeposits,
22867
23095
  totalDebtStable: 0,
22868
23096
  totalDebt: entireDebt,
@@ -23037,10 +23265,10 @@ function riverKeyParts(key3) {
23037
23265
  return { lender: "RIVER", chainId: m[1], index: Number(m[2]) };
23038
23266
  }
23039
23267
  var WAD7 = 1e18;
23040
- function toHuman3(raw, decimals) {
23268
+ function toHuman4(raw, decimals) {
23041
23269
  return Number(raw) / 10 ** decimals;
23042
23270
  }
23043
- function currencyFor5(address, decimals, symbol, tokens) {
23271
+ function currencyFor6(address, decimals, symbol, tokens) {
23044
23272
  const lower4 = address.toLowerCase();
23045
23273
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
23046
23274
  }
@@ -23059,7 +23287,7 @@ function convertRiverMarketsToResponse(raw, chainId, prices = {}, _additionalYie
23059
23287
  const debtSymbol = debtToken?.symbol ?? "satUSD";
23060
23288
  const debtPriceKey = toOracleKey(debtToken?.assetGroup) || toGenericPriceKey(debtAddr, chainId);
23061
23289
  const debtPrice = prices[debtPriceKey] || 1;
23062
- const spDeposits = raw.spDeposits !== null ? toHuman3(raw.spDeposits, debtDecimals) : 0;
23290
+ const spDeposits = raw.spDeposits !== null ? toHuman4(raw.spDeposits, debtDecimals) : 0;
23063
23291
  for (const m of raw.markets ?? []) {
23064
23292
  const market = m.market;
23065
23293
  const lenderKey = riverLenderKey(raw.lender, chainId, market.index);
@@ -23070,8 +23298,8 @@ function convertRiverMarketsToResponse(raw, chainId, prices = {}, _additionalYie
23070
23298
  const marketName2 = market.name ?? `${debtSymbol} / ${collSymbol}`;
23071
23299
  const collPriceKey = toOracleKey(collToken?.assetGroup) || toGenericPriceKey(collAddr, chainId);
23072
23300
  const collPrice = (m.price !== null ? Number(m.price) / WAD7 : 0) || (prices[collPriceKey] ?? 0);
23073
- const entireDebt = m.entireDebt !== null ? toHuman3(m.entireDebt, debtDecimals) : 0;
23074
- const entireColl = m.entireColl !== null ? toHuman3(m.entireColl, collDecimals) : 0;
23301
+ const entireDebt = m.entireDebt !== null ? toHuman4(m.entireDebt, debtDecimals) : 0;
23302
+ const entireColl = m.entireColl !== null ? toHuman4(m.entireColl, collDecimals) : 0;
23075
23303
  const halted = !!market.paused || !!market.sunsetting;
23076
23304
  const mcr = Number(market.mcr) / WAD7 || 1.1;
23077
23305
  const ltv = 1 / mcr;
@@ -23093,7 +23321,7 @@ function convertRiverMarketsToResponse(raw, chainId, prices = {}, _additionalYie
23093
23321
  name: "Collateral " + collSymbol,
23094
23322
  poolId: market.troveManager.toLowerCase(),
23095
23323
  underlying: collAddr,
23096
- asset: currencyFor5(collAddr, collDecimals, collSymbol, tokens),
23324
+ asset: currencyFor6(collAddr, collDecimals, collSymbol, tokens),
23097
23325
  totalDeposits: entireColl,
23098
23326
  totalDebtStable: 0,
23099
23327
  totalDebt: 0,
@@ -23137,7 +23365,7 @@ function convertRiverMarketsToResponse(raw, chainId, prices = {}, _additionalYie
23137
23365
  name: debtSymbol,
23138
23366
  poolId: cfg.xapp.toLowerCase(),
23139
23367
  underlying: debtAddr,
23140
- asset: currencyFor5(debtAddr, debtDecimals, debtSymbol, tokens),
23368
+ asset: currencyFor6(debtAddr, debtDecimals, debtSymbol, tokens),
23141
23369
  totalDeposits: spHere,
23142
23370
  totalDebtStable: 0,
23143
23371
  totalDebt: entireDebt,
@@ -23271,7 +23499,7 @@ async function fetchTellerMarkets(chainId) {
23271
23499
  } catch {
23272
23500
  return { chainId, pools: [] };
23273
23501
  }
23274
- const big22 = (i) => {
23502
+ const big23 = (i) => {
23275
23503
  const r = results[i];
23276
23504
  if (typeof r === "bigint") return r;
23277
23505
  if (typeof r === "number") return BigInt(r);
@@ -23285,20 +23513,20 @@ async function fetchTellerMarkets(chainId) {
23285
23513
  return null;
23286
23514
  };
23287
23515
  const num19 = (i) => {
23288
- const b = big22(i);
23516
+ const b = big23(i);
23289
23517
  return b === null ? null : Number(b);
23290
23518
  };
23291
23519
  const pool0 = pools.map((config, i) => {
23292
23520
  const base = i * READS_PER_POOL;
23293
23521
  return {
23294
23522
  config,
23295
- available: big22(base),
23296
- committed: big22(base + 1),
23523
+ available: big23(base),
23524
+ committed: big23(base + 1),
23297
23525
  minRateBps: num19(base + 2),
23298
- collateralPerPrincipal: big22(base + 3),
23526
+ collateralPerPrincipal: big23(base + 3),
23299
23527
  maxLoanDuration: num19(base + 4),
23300
- marketId: big22(base + 5),
23301
- totalAssets: big22(base + 6)
23528
+ marketId: big23(base + 5),
23529
+ totalAssets: big23(base + 6)
23302
23530
  };
23303
23531
  });
23304
23532
  const attByMarket = /* @__PURE__ */ new Map();
@@ -23774,7 +24002,7 @@ function tellerPoolFromLenderKey(lender) {
23774
24002
  const body = lender.slice("TELLER_".length);
23775
24003
  return body.length === 40 ? "0x" + body.toLowerCase() : void 0;
23776
24004
  }
23777
- function currencyFor6(address, decimals, symbol, tokens) {
24005
+ function currencyFor7(address, decimals, symbol, tokens) {
23778
24006
  const lower4 = address.toLowerCase();
23779
24007
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
23780
24008
  }
@@ -23838,7 +24066,7 @@ function convertTellerMarketsToResponse(raw, chainId, prices = {}, _additionalYi
23838
24066
  name: cfg.principalSymbol,
23839
24067
  poolId: cfg.pool.toLowerCase(),
23840
24068
  underlying: principalAddr,
23841
- asset: currencyFor6(
24069
+ asset: currencyFor7(
23842
24070
  principalAddr,
23843
24071
  cfg.principalDecimals,
23844
24072
  cfg.principalSymbol,
@@ -23895,7 +24123,7 @@ function convertTellerMarketsToResponse(raw, chainId, prices = {}, _additionalYi
23895
24123
  name: "Collateral " + cfg.collateralSymbol,
23896
24124
  poolId: cfg.pool.toLowerCase(),
23897
24125
  underlying: collateralAddr,
23898
- asset: currencyFor6(
24126
+ asset: currencyFor7(
23899
24127
  collateralAddr,
23900
24128
  cfg.collateralDecimals,
23901
24129
  cfg.collateralSymbol,
@@ -24120,7 +24348,7 @@ function termMaxLtvToWad(v) {
24120
24348
 
24121
24349
  // src/lending/public-data/termmax/convertPublic.ts
24122
24350
  var nowSec4 = () => Math.floor(Date.now() / 1e3);
24123
- function currencyFor7(address, decimals, tokens) {
24351
+ function currencyFor8(address, decimals, tokens) {
24124
24352
  const lower4 = address.toLowerCase();
24125
24353
  return tokens[lower4] ?? {
24126
24354
  address: lower4,
@@ -24180,7 +24408,7 @@ function convertTermMaxMarketsToResponse(raw, chainId, prices = {}, _additionalY
24180
24408
  name: "Loan " + (tokens[debtAddr]?.symbol ?? ""),
24181
24409
  poolId: debtAddr,
24182
24410
  underlying: debtAddr,
24183
- asset: currencyFor7(debtAddr, config.debtDecimals, tokens),
24411
+ asset: currencyFor8(debtAddr, config.debtDecimals, tokens),
24184
24412
  totalDeposits: supplyLiquidity,
24185
24413
  totalDebtStable: 0,
24186
24414
  totalDebt: 0,
@@ -24264,7 +24492,7 @@ function convertTermMaxMarketsToResponse(raw, chainId, prices = {}, _additionalY
24264
24492
  name: "Collateral " + (tokens[collAddr]?.symbol ?? ""),
24265
24493
  poolId: collAddr,
24266
24494
  underlying: collAddr,
24267
- asset: currencyFor7(collAddr, config.collateralDecimals, tokens),
24495
+ asset: currencyFor8(collAddr, config.collateralDecimals, tokens),
24268
24496
  totalDeposits: collCapacity,
24269
24497
  totalDebtStable: 0,
24270
24498
  totalDebt: 0,
@@ -24545,7 +24773,7 @@ var COOLER_PUBLIC_READ_ABI = [
24545
24773
  ...CoolerLtvOracleAbi,
24546
24774
  ...SUSDS_MAX_WITHDRAW_ABI
24547
24775
  ];
24548
- var big = (v) => {
24776
+ var big2 = (v) => {
24549
24777
  try {
24550
24778
  if (typeof v === "bigint") return v;
24551
24779
  if (typeof v === "number") return BigInt(v);
@@ -24599,33 +24827,33 @@ async function fetchCoolerMarkets(lender, chainId) {
24599
24827
  allowFailure: true
24600
24828
  });
24601
24829
  const ltvs = results[3];
24602
- const oltvPrice = Array.isArray(ltvs) ? big(ltvs[0]) : null;
24603
- const lltvPrice = Array.isArray(ltvs) ? big(ltvs[1]) : null;
24830
+ const oltvPrice = Array.isArray(ltvs) ? big2(ltvs[0]) : null;
24831
+ const lltvPrice = Array.isArray(ltvs) ? big2(ltvs[1]) : null;
24604
24832
  const dripRaw = results[9];
24605
24833
  let drip = null;
24606
24834
  if (Array.isArray(dripRaw) && dripRaw.length >= 5) {
24607
- const [startingValue, startTime, targetValue, targetTime, slope] = dripRaw.map(big);
24835
+ const [startingValue, startTime, targetValue, targetTime, slope] = dripRaw.map(big2);
24608
24836
  if (startingValue !== null && startTime !== null && targetValue !== null && targetTime !== null && slope !== null) {
24609
24837
  drip = { startingValue, startTime, targetValue, targetTime, slope };
24610
24838
  }
24611
24839
  }
24612
- const premium = big(results[10]);
24840
+ const premium = big2(results[10]);
24613
24841
  return {
24614
24842
  lender,
24615
24843
  config,
24616
- totalCollateral: big(results[0]),
24617
- totalDebt: big(results[1]),
24618
- interestRateWad: big(results[2]),
24844
+ totalCollateral: big2(results[0]),
24845
+ totalDebt: big2(results[1]),
24846
+ interestRateWad: big2(results[2]),
24619
24847
  oltvPrice,
24620
24848
  lltvPrice,
24621
- minDebtRequired: big(results[4]),
24849
+ minDebtRequired: big2(results[4]),
24622
24850
  borrowsPaused: typeof results[5] === "boolean" ? results[5] : null,
24623
24851
  liquidationsPaused: typeof results[6] === "boolean" ? results[6] : null,
24624
24852
  debtToken: typeof results[7] === "string" && results[7].startsWith("0x") ? results[7] : null,
24625
24853
  collateralToken: typeof results[8] === "string" && results[8].startsWith("0x") ? results[8] : null,
24626
24854
  drip,
24627
24855
  liquidationLtvPremiumBps: premium !== null ? Number(premium) : null,
24628
- susdsHeadroom: big(results[11]),
24856
+ susdsHeadroom: big2(results[11]),
24629
24857
  source: "chain"
24630
24858
  };
24631
24859
  } catch {
@@ -24925,7 +25153,7 @@ var STATE_READS = 14;
24925
25153
  var ONE = 10n ** 18n;
24926
25154
  var identityCache = /* @__PURE__ */ new Map();
24927
25155
  var identityKey = (chainId, pair) => `${chainId}:${pair.toLowerCase()}`;
24928
- var big2 = (v) => {
25156
+ var big3 = (v) => {
24929
25157
  if (typeof v === "bigint") return v;
24930
25158
  if (typeof v === "number") return BigInt(v);
24931
25159
  return null;
@@ -25134,28 +25362,28 @@ async function fetchResupplyMarkets(lender, chainId) {
25134
25362
  const accounting = results[base + 5];
25135
25363
  const rateInfo = results[base + 6];
25136
25364
  const exchangeInfo = results[base + 7];
25137
- const tuple = (v, idx) => Array.isArray(v) ? big2(v[idx]) : null;
25365
+ const tuple = (v, idx) => Array.isArray(v) ? big3(v[idx]) : null;
25138
25366
  return {
25139
25367
  identity,
25140
- maxLTV: big2(results[base]),
25141
- borrowLimit: big2(results[base + 1]),
25142
- liquidationFee: big2(results[base + 2]),
25143
- mintFee: big2(results[base + 3]),
25144
- minimumBorrowAmount: big2(results[base + 4]),
25368
+ maxLTV: big3(results[base]),
25369
+ borrowLimit: big3(results[base + 1]),
25370
+ liquidationFee: big3(results[base + 2]),
25371
+ mintFee: big3(results[base + 3]),
25372
+ minimumBorrowAmount: big3(results[base + 4]),
25145
25373
  totalBorrowAmount: tuple(accounting, 1),
25146
25374
  totalBorrowShares: tuple(accounting, 2),
25147
25375
  totalCollateral: tuple(accounting, 3),
25148
25376
  ratePerSec: tuple(rateInfo, 1),
25149
25377
  exchangeRate: tuple(exchangeInfo, 2),
25150
- collateralPrice: big2(results[base + 8]),
25378
+ collateralPrice: big3(results[base + 8]),
25151
25379
  // Indices follow the PUSH ORDER above exactly: the two reward reads sit
25152
25380
  // at +9/+10, BEFORE the lens block, so the lens reads are +11/+12.
25153
25381
  // (Getting this wrong is silent — it produced a 3-billion-percent APR
25154
25382
  // before the numbers were checked against a hand computation.)
25155
- convexPid: big2(results[base + 9]),
25156
- rsupWeight: pairEmissions ? big2(results[base + 10]) : null,
25157
- liveRatePerSec: utilities ? big2(results[base + 11]) : null,
25158
- underlyingSupplyRatePerSec: utilities ? big2(results[base + 12]) : null,
25383
+ convexPid: big3(results[base + 9]),
25384
+ rsupWeight: pairEmissions ? big3(results[base + 10]) : null,
25385
+ liveRatePerSec: utilities ? big3(results[base + 11]) : null,
25386
+ underlyingSupplyRatePerSec: utilities ? big3(results[base + 12]) : null,
25159
25387
  collateralRewards: []
25160
25388
  };
25161
25389
  });
@@ -25213,9 +25441,9 @@ async function readRewardContext(chainId, registry, utilities) {
25213
25441
  ],
25214
25442
  allowFailure: true
25215
25443
  });
25216
- const periodFinish = big2(stream[0]);
25217
- const rewardRate = big2(stream[1]);
25218
- const totalWeight = big2(stream[2]);
25444
+ const periodFinish = big3(stream[0]);
25445
+ const rewardRate = big3(stream[1]);
25446
+ const totalWeight = big3(stream[2]);
25219
25447
  if (periodFinish === null || rewardRate === null || totalWeight === null || totalWeight === 0n) {
25220
25448
  return { pairEmissions, convexPoolUtil };
25221
25449
  }
@@ -25284,7 +25512,7 @@ function getCurvanceAssetRoster(chainId, lender) {
25284
25512
  // src/lending/public-data/curvance/fetchPublic.ts
25285
25513
  var FALLBACK_TOKEN_READS = 12;
25286
25514
  var zero = "0x0000000000000000000000000000000000000000";
25287
- var big3 = (v) => {
25515
+ var big4 = (v) => {
25288
25516
  if (typeof v === "bigint") return v;
25289
25517
  if (typeof v === "number") return BigInt(v);
25290
25518
  if (typeof v === "string" && v !== "0x") {
@@ -25399,41 +25627,41 @@ async function fetchViaReader(lender, chainId, config) {
25399
25627
  assetSymbol: str(t?.asset?.symbol, "?"),
25400
25628
  assetName: str(t?.asset?.name, "?"),
25401
25629
  assetDecimals: num3(t?.asset?.decimals, 18),
25402
- collRatio: big3(t?.collRatio),
25403
- collReqSoft: big3(t?.collReqSoft),
25404
- collReqHard: big3(t?.collReqHard),
25405
- liqIncBase: big3(t?.liqIncBase),
25406
- liqIncCurve: big3(t?.liqIncCurve),
25407
- closeFactorBase: big3(t?.closeFactorBase),
25408
- maxLeverage: big3(t?.maxLeverage),
25409
- collateralCap: big3(t?.collateralCap),
25410
- debtCap: big3(t?.debtCap),
25630
+ collRatio: big4(t?.collRatio),
25631
+ collReqSoft: big4(t?.collReqSoft),
25632
+ collReqHard: big4(t?.collReqHard),
25633
+ liqIncBase: big4(t?.liqIncBase),
25634
+ liqIncCurve: big4(t?.liqIncCurve),
25635
+ closeFactorBase: big4(t?.closeFactorBase),
25636
+ maxLeverage: big4(t?.maxLeverage),
25637
+ collateralCap: big4(t?.collateralCap),
25638
+ debtCap: big4(t?.debtCap),
25411
25639
  mintPaused: !!t?.mintPaused,
25412
25640
  collateralizationPaused: !!t?.collateralizationPaused,
25413
25641
  borrowPaused: !!t?.borrowPaused,
25414
25642
  redeemPaused: !!t?.redeemPaused,
25415
- totalAssets: big3(d?.totalAssets),
25416
- totalSupply: big3(d?.totalSupply),
25417
- exchangeRate: big3(d?.exchangeRate),
25418
- collateral: big3(d?.collateral),
25419
- debt: big3(d?.debt),
25420
- liquidity: big3(d?.liquidity),
25421
- assetPrice: big3(d?.assetPrice),
25422
- assetPriceLower: big3(d?.assetPriceLower),
25423
- borrowRate: big3(d?.borrowRate),
25424
- predictedBorrowRate: big3(d?.predictedBorrowRate),
25425
- supplyRate: big3(d?.supplyRate),
25426
- utilizationRate: big3(d?.utilizationRate),
25427
- interestFee: big3(t?.interestFee),
25428
- irmTargetRate: big3(t?.irmTargetRate),
25429
- irmMaxRate: big3(t?.irmMaxRate),
25430
- irmTargetUtilization: big3(t?.irmTargetUtilization)
25643
+ totalAssets: big4(d?.totalAssets),
25644
+ totalSupply: big4(d?.totalSupply),
25645
+ exchangeRate: big4(d?.exchangeRate),
25646
+ collateral: big4(d?.collateral),
25647
+ debt: big4(d?.debt),
25648
+ liquidity: big4(d?.liquidity),
25649
+ assetPrice: big4(d?.assetPrice),
25650
+ assetPriceLower: big4(d?.assetPriceLower),
25651
+ borrowRate: big4(d?.borrowRate),
25652
+ predictedBorrowRate: big4(d?.predictedBorrowRate),
25653
+ supplyRate: big4(d?.supplyRate),
25654
+ utilizationRate: big4(d?.utilizationRate),
25655
+ interestFee: big4(t?.interestFee),
25656
+ irmTargetRate: big4(t?.irmTargetRate),
25657
+ irmMaxRate: big4(t?.irmMaxRate),
25658
+ irmTargetUtilization: big4(t?.irmTargetUtilization)
25431
25659
  });
25432
25660
  }
25433
25661
  if (tokens.length === 0) continue;
25434
25662
  markets.push({
25435
25663
  marketManager,
25436
- cooldownLength: big3(m?.cooldownLength),
25664
+ cooldownLength: big4(m?.cooldownLength),
25437
25665
  // Filled in below — one batched round for every market at once.
25438
25666
  minLoanSizeUsdWad: 0n,
25439
25667
  tokens
@@ -25494,7 +25722,7 @@ async function fetchViaMulticall(lender, chainId, config) {
25494
25722
  const pairs = [];
25495
25723
  managers.forEach((mm, i) => {
25496
25724
  const toks = listed[i * 2];
25497
- const redeemPaused = big3(listed[i * 2 + 1]) === 2n;
25725
+ const redeemPaused = big4(listed[i * 2 + 1]) === 2n;
25498
25726
  if (!Array.isArray(toks)) return;
25499
25727
  for (const t of toks) {
25500
25728
  if (typeof t === "string" && t.startsWith("0x")) {
@@ -25580,9 +25808,9 @@ async function fetchViaMulticall(lender, chainId, config) {
25580
25808
  const paused = results[base + 4];
25581
25809
  const asset = results[base + 7];
25582
25810
  if (!Array.isArray(coll) || typeof asset !== "string") return;
25583
- const tuple = (v, idx) => Array.isArray(v) ? big3(v[idx]) : 0n;
25584
- const held = big3(results[base + 10]);
25585
- const debt = big3(results[base + 9]);
25811
+ const tuple = (v, idx) => Array.isArray(v) ? big4(v[idx]) : 0n;
25812
+ const held = big4(results[base + 10]);
25813
+ const debt = big4(results[base + 9]);
25586
25814
  const token = {
25587
25815
  cToken: p.cToken,
25588
25816
  symbol: str(results[base + 5], "c?"),
@@ -25599,13 +25827,13 @@ async function fetchViaMulticall(lender, chainId, config) {
25599
25827
  liqIncCurve: tuple(liq, 1),
25600
25828
  closeFactorBase: tuple(liq, 4),
25601
25829
  maxLeverage: 0n,
25602
- collateralCap: big3(results[base + 2]),
25603
- debtCap: big3(results[base + 3]),
25830
+ collateralCap: big4(results[base + 2]),
25831
+ debtCap: big4(results[base + 3]),
25604
25832
  mintPaused: Array.isArray(paused) ? !!paused[0] : false,
25605
25833
  collateralizationPaused: Array.isArray(paused) ? !!paused[1] : false,
25606
25834
  borrowPaused: Array.isArray(paused) ? !!paused[2] : false,
25607
25835
  redeemPaused: p.redeemPaused,
25608
- totalAssets: big3(results[base + 8]),
25836
+ totalAssets: big4(results[base + 8]),
25609
25837
  totalSupply: 0n,
25610
25838
  exchangeRate: 0n,
25611
25839
  collateral: 0n,
@@ -25619,7 +25847,7 @@ async function fetchViaMulticall(lender, chainId, config) {
25619
25847
  predictedBorrowRate: 0n,
25620
25848
  supplyRate: 0n,
25621
25849
  utilizationRate: held + debt > 0n ? debt * 10n ** 18n / (held + debt) : 0n,
25622
- interestFee: big3(results[base + 11]),
25850
+ interestFee: big4(results[base + 11]),
25623
25851
  irmTargetRate: 0n,
25624
25852
  irmMaxRate: 0n,
25625
25853
  irmTargetUtilization: 0n
@@ -25706,7 +25934,7 @@ var ERC20_ABI = [
25706
25934
  ];
25707
25935
  var RAY4 = 1e27;
25708
25936
  var ok = (v) => v !== void 0 && v !== null && v !== "0x";
25709
- var big4 = (v) => {
25937
+ var big5 = (v) => {
25710
25938
  if (typeof v === "bigint") return v;
25711
25939
  if (typeof v === "number") return BigInt(v);
25712
25940
  if (typeof v === "string" && /^(0x[0-9a-fA-F]+|\d+)$/.test(v)) return BigInt(v);
@@ -25814,10 +26042,10 @@ async function fetchTwyneMarkets(lender, chainId) {
25814
26042
  const pendingDebtBalances = [];
25815
26043
  markets.forEach((m, i) => {
25816
26044
  const c = i * 8;
25817
- const creditTotalAssets = big4(creditReads[c]);
25818
- const creditTotalBorrows = big4(creditReads[c + 1]);
25819
- const creditCash = big4(creditReads[c + 2]);
25820
- const creditRateSpy = big4(creditReads[c + 3]);
26045
+ const creditTotalAssets = big5(creditReads[c]);
26046
+ const creditTotalBorrows = big5(creditReads[c + 1]);
26047
+ const creditCash = big5(creditReads[c + 2]);
26048
+ const creditRateSpy = big5(creditReads[c + 3]);
25821
26049
  if (creditTotalAssets === void 0 || creditCash === void 0 || creditRateSpy === void 0) return;
25822
26050
  const aaveIdx = aaveMarkets.indexOf(m);
25823
26051
  const eulerIdx = eulerMarkets.indexOf(m);
@@ -25836,21 +26064,21 @@ async function fetchTwyneMarkets(lender, chainId) {
25836
26064
  if (ok(debtReserve) && debtReserve?.currentVariableBorrowRate !== void 0)
25837
26065
  externalBorrowRate = Number(debtReserve.currentVariableBorrowRate) / RAY4;
25838
26066
  if (ok(debtReserve)) {
25839
- const virtual = big4(debtReserve.virtualUnderlyingBalance);
26067
+ const virtual = big5(debtReserve.virtualUnderlyingBalance);
25840
26068
  if (virtual !== void 0 && virtual > 0n) externalBorrowLiquidity = virtual;
25841
26069
  else if (typeof debtReserve.aTokenAddress === "string")
25842
26070
  debtAToken = debtReserve.aTokenAddress;
25843
26071
  }
25844
26072
  } else if (eulerIdx >= 0) {
25845
26073
  const e = eulerIdx * 7;
25846
- externalLiqLtv = big4(eulerReads[e]);
25847
- const spy = big4(eulerReads[e + 1]);
26074
+ externalLiqLtv = big5(eulerReads[e]);
26075
+ const spy = big5(eulerReads[e + 1]);
25848
26076
  if (spy !== void 0) externalBorrowRate = Number(spy) / RAY4 * 31536e3;
25849
- externalBorrowLiquidity = big4(eulerReads[e + 2]);
25850
- const collSpy = big4(eulerReads[e + 3]);
25851
- const collAssets = big4(eulerReads[e + 4]);
25852
- const collBorrows = big4(eulerReads[e + 5]);
25853
- const collFeeBps = big4(eulerReads[e + 6]) ?? 0n;
26077
+ externalBorrowLiquidity = big5(eulerReads[e + 2]);
26078
+ const collSpy = big5(eulerReads[e + 3]);
26079
+ const collAssets = big5(eulerReads[e + 4]);
26080
+ const collBorrows = big5(eulerReads[e + 5]);
26081
+ const collFeeBps = big5(eulerReads[e + 6]) ?? 0n;
25854
26082
  if (collSpy !== void 0 && collAssets && collAssets > 0n) {
25855
26083
  const util = Number(collBorrows ?? 0n) / Number(collAssets);
25856
26084
  externalSupplyRate = Number(collSpy) / RAY4 * 31536e3 * util * (1 - Number(collFeeBps) / 1e4);
@@ -25858,7 +26086,7 @@ async function fetchTwyneMarkets(lender, chainId) {
25858
26086
  }
25859
26087
  const s = i * 3;
25860
26088
  if (externalBorrowLiquidity === void 0 && !debtAToken) {
25861
- externalBorrowLiquidity = big4(scaleReads[s + 2]);
26089
+ externalBorrowLiquidity = big5(scaleReads[s + 2]);
25862
26090
  }
25863
26091
  if (debtAToken) pendingDebtBalances.push({ index: out.length, token: m.targetAsset, holder: debtAToken });
25864
26092
  out.push({
@@ -25867,19 +26095,19 @@ async function fetchTwyneMarkets(lender, chainId) {
25867
26095
  creditTotalBorrows: creditTotalBorrows ?? 0n,
25868
26096
  creditCash,
25869
26097
  creditRateSpy,
25870
- creditDepositCapacity: big4(creditReads[c + 7]),
26098
+ creditDepositCapacity: big5(creditReads[c + 7]),
25871
26099
  creditDecimals: Number(creditReads[c + 4] ?? 18),
25872
26100
  creditSymbol: typeof creditReads[c + 5] === "string" ? creditReads[c + 5] : void 0,
25873
26101
  creditIrm: typeof creditReads[c + 6] === "string" ? creditReads[c + 6].toLowerCase() : m.creditIrm,
25874
26102
  externalLiqLtv,
25875
- maxTwyneLiqLtv: big4(bounds[i * 2]) ?? (m.maxTwyneLiqLTV !== void 0 ? BigInt(m.maxTwyneLiqLTV) : void 0),
25876
- externalLiqBuffer: big4(bounds[i * 2 + 1]) ?? (m.externalLiqBuffer !== void 0 ? BigInt(m.externalLiqBuffer) : void 0),
26103
+ maxTwyneLiqLtv: big5(bounds[i * 2]) ?? (m.maxTwyneLiqLTV !== void 0 ? BigInt(m.maxTwyneLiqLTV) : void 0),
26104
+ externalLiqBuffer: big5(bounds[i * 2 + 1]) ?? (m.externalLiqBuffer !== void 0 ? BigInt(m.externalLiqBuffer) : void 0),
25877
26105
  externalSupplyRate,
25878
26106
  externalBorrowRate,
25879
26107
  externalBorrowLiquidity,
25880
26108
  collateralDecimals: Number(scaleReads[s] ?? 18),
25881
26109
  targetDecimals: Number(scaleReads[s + 1] ?? 18),
25882
- collateralToUnderlying: big4(wrapperReads[i]),
26110
+ collateralToUnderlying: big5(wrapperReads[i]),
25883
26111
  // Computed HERE, never read from the roster: a stored flag goes stale,
25884
26112
  // and two of the three live PT markets have already matured.
25885
26113
  collateralMatured: !!m.collateralMaturity && m.collateralMaturity <= nowSec9,
@@ -25898,7 +26126,7 @@ async function fetchTwyneMarkets(lender, chainId) {
25898
26126
  allowFailure: true
25899
26127
  });
25900
26128
  pendingDebtBalances.forEach((p, i) => {
25901
- const v = big4(balances[i]);
26129
+ const v = big5(balances[i]);
25902
26130
  if (v !== void 0 && out[p.index]) out[p.index].externalBorrowLiquidity = v;
25903
26131
  });
25904
26132
  }
@@ -25906,7 +26134,7 @@ async function fetchTwyneMarkets(lender, chainId) {
25906
26134
  return { lender, chainId, config, markets: out };
25907
26135
  }
25908
26136
  var PAIR_READS = 15;
25909
- var big5 = (v) => {
26137
+ var big6 = (v) => {
25910
26138
  if (typeof v === "bigint") return v;
25911
26139
  if (typeof v === "number") return BigInt(v);
25912
26140
  if (typeof v === "string" && v !== "0x") {
@@ -26013,41 +26241,41 @@ async function fetchFraxlendPairs(lender, chainId) {
26013
26241
  decimals: dec(decimals),
26014
26242
  asset: asset.toLowerCase(),
26015
26243
  collateral: collateral.toLowerCase(),
26016
- maxLtv: big5(maxLtv),
26017
- ltvPrecision: big5(ltvPrec) || 100000n,
26018
- exchangePrecision: big5(exPrec) || 10n ** 18n,
26019
- liqPrecision: big5(liqPrec) || 100000n,
26244
+ maxLtv: big6(maxLtv),
26245
+ ltvPrecision: big6(ltvPrec) || 100000n,
26246
+ exchangePrecision: big6(exPrec) || 10n ** 18n,
26247
+ liqPrecision: big6(liqPrec) || 100000n,
26020
26248
  cleanLiquidationFee: 0n,
26021
26249
  dirtyLiquidationFee: 0n,
26022
26250
  protocolLiquidationFee: 0n,
26023
- depositLimit: big5(depositLimit),
26024
- borrowLimit: big5(borrowLimit),
26025
- totalAssetAmount: big5(
26251
+ depositLimit: big6(depositLimit),
26252
+ borrowLimit: big6(borrowLimit),
26253
+ totalAssetAmount: big6(
26026
26254
  totalAsset.amount ?? totalAsset[0]
26027
26255
  ),
26028
- totalAssetShares: big5(
26256
+ totalAssetShares: big6(
26029
26257
  totalAsset.shares ?? totalAsset[1]
26030
26258
  ),
26031
- totalBorrowAmount: big5(
26259
+ totalBorrowAmount: big6(
26032
26260
  totalBorrow.amount ?? totalBorrow[0]
26033
26261
  ),
26034
- totalBorrowShares: big5(
26262
+ totalBorrowShares: big6(
26035
26263
  totalBorrow.shares ?? totalBorrow[1]
26036
26264
  ),
26037
- totalCollateral: big5(totalCollateral),
26265
+ totalCollateral: big6(totalCollateral),
26038
26266
  oracle: str2(xrInfo[0], "").toLowerCase(),
26039
26267
  maxOracleDeviation: Number(xrInfo[1] ?? 0),
26040
- exchangeRateLastTimestamp: big5(xrInfo[2]),
26041
- lowExchangeRate: big5(xrInfo[3]),
26042
- highExchangeRate: big5(xrInfo[4]),
26043
- ratePerSec: big5(rateInfo.ratePerSec ?? rateInfo[3]),
26044
- fullUtilizationRate: big5(
26268
+ exchangeRateLastTimestamp: big6(xrInfo[2]),
26269
+ lowExchangeRate: big6(xrInfo[3]),
26270
+ highExchangeRate: big6(xrInfo[4]),
26271
+ ratePerSec: big6(rateInfo.ratePerSec ?? rateInfo[3]),
26272
+ fullUtilizationRate: big6(
26045
26273
  rateInfo.fullUtilizationRate ?? rateInfo[4]
26046
26274
  ),
26047
26275
  feeToProtocolRate: Number(
26048
26276
  rateInfo.feeToProtocolRate ?? rateInfo[1] ?? 0
26049
26277
  ),
26050
- rateLastTimestamp: big5(
26278
+ rateLastTimestamp: big6(
26051
26279
  rateInfo.lastTimestamp ?? rateInfo[2]
26052
26280
  ),
26053
26281
  rateContract: str2(rateContract, "").toLowerCase(),
@@ -26111,7 +26339,7 @@ function inverseKeyParts(key3) {
26111
26339
  if (!/^[0-9A-F]{40}$/.test(suffix)) return void 0;
26112
26340
  return { lender: "INVERSE", market: "0x" + suffix.toLowerCase() };
26113
26341
  }
26114
- function currencyFor8(address, decimals, symbol, tokens) {
26342
+ function currencyFor9(address, decimals, symbol, tokens) {
26115
26343
  const lower4 = address.toLowerCase();
26116
26344
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
26117
26345
  }
@@ -26155,7 +26383,7 @@ function convertInverseMarketsToResponse(raw, chainId, prices = {}, _additionalY
26155
26383
  name: "Collateral " + collSymbol,
26156
26384
  poolId: market.address.toLowerCase(),
26157
26385
  underlying: collAddr,
26158
- asset: currencyFor8(collAddr, collDecimals, collSymbol, tokens),
26386
+ asset: currencyFor9(collAddr, collDecimals, collSymbol, tokens),
26159
26387
  totalDeposits: collateralTotal,
26160
26388
  totalDebtStable: 0,
26161
26389
  totalDebt: 0,
@@ -26199,7 +26427,7 @@ function convertInverseMarketsToResponse(raw, chainId, prices = {}, _additionalY
26199
26427
  name: "DOLA",
26200
26428
  poolId: market.address.toLowerCase(),
26201
26429
  underlying: dolaAddr,
26202
- asset: currencyFor8(dolaAddr, debtDecimals, "DOLA", tokens),
26430
+ asset: currencyFor9(dolaAddr, debtDecimals, "DOLA", tokens),
26203
26431
  totalDeposits: 0,
26204
26432
  totalDebtStable: 0,
26205
26433
  totalDebt,
@@ -26295,7 +26523,7 @@ function convertInverseMarketsToResponse(raw, chainId, prices = {}, _additionalY
26295
26523
  var WAD9 = 1e18;
26296
26524
  var clamp01 = (v) => Math.max(0, Math.min(1, v));
26297
26525
  var wadToNumber = (v) => v !== null ? Number(v) / WAD9 : 0;
26298
- function currencyFor9(address, decimals, symbol, tokens) {
26526
+ function currencyFor10(address, decimals, symbol, tokens) {
26299
26527
  const lower4 = address.toLowerCase();
26300
26528
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
26301
26529
  }
@@ -26339,7 +26567,7 @@ function convertCoolerMarketsToResponse(raw, chainId, prices = {}, _additionalYi
26339
26567
  name: "Collateral " + collSymbol,
26340
26568
  poolId: cfg.monoCooler.toLowerCase(),
26341
26569
  underlying: collAddr,
26342
- asset: currencyFor9(collAddr, collDecimals, collSymbol, tokens),
26570
+ asset: currencyFor10(collAddr, collDecimals, collSymbol, tokens),
26343
26571
  totalDeposits: totalCollateral,
26344
26572
  totalDebtStable: 0,
26345
26573
  totalDebt: 0,
@@ -26385,7 +26613,7 @@ function convertCoolerMarketsToResponse(raw, chainId, prices = {}, _additionalYi
26385
26613
  name: debtSymbol,
26386
26614
  poolId: cfg.monoCooler.toLowerCase(),
26387
26615
  underlying: debtAddr,
26388
- asset: currencyFor9(debtAddr, debtDecimals, debtSymbol, tokens),
26616
+ asset: currencyFor10(debtAddr, debtDecimals, debtSymbol, tokens),
26389
26617
  totalDeposits: 0,
26390
26618
  totalDebtStable: 0,
26391
26619
  totalDebt,
@@ -26492,7 +26720,7 @@ function llamaLendKeyParts(key3) {
26492
26720
  if (!/^[0-9A-F]{40}$/.test(suffix)) return void 0;
26493
26721
  return { lender: "LLAMALEND", controller: "0x" + suffix.toLowerCase() };
26494
26722
  }
26495
- function currencyFor10(address, decimals, symbol, tokens) {
26723
+ function currencyFor11(address, decimals, symbol, tokens) {
26496
26724
  const lower4 = address.toLowerCase();
26497
26725
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
26498
26726
  }
@@ -26555,7 +26783,7 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
26555
26783
  name: "Collateral " + collSymbol,
26556
26784
  poolId: market.controller.toLowerCase(),
26557
26785
  underlying: collAddr,
26558
- asset: currencyFor10(collAddr, collDecimals, collSymbol, tokens),
26786
+ asset: currencyFor11(collAddr, collDecimals, collSymbol, tokens),
26559
26787
  // Collateral lives inside the LLAMMA spread over bands; there is no
26560
26788
  // single market-level balance worth reporting, and the number the UI
26561
26789
  // needs is the borrowed side anyway.
@@ -26603,7 +26831,7 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
26603
26831
  name: loanSymbol,
26604
26832
  poolId: market.controller.toLowerCase(),
26605
26833
  underlying: loanAddr,
26606
- asset: currencyFor10(loanAddr, loanDecimals, loanSymbol, tokens),
26834
+ asset: currencyFor11(loanAddr, loanDecimals, loanSymbol, tokens),
26607
26835
  totalDeposits,
26608
26836
  totalDebtStable: 0,
26609
26837
  totalDebt,
@@ -26841,7 +27069,7 @@ function resupplyKeyParts(key3) {
26841
27069
  var SECONDS_PER_YEAR9 = 31536e3;
26842
27070
  var LTV_PRECISION = 1e5;
26843
27071
  var ONE2 = 10n ** 18n;
26844
- function currencyFor11(address, decimals, symbol, tokens) {
27072
+ function currencyFor12(address, decimals, symbol, tokens) {
26845
27073
  const lower4 = address.toLowerCase();
26846
27074
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
26847
27075
  }
@@ -26952,7 +27180,7 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
26952
27180
  name: "Collateral " + collSymbol,
26953
27181
  poolId: id.pair.toLowerCase(),
26954
27182
  underlying: collAddr,
26955
- asset: currencyFor11(collAddr, collDecimals, collSymbol, tokens),
27183
+ asset: currencyFor12(collAddr, collDecimals, collSymbol, tokens),
26956
27184
  totalDeposits: totalColl,
26957
27185
  totalDebtStable: 0,
26958
27186
  totalDebt: 0,
@@ -27005,7 +27233,7 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
27005
27233
  name: debtSymbol,
27006
27234
  poolId: id.pair.toLowerCase(),
27007
27235
  underlying: debtAddr,
27008
- asset: currencyFor11(debtAddr, debtDecimals, debtSymbol, tokens),
27236
+ asset: currencyFor12(debtAddr, debtDecimals, debtSymbol, tokens),
27009
27237
  totalDeposits: 0,
27010
27238
  totalDebtStable: 0,
27011
27239
  totalDebt,
@@ -27134,7 +27362,7 @@ var BPS2 = 1e4;
27134
27362
  function ratePerSecToApr2(rate) {
27135
27363
  return Number(rate) / 1e18 * SECONDS_PER_YEAR10 * 100;
27136
27364
  }
27137
- function currencyFor12(address, decimals, symbol, name, tokens) {
27365
+ function currencyFor13(address, decimals, symbol, name, tokens) {
27138
27366
  const lower4 = address.toLowerCase();
27139
27367
  return tokens[lower4] ?? { address: lower4, symbol, name, decimals };
27140
27368
  }
@@ -27189,7 +27417,7 @@ function convertCurvanceMarketsToResponse(raw, chainId, prices = {}, _additional
27189
27417
  name: t.assetSymbol,
27190
27418
  poolId: market.marketManager.toLowerCase(),
27191
27419
  underlying: assetAddr,
27192
- asset: currencyFor12(assetAddr, dec2, t.assetSymbol, t.assetName, tokens),
27420
+ asset: currencyFor13(assetAddr, dec2, t.assetSymbol, t.assetName, tokens),
27193
27421
  totalDeposits,
27194
27422
  totalDebtStable: 0,
27195
27423
  totalDebt,
@@ -27382,7 +27610,7 @@ var toFloat2 = (v, dec2) => v === void 0 ? 0 : Number(v) / 10 ** dec2;
27382
27610
  function spyToApr(spy) {
27383
27611
  return Number(spy) / RAY5 * SECONDS_PER_YEAR11 * 100;
27384
27612
  }
27385
- function currencyFor13(address, decimals, symbol, tokens) {
27613
+ function currencyFor14(address, decimals, symbol, tokens) {
27386
27614
  const lower4 = address.toLowerCase();
27387
27615
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
27388
27616
  }
@@ -27416,7 +27644,7 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
27416
27644
  name: m.symbol ?? collToken?.symbol ?? "collateral",
27417
27645
  poolId: m.intermediateVault.toLowerCase(),
27418
27646
  underlying: collAddr,
27419
- asset: currencyFor13(collAddr, row.collateralDecimals, m.symbol ?? "", tokens),
27647
+ asset: currencyFor14(collAddr, row.collateralDecimals, m.symbol ?? "", tokens),
27420
27648
  totalDeposits: creditTotal,
27421
27649
  totalDebtStable: 0,
27422
27650
  totalDebt: 0,
@@ -27500,7 +27728,7 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
27500
27728
  name: debtToken?.symbol ?? "debt",
27501
27729
  poolId: m.intermediateVault.toLowerCase(),
27502
27730
  underlying: debtAddr,
27503
- asset: currencyFor13(debtAddr, row.targetDecimals, debtToken?.symbol ?? "", tokens),
27731
+ asset: currencyFor14(debtAddr, row.targetDecimals, debtToken?.symbol ?? "", tokens),
27504
27732
  // Borrower aggregates are NOT readable without an event replay — see the
27505
27733
  // header. Zero here means "not measured", and the descriptor says so.
27506
27734
  totalDeposits: 0,
@@ -27639,7 +27867,7 @@ var SECONDS_PER_YEAR12 = 31536e3;
27639
27867
  var ratePerSecToApr3 = (rate) => Number(rate) / 1e18 * SECONDS_PER_YEAR12 * 100;
27640
27868
  var toFloat3 = (raw, decimals) => Number(raw) / 10 ** decimals;
27641
27869
  var MAX_UINT = (1n << 256n) - 1n;
27642
- function currencyFor14(address, decimals, symbol, name, tokens) {
27870
+ function currencyFor15(address, decimals, symbol, name, tokens) {
27643
27871
  const lower4 = address.toLowerCase();
27644
27872
  return tokens[lower4] ?? { address: lower4, symbol, name, decimals };
27645
27873
  }
@@ -27688,7 +27916,7 @@ function convertFraxlendPairsToResponse(raw, chainId, prices = {}, _additionalYi
27688
27916
  name: p.assetSymbol,
27689
27917
  poolId: p.pair.toLowerCase(),
27690
27918
  underlying: p.asset,
27691
- asset: currencyFor14(
27919
+ asset: currencyFor15(
27692
27920
  p.asset,
27693
27921
  p.assetDecimals,
27694
27922
  p.assetSymbol,
@@ -27741,7 +27969,7 @@ function convertFraxlendPairsToResponse(raw, chainId, prices = {}, _additionalYi
27741
27969
  name: p.collateralSymbol,
27742
27970
  poolId: p.pair.toLowerCase(),
27743
27971
  underlying: p.collateral,
27744
- asset: currencyFor14(
27972
+ asset: currencyFor15(
27745
27973
  p.collateral,
27746
27974
  p.collateralDecimals,
27747
27975
  p.collateralSymbol,
@@ -27911,12 +28139,12 @@ async function fetchDssMarkets(lender, chainId) {
27911
28139
  } catch {
27912
28140
  return { lender, config, chainData, markets: [] };
27913
28141
  }
27914
- const big22 = (v) => {
28142
+ const big23 = (v) => {
27915
28143
  if (typeof v === "bigint") return v;
27916
28144
  if (typeof v === "number") return BigInt(v);
27917
28145
  return null;
27918
28146
  };
27919
- const field13 = (res, name, idx) => big22(res?.[name] ?? res?.[idx]);
28147
+ const field13 = (res, name, idx) => big23(res?.[name] ?? res?.[idx]);
27920
28148
  let cursor = 0;
27921
28149
  const out = markets.map((market, i) => {
27922
28150
  const base = cursor;
@@ -27933,7 +28161,7 @@ async function fetchDssMarkets(lender, chainId) {
27933
28161
  dust: field13(vatIlk, "dust", 4),
27934
28162
  duty: field13(jugIlk, "duty", 0),
27935
28163
  mat: field13(spotIlk, "mat", 1),
27936
- joinBalance: joinReadIndex[i] >= 0 ? big22(results[joinReadIndex[i]]) : null
28164
+ joinBalance: joinReadIndex[i] >= 0 ? big23(results[joinReadIndex[i]]) : null
27937
28165
  };
27938
28166
  });
27939
28167
  return { lender, config, chainData, markets: out };
@@ -27958,10 +28186,10 @@ var WAD11 = 1e18;
27958
28186
  var RAY6 = 1e27;
27959
28187
  var RAD = 1e45;
27960
28188
  var YEAR_SECONDS2 = 31536e3;
27961
- function toHuman4(raw, decimals) {
28189
+ function toHuman5(raw, decimals) {
27962
28190
  return Number(raw) / 10 ** decimals;
27963
28191
  }
27964
- function currencyFor15(address, decimals, symbol, tokens) {
28192
+ function currencyFor16(address, decimals, symbol, tokens) {
27965
28193
  const lower4 = address.toLowerCase();
27966
28194
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
27967
28195
  }
@@ -27995,7 +28223,7 @@ function convertDssMarketsToResponse(raw, chainId, prices = {}, _additionalYield
27995
28223
  const spotDerivedPrice = m.spot !== null && m.mat !== null ? Number(m.spot) / RAY6 * (Number(m.mat) / RAY6) : 0;
27996
28224
  const collPrice = spotDerivedPrice || (prices[collPriceKey] ?? 0);
27997
28225
  const totalDebt = m.Art !== null && m.rate !== null ? Number(m.Art * m.rate / BigInt(1e27)) / 10 ** debtDecimals : 0;
27998
- const totalColl = m.joinBalance !== null ? toHuman4(m.joinBalance, collDecimals) : 0;
28226
+ const totalColl = m.joinBalance !== null ? toHuman5(m.joinBalance, collDecimals) : 0;
27999
28227
  const mat = m.mat !== null ? Number(m.mat) / RAY6 : Number(market.mat) / RAY6 || 1.5;
28000
28228
  const ltv = mat > 0 ? 1 / mat : 0;
28001
28229
  const chop = market.chop ? Number(market.chop) / WAD11 : 0;
@@ -28013,7 +28241,7 @@ function convertDssMarketsToResponse(raw, chainId, prices = {}, _additionalYield
28013
28241
  name: "Collateral " + collSymbol,
28014
28242
  poolId: market.gemJoin?.toLowerCase(),
28015
28243
  underlying: collAddr,
28016
- asset: currencyFor15(collAddr, collDecimals, collSymbol, tokens),
28244
+ asset: currencyFor16(collAddr, collDecimals, collSymbol, tokens),
28017
28245
  totalDeposits: totalColl,
28018
28246
  totalDebtStable: 0,
28019
28247
  totalDebt: 0,
@@ -28057,7 +28285,7 @@ function convertDssMarketsToResponse(raw, chainId, prices = {}, _additionalYield
28057
28285
  name: debtSymbol,
28058
28286
  poolId: cfg.vat.toLowerCase(),
28059
28287
  underlying: debtAddr,
28060
- asset: currencyFor15(debtAddr, debtDecimals, debtSymbol, tokens),
28288
+ asset: currencyFor16(debtAddr, debtDecimals, debtSymbol, tokens),
28061
28289
  totalDeposits: 0,
28062
28290
  totalDebtStable: 0,
28063
28291
  totalDebt,
@@ -28207,26 +28435,26 @@ async function fetchFrankencoinMarkets(lender, chainId) {
28207
28435
  } catch {
28208
28436
  return { lender, config, chainData, markets: [] };
28209
28437
  }
28210
- const big22 = (v) => {
28438
+ const big23 = (v) => {
28211
28439
  if (typeof v === "bigint") return v;
28212
28440
  if (typeof v === "number") return BigInt(v);
28213
28441
  return null;
28214
28442
  };
28215
28443
  const out = markets.map((market, i) => {
28216
28444
  const base = i * READS_PER_MARKET3;
28217
- const expiration = big22(results[base + 7]);
28445
+ const expiration = big23(results[base + 7]);
28218
28446
  return {
28219
28447
  market,
28220
- price: big22(results[base]),
28221
- minted: big22(results[base + 1]),
28222
- availableForClones: big22(results[base + 2]),
28223
- annualInterestPPM: big22(results[base + 3]),
28224
- currentFeePPM: big22(results[base + 4]),
28225
- reserveContribution: big22(results[base + 5]),
28226
- challengedAmount: big22(results[base + 6]),
28448
+ price: big23(results[base]),
28449
+ minted: big23(results[base + 1]),
28450
+ availableForClones: big23(results[base + 2]),
28451
+ annualInterestPPM: big23(results[base + 3]),
28452
+ currentFeePPM: big23(results[base + 4]),
28453
+ reserveContribution: big23(results[base + 5]),
28454
+ challengedAmount: big23(results[base + 6]),
28227
28455
  expiration,
28228
28456
  isClosed: typeof results[base + 8] === "boolean" ? results[base + 8] : null,
28229
- collateralBalance: big22(results[base + 9])
28457
+ collateralBalance: big23(results[base + 9])
28230
28458
  };
28231
28459
  });
28232
28460
  return { lender, config, chainData, markets: out };
@@ -28248,7 +28476,7 @@ function frankencoinKeyParts(key3) {
28248
28476
  };
28249
28477
  }
28250
28478
  var PPM = 1e6;
28251
- function currencyFor16(address, decimals, symbol, tokens) {
28479
+ function currencyFor17(address, decimals, symbol, tokens) {
28252
28480
  const lower4 = address.toLowerCase();
28253
28481
  return tokens[lower4] ?? { address: lower4, symbol, name: symbol, decimals };
28254
28482
  }
@@ -28299,7 +28527,7 @@ function convertFrankencoinMarketsToResponse(raw, chainId, prices = {}, _additio
28299
28527
  name: "Collateral " + collSymbol,
28300
28528
  poolId: market.position.toLowerCase(),
28301
28529
  underlying: collAddr,
28302
- asset: currencyFor16(collAddr, collDecimals, collSymbol, tokens),
28530
+ asset: currencyFor17(collAddr, collDecimals, collSymbol, tokens),
28303
28531
  totalDeposits: totalColl,
28304
28532
  totalDebtStable: 0,
28305
28533
  totalDebt: 0,
@@ -28346,7 +28574,7 @@ function convertFrankencoinMarketsToResponse(raw, chainId, prices = {}, _additio
28346
28574
  name: debtSymbol,
28347
28575
  poolId: cfg.mintingHub.toLowerCase(),
28348
28576
  underlying: debtAddr,
28349
- asset: currencyFor16(debtAddr, debtDecimals, debtSymbol, tokens),
28577
+ asset: currencyFor17(debtAddr, debtDecimals, debtSymbol, tokens),
28350
28578
  totalDeposits: 0,
28351
28579
  totalDebtStable: 0,
28352
28580
  totalDebt,
@@ -29065,6 +29293,7 @@ async function getLenderDataFromApi(lender, chainId, prices, additionalYields, i
29065
29293
  if (isMidnight(lender)) return await fetchMidnightMarkets(chainId);
29066
29294
  if (isTerm(lender)) return await fetchTermMarkets(chainId);
29067
29295
  if (isExactly(lender)) return await fetchExactlyMarkets(chainId);
29296
+ if (isFlyingTulip(lender)) return await fetchFlyingTulipMarkets(chainId);
29068
29297
  if (isLiquityFamily(lender)) return await fetchLiquityMarkets(lender, chainId);
29069
29298
  if (isRiver(lender)) return await fetchRiverMarkets(lender, chainId);
29070
29299
  if (isTeller(lender)) return await fetchTellerMarkets(chainId);
@@ -29143,6 +29372,14 @@ function convertLenderDataFromApi(lender, chainId, data, prices, additionalYield
29143
29372
  additionalYields,
29144
29373
  list
29145
29374
  );
29375
+ if (isFlyingTulip(lender))
29376
+ return convertFlyingTulipMarketsToResponse(
29377
+ data,
29378
+ chainId,
29379
+ prices,
29380
+ additionalYields,
29381
+ list
29382
+ )[lender] ?? {};
29146
29383
  if (isCooler(lender))
29147
29384
  return convertCoolerMarketsToResponse(
29148
29385
  data,
@@ -29504,6 +29741,7 @@ function lenderApiOnly(lender, chainId) {
29504
29741
  if (isMidnight(lender)) return true;
29505
29742
  if (isTerm(lender)) return true;
29506
29743
  if (isExactly(lender)) return true;
29744
+ if (isFlyingTulip(lender)) return true;
29507
29745
  if (isLiquityFamily(lender)) return true;
29508
29746
  if (isRiver(lender)) return true;
29509
29747
  if (isTeller(lender)) return true;
@@ -31770,7 +32008,7 @@ var getCachedDssCdps = (lender, chainId, account) => {
31770
32008
  if (!hit || Date.now() - hit.at > CACHE_TTL_MS2) return void 0;
31771
32009
  return hit;
31772
32010
  };
31773
- var big6 = (v) => {
32011
+ var big7 = (v) => {
31774
32012
  try {
31775
32013
  if (typeof v === "bigint") return v;
31776
32014
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -31801,7 +32039,7 @@ var buildDssUserCall = async (chainId, lender, account) => {
31801
32039
  ],
31802
32040
  allowFailure: false
31803
32041
  });
31804
- owners.push({ owner: account, count: big6(rawCount), cursor: big6(rawFirst) });
32042
+ owners.push({ owner: account, count: big7(rawCount), cursor: big7(rawFirst) });
31805
32043
  const proxy = String(rawProxy ?? zero2);
31806
32044
  if (proxy.toLowerCase() !== zero2) {
31807
32045
  const [pCount, pFirst] = await multicallRetryUniversal({
@@ -31813,7 +32051,7 @@ var buildDssUserCall = async (chainId, lender, account) => {
31813
32051
  ],
31814
32052
  allowFailure: false
31815
32053
  });
31816
- owners.push({ owner: proxy, count: big6(pCount), cursor: big6(pFirst) });
32054
+ owners.push({ owner: proxy, count: big7(pCount), cursor: big7(pFirst) });
31817
32055
  }
31818
32056
  } catch {
31819
32057
  return [];
@@ -31854,7 +32092,7 @@ var buildDssUserCall = async (chainId, lender, account) => {
31854
32092
  if (curated.has(ilk)) {
31855
32093
  cdps.push({ cdpId: cursor.toString(), urn: String(urn), ilk });
31856
32094
  }
31857
- cursor = big6(field6(link, "next", 1));
32095
+ cursor = big7(field6(link, "next", 1));
31858
32096
  }
31859
32097
  }
31860
32098
  } catch {
@@ -35043,7 +35281,7 @@ var getExactlyUserDataConverter = (_lender, chainId, account, meta) => {
35043
35281
  expected
35044
35282
  ];
35045
35283
  };
35046
- var big7 = (v) => {
35284
+ var big8 = (v) => {
35047
35285
  try {
35048
35286
  if (typeof v === "bigint") return v;
35049
35287
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35051,7 +35289,7 @@ var big7 = (v) => {
35051
35289
  }
35052
35290
  return 0n;
35053
35291
  };
35054
- var field7 = (res, name, idx) => big7(res?.[name] ?? res?.[idx]);
35292
+ var field7 = (res, name, idx) => big8(res?.[name] ?? res?.[idx]);
35055
35293
  var getLiquityUserDataConverter = (lender, chainId, account, meta) => {
35056
35294
  const cfg = liquityConfigFor(lender, chainId);
35057
35295
  const branches = liquityBranchesByChain(lender, chainId);
@@ -35172,11 +35410,11 @@ var getLiquityUserDataConverter = (lender, chainId, account, meta) => {
35172
35410
  };
35173
35411
  });
35174
35412
  const spBase = troves.length * 2;
35175
- const spDeposit = big7(slice2[spBase]);
35176
- const spYield = big7(slice2[spBase + 1]);
35177
- const spCollGain = big7(slice2[spBase + 2]);
35178
- const spStashed = big7(slice2[spBase + 3]);
35179
- const collSurplus = branch.collSurplusPool ? big7(slice2[spBase + 4]) : 0n;
35413
+ const spDeposit = big8(slice2[spBase]);
35414
+ const spYield = big8(slice2[spBase + 1]);
35415
+ const spCollGain = big8(slice2[spBase + 2]);
35416
+ const spStashed = big8(slice2[spBase + 3]);
35417
+ const collSurplus = branch.collSurplusPool ? big8(slice2[spBase + 4]) : 0n;
35180
35418
  const spStable = spDeposit + spYield;
35181
35419
  const spColl = spCollGain + spStashed + collSurplus;
35182
35420
  if (spStable > 0n || spColl > 0n) {
@@ -35255,7 +35493,7 @@ var getLiquityUserDataConverter = (lender, chainId, account, meta) => {
35255
35493
  expected
35256
35494
  ];
35257
35495
  };
35258
- var big8 = (v) => {
35496
+ var big9 = (v) => {
35259
35497
  try {
35260
35498
  if (typeof v === "bigint") return v;
35261
35499
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35263,7 +35501,7 @@ var big8 = (v) => {
35263
35501
  }
35264
35502
  return 0n;
35265
35503
  };
35266
- var field8 = (res, name, idx) => big8(res?.[name] ?? res?.[idx]);
35504
+ var field8 = (res, name, idx) => big9(res?.[name] ?? res?.[idx]);
35267
35505
  var getRiverUserDataConverter = (lender, chainId, account, meta) => {
35268
35506
  const cfg = riverConfigFor(lender, chainId);
35269
35507
  const markets = riverChainData(lender, chainId)?.markets ?? [];
@@ -35279,13 +35517,13 @@ var getRiverUserDataConverter = (lender, chainId, account, meta) => {
35279
35517
  const debtAddr = cfg.debtToken.toLowerCase();
35280
35518
  const debtDecimals = cfg.debtDecimals ?? 18;
35281
35519
  const out = {};
35282
- const spDeposit = big8(data[markets.length * RIVER_CALLS_PER_MARKET]);
35520
+ const spDeposit = big9(data[markets.length * RIVER_CALLS_PER_MARKET]);
35283
35521
  markets.forEach((market, i) => {
35284
35522
  const base = i * RIVER_CALLS_PER_MARKET;
35285
35523
  const entire = data[base];
35286
35524
  if (isFailedCall(entire) || isFailedCall(data[base + 1])) return;
35287
- const status = Number(big8(data[base + 1]));
35288
- const surplus = big8(data[base + 2]);
35525
+ const status = Number(big9(data[base + 1]));
35526
+ const surplus = big9(data[base + 2]);
35289
35527
  const lenderKey = riverLenderKey(lender, chainId, market.index);
35290
35528
  const metaMap = meta?.[lenderKey];
35291
35529
  if (!metaMap) return;
@@ -35396,7 +35634,7 @@ var getRiverUserDataConverter = (lender, chainId, account, meta) => {
35396
35634
  viaLens ? 1 : expected
35397
35635
  ];
35398
35636
  };
35399
- var big9 = (v) => {
35637
+ var big10 = (v) => {
35400
35638
  try {
35401
35639
  if (typeof v === "bigint") return v;
35402
35640
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35419,24 +35657,24 @@ var getInverseUserDataConverter = (lender, chainId, account, meta) => {
35419
35657
  const dolaAddr = cfg.dola.toLowerCase();
35420
35658
  const debtDecimals = cfg.debtDecimals ?? 18;
35421
35659
  const tailBase = markets.length * INVERSE_CALLS_PER_MARKET;
35422
- const dbrBalance = big9(data[tailBase]);
35423
- const dbrDeficit = big9(data[tailBase + 1]);
35660
+ const dbrBalance = big10(data[tailBase]);
35661
+ const dbrDeficit = big10(data[tailBase + 1]);
35424
35662
  const dbrSignedRaw = data[tailBase + 2];
35425
- const dbrSigned = isFailedCall(dbrSignedRaw) ? 0n : big9(dbrSignedRaw);
35663
+ const dbrSigned = isFailedCall(dbrSignedRaw) ? 0n : big10(dbrSignedRaw);
35426
35664
  const dbrTotalDebtRaw = data[tailBase + 3];
35427
- const dbrTotalDebt = isFailedCall(dbrTotalDebtRaw) ? 0n : big9(dbrTotalDebtRaw);
35665
+ const dbrTotalDebt = isFailedCall(dbrTotalDebtRaw) ? 0n : big10(dbrTotalDebtRaw);
35428
35666
  const dbrRunway = dbrTotalDebt > 0n ? dbrBalance * 31536000n / dbrTotalDebt : 0n;
35429
35667
  const nowSec9 = BigInt(Math.floor(Date.now() / 1e3));
35430
35668
  const out = {};
35431
35669
  markets.forEach((market, i) => {
35432
35670
  const base = i * INVERSE_CALLS_PER_MARKET;
35433
- const escrowBal = isFailedCall(data[base]) ? 0n : big9(data[base]);
35671
+ const escrowBal = isFailedCall(data[base]) ? 0n : big10(data[base]);
35434
35672
  const debtRaw = data[base + 1];
35435
35673
  if (isFailedCall(debtRaw)) return;
35436
- const debt = big9(debtRaw);
35674
+ const debt = big10(debtRaw);
35437
35675
  if (escrowBal === 0n && debt === 0n) return;
35438
- const creditLimit = isFailedCall(data[base + 2]) ? 0n : big9(data[base + 2]);
35439
- const withdrawalLimit = isFailedCall(data[base + 3]) ? 0n : big9(data[base + 3]);
35676
+ const creditLimit = isFailedCall(data[base + 2]) ? 0n : big10(data[base + 2]);
35677
+ const withdrawalLimit = isFailedCall(data[base + 3]) ? 0n : big10(data[base + 3]);
35440
35678
  const lenderKey = inverseLenderKey(lender, market.address);
35441
35679
  const metaMap = meta?.[lenderKey];
35442
35680
  if (!metaMap) return;
@@ -35522,7 +35760,7 @@ var getInverseUserDataConverter = (lender, chainId, account, meta) => {
35522
35760
  expected
35523
35761
  ];
35524
35762
  };
35525
- var big10 = (v) => {
35763
+ var big11 = (v) => {
35526
35764
  try {
35527
35765
  if (typeof v === "bigint") return v;
35528
35766
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35549,8 +35787,8 @@ var getCoolerUserDataConverter = (lender, chainId, account, meta) => {
35549
35787
  totalDelegated: raw[6]
35550
35788
  } : raw;
35551
35789
  if (pos === null || typeof pos !== "object") return void 0;
35552
- const collateral = big10(pos.collateral);
35553
- const debt = big10(pos.currentDebt);
35790
+ const collateral = big11(pos.collateral);
35791
+ const debt = big11(pos.currentDebt);
35554
35792
  if (collateral === 0n && debt === 0n) return void 0;
35555
35793
  const collAddr = cfg.gohm.toLowerCase();
35556
35794
  const collUid = createMarketUid(chainId, lender, collAddr);
@@ -35568,11 +35806,11 @@ var getCoolerUserDataConverter = (lender, chainId, account, meta) => {
35568
35806
  const loanOracle = loanMeta ? getOraclePrice(loanMeta) : 0;
35569
35807
  const loanHist = loanMeta?.price?.priceUsd24h ?? loanDisplay;
35570
35808
  const coolerInfo = {
35571
- healthFactor: big10(pos.healthFactor).toString(),
35572
- currentLtv: big10(pos.currentLtv).toString(),
35573
- totalDelegated: big10(pos.totalDelegated).toString(),
35574
- maxOriginationDebtAmount: big10(pos.maxOriginationDebtAmount).toString(),
35575
- liquidationDebtAmount: big10(pos.liquidationDebtAmount).toString()
35809
+ healthFactor: big11(pos.healthFactor).toString(),
35810
+ currentLtv: big11(pos.currentLtv).toString(),
35811
+ totalDelegated: big11(pos.totalDelegated).toString(),
35812
+ maxOriginationDebtAmount: big11(pos.maxOriginationDebtAmount).toString(),
35813
+ liquidationDebtAmount: big11(pos.liquidationDebtAmount).toString()
35576
35814
  };
35577
35815
  const collStr = parseRawAmount(collateral.toString(), 18);
35578
35816
  const collNum = Number(collStr);
@@ -35647,18 +35885,18 @@ var statesFromSlice2 = (data, marketCount) => {
35647
35885
  const healthRaw = data[base + 1];
35648
35886
  const pricesRaw = data[base + 2];
35649
35887
  out.set(i, {
35650
- collateral: big11(stateRaw[0]),
35651
- bandBorrowed: big11(stateRaw[1]),
35652
- debt: big11(stateRaw[2]),
35653
- bandCount: Number(big11(stateRaw[3])),
35654
- health: isFailedCall(healthRaw) ? 0n : big11(healthRaw),
35888
+ collateral: big12(stateRaw[0]),
35889
+ bandBorrowed: big12(stateRaw[1]),
35890
+ debt: big12(stateRaw[2]),
35891
+ bandCount: Number(big12(stateRaw[3])),
35892
+ health: isFailedCall(healthRaw) ? 0n : big12(healthRaw),
35655
35893
  priceUpper: arrAt(pricesRaw, 0),
35656
35894
  priceLower: arrAt(pricesRaw, 1),
35657
- bands: isFailedCall(ticksRaw) || !Array.isArray(ticksRaw) ? void 0 : [Number(big11(ticksRaw[0])), Number(big11(ticksRaw[1]))],
35895
+ bands: isFailedCall(ticksRaw) || !Array.isArray(ticksRaw) ? void 0 : [Number(big12(ticksRaw[0])), Number(big12(ticksRaw[1]))],
35658
35896
  delegated: isFailedCall(approvalRaw) ? false : approvalRaw === true,
35659
- vaultShares: isFailedCall(vaultSharesRaw) ? 0n : big11(vaultSharesRaw),
35660
- gaugeShares: isFailedCall(gaugeSharesRaw) ? 0n : big11(gaugeSharesRaw),
35661
- shareToAsset: isFailedCall(shareToAssetRaw) ? 0n : big11(shareToAssetRaw)
35897
+ vaultShares: isFailedCall(vaultSharesRaw) ? 0n : big12(vaultSharesRaw),
35898
+ gaugeShares: isFailedCall(gaugeSharesRaw) ? 0n : big12(gaugeSharesRaw),
35899
+ shareToAsset: isFailedCall(shareToAssetRaw) ? 0n : big12(shareToAssetRaw)
35662
35900
  });
35663
35901
  }
35664
35902
  return out;
@@ -35687,7 +35925,7 @@ var statesFromLens = (rows) => {
35687
35925
  }
35688
35926
  return out;
35689
35927
  };
35690
- var big11 = (v) => {
35928
+ var big12 = (v) => {
35691
35929
  try {
35692
35930
  if (typeof v === "bigint") return v;
35693
35931
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35697,7 +35935,7 @@ var big11 = (v) => {
35697
35935
  };
35698
35936
  var arrAt = (v, i) => {
35699
35937
  if (isFailedCall(v) || !Array.isArray(v)) return 0n;
35700
- return big11(v[i]);
35938
+ return big12(v[i]);
35701
35939
  };
35702
35940
  var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
35703
35941
  const cfg = llamaLendConfigFor(lender, chainId);
@@ -35836,7 +36074,7 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
35836
36074
  expected
35837
36075
  ];
35838
36076
  };
35839
- var big12 = (v) => {
36077
+ var big13 = (v) => {
35840
36078
  try {
35841
36079
  if (typeof v === "bigint") return v;
35842
36080
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -35844,7 +36082,7 @@ var big12 = (v) => {
35844
36082
  }
35845
36083
  return 0n;
35846
36084
  };
35847
- var tupleAt = (v, i) => Array.isArray(v) ? big12(v[i]) : 0n;
36085
+ var tupleAt = (v, i) => Array.isArray(v) ? big13(v[i]) : 0n;
35848
36086
  var ONE4 = 10n ** 18n;
35849
36087
  function sharesToAmount(shares, totalAmount, totalShares) {
35850
36088
  if (totalShares === 0n || shares === 0n) return 0n;
@@ -35870,7 +36108,7 @@ var getResupplyUserDataConverter = (lender, chainId, account, meta) => {
35870
36108
  if (isFailedCall(accounting) || !Array.isArray(accounting)) return;
35871
36109
  const totalBorrowAmount = tupleAt(accounting, 1);
35872
36110
  const totalBorrowShares = tupleAt(accounting, 2);
35873
- const sharePrice = isFailedCall(data[base + 1]) ? 0n : big12(data[base + 1]);
36111
+ const sharePrice = isFailedCall(data[base + 1]) ? 0n : big13(data[base + 1]);
35874
36112
  const lenderKey = resupplyLenderKey(lender, chainId, pair);
35875
36113
  const metaMap = meta?.[lenderKey];
35876
36114
  if (!metaMap) return;
@@ -35968,7 +36206,7 @@ var getResupplyUserDataConverter = (lender, chainId, account, meta) => {
35968
36206
  expected
35969
36207
  ];
35970
36208
  };
35971
- var big13 = (v) => {
36209
+ var big14 = (v) => {
35972
36210
  try {
35973
36211
  if (typeof v === "bigint") return v;
35974
36212
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36003,9 +36241,9 @@ var getFraxlendUserDataConverter = (lender, chainId, account, meta) => {
36003
36241
  const fTokenRaw = data[base + 2];
36004
36242
  const previewRaw = data[base + 3];
36005
36243
  if (isFailedCall(collRaw) || isFailedCall(sharesRaw)) return;
36006
- const collateral = big13(collRaw);
36007
- const borrowShares = big13(sharesRaw);
36008
- const fTokenShares = isFailedCall(fTokenRaw) ? 0n : big13(fTokenRaw);
36244
+ const collateral = big14(collRaw);
36245
+ const borrowShares = big14(sharesRaw);
36246
+ const fTokenShares = isFailedCall(fTokenRaw) ? 0n : big14(fTokenRaw);
36009
36247
  if (collateral === 0n && borrowShares === 0n && fTokenShares === 0n)
36010
36248
  return;
36011
36249
  let totalBorrowAmount = 0n;
@@ -36015,10 +36253,10 @@ var getFraxlendUserDataConverter = (lender, chainId, account, meta) => {
36015
36253
  if (!isFailedCall(previewRaw) && previewRaw) {
36016
36254
  const ta = previewRaw[4];
36017
36255
  const tb = previewRaw[5];
36018
- totalAssetAmount = big13(ta?.amount ?? ta?.[0]);
36019
- totalAssetShares = big13(ta?.shares ?? ta?.[1]);
36020
- totalBorrowAmount = big13(tb?.amount ?? tb?.[0]);
36021
- totalBorrowShares = big13(tb?.shares ?? tb?.[1]);
36256
+ totalAssetAmount = big14(ta?.amount ?? ta?.[0]);
36257
+ totalAssetShares = big14(ta?.shares ?? ta?.[1]);
36258
+ totalBorrowAmount = big14(tb?.amount ?? tb?.[0]);
36259
+ totalBorrowShares = big14(tb?.shares ?? tb?.[1]);
36022
36260
  }
36023
36261
  const debt = fraxlendToAmount(
36024
36262
  borrowShares,
@@ -36128,7 +36366,7 @@ var getFraxlendUserDataConverter = (lender, chainId, account, meta) => {
36128
36366
  ];
36129
36367
  };
36130
36368
  var WAD14 = 10n ** 18n;
36131
- var big14 = (v) => {
36369
+ var big15 = (v) => {
36132
36370
  try {
36133
36371
  if (typeof v === "bigint") return v;
36134
36372
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36136,7 +36374,7 @@ var big14 = (v) => {
36136
36374
  }
36137
36375
  return 0n;
36138
36376
  };
36139
- var tupleAt2 = (v, i) => Array.isArray(v) ? big14(v[i]) : 0n;
36377
+ var tupleAt2 = (v, i) => Array.isArray(v) ? big15(v[i]) : 0n;
36140
36378
  var HOLD_PERIOD_SECONDS = 1200n;
36141
36379
  var getCurvanceUserDataConverter = (lender, chainId, account, meta) => {
36142
36380
  const cfg = curvanceConfigFor(lender, chainId);
@@ -36159,7 +36397,7 @@ var getCurvanceUserDataConverter = (lender, chainId, account, meta) => {
36159
36397
  const cooldownRaw = data[base];
36160
36398
  const status = data[base + 1];
36161
36399
  if (isFailedCall(status) || !Array.isArray(status)) continue;
36162
- const cooldownTimestamp = isFailedCall(cooldownRaw) ? 0n : big14(cooldownRaw);
36400
+ const cooldownTimestamp = isFailedCall(cooldownRaw) ? 0n : big15(cooldownRaw);
36163
36401
  const holdPeriodEndsAt = cooldownTimestamp > 0n ? cooldownTimestamp + HOLD_PERIOD_SECONDS : 0n;
36164
36402
  const holdPeriodActive = holdPeriodEndsAt > nowSeconds;
36165
36403
  const lenderKey = curvanceLenderKey(lender, chainId, p.marketManager);
@@ -36181,10 +36419,10 @@ var getCurvanceUserDataConverter = (lender, chainId, account, meta) => {
36181
36419
  let rows = 0;
36182
36420
  p.activeTokens.forEach(({ cToken, asset }, i) => {
36183
36421
  const tokenBase = base + CURVANCE_MARKET_READS + i * CURVANCE_READS_PER_TOKEN;
36184
- const shares = isFailedCall(data[tokenBase]) ? 0n : big14(data[tokenBase]);
36185
- const collateralShares = isFailedCall(data[tokenBase + 1]) ? 0n : big14(data[tokenBase + 1]);
36186
- const debtRaw = isFailedCall(data[tokenBase + 2]) ? 0n : big14(data[tokenBase + 2]);
36187
- const exchangeRate = isFailedCall(data[tokenBase + 3]) ? 0n : big14(data[tokenBase + 3]);
36422
+ const shares = isFailedCall(data[tokenBase]) ? 0n : big15(data[tokenBase]);
36423
+ const collateralShares = isFailedCall(data[tokenBase + 1]) ? 0n : big15(data[tokenBase + 1]);
36424
+ const debtRaw = isFailedCall(data[tokenBase + 2]) ? 0n : big15(data[tokenBase + 2]);
36425
+ const exchangeRate = isFailedCall(data[tokenBase + 3]) ? 0n : big15(data[tokenBase + 3]);
36188
36426
  info.tokens[cToken.toLowerCase()] = {
36189
36427
  shares: shares.toString(),
36190
36428
  collateralShares: collateralShares.toString(),
@@ -36244,7 +36482,7 @@ var getCurvanceUserDataConverter = (lender, chainId, account, meta) => {
36244
36482
  ];
36245
36483
  };
36246
36484
  var WAD15 = 10n ** 18n;
36247
- var big15 = (v) => {
36485
+ var big16 = (v) => {
36248
36486
  try {
36249
36487
  if (typeof v === "bigint") return v;
36250
36488
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36266,13 +36504,13 @@ var getTwyneUserDataConverter = (lender, chainId, account, meta) => {
36266
36504
  const base = i * TWYNE_READS_PER_VAULT;
36267
36505
  const totalRaw = data[base];
36268
36506
  if (isFailedCall(totalRaw)) return;
36269
- const total = big15(totalRaw);
36270
- const reserved = isFailedCall(data[base + 1]) ? 0n : big15(data[base + 1]);
36271
- const debt = isFailedCall(data[base + 2]) ? 0n : big15(data[base + 2]);
36272
- const liqLtv = isFailedCall(data[base + 3]) ? 0n : big15(data[base + 3]);
36507
+ const total = big16(totalRaw);
36508
+ const reserved = isFailedCall(data[base + 1]) ? 0n : big16(data[base + 1]);
36509
+ const debt = isFailedCall(data[base + 2]) ? 0n : big16(data[base + 2]);
36510
+ const liqLtv = isFailedCall(data[base + 3]) ? 0n : big16(data[base + 3]);
36273
36511
  const canLiquidate = isFailedCall(data[base + 4]) ? false : Boolean(data[base + 4]);
36274
36512
  const extLiquidated = isFailedCall(data[base + 5]) ? false : Boolean(data[base + 5]);
36275
- const releasable = isFailedCall(data[base + 6]) ? 0n : big15(data[base + 6]);
36513
+ const releasable = isFailedCall(data[base + 6]) ? 0n : big16(data[base + 6]);
36276
36514
  const scale3 = ref.collateralToUnderlying ?? WAD15;
36277
36515
  const userCollateral = total > reserved ? total - reserved : 0n;
36278
36516
  if (userCollateral === 0n && debt === 0n) return;
@@ -36388,7 +36626,7 @@ var getTwyneUserDataConverter = (lender, chainId, account, meta) => {
36388
36626
  ];
36389
36627
  };
36390
36628
  var RAY7 = 10n ** 27n;
36391
- var big16 = (v) => {
36629
+ var big17 = (v) => {
36392
36630
  try {
36393
36631
  if (typeof v === "bigint") return v;
36394
36632
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36396,7 +36634,7 @@ var big16 = (v) => {
36396
36634
  }
36397
36635
  return 0n;
36398
36636
  };
36399
- var field9 = (res, name, idx) => big16(res?.[name] ?? res?.[idx]);
36637
+ var field9 = (res, name, idx) => big17(res?.[name] ?? res?.[idx]);
36400
36638
  var getDssUserDataConverter = (lender, chainId, account, meta) => {
36401
36639
  const cfg = dssConfigFor(lender, chainId);
36402
36640
  const markets = dssChainData(lender, chainId)?.markets ?? [];
@@ -36511,7 +36749,7 @@ var getDssUserDataConverter = (lender, chainId, account, meta) => {
36511
36749
  expected
36512
36750
  ];
36513
36751
  };
36514
- var big17 = (v) => {
36752
+ var big18 = (v) => {
36515
36753
  try {
36516
36754
  if (typeof v === "bigint") return v;
36517
36755
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36541,11 +36779,11 @@ var getFrankencoinUserDataConverter = (lender, chainId, account, meta) => {
36541
36779
  const ownerRes = data[base];
36542
36780
  if (isFailedCall(ownerRes)) return;
36543
36781
  if (String(ownerRes).toLowerCase() !== lowerAccount) return;
36544
- const minted = big17(data[base + 1]);
36545
- const price2 = big17(data[base + 2]);
36546
- const expiration = big17(data[base + 3]);
36547
- const challenged = big17(data[base + 4]);
36548
- const coll = big17(data[base + 5]);
36782
+ const minted = big18(data[base + 1]);
36783
+ const price2 = big18(data[base + 2]);
36784
+ const expiration = big18(data[base + 3]);
36785
+ const challenged = big18(data[base + 4]);
36786
+ const coll = big18(data[base + 5]);
36549
36787
  if (minted === 0n && coll === 0n) return;
36550
36788
  const market = marketByOriginal.get(p.original);
36551
36789
  if (!market) return;
@@ -36646,7 +36884,7 @@ var getFrankencoinUserDataConverter = (lender, chainId, account, meta) => {
36646
36884
 
36647
36885
  // src/lending/user-data/teller/userCallParse.ts
36648
36886
  var nowSec7 = () => Math.floor(Date.now() / 1e3);
36649
- var big18 = (v) => {
36887
+ var big19 = (v) => {
36650
36888
  try {
36651
36889
  if (typeof v === "bigint") return v;
36652
36890
  if (typeof v === "number" || typeof v === "string") return BigInt(v);
@@ -36668,7 +36906,7 @@ var getTellerUserDataConverter = (_lender, chainId, account, meta) => {
36668
36906
  const base = i * TELLER_CALLS_PER_BID;
36669
36907
  const bidRes = data[base];
36670
36908
  const owed = data[base + 1];
36671
- const collAmount = big18(data[base + 2]);
36909
+ const collAmount = big19(data[base + 2]);
36672
36910
  const defaulted = !!data[base + 3];
36673
36911
  if (isFailedCall(bidRes) || isFailedCall(owed) || !bidRes) return;
36674
36912
  const pool = b.pool;
@@ -36689,17 +36927,17 @@ var getTellerUserDataConverter = (_lender, chainId, account, meta) => {
36689
36927
  const collDisplay = collMeta ? getDisplayPrice(collMeta) : 0;
36690
36928
  const collOracle = collMeta ? getOraclePrice(collMeta) : 0;
36691
36929
  const collHist = collMeta?.price?.priceUsd24h ?? collDisplay;
36692
- const owedPrincipal = big18(field10(owed, "principal", 0));
36693
- const owedInterest = big18(field10(owed, "interest", 1));
36930
+ const owedPrincipal = big19(field10(owed, "principal", 0));
36931
+ const owedInterest = big19(field10(owed, "interest", 1));
36694
36932
  const owedTotal = owedPrincipal + owedInterest;
36695
36933
  if (owedTotal === 0n && collAmount === 0n) return;
36696
36934
  const loanDetails = field10(bidRes, "loanDetails", 5);
36697
36935
  const terms = field10(bidRes, "terms", 6);
36698
36936
  const acceptedTs = Number(
36699
- big18(field10(loanDetails, "acceptedTimestamp", 4))
36937
+ big19(field10(loanDetails, "acceptedTimestamp", 4))
36700
36938
  );
36701
- const loanDuration = Number(big18(field10(loanDetails, "loanDuration", 6)));
36702
- const aprBps = Number(big18(field10(terms, "APR", 2)));
36939
+ const loanDuration = Number(big19(field10(loanDetails, "loanDuration", 6)));
36940
+ const aprBps = Number(big19(field10(terms, "APR", 2)));
36703
36941
  const maturity = acceptedTs > 0 ? acceptedTs + loanDuration : void 0;
36704
36942
  const isMatured2 = defaulted || maturity !== void 0 && maturity < now;
36705
36943
  const collStr = parseRawAmount(collAmount.toString(), collDecimals);
@@ -41898,7 +42136,7 @@ function unflattenLenderData(pools) {
41898
42136
  }
41899
42137
  return result;
41900
42138
  }
41901
- var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
42139
+ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient20, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
41902
42140
  const queries = organizeUserQueries(queriesRaw);
41903
42141
  const builtCalls = await Promise.all(
41904
42142
  queries.map(async (query3) => {
@@ -41908,7 +42146,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowF
41908
42146
  query3.lender,
41909
42147
  query3.account,
41910
42148
  query3.params,
41911
- getEvmClient19
42149
+ getEvmClient20
41912
42150
  );
41913
42151
  return callData.map((call) => ({ call, abi: call.abi ?? abi }));
41914
42152
  })
@@ -41918,7 +42156,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowF
41918
42156
  chainId,
41919
42157
  calls.map((call) => call.abi),
41920
42158
  calls.map((call) => call.call),
41921
- getEvmClient19,
42159
+ getEvmClient20,
41922
42160
  concurrency,
41923
42161
  retries,
41924
42162
  allowFailure,
@@ -47679,6 +47917,98 @@ var strataFetcher = {
47679
47917
  return out;
47680
47918
  }
47681
47919
  };
47920
+ var CHAIN_ID12 = "1";
47921
+ var SCRVUSD = "0x0655977feb2f289a4ab78af67bab0d17aab84367";
47922
+ var ONE_E1811 = 10n ** 18n;
47923
+ var WINDOW_SECONDS7 = 30 * 24 * 60 * 60;
47924
+ var BLOCK_TIME_SECONDS6 = 12;
47925
+ var WINDOW_BLOCKS6 = BigInt(Math.floor(WINDOW_SECONDS7 / BLOCK_TIME_SECONDS6));
47926
+ var SERIES_SPAN_SECONDS = 45 * 24 * 60 * 60;
47927
+ var MAX_RPC_TRIES6 = 2;
47928
+ var ONCHAIN_DEADLINE_MS2 = 12e3;
47929
+ var CURVE_SAVINGS_YIELD_URL = "https://prices.curve.finance/v1/crvusd/savings/yield";
47930
+ var SCRVUSD_KEY = "SCRVUSD";
47931
+ var SCRVUSD_GROUP_KEY = "Savings crvUSD::SCRVUSD";
47932
+ var SCRVUSD_GROUP_KEY_CASE = "Savings crvUSD::scrvUSD";
47933
+ var SCRVUSD_GROUP_KEY_BASE = "Superbridge Bridged scrvUSD::SCRVUSD";
47934
+ var CONVERT_TO_ASSETS_ABI4 = [
47935
+ {
47936
+ name: "convertToAssets",
47937
+ type: "function",
47938
+ stateMutability: "view",
47939
+ inputs: [{ type: "uint256" }],
47940
+ outputs: [{ type: "uint256" }]
47941
+ }
47942
+ ];
47943
+ var fetchCurveSeriesAprPercent = async (nowSeconds) => {
47944
+ const end = Math.floor(nowSeconds);
47945
+ const start = end - SERIES_SPAN_SECONDS;
47946
+ const res = await fetch(
47947
+ `${CURVE_SAVINGS_YIELD_URL}?agg_number=1&agg_units=day&start=${start}&end=${end}`,
47948
+ {
47949
+ headers: { accept: "application/json" },
47950
+ signal: AbortSignal.timeout(8e3)
47951
+ }
47952
+ );
47953
+ if (!res.ok) throw new Error(`Curve savings HTTP ${res.status}`);
47954
+ const json = await res.json();
47955
+ const points = (json?.data ?? []).filter(
47956
+ (p) => typeof p?.timestamp === "number" && typeof p?.price === "number" && p.price >= 1
47957
+ ).sort((a, b) => a.timestamp - b.timestamp);
47958
+ if (points.length < 2) throw new Error("scrvUSD: series too short");
47959
+ const last = points[points.length - 1];
47960
+ const base = [...points].reverse().find((p) => p.timestamp <= last.timestamp - WINDOW_SECONDS7);
47961
+ if (!base) throw new Error("scrvUSD: series does not span the window");
47962
+ const elapsed = last.timestamp - base.timestamp;
47963
+ if (elapsed <= 0) throw new Error("scrvUSD: non-positive window");
47964
+ return annualizeRateDeltaPercent(last.price, base.price, elapsed);
47965
+ };
47966
+ var readRateAt5 = (client, blockNumber) => client.readContract({
47967
+ address: SCRVUSD,
47968
+ abi: CONVERT_TO_ASSETS_ABI4,
47969
+ functionName: "convertToAssets",
47970
+ args: [ONE_E1811],
47971
+ ...blockNumber !== void 0 ? { blockNumber } : {}
47972
+ });
47973
+ var computeAprOnChain2 = async () => {
47974
+ let lastErr;
47975
+ const deadline = Date.now() + ONCHAIN_DEADLINE_MS2;
47976
+ for (let rpcId = 0; rpcId < MAX_RPC_TRIES6; rpcId++) {
47977
+ if (Date.now() > deadline) break;
47978
+ try {
47979
+ const client = getEvmClient(CHAIN_ID12, rpcId);
47980
+ const head = await client.getBlockNumber();
47981
+ const pastBlock = head > WINDOW_BLOCKS6 ? head - WINDOW_BLOCKS6 : 0n;
47982
+ const [rateNow, rateThen, headBlock, thenBlock] = await Promise.all([
47983
+ readRateAt5(client),
47984
+ readRateAt5(client, pastBlock),
47985
+ client.getBlock({ blockNumber: head }),
47986
+ client.getBlock({ blockNumber: pastBlock })
47987
+ ]);
47988
+ if (rateNow < ONE_E1811 || rateThen < ONE_E1811) {
47989
+ throw new Error("scrvUSD: share price below par \u2014 pruned or bad read");
47990
+ }
47991
+ const elapsed = Number(headBlock.timestamp - thenBlock.timestamp);
47992
+ if (elapsed <= 0) throw new Error("scrvUSD: non-positive window");
47993
+ return annualizeRateDeltaPercent(rateNow, rateThen, elapsed);
47994
+ } catch (e) {
47995
+ lastErr = e;
47996
+ }
47997
+ }
47998
+ throw lastErr ?? new Error("scrvUSD: no RPC served archive state");
47999
+ };
48000
+ var scrvusdFetcher = {
48001
+ label: "SCRVUSD",
48002
+ fetch: async () => {
48003
+ const apr = await fetchCurveSeriesAprPercent(Date.now() / 1e3).catch(() => computeAprOnChain2()).catch(() => 0);
48004
+ return {
48005
+ [SCRVUSD_KEY]: apr,
48006
+ [SCRVUSD_GROUP_KEY]: apr,
48007
+ [SCRVUSD_GROUP_KEY_CASE]: apr,
48008
+ [SCRVUSD_GROUP_KEY_BASE]: apr
48009
+ };
48010
+ }
48011
+ };
47682
48012
  var thBill = "Theo Short Duration US Treasury Fund::THBILL";
47683
48013
  var thBillBare = "thBILL::thBILL";
47684
48014
  var THBILL_DEFILLAMA_POOL = "e17dab50-85b1-45e8-b4a5-b8ae7898c4a3";
@@ -47702,7 +48032,7 @@ var STHUSD_DEADLINE_MS = 12e3;
47702
48032
  var STHUSD_KEY = "STHUSD";
47703
48033
  var STHUSD_GROUP_KEY = "Staked thUSD::STHUSD";
47704
48034
  var STHUSD_GROUP_KEY_OFT = "sthUSD::sthUSD";
47705
- var CONVERT_TO_ASSETS_ABI4 = [
48035
+ var CONVERT_TO_ASSETS_ABI5 = [
47706
48036
  {
47707
48037
  name: "convertToAssets",
47708
48038
  type: "function",
@@ -47713,7 +48043,7 @@ var CONVERT_TO_ASSETS_ABI4 = [
47713
48043
  ];
47714
48044
  var readSthUsdRateAt = (client, blockNumber) => client.readContract({
47715
48045
  address: STHUSD_VAULT,
47716
- abi: CONVERT_TO_ASSETS_ABI4,
48046
+ abi: CONVERT_TO_ASSETS_ABI5,
47717
48047
  functionName: "convertToAssets",
47718
48048
  args: [STHUSD_UNIT],
47719
48049
  ...blockNumber !== void 0 ? { blockNumber } : {}
@@ -50753,6 +51083,55 @@ var SINGLE_CHAIN_ENTRIES = {
50753
51083
  yieldFetcher: frankencoinSavingsFetcher,
50754
51084
  yieldKey: zchfSavingsKey(Chain.ETHEREUM_MAINNET)
50755
51085
  },
51086
+ {
51087
+ // Curve **scrvUSD** (Savings crvUSD) — an ERC-4626 over crvUSD, and
51088
+ // structurally a **Yearn V3 vault that Curve operates**: the share
51089
+ // token is an EIP-1167 proxy onto `YearnV3Vault.vy` v3.0.4
51090
+ // (`0xd8063123…`, Sourcify-verified), "Multi Strategy". Curve routes
51091
+ // crvUSD borrow revenue in and Yearn's profit-unlocking rail releases
51092
+ // it over `profitMaxUnlockTime` (7 days) per report.
51093
+ //
51094
+ // $17.07M held / 15.43M shares, price 1.10649 (2026-08-26). Ethereum is
51095
+ // the ONLY vault: the Arbitrum (`0xefb6601d…`), Base (`0x646a737b…`)
51096
+ // and XDC (`0x3d8eadb7…`) tokens are bare bridged ERC-20s whose
51097
+ // `asset()` and `totalAssets()` revert, and together they hold ~188k
51098
+ // shares — 1.2 % of supply. Not registered: there is no vault there.
51099
+ //
51100
+ // Instant and free, verified on-chain 2026-08-26: `maxDeposit` is
51101
+ // `uint256.max`, `maxRedeem(holder)` equals the holder's balance to
51102
+ // the wei (Yearn rounding aside), and `totalDebt` is **0** — every
51103
+ // asset sits idle in the vault, so nothing has to be unwound to pay an
51104
+ // exit.
51105
+ //
51106
+ // **Do not take the rate from Curve's `proj_apy`.** It is a projection
51107
+ // off `profitUnlockingRate`, which Yearn V3 does not zero when
51108
+ // `fullProfitUnlockDate` passes: on 2026-08-26 the vault had been
51109
+ // exactly flat for a full day (`convertToAssets` byte-identical,
51110
+ // `balanceOf(vault) == 0`) while the field — and Curve's whole API
51111
+ // record, `price` and `assets` included — still read 1.301 %.
51112
+ // `scrvusdFetcher` measures a 30-day REALIZED delta instead; see its
51113
+ // docstring.
51114
+ //
51115
+ // No `solvency`. Today the shares are backed 1:1 by crvUSD held in the
51116
+ // contract (`totalDebt` 0), which would make `overcollateralized`
51117
+ // literally true — but this is a Multi-Strategy vault and the
51118
+ // allocation is a role-holder dial, not a property of the design. An
51119
+ // asserted answer here would be a snapshot of a setting. Absent lets
51120
+ // the builder mark `coverage.pending.counterparty` instead, which is
51121
+ // the honest statement.
51122
+ address: "0x0655977feb2f289a4ab78af67bab0d17aab84367",
51123
+ underlying: "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e",
51124
+ // crvUSD
51125
+ symbol: "scrvUSD",
51126
+ brand: "Curve",
51127
+ description: "crvUSD is Curve\u2019s overcollateralised stablecoin, minted against collateral in its own soft-liquidating CDP markets. scrvUSD is the savings wrapper: Curve routes crvUSD borrow-fee revenue into the vault and it is released into the share price over the week after each deposit, so the price steps up between reports and sits flat in the gaps. Deposits and withdrawals are instant, permissionless, uncapped and free.",
51128
+ decimals: 18,
51129
+ isRebasing: false,
51130
+ isMintable: true,
51131
+ withdrawalMode: "instant",
51132
+ yieldFetcher: scrvusdFetcher,
51133
+ yieldKey: SCRVUSD_KEY
51134
+ },
50756
51135
  {
50757
51136
  // Theo **sthUSD** — the ERC-4626 staked wrapper over `thUSD`, Theo's
50758
51137
  // gold-yield stablecoin. Source Sourcify-verified on chain 1
@@ -51974,7 +52353,10 @@ var LENDING_ONLY_FETCHERS = [
51974
52353
  ethZeroFetcher,
51975
52354
  jitoSolFetcher,
51976
52355
  thbillFetcher,
51977
- sthusdFetcher,
52356
+ // sthusdFetcher / scrvusdFetcher are NOT here: both are vault-wired by
52357
+ // their savings rows, so they reach the global map through
52358
+ // `collectVaultFetchers` (the disjointness rule above). thbillFetcher
52359
+ // stays — thBILL is a lending collateral with no vault row of its own.
51978
52360
  ssuperusdFetcher,
51979
52361
  hlpFetcher,
51980
52362
  hwhlpFetcher,
@@ -52908,7 +53290,7 @@ async function fetchForChain(chainId, nowSeconds) {
52908
53290
  abi: GAUGE_ABI,
52909
53291
  allowFailure: true
52910
53292
  });
52911
- const big22 = (v) => {
53293
+ const big23 = (v) => {
52912
53294
  try {
52913
53295
  if (typeof v === "bigint") return v;
52914
53296
  if (typeof v === "string" && v !== "0x") return BigInt(v);
@@ -52922,15 +53304,15 @@ async function fetchForChain(chainId, nowSeconds) {
52922
53304
  const b = i * STRIDE;
52923
53305
  return {
52924
53306
  market: m,
52925
- inflationRate: big22(r1[b]),
52926
- workingSupply: big22(r1[b + 1]),
52927
- totalSupply: big22(r1[b + 2]),
53307
+ inflationRate: big23(r1[b]),
53308
+ workingSupply: big23(r1[b + 1]),
53309
+ totalSupply: big23(r1[b + 2]),
52928
53310
  isKilled: r1[b + 3] === true,
52929
- rewardCount: Number(big22(r1[b + 4])),
52930
- pricePerShare: big22(r1[b + 5]),
53311
+ rewardCount: Number(big23(r1[b + 4])),
53312
+ pricePerShare: big23(r1[b + 5]),
52931
53313
  // Off L1 the child gauge's own rate is already market-scoped, so the
52932
53314
  // weight is the identity.
52933
- relativeWeight: isL1 ? big22(r1[b + 6]) : WAD16
53315
+ relativeWeight: isL1 ? big23(r1[b + 6]) : WAD16
52934
53316
  };
52935
53317
  });
52936
53318
  const tokenCalls = state.flatMap(
@@ -53023,7 +53405,7 @@ async function fetchForChain(chainId, nowSeconds) {
53023
53405
  const decoded = decodeRewardData(data);
53024
53406
  if (!decoded) continue;
53025
53407
  const { periodFinish, rate } = decoded;
53026
- const decimals = typeof decRaw === "number" ? decRaw : Number(big22(decRaw) || 18n);
53408
+ const decimals = typeof decRaw === "number" ? decRaw : Number(big23(decRaw) || 18n);
53027
53409
  const rewardPrice = priceOf(prices, chainId, token);
53028
53410
  const apr = extraRewardApr({
53029
53411
  rate,
@@ -53807,6 +54189,49 @@ var exactlyFetcher = {
53807
54189
  parse: parseExactlyResults,
53808
54190
  getAbi: getExactlyAbi
53809
54191
  };
54192
+ function getFlyingTulipCalls(chainId) {
54193
+ const lender = FLYING_TULIP_LENDER_KEY;
54194
+ const lendingLens = flyingTulipConfigFor(lender, chainId)?.lendingLens;
54195
+ const roster = flyingTulipAssetsFor(lender, chainId)?.assets ?? [];
54196
+ const priceable = roster.filter((a) => a.priceable);
54197
+ if (!lendingLens || priceable.length === 0) return [];
54198
+ const assets = priceable.map((a) => a.address.toLowerCase());
54199
+ const calls = assets.map((asset) => ({
54200
+ address: lendingLens,
54201
+ name: "priceAndDecimals",
54202
+ params: [asset]
54203
+ }));
54204
+ return [{ calls, meta: { lendingLens, assets }, lender }];
54205
+ }
54206
+ function parseFlyingTulipResults(data, meta, context) {
54207
+ const { chainId } = context;
54208
+ const entries = [];
54209
+ meta.assets.forEach((asset, i) => {
54210
+ const res = data?.[i];
54211
+ const pxWad = Array.isArray(res) ? res[0] : void 0;
54212
+ if (pxWad == null) return;
54213
+ const priceUSD = Number(pxWad) / 1e18;
54214
+ if (!(priceUSD > 0)) return;
54215
+ entries.push({
54216
+ asset,
54217
+ // Direct USD price — no oracle-unit denomination, so raw == USD.
54218
+ price: priceUSD,
54219
+ priceUSD,
54220
+ marketUid: createMarketUid(chainId, FLYING_TULIP_LENDER_KEY, asset),
54221
+ targetLender: FLYING_TULIP_LENDER_KEY,
54222
+ description: "Flying Tulip OracleRouter via LendingLens (USD)"
54223
+ });
54224
+ });
54225
+ return entries;
54226
+ }
54227
+ function getFlyingTulipAbi() {
54228
+ return FlyingTulipLendingLensAbi;
54229
+ }
54230
+ var flyingTulipFetcher = {
54231
+ getCalls: getFlyingTulipCalls,
54232
+ parse: parseFlyingTulipResults,
54233
+ getAbi: getFlyingTulipAbi
54234
+ };
53810
54235
  function getTermCalls(chainId) {
53811
54236
  const oracle = termConfig()?.[chainId]?.priceOracle;
53812
54237
  const markets = termMarketsByChain(chainId);
@@ -54039,7 +54464,7 @@ function getDssCalls(chainId) {
54039
54464
  return results;
54040
54465
  }
54041
54466
  var RAY10 = 1e27;
54042
- var big19 = (v) => {
54467
+ var big20 = (v) => {
54043
54468
  try {
54044
54469
  if (typeof v === "bigint") return v;
54045
54470
  if (v == null || v === "0x") return 0n;
@@ -54051,16 +54476,16 @@ var big19 = (v) => {
54051
54476
  var field12 = (res, name, idx) => {
54052
54477
  const v = res?.[name];
54053
54478
  if (typeof v === "bigint" || typeof v === "number" || typeof v === "string") {
54054
- return big19(v);
54479
+ return big20(v);
54055
54480
  }
54056
- return big19(res?.[idx]);
54481
+ return big20(res?.[idx]);
54057
54482
  };
54058
54483
  function parseDssResults(data, meta, context) {
54059
54484
  const { chainId } = context;
54060
54485
  const key3 = dssLenderKey(meta.lender, chainId, meta.ilk);
54061
54486
  const entries = [];
54062
54487
  const spot = field12(data?.[0], "spot", 2);
54063
- const mat = big19(meta.mat);
54488
+ const mat = big20(meta.mat);
54064
54489
  if (spot > 0n && mat > 0n) {
54065
54490
  const collUSD = Number(spot) / RAY10 * (Number(mat) / RAY10);
54066
54491
  if (collUSD > 0 && collUSD < 1e9) {
@@ -56386,6 +56811,11 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
56386
56811
  () => exactlyFetcher.getCalls(chainId),
56387
56812
  getCallsErrors
56388
56813
  ) : [];
56814
+ const flyingTulipResults = isActive("flyingTulip") ? safeGetCalls(
56815
+ "flyingTulip",
56816
+ () => flyingTulipFetcher.getCalls(chainId),
56817
+ getCallsErrors
56818
+ ) : [];
56389
56819
  const termResults = isActive("term") ? safeGetCalls(
56390
56820
  "term",
56391
56821
  () => termFetcher.getCalls(chainId),
@@ -56527,6 +56957,13 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
56527
56957
  getExactlyAbi(),
56528
56958
  "direct"
56529
56959
  );
56960
+ const flyingTulipGroup = buildGroup(
56961
+ "flyingTulip",
56962
+ flyingTulipResults,
56963
+ flyingTulipFetcher.parse,
56964
+ getFlyingTulipAbi(),
56965
+ "direct"
56966
+ );
56530
56967
  const termGroup = buildGroup(
56531
56968
  "term",
56532
56969
  termResults,
@@ -56645,6 +57082,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
56645
57082
  morphoGroup,
56646
57083
  midnightGroup,
56647
57084
  exactlyGroup,
57085
+ flyingTulipGroup,
56648
57086
  termGroup,
56649
57087
  liquityGroup,
56650
57088
  riverGroup,
@@ -56698,6 +57136,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
56698
57136
  dolomiteData,
56699
57137
  midnightData,
56700
57138
  exactlyData,
57139
+ flyingTulipData,
56701
57140
  termData,
56702
57141
  liquityData,
56703
57142
  riverData,
@@ -56808,6 +57247,14 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
56808
57247
  allowFailure,
56809
57248
  rpcOverrides
56810
57249
  ),
57250
+ executeGroup(
57251
+ flyingTulipGroup,
57252
+ chainId,
57253
+ chainBatchSize,
57254
+ retries,
57255
+ allowFailure,
57256
+ rpcOverrides
57257
+ ),
56811
57258
  executeGroup(
56812
57259
  termGroup,
56813
57260
  chainId,
@@ -57013,6 +57460,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
57013
57460
  parseTrackers(gearboxV3Group, gearboxV3Data.results, false);
57014
57461
  parseTrackers(dolomiteGroup, dolomiteData.results);
57015
57462
  parseTrackers(exactlyGroup, exactlyData.results);
57463
+ parseTrackers(flyingTulipGroup, flyingTulipData.results);
57016
57464
  parseTrackers(termGroup, termData.results);
57017
57465
  parseTrackers(liquityGroup, liquityData.results);
57018
57466
  parseTrackers(riverGroup, riverData.results);
@@ -60484,7 +60932,7 @@ var num4 = (v) => {
60484
60932
  const n = Number(v);
60485
60933
  return Number.isFinite(n) ? n : 0;
60486
60934
  };
60487
- var big20 = (v) => {
60935
+ var big21 = (v) => {
60488
60936
  try {
60489
60937
  if (v === void 0 || v === null || v === "") return "0";
60490
60938
  const s = String(v);
@@ -60520,12 +60968,12 @@ async function fetchTermMaxVaultsFromApi(chainId, prices = {}, tokenList = {}, f
60520
60968
  const assetEntry = tokenList[underlying];
60521
60969
  const priceKey = toOracleKey(assetEntry?.assetGroup) || toGenericPriceKey(underlying, chainId);
60522
60970
  const priceUsd = prices[priceKey];
60523
- const totalAssets = big20(r.totalAssets);
60524
- const totalSupply = big20(r.totalSupplyAmt);
60971
+ const totalAssets = big21(r.totalAssets);
60972
+ const totalSupply = big21(r.totalSupplyAmt);
60525
60973
  const totalAssetsFormatted = Number(totalAssets) / scale3;
60526
60974
  const supplyRate = num4(r.apr) * 100;
60527
60975
  const rewardsRate = num4(r?.incentiveData?.TMX_APR) * 100;
60528
- const rawLiquidity = BigInt(big20(r.redeemableAmt ?? r.idleFunds ?? "0"));
60976
+ const rawLiquidity = BigInt(big21(r.redeemableAmt ?? r.idleFunds ?? "0"));
60529
60977
  const totalAssetsBig = BigInt(totalAssets);
60530
60978
  const liquidity = (rawLiquidity > totalAssetsBig ? totalAssetsBig : rawLiquidity).toString();
60531
60979
  const liquidityFormatted = Number(liquidity) / scale3;
@@ -60561,7 +61009,7 @@ async function fetchTermMaxVaultsFromApi(chainId, prices = {}, tokenList = {}, f
60561
61009
  liquidityUsd: priceUsd ? liquidityFormatted * priceUsd : 0,
60562
61010
  version: r.version,
60563
61011
  isPaused: r.isPaused === true || void 0,
60564
- supplyCap: r.capacity ? big20(r.capacity) : void 0,
61012
+ supplyCap: r.capacity ? big21(r.capacity) : void 0,
60565
61013
  basePool: r.poolAddress ? lower3(r.poolAddress) : void 0
60566
61014
  };
60567
61015
  }
@@ -60617,7 +61065,7 @@ var Erc20DecimalsBalanceAbi = [
60617
61065
 
60618
61066
  // src/vaults/termmax/fetchFromChain.ts
60619
61067
  var DECIMAL_BASE2 = 100000000n;
60620
- var big21 = (v) => {
61068
+ var big22 = (v) => {
60621
61069
  if (v === void 0 || v === null || v === "0x") return 0n;
60622
61070
  try {
60623
61071
  return typeof v === "bigint" ? v : BigInt(v);
@@ -60681,7 +61129,7 @@ var fetchTermMaxVaultsFromChain = async (chainId, multicallRetry, prices = {}, t
60681
61129
  vaults.forEach((address, i) => {
60682
61130
  const at = (k) => res[i * READS_PER_VAULT + VAULT_READS.indexOf(k)];
60683
61131
  const asset = addr(at("asset"));
60684
- const totalAssets = big21(at("totalAssets"));
61132
+ const totalAssets = big22(at("totalAssets"));
60685
61133
  if (!asset || totalAssets === 0n) return;
60686
61134
  rows.push({
60687
61135
  address,
@@ -60690,11 +61138,11 @@ var fetchTermMaxVaultsFromChain = async (chainId, multicallRetry, prices = {}, t
60690
61138
  decimals: num5(at("decimals")) ?? 18,
60691
61139
  asset,
60692
61140
  totalAssets,
60693
- totalSupply: big21(at("totalSupply")),
60694
- annualizedInterest: big21(at("annualizedInterest")),
60695
- accretingPrincipal: big21(at("accretingPrincipal")),
60696
- performanceFeeRate: big21(at("performanceFeeRate")),
60697
- aprRaw: at("apr") != null ? big21(at("apr")) : void 0,
61141
+ totalSupply: big22(at("totalSupply")),
61142
+ annualizedInterest: big22(at("annualizedInterest")),
61143
+ accretingPrincipal: big22(at("accretingPrincipal")),
61144
+ performanceFeeRate: big22(at("performanceFeeRate")),
61145
+ aprRaw: at("apr") != null ? big22(at("apr")) : void 0,
60698
61146
  curator: addr(at("curator")),
60699
61147
  guardian: addr(at("guardian")),
60700
61148
  timelock: num5(at("timelock")),
@@ -60715,7 +61163,7 @@ var fetchTermMaxVaultsFromChain = async (chainId, multicallRetry, prices = {}, t
60715
61163
  const out = {};
60716
61164
  rows.forEach((r, i) => {
60717
61165
  const assetDecimals = num5(res2[i * 2]) ?? r.decimals;
60718
- const idle = big21(res2[i * 2 + 1]);
61166
+ const idle = big22(res2[i * 2 + 1]);
60719
61167
  const assetEntry = tokenList[r.asset];
60720
61168
  const priceKey = toOracleKey(assetEntry?.assetGroup) || toGenericPriceKey(r.asset, chainId);
60721
61169
  const priceUsd = prices[priceKey];
@@ -60835,7 +61283,7 @@ var Erc4626PreviewRedeemAbi = [
60835
61283
  ];
60836
61284
 
60837
61285
  // src/vaults/lst/readers/shared.ts
60838
- var ONE_E1811 = 10n ** 18n;
61286
+ var ONE_E1812 = 10n ** 18n;
60839
61287
  var rescaleDecimals = (v, fromDec, toDec) => toDec >= fromDec ? v * 10n ** BigInt(toDec - fromDec) : v / 10n ** BigInt(fromDec - toDec);
60840
61288
  var MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
60841
61289
  var Multicall3BalanceAbi = [
@@ -60878,7 +61326,7 @@ var readerBeetsStS = (entry) => ({
60878
61326
  }
60879
61327
  const liquidity = toBigInt13(pool);
60880
61328
  return {
60881
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61329
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
60882
61330
  totalSupply,
60883
61331
  exchangeRate,
60884
61332
  liquidity
@@ -60911,7 +61359,7 @@ var readerBenqiSavax = (entry) => ({
60911
61359
  {
60912
61360
  address: entry.address,
60913
61361
  name: "getPooledAvaxByShares",
60914
- params: [ONE_E1811]
61362
+ params: [ONE_E1812]
60915
61363
  },
60916
61364
  { address: entry.address, name: "totalPooledAvax", params: [] }
60917
61365
  ],
@@ -60922,7 +61370,7 @@ var readerBenqiSavax = (entry) => ({
60922
61370
  if (totalSupply === void 0 || exchangeRate === void 0) {
60923
61371
  return void 0;
60924
61372
  }
60925
- const totalAssets = toBigInt13(totalPooled) ?? totalSupply * exchangeRate / ONE_E1811;
61373
+ const totalAssets = toBigInt13(totalPooled) ?? totalSupply * exchangeRate / ONE_E1812;
60926
61374
  return {
60927
61375
  totalAssets,
60928
61376
  totalSupply,
@@ -60941,7 +61389,7 @@ var readerBgtWrapper1to1 = (entry) => ({
60941
61389
  return {
60942
61390
  totalAssets: totalSupply,
60943
61391
  totalSupply,
60944
- exchangeRate: ONE_E1811
61392
+ exchangeRate: ONE_E1812
60945
61393
  };
60946
61394
  }
60947
61395
  });
@@ -60971,7 +61419,7 @@ var readerDineroBeraEth = (entry) => ({
60971
61419
  return void 0;
60972
61420
  }
60973
61421
  return {
60974
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61422
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
60975
61423
  totalSupply,
60976
61424
  exchangeRate
60977
61425
  };
@@ -60983,7 +61431,7 @@ var readerErc4626 = (entry) => ({
60983
61431
  calls: [
60984
61432
  { address: entry.address, name: "totalAssets", params: [] },
60985
61433
  { address: entry.address, name: "totalSupply", params: [] },
60986
- { address: entry.address, name: "convertToAssets", params: [ONE_E1811] }
61434
+ { address: entry.address, name: "convertToAssets", params: [ONE_E1812] }
60987
61435
  ],
60988
61436
  abis: [Erc4626ReadAbi, TotalSupplyAbi, Erc4626ReadAbi],
60989
61437
  parse: ([assets, supply, rate]) => {
@@ -61000,7 +61448,7 @@ var readerErc4626PreviewRedeem = (entry) => ({
61000
61448
  calls: [
61001
61449
  { address: entry.address, name: "totalAssets", params: [] },
61002
61450
  { address: entry.address, name: "totalSupply", params: [] },
61003
- { address: entry.address, name: "previewRedeem", params: [ONE_E1811] }
61451
+ { address: entry.address, name: "previewRedeem", params: [ONE_E1812] }
61004
61452
  ],
61005
61453
  abis: [Erc4626PreviewRedeemAbi, TotalSupplyAbi, Erc4626PreviewRedeemAbi],
61006
61454
  parse: ([assets, supply, rate]) => {
@@ -61080,7 +61528,7 @@ var readerEtherFiWeEth = (entry) => {
61080
61528
  }
61081
61529
  }
61082
61530
  return {
61083
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61531
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61084
61532
  totalSupply,
61085
61533
  exchangeRate,
61086
61534
  liquidity
@@ -61113,7 +61561,7 @@ var readerHyperbeatBeHype = (entry) => {
61113
61561
  return {
61114
61562
  totalAssets: totalSupply,
61115
61563
  totalSupply,
61116
- exchangeRate: ONE_E1811
61564
+ exchangeRate: ONE_E1812
61117
61565
  };
61118
61566
  }
61119
61567
  };
@@ -61121,7 +61569,7 @@ var readerHyperbeatBeHype = (entry) => {
61121
61569
  return {
61122
61570
  calls: [
61123
61571
  { address: entry.address, name: "totalSupply", params: [] },
61124
- { address: stakingCore, name: "BeHYPEToHYPE", params: [ONE_E1811] }
61572
+ { address: stakingCore, name: "BeHYPEToHYPE", params: [ONE_E1812] }
61125
61573
  ],
61126
61574
  abis: [TotalSupplyAbi, HyperbeatStakingCoreAbi],
61127
61575
  parse: ([supply, rate]) => {
@@ -61131,7 +61579,7 @@ var readerHyperbeatBeHype = (entry) => {
61131
61579
  return void 0;
61132
61580
  }
61133
61581
  return {
61134
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61582
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61135
61583
  totalSupply,
61136
61584
  exchangeRate
61137
61585
  };
@@ -61163,7 +61611,7 @@ var readerKelpRsEth = (entry) => {
61163
61611
  return {
61164
61612
  totalAssets: totalSupply,
61165
61613
  totalSupply,
61166
- exchangeRate: ONE_E1811
61614
+ exchangeRate: ONE_E1812
61167
61615
  };
61168
61616
  }
61169
61617
  };
@@ -61181,7 +61629,7 @@ var readerKelpRsEth = (entry) => {
61181
61629
  return void 0;
61182
61630
  }
61183
61631
  return {
61184
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61632
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61185
61633
  totalSupply,
61186
61634
  exchangeRate
61187
61635
  };
@@ -61213,7 +61661,7 @@ var readerKinetiqKHype = (entry) => {
61213
61661
  return {
61214
61662
  totalAssets: totalSupply,
61215
61663
  totalSupply,
61216
- exchangeRate: ONE_E1811
61664
+ exchangeRate: ONE_E1812
61217
61665
  };
61218
61666
  }
61219
61667
  };
@@ -61221,7 +61669,7 @@ var readerKinetiqKHype = (entry) => {
61221
61669
  return {
61222
61670
  calls: [
61223
61671
  { address: entry.address, name: "totalSupply", params: [] },
61224
- { address: accountant, name: "kHYPEToHYPE", params: [ONE_E1811] }
61672
+ { address: accountant, name: "kHYPEToHYPE", params: [ONE_E1812] }
61225
61673
  ],
61226
61674
  abis: [TotalSupplyAbi, KinetiqStakingAccountantAbi],
61227
61675
  parse: ([supply, rate]) => {
@@ -61231,7 +61679,7 @@ var readerKinetiqKHype = (entry) => {
61231
61679
  return void 0;
61232
61680
  }
61233
61681
  return {
61234
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61682
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61235
61683
  totalSupply,
61236
61684
  exchangeRate
61237
61685
  };
@@ -61271,7 +61719,7 @@ var readerLairStKaia = (entry) => ({
61271
61719
  if (totalSupply === void 0 || exchangeRate === void 0) {
61272
61720
  return void 0;
61273
61721
  }
61274
- const totalAssets = toBigInt13(totalStaking) ?? totalSupply * exchangeRate / ONE_E1811;
61722
+ const totalAssets = toBigInt13(totalStaking) ?? totalSupply * exchangeRate / ONE_E1812;
61275
61723
  return {
61276
61724
  totalAssets,
61277
61725
  totalSupply,
@@ -61305,7 +61753,7 @@ var readerLidoWstEth = (entry) => ({
61305
61753
  return void 0;
61306
61754
  }
61307
61755
  return {
61308
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61756
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61309
61757
  totalSupply,
61310
61758
  exchangeRate
61311
61759
  };
@@ -61343,7 +61791,7 @@ var readerListaSlisBnb = (entry) => {
61343
61791
  return {
61344
61792
  totalAssets: totalSupply,
61345
61793
  totalSupply,
61346
- exchangeRate: ONE_E1811
61794
+ exchangeRate: ONE_E1812
61347
61795
  };
61348
61796
  }
61349
61797
  };
@@ -61351,7 +61799,7 @@ var readerListaSlisBnb = (entry) => {
61351
61799
  return {
61352
61800
  calls: [
61353
61801
  { address: entry.address, name: "totalSupply", params: [] },
61354
- { address: manager, name: "convertSnBnbToBnb", params: [ONE_E1811] },
61802
+ { address: manager, name: "convertSnBnbToBnb", params: [ONE_E1812] },
61355
61803
  { address: manager, name: "getTotalPooledBnb", params: [] }
61356
61804
  ],
61357
61805
  abis: [TotalSupplyAbi, ListaStakeManagerReadAbi, ListaStakeManagerReadAbi],
@@ -61362,7 +61810,7 @@ var readerListaSlisBnb = (entry) => {
61362
61810
  return void 0;
61363
61811
  }
61364
61812
  const pooledBnb = toBigInt13(pooled);
61365
- const totalAssets = pooledBnb ?? totalSupply * exchangeRate / ONE_E1811;
61813
+ const totalAssets = pooledBnb ?? totalSupply * exchangeRate / ONE_E1812;
61366
61814
  return { totalAssets, totalSupply, exchangeRate };
61367
61815
  }
61368
61816
  };
@@ -61392,7 +61840,7 @@ var readerMantleMEth = (entry) => {
61392
61840
  return {
61393
61841
  totalAssets: totalSupply,
61394
61842
  totalSupply,
61395
- exchangeRate: ONE_E1811
61843
+ exchangeRate: ONE_E1812
61396
61844
  };
61397
61845
  }
61398
61846
  };
@@ -61400,7 +61848,7 @@ var readerMantleMEth = (entry) => {
61400
61848
  return {
61401
61849
  calls: [
61402
61850
  { address: entry.address, name: "totalSupply", params: [] },
61403
- { address: staking, name: "mETHToETH", params: [ONE_E1811] }
61851
+ { address: staking, name: "mETHToETH", params: [ONE_E1812] }
61404
61852
  ],
61405
61853
  abis: [TotalSupplyAbi, MantleStakingAbi],
61406
61854
  parse: ([supply, rate]) => {
@@ -61410,7 +61858,7 @@ var readerMantleMEth = (entry) => {
61410
61858
  return void 0;
61411
61859
  }
61412
61860
  return {
61413
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61861
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61414
61862
  totalSupply,
61415
61863
  exchangeRate
61416
61864
  };
@@ -61431,7 +61879,7 @@ var readerOffChain = (entry) => {
61431
61879
  return {
61432
61880
  totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
61433
61881
  totalSupply,
61434
- exchangeRate: ONE_E1811
61882
+ exchangeRate: ONE_E1812
61435
61883
  };
61436
61884
  }
61437
61885
  };
@@ -61465,7 +61913,7 @@ var readerRenzoEzEth = (entry) => {
61465
61913
  return {
61466
61914
  totalAssets: totalSupply,
61467
61915
  totalSupply,
61468
- exchangeRate: ONE_E1811
61916
+ exchangeRate: ONE_E1812
61469
61917
  };
61470
61918
  }
61471
61919
  };
@@ -61484,7 +61932,7 @@ var readerRenzoEzEth = (entry) => {
61484
61932
  return {
61485
61933
  totalAssets: totalTvl,
61486
61934
  totalSupply,
61487
- exchangeRate: totalTvl * ONE_E1811 / totalSupply
61935
+ exchangeRate: totalTvl * ONE_E1812 / totalSupply
61488
61936
  };
61489
61937
  }
61490
61938
  };
@@ -61540,7 +61988,7 @@ var readerRocketReth = (entry) => {
61540
61988
  }
61541
61989
  const liquidity = depositPool ? toBigInt13(slice2[2]) : void 0;
61542
61990
  return {
61543
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
61991
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61544
61992
  totalSupply,
61545
61993
  exchangeRate,
61546
61994
  liquidity
@@ -61582,7 +62030,7 @@ var readerStaderEthx = (entry) => {
61582
62030
  return {
61583
62031
  totalAssets: totalSupply,
61584
62032
  totalSupply,
61585
- exchangeRate: ONE_E1811
62033
+ exchangeRate: ONE_E1812
61586
62034
  };
61587
62035
  }
61588
62036
  };
@@ -61600,7 +62048,7 @@ var readerStaderEthx = (entry) => {
61600
62048
  return void 0;
61601
62049
  }
61602
62050
  return {
61603
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62051
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61604
62052
  totalSupply,
61605
62053
  exchangeRate
61606
62054
  };
@@ -61617,7 +62065,7 @@ var readerStaderMaticX = (entry) => {
61617
62065
  {
61618
62066
  address: rateAddress,
61619
62067
  name: "convertMaticXToMatic",
61620
- params: [ONE_E1811],
62068
+ params: [ONE_E1812],
61621
62069
  chainId: homeChainId
61622
62070
  }
61623
62071
  ],
@@ -61632,7 +62080,7 @@ var readerStaderMaticX = (entry) => {
61632
62080
  }
61633
62081
  const isCrossChain = homeContract !== void 0;
61634
62082
  return {
61635
- totalAssets: isCrossChain ? totalSupply * amountInMatic / ONE_E1811 : totalPooledMatic ?? totalSupply * amountInMatic / ONE_E1811,
62083
+ totalAssets: isCrossChain ? totalSupply * amountInMatic / ONE_E1812 : totalPooledMatic ?? totalSupply * amountInMatic / ONE_E1812,
61636
62084
  totalSupply,
61637
62085
  exchangeRate: amountInMatic
61638
62086
  };
@@ -61664,7 +62112,7 @@ var readerStakeWiseOsEth = (entry) => {
61664
62112
  return {
61665
62113
  totalAssets: totalSupply,
61666
62114
  totalSupply,
61667
- exchangeRate: ONE_E1811
62115
+ exchangeRate: ONE_E1812
61668
62116
  };
61669
62117
  }
61670
62118
  };
@@ -61672,7 +62120,7 @@ var readerStakeWiseOsEth = (entry) => {
61672
62120
  return {
61673
62121
  calls: [
61674
62122
  { address: entry.address, name: "totalSupply", params: [] },
61675
- { address: controller, name: "convertToAssets", params: [ONE_E1811] }
62123
+ { address: controller, name: "convertToAssets", params: [ONE_E1812] }
61676
62124
  ],
61677
62125
  abis: [TotalSupplyAbi, StakeWiseOsTokenAbi],
61678
62126
  parse: ([supply, rate]) => {
@@ -61682,7 +62130,7 @@ var readerStakeWiseOsEth = (entry) => {
61682
62130
  return void 0;
61683
62131
  }
61684
62132
  return {
61685
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62133
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61686
62134
  totalSupply,
61687
62135
  exchangeRate
61688
62136
  };
@@ -61714,7 +62162,7 @@ var readerStCelo = (entry) => {
61714
62162
  return {
61715
62163
  totalAssets: totalSupply,
61716
62164
  totalSupply,
61717
- exchangeRate: ONE_E1811
62165
+ exchangeRate: ONE_E1812
61718
62166
  };
61719
62167
  }
61720
62168
  };
@@ -61722,7 +62170,7 @@ var readerStCelo = (entry) => {
61722
62170
  return {
61723
62171
  calls: [
61724
62172
  { address: entry.address, name: "totalSupply", params: [] },
61725
- { address: manager, name: "toCelo", params: [ONE_E1811] }
62173
+ { address: manager, name: "toCelo", params: [ONE_E1812] }
61726
62174
  ],
61727
62175
  abis: [TotalSupplyAbi, StCeloManagerAbi],
61728
62176
  parse: ([supply, rate]) => {
@@ -61732,7 +62180,7 @@ var readerStCelo = (entry) => {
61732
62180
  return void 0;
61733
62181
  }
61734
62182
  return {
61735
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62183
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61736
62184
  totalSupply,
61737
62185
  exchangeRate
61738
62186
  };
@@ -61765,7 +62213,7 @@ var readerSwellGetRate = (entry) => ({
61765
62213
  return void 0;
61766
62214
  }
61767
62215
  return {
61768
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62216
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61769
62217
  totalSupply,
61770
62218
  exchangeRate
61771
62219
  };
@@ -61796,7 +62244,7 @@ var readerValantisWstHype = (entry) => {
61796
62244
  return {
61797
62245
  totalAssets: totalSupply,
61798
62246
  totalSupply,
61799
- exchangeRate: ONE_E1811
62247
+ exchangeRate: ONE_E1812
61800
62248
  };
61801
62249
  }
61802
62250
  };
@@ -61814,7 +62262,7 @@ var readerValantisWstHype = (entry) => {
61814
62262
  return void 0;
61815
62263
  }
61816
62264
  return {
61817
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62265
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61818
62266
  totalSupply,
61819
62267
  exchangeRate
61820
62268
  };
@@ -61848,7 +62296,7 @@ var readerVedaAccountant = (entry) => {
61848
62296
  return {
61849
62297
  totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
61850
62298
  totalSupply,
61851
- exchangeRate: ONE_E1811
62299
+ exchangeRate: ONE_E1812
61852
62300
  };
61853
62301
  }
61854
62302
  };
@@ -61867,7 +62315,7 @@ var readerVedaAccountant = (entry) => {
61867
62315
  const exchangeRate = rawRate * scale3;
61868
62316
  return {
61869
62317
  totalAssets: rescaleDecimals(
61870
- totalSupply * exchangeRate / ONE_E1811,
62318
+ totalSupply * exchangeRate / ONE_E1812,
61871
62319
  shareDec,
61872
62320
  underlyingDec
61873
62321
  ),
@@ -61903,9 +62351,9 @@ var readerAnkrRatio = (entry) => ({
61903
62351
  return void 0;
61904
62352
  }
61905
62353
  return {
61906
- totalAssets: totalSupply * ONE_E1811 / r,
62354
+ totalAssets: totalSupply * ONE_E1812 / r,
61907
62355
  totalSupply,
61908
- exchangeRate: ONE_E1811 * ONE_E1811 / r
62356
+ exchangeRate: ONE_E1812 * ONE_E1812 / r
61909
62357
  };
61910
62358
  }
61911
62359
  });
@@ -61935,7 +62383,7 @@ var readerBinanceWbeth = (entry) => ({
61935
62383
  return void 0;
61936
62384
  }
61937
62385
  return {
61938
- totalAssets: totalSupply * exchangeRate / ONE_E1811,
62386
+ totalAssets: totalSupply * exchangeRate / ONE_E1812,
61939
62387
  totalSupply,
61940
62388
  exchangeRate
61941
62389
  };
@@ -61981,7 +62429,7 @@ var readerCoreEarnRate = (entry) => {
61981
62429
  return {
61982
62430
  totalAssets: totalSupply * r / CORE_RATE_DENOM,
61983
62431
  totalSupply,
61984
- exchangeRate: r * ONE_E1811 / CORE_RATE_DENOM
62432
+ exchangeRate: r * ONE_E1812 / CORE_RATE_DENOM
61985
62433
  };
61986
62434
  }
61987
62435
  };
@@ -62003,7 +62451,7 @@ var readerCoreStakedRatio = (entry) => {
62003
62451
  return {
62004
62452
  totalAssets: totalStaked,
62005
62453
  totalSupply,
62006
- exchangeRate: totalStaked * ONE_E1811 / totalSupply
62454
+ exchangeRate: totalStaked * ONE_E1812 / totalSupply
62007
62455
  };
62008
62456
  }
62009
62457
  };
@@ -62038,7 +62486,7 @@ var readerKintsuSMon = (entry) => ({
62038
62486
  const totalAssets = toBigInt13(pooled);
62039
62487
  const totalSupply = toBigInt13(shares);
62040
62488
  if (totalAssets === void 0 || totalSupply === void 0) return void 0;
62041
- const exchangeRate = totalSupply > 0n ? totalAssets * ONE_E1811 / totalSupply : ONE_E1811;
62489
+ const exchangeRate = totalSupply > 0n ? totalAssets * ONE_E1812 / totalSupply : ONE_E1812;
62042
62490
  return { totalAssets, totalSupply, exchangeRate };
62043
62491
  }
62044
62492
  });
@@ -62113,7 +62561,7 @@ var readerTreehouseTAsset = (entry) => {
62113
62561
  calls: [
62114
62562
  { address: entry.address, name: "totalAssets", params: [] },
62115
62563
  { address: entry.address, name: "totalSupply", params: [] },
62116
- { address: entry.address, name: "convertToAssets", params: [ONE_E1811] },
62564
+ { address: entry.address, name: "convertToAssets", params: [ONE_E1812] },
62117
62565
  { address: fl, name: "getRedeemableAmount", params: [] },
62118
62566
  { address: fl, name: "redemptionFee", params: [] },
62119
62567
  { address: fl, name: "minRedeemInUnderlying", params: [] },
@@ -62727,7 +63175,7 @@ var deriveExitRoutes = (i) => {
62727
63175
  };
62728
63176
 
62729
63177
  // src/vaults/lst/fetchPublic.ts
62730
- var ONE_E1812 = 10n ** 18n;
63178
+ var ONE_E1813 = 10n ** 18n;
62731
63179
  var ERC20_BALANCE_ABI = parseAbi([
62732
63180
  "function balanceOf(address) view returns (uint256)"
62733
63181
  ]);
@@ -62858,8 +63306,8 @@ var fetchLstShareTokens = async (chainId, multicallRetry, prices = {}, tokenList
62858
63306
  const underlyingUnit = 10n ** BigInt(underlyingDec);
62859
63307
  const totalAssetsFormatted = Number(state.totalAssets) / 10 ** underlyingDec;
62860
63308
  const totalAssetsUsd = priceUsd !== void 0 ? totalAssetsFormatted * priceUsd : 0;
62861
- const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1812;
62862
- const convertToShares = state.exchangeRate > 0n ? ONE_E1812 * shareUnit / state.exchangeRate : 0n;
63309
+ const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1813;
63310
+ const convertToShares = state.exchangeRate > 0n ? ONE_E1813 * shareUnit / state.exchangeRate : 0n;
62863
63311
  let liquidityRaw;
62864
63312
  if (state.liquidity !== void 0) {
62865
63313
  liquidityRaw = state.liquidity;
@@ -66496,7 +66944,7 @@ var NavOracleReadAbi = [
66496
66944
  ];
66497
66945
 
66498
66946
  // src/vaults/savings/readers/shared.ts
66499
- var ONE_E1813 = 10n ** 18n;
66947
+ var ONE_E1814 = 10n ** 18n;
66500
66948
  var toBigInt15 = (v) => {
66501
66949
  if (v === void 0 || v === null) return void 0;
66502
66950
  if (typeof v === "bigint") return v;
@@ -66537,7 +66985,7 @@ var readerErc46262 = (entry) => {
66537
66985
  return {
66538
66986
  totalAssets,
66539
66987
  totalSupply,
66540
- exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit
66988
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit
66541
66989
  };
66542
66990
  }
66543
66991
  };
@@ -66568,7 +67016,7 @@ var readerErc4626Cooldown = (entry) => {
66568
67016
  return {
66569
67017
  totalAssets,
66570
67018
  totalSupply,
66571
- exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
67019
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit,
66572
67020
  withdrawalCooldownSeconds: cooldownSecs === void 0 ? void 0 : Number(cooldownSecs)
66573
67021
  };
66574
67022
  }
@@ -66831,7 +67279,7 @@ var readerErc4626Idle = (entry) => {
66831
67279
  return {
66832
67280
  totalAssets,
66833
67281
  totalSupply,
66834
- exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
67282
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit,
66835
67283
  ...capacity !== void 0 ? {
66836
67284
  instantRedeemCapacity: capacity,
66837
67285
  instantRedeemEnabled: true,
@@ -66880,7 +67328,7 @@ var readerErc4626WithdrawLimit = (entry) => {
66880
67328
  return {
66881
67329
  totalAssets,
66882
67330
  totalSupply,
66883
- exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
67331
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit,
66884
67332
  ...capacity !== void 0 ? {
66885
67333
  instantRedeemCapacity: capacity,
66886
67334
  instantRedeemEnabled: true,
@@ -66910,7 +67358,7 @@ var readerBitwayVault = (entry) => {
66910
67358
  {
66911
67359
  address: vault,
66912
67360
  name: "convertToAssets",
66913
- params: [ONE_E1813, underlying]
67361
+ params: [ONE_E1814, underlying]
66914
67362
  },
66915
67363
  { address: vault, name: "getContractBalance", params: [underlying] },
66916
67364
  { address: vault, name: "WAITING_TIME", params: [] }
@@ -66933,7 +67381,7 @@ var readerBitwayVault = (entry) => {
66933
67381
  // totalSupply is in raw share units; convert to raw underlying.
66934
67382
  // (Every live leg is 18/18-dec — BSC stables are 18-dec — but the
66935
67383
  // rescale keeps a future 6-dec listing honest.)
66936
- totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1813),
67384
+ totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1814),
66937
67385
  totalSupply,
66938
67386
  exchangeRate,
66939
67387
  withdrawFeeBps: penaltyBps,
@@ -66968,7 +67416,7 @@ var readerFrankencoinSavings = (entry) => ({
66968
67416
  // `fetchPublic` derives `convertToAssets` / `convertToShares` from
66969
67417
  // `exchangeRate`, and 1e18 makes them the identity.
66970
67418
  totalSupply: deposits,
66971
- exchangeRate: ONE_E1813
67419
+ exchangeRate: ONE_E1814
66972
67420
  };
66973
67421
  }
66974
67422
  });
@@ -67015,7 +67463,7 @@ var readerHyperbeatVault = (entry) => {
67015
67463
  const feeRaw = toBigInt15(fee);
67016
67464
  return {
67017
67465
  // totalSupply is in raw share units; convert to raw underlying.
67018
- totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1813),
67466
+ totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1814),
67019
67467
  totalSupply,
67020
67468
  exchangeRate,
67021
67469
  // `instantWithdrawalFee` is over a base of 10 000, so the raw
@@ -67052,9 +67500,9 @@ var readerNavOracle = (entry) => {
67052
67500
  const raw = Array.isArray(round) ? round[1] : round?.answer;
67053
67501
  const answer = toBigInt15(raw);
67054
67502
  if (answer === void 0 || answer <= 0n) return void 0;
67055
- const exchangeRate = answer * ONE_E1813 / oracleScale;
67503
+ const exchangeRate = answer * ONE_E1814 / oracleScale;
67056
67504
  return {
67057
- totalAssets: totalSupply * exchangeRate * underlyingUnit / (ONE_E1813 * shareUnit),
67505
+ totalAssets: totalSupply * exchangeRate * underlyingUnit / (ONE_E1814 * shareUnit),
67058
67506
  totalSupply,
67059
67507
  exchangeRate
67060
67508
  };
@@ -67068,7 +67516,7 @@ var readerNativeWnlp = (entry) => {
67068
67516
  return {
67069
67517
  calls: [
67070
67518
  { address, name: "totalSupply", params: [] },
67071
- { address, name: "getNlpByWnlp", params: [ONE_E1813] },
67519
+ { address, name: "getNlpByWnlp", params: [ONE_E1814] },
67072
67520
  { address, name: "instantRedeemFeeBips", params: [] },
67073
67521
  { address, name: "instantRedeemEnabled", params: [] },
67074
67522
  // Falls back to the vault itself when no CreditVault is pinned —
@@ -67102,7 +67550,7 @@ var readerNativeWnlp = (entry) => {
67102
67550
  const windowSeconds = toBigInt15(window);
67103
67551
  const bips = toBigInt15(feeBips);
67104
67552
  return {
67105
- totalAssets: totalSupply * exchangeRate / ONE_E1813,
67553
+ totalAssets: totalSupply * exchangeRate / ONE_E1814,
67106
67554
  totalSupply,
67107
67555
  exchangeRate,
67108
67556
  // `instantRedeemFeeBips` on-chain is already basis points, so it
@@ -67139,7 +67587,7 @@ var readerWrenNav = (entry) => {
67139
67587
  const burncost = toBigInt15(burn);
67140
67588
  const hasBurncost = burncost !== void 0 && burncost > 0n;
67141
67589
  const exchangeRate = hasBurncost ? burncost : navPrice;
67142
- const totalAssets = totalSupply * exchangeRate * underlyingUnit / (ONE_E1813 * shareUnit);
67590
+ const totalAssets = totalSupply * exchangeRate * underlyingUnit / (ONE_E1814 * shareUnit);
67143
67591
  const burnFlag = toBigInt15(burnable);
67144
67592
  const instantRedeemEnabled = burnFlag === void 0 ? true : burnFlag > 0n;
67145
67593
  return {
@@ -67154,7 +67602,7 @@ var readerWrenNav = (entry) => {
67154
67602
  };
67155
67603
 
67156
67604
  // src/vaults/savings/readers/yieldBasisLt.ts
67157
- var ONE_SHARE = ONE_E1813;
67605
+ var ONE_SHARE = ONE_E1814;
67158
67606
  var readerYieldBasisLt = (entry) => {
67159
67607
  const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
67160
67608
  const amm = entry.capacityContract ?? entry.address;
@@ -67182,7 +67630,7 @@ var readerYieldBasisLt = (entry) => {
67182
67630
  }
67183
67631
  if (totalSupply === 0n || redeemRaw === 0n) return void 0;
67184
67632
  const totalAssets = totalSupply * redeemRaw / ONE_SHARE;
67185
- const exchangeRate = redeemRaw * ONE_E1813 / underlyingUnit;
67633
+ const exchangeRate = redeemRaw * ONE_E1814 / underlyingUnit;
67186
67634
  const equity = Array.isArray(valueOracle) ? toBigInt15(valueOracle[1]) : toBigInt15(valueOracle?.value);
67187
67635
  const cap = toBigInt15(maxDebt);
67188
67636
  let depositCapacity;
@@ -67234,7 +67682,7 @@ var buildReader2 = (entry) => {
67234
67682
  var resolveYieldApr2 = async (entries) => (await resolveEntryApr(entries)).apr;
67235
67683
 
67236
67684
  // src/vaults/savings/fetchPublic.ts
67237
- var ONE_E1814 = 10n ** 18n;
67685
+ var ONE_E1815 = 10n ** 18n;
67238
67686
  var resolveSelfOnly = (chainId, vault) => {
67239
67687
  const entry = findSavingsWithdrawEntry(chainId, vault);
67240
67688
  if (!entry) return void 0;
@@ -67291,8 +67739,8 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
67291
67739
  1,
67292
67740
  Number(liquidityAmount * 1000000n / state.totalAssets) / 1e6
67293
67741
  ) : 1;
67294
- const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1814;
67295
- const convertToShares = state.exchangeRate > 0n ? ONE_E1814 * shareUnit / state.exchangeRate : 0n;
67742
+ const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1815;
67743
+ const convertToShares = state.exchangeRate > 0n ? ONE_E1815 * shareUnit / state.exchangeRate : 0n;
67296
67744
  const depositCapacity = state.depositCapacity?.toString();
67297
67745
  const depositCapacityFormatted = state.depositCapacity !== void 0 ? Number(state.depositCapacity) / 10 ** underlyingDec : void 0;
67298
67746
  const depositCapacityUsd = depositCapacityFormatted !== void 0 && priceUsd !== void 0 ? depositCapacityFormatted * priceUsd : void 0;
@@ -67698,7 +68146,7 @@ async function fetchAaveEarnApiVaults(chainId, targets) {
67698
68146
  }
67699
68147
 
67700
68148
  // src/vaults/aave-earn/registry.ts
67701
- var EMPTY = { curators: [], vaults: [] };
68149
+ var EMPTY2 = { curators: [], vaults: [] };
67702
68150
  var AAVE_EARN_REGISTRY = {
67703
68151
  // Ethereum. Owners run vaults across multiple chains (CREATE3 factory
67704
68152
  // `0xa35995bb2fFC5F2b33379C2e95d00C20FbF71E70`), so the same owner is
@@ -67726,7 +68174,7 @@ var AAVE_EARN_REGISTRY = {
67726
68174
  vaults: []
67727
68175
  }
67728
68176
  };
67729
- var getAaveEarnRegistry = (chainId) => AAVE_EARN_REGISTRY[String(chainId)] ?? EMPTY;
68177
+ var getAaveEarnRegistry = (chainId) => AAVE_EARN_REGISTRY[String(chainId)] ?? EMPTY2;
67730
68178
  var hasAaveEarnVaults = (chainId) => {
67731
68179
  const reg = getAaveEarnRegistry(chainId);
67732
68180
  return reg.curators.length > 0 || reg.vaults.length > 0;
@@ -69133,23 +69581,23 @@ var priceGmMarkets = async (chainId, multicallRetry, markets, prices) => {
69133
69581
  const indexMax = price(prices, m.indexToken)?.max;
69134
69582
  if (Array.isArray(dsRes) && longMax != null && shortMax != null) {
69135
69583
  const base = i * SLOTS;
69136
- const big22 = (j) => typeof dsRes[base + j] === "bigint" ? dsRes[base + j] : 0n;
69584
+ const big23 = (j) => typeof dsRes[base + j] === "bigint" ? dsRes[base + j] : 0n;
69137
69585
  const cap = computeDepositCapacityUsd(
69138
- [info?.longTokenAmount, longMax, big22(0), big22(2)],
69139
- [info?.shortTokenAmount, shortMax, big22(1), big22(3)]
69586
+ [info?.longTokenAmount, longMax, big23(0), big23(2)],
69587
+ [info?.shortTokenAmount, shortMax, big23(1), big23(3)]
69140
69588
  );
69141
69589
  if (cap != null) value.depositCapacityUsd = cap;
69142
69590
  if (indexMax != null) {
69143
69591
  const divisor = m.longToken.toLowerCase() === m.shortToken.toLowerCase() ? 2n : 1n;
69144
- const reservedUsdLong = (big22(4) + big22(5)) / divisor * indexMax;
69145
- const reservedUsdShort = (big22(6) + big22(7)) / divisor;
69592
+ const reservedUsdLong = (big23(4) + big23(5)) / divisor * indexMax;
69593
+ const reservedUsdShort = (big23(6) + big23(7)) / divisor;
69146
69594
  const liq = computeLiquidityUsd(
69147
69595
  info?.longTokenUsd,
69148
69596
  info?.shortTokenUsd,
69149
69597
  reservedUsdLong,
69150
69598
  reservedUsdShort,
69151
- big22(8),
69152
- big22(9)
69599
+ big23(8),
69600
+ big23(9)
69153
69601
  );
69154
69602
  if (liq != null)
69155
69603
  value.liquidityUsd = Math.max(0, Math.min(liq, value.tvlUsd));
@@ -69348,21 +69796,21 @@ var fetchGmxExecutionFees = async (chainId, multicallRetry, gasPriceWei) => {
69348
69796
  } catch {
69349
69797
  return void 0;
69350
69798
  }
69351
- const big22 = (i) => typeof res[i] === "bigint" ? res[i] : 0n;
69352
- const base = big22(0);
69353
- const mult = big22(1);
69799
+ const big23 = (i) => typeof res[i] === "bigint" ? res[i] : 0n;
69800
+ const base = big23(0);
69801
+ const mult = big23(1);
69354
69802
  if (base === 0n && mult === 0n) return void 0;
69355
69803
  const PRECISION = 10n ** 30n;
69356
69804
  const adjusted = (opGas) => base + opGas * mult / PRECISION;
69357
69805
  const fee = (opGas) => (adjusted(opGas) * gasPriceWei).toString();
69358
- const glvExtra = big22(6) * GLV_NOMINAL_MARKET_COUNT;
69806
+ const glvExtra = big23(6) * GLV_NOMINAL_MARKET_COUNT;
69359
69807
  return {
69360
69808
  chainId,
69361
69809
  gasPriceWei: gasPriceWei.toString(),
69362
- deposit: fee(big22(2)),
69363
- withdrawal: fee(big22(3)),
69364
- glvDeposit: fee(big22(4) + glvExtra),
69365
- glvWithdrawal: fee(big22(5) + glvExtra)
69810
+ deposit: fee(big23(2)),
69811
+ withdrawal: fee(big23(3)),
69812
+ glvDeposit: fee(big23(4) + glvExtra),
69813
+ glvWithdrawal: fee(big23(5) + glvExtra)
69366
69814
  };
69367
69815
  };
69368
69816
 
@@ -71176,6 +71624,28 @@ var TERM_PROFILES = [
71176
71624
  ]
71177
71625
  }
71178
71626
  }),
71627
+ P({
71628
+ id: "flyingTulip.crossMargin@v1",
71629
+ name: "Flying Tulip cross-margin account",
71630
+ family: "flyingTulip",
71631
+ supply: {
71632
+ description: "One cross-margin account per chain: every asset you deposit backs every asset you borrow, under a single global health check.",
71633
+ implications: [
71634
+ "The rate shown is interest only \u2014 borrowers pay it and it is shared pro rata with utilization. Flying Tulip also pays an FT token emission on deposits that is NOT included here, so the figure is a floor, not the whole return.",
71635
+ "A withdrawal is checked against the same health gate as a borrow: it must leave your account at a health factor of 1.50 or better, so a deposit that is backing debt is not freely withdrawable.",
71636
+ "While you hold any debt your account must keep a minimum equity in USD \u2014 $250 on Ethereum, $10 on Sonic \u2014 which can block a withdrawal that would take you under it."
71637
+ ]
71638
+ },
71639
+ borrow: {
71640
+ description: "Borrow any listed asset against your whole account. There is no per-market LTV: the requirement is charged on your debt as well as your collateral, so how much you can borrow depends on the PAIR.",
71641
+ implications: [
71642
+ "Liquidation starts at a health factor below 1.25, NOT below 1.0 \u2014 you are liquidatable a quarter of a point earlier than on an ordinary lending market.",
71643
+ "A new borrow must leave you at 1.50 or better, so a position opened at the limit sits only 0.25 of health above liquidation from the moment it opens.",
71644
+ "Your account must hold a minimum equity in USD for as long as any debt exists ($250 on Ethereum, $10 on Sonic).",
71645
+ "Repayment is never blocked and anyone may repay on your behalf \u2014 there is no cooldown, freeze or queue on the way out."
71646
+ ]
71647
+ }
71648
+ }),
71179
71649
  P({
71180
71650
  id: "twyne.credit-delegation@v1",
71181
71651
  name: "Twyne credit delegation",
@@ -76160,6 +76630,74 @@ var curvanceAdapter = {
76160
76630
  function numOrUndef(v) {
76161
76631
  return typeof v === "number" && Number.isFinite(v) ? v : void 0;
76162
76632
  }
76633
+ function numOrUndef2(v) {
76634
+ if (typeof v === "number" && Number.isFinite(v)) return v;
76635
+ if (typeof v === "string" && /^\d+$/.test(v)) return Number(v);
76636
+ return void 0;
76637
+ }
76638
+ function wadUsd(v) {
76639
+ const s = typeof v === "bigint" || typeof v === "number" ? String(v) : v;
76640
+ if (typeof s !== "string" || !/^\d+$/.test(s)) return void 0;
76641
+ const n = Number(BigInt(s) / 10n ** 14n) / 1e4;
76642
+ return Number.isFinite(n) && n > 0 ? n : void 0;
76643
+ }
76644
+ var flyingTulipAdapter = {
76645
+ id: "flying-tulip",
76646
+ matches: isFlyingTulip,
76647
+ profileId: () => "flyingTulip.crossMargin@v1",
76648
+ build: (input) => {
76649
+ const ft = input.market?.flyingTulip ?? {};
76650
+ const hfTargetBps = numOrUndef2(ft.hfTargetBps);
76651
+ numOrUndef2(ft.hfSafeBps);
76652
+ wadUsd(ft.minEquityUSDWad);
76653
+ const liqHf = hfTargetBps != null ? hfTargetBps / 1e4 : void 0;
76654
+ return {
76655
+ constraints: {
76656
+ // One account per address per chain, spanning every asset — there is
76657
+ // no per-market position and no id.
76658
+ positionModel: "account",
76659
+ positionIdMeaning: "the borrower address itself \u2014 one cross-margin account per chain covering every asset, with a single global health check",
76660
+ crossMargin: true
76661
+ // NOTE the USD equity floor ($250 Ethereum / $10 Sonic) has no
76662
+ // structured slot — `availability.minSize` is a DEBT floor in asset
76663
+ // units and this is an EQUITY floor in USD, so putting it there would
76664
+ // be read as the wrong gate on the wrong quantity. It is stated in the
76665
+ // profile prose instead, and the raw value stays on
76666
+ // `params.market.flyingTulip.minEquityUSDWad` for a caller that needs
76667
+ // to gate on it.
76668
+ },
76669
+ borrow: {
76670
+ debtShape: "accruing",
76671
+ // The HF >= 1.50 open gate likewise has no structured slot; it is in
76672
+ // the profile prose. `availability` here carries no minimum size —
76673
+ // Flying Tulip has none on the debt leg.
76674
+ exit: {
76675
+ // Repay is always open — `repayFor` is permissionless, so a third
76676
+ // party can rescue the account, and nothing gates or delays it.
76677
+ partialAllowed: true,
76678
+ cooldownSecs: void 0
76679
+ },
76680
+ ...liqHf != null ? {
76681
+ liquidation: {
76682
+ model: "partial",
76683
+ trigger: "price",
76684
+ // THE correction. Everything else in this repo may assume
76685
+ // `HF < 1 ⇒ liquidatable`; here the protocol reverts above
76686
+ // 1.25, so the position is liquidatable a quarter of a point
76687
+ // of health EARLIER than the default reading.
76688
+ liquidationHealthFactor: liqHf
76689
+ }
76690
+ } : {}
76691
+ },
76692
+ supply: {
76693
+ exit: {
76694
+ // A withdrawal is checked against the SAME open gate as a borrow
76695
+ // (HF >= 1.50) and against the equity floor.
76696
+ }
76697
+ }
76698
+ };
76699
+ }
76700
+ };
76163
76701
  var num16 = (v) => typeof v === "number" && Number.isFinite(v) ? v : void 0;
76164
76702
  var pct2 = (v) => `${(v * 100).toFixed(2)} %`;
76165
76703
  var twyneAdapter = {
@@ -76375,6 +76913,7 @@ var TERM_ADAPTERS = [
76375
76913
  frankencoinAdapter,
76376
76914
  resupplyAdapter,
76377
76915
  curvanceAdapter,
76916
+ flyingTulipAdapter,
76378
76917
  twyneAdapter,
76379
76918
  fraxlendAdapter,
76380
76919
  morphoBlueAdapter,
@@ -77518,6 +78057,6 @@ function earnPositionTotals(items) {
77518
78057
  };
77519
78058
  }
77520
78059
 
77521
- export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, 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, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, 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, convertCoolerMarketsToResponse, 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, fetchCoolerMarkets, 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, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, fillableRemaining, 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, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, 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, termApiBaseUrl, 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, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
78060
+ export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, EARN_DESCRIPTIONS, EARN_LABELS, EMPTY_BALANCE, EXACTLY_LENDER_KEY, FLYING_TULIP_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, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, 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, convertCoolerMarketsToResponse, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFlyingTulipMarketsToResponse, 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, fetchCoolerMarkets, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidDexState, fetchFluidFTokens, fetchFlyingTulipMarkets, 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, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, fillableRemaining, 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, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, 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, termApiBaseUrl, 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, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
77522
78061
  //# sourceMappingURL=index.js.map
77523
78062
  //# sourceMappingURL=index.js.map