@1delta/margin-fetcher 5.0.75 → 5.0.77

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
@@ -16678,13 +16678,13 @@ var REPAIR_BACKOFF_JITTER_MS = 60;
16678
16678
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
16679
16679
  var backoffForRound = (round) => REPAIR_BACKOFF_BASE_MS * 2 ** round + Math.random() * REPAIR_BACKOFF_JITTER_MS;
16680
16680
  var endpointUrl = (client, rpcId) => client?.transport?.url ?? `rpc#${rpcId}`;
16681
- var resolveEndpoint = (chainId, getEvmClient19, startRpcId, tried, maxProbe = 12, timeoutMs) => {
16681
+ var resolveEndpoint = (chainId, getEvmClient20, startRpcId, tried, maxProbe = 12, timeoutMs) => {
16682
16682
  let fallback = null;
16683
16683
  for (let probe = 0; probe < maxProbe; probe++) {
16684
16684
  const rpcId = startRpcId + probe;
16685
16685
  let client;
16686
16686
  try {
16687
- client = getEvmClient19(chainId, rpcId, { timeoutMs });
16687
+ client = getEvmClient20(chainId, rpcId, { timeoutMs });
16688
16688
  } catch {
16689
16689
  break;
16690
16690
  }
@@ -16713,7 +16713,7 @@ var recordPermanentFailures = (slots, offset, collector) => {
16713
16713
  if (slots[i].permanent) collector.add(offset + i);
16714
16714
  }
16715
16715
  };
16716
- var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
16716
+ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient20, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
16717
16717
  let searchFrom = nextRpcId;
16718
16718
  for (let round = 0; round < rounds; round++) {
16719
16719
  const failedIdx = [];
@@ -16723,7 +16723,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRp
16723
16723
  if (failedIdx.length === 0) return slots;
16724
16724
  const endpoint = resolveEndpoint(
16725
16725
  chainId,
16726
- getEvmClient19,
16726
+ getEvmClient20,
16727
16727
  searchFrom,
16728
16728
  options?.tried
16729
16729
  );
@@ -16775,7 +16775,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient19, nextRp
16775
16775
  }
16776
16776
  return slots;
16777
16777
  };
16778
- var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
16778
+ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
16779
16779
  const abiIsArray = isArray(abi[0]);
16780
16780
  const contracts = calls.map(({ address, name, params }, i) => ({
16781
16781
  abi: abiIsArray ? abi?.[i] : abi,
@@ -16849,7 +16849,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16849
16849
  const attemptHedged = async (items, startRpcId, tried) => {
16850
16850
  const primary = resolveEndpoint(
16851
16851
  chainId,
16852
- getEvmClient19,
16852
+ getEvmClient20,
16853
16853
  startRpcId,
16854
16854
  tried,
16855
16855
  12,
@@ -16873,7 +16873,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16873
16873
  clearTimeout(timer);
16874
16874
  const alt = resolveEndpoint(
16875
16875
  chainId,
16876
- getEvmClient19,
16876
+ getEvmClient20,
16877
16877
  primary.rpcId + 1,
16878
16878
  tried,
16879
16879
  12,
@@ -16925,7 +16925,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16925
16925
  chainId,
16926
16926
  batch.items,
16927
16927
  slots,
16928
- getEvmClient19,
16928
+ getEvmClient20,
16929
16929
  won.rpcId + 1,
16930
16930
  requestBytes,
16931
16931
  logs,
@@ -16947,7 +16947,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient19, poolS
16947
16947
  const tried = /* @__PURE__ */ new Set();
16948
16948
  const start = resolveEndpoint(
16949
16949
  chainId,
16950
- getEvmClient19,
16950
+ getEvmClient20,
16951
16951
  workerId,
16952
16952
  void 0,
16953
16953
  12,
@@ -42377,7 +42377,7 @@ function unflattenLenderData(pools) {
42377
42377
  }
42378
42378
  return result;
42379
42379
  }
42380
- var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
42380
+ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient20, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
42381
42381
  const queries = organizeUserQueries(queriesRaw);
42382
42382
  const builtCalls = await Promise.all(
42383
42383
  queries.map(async (query3) => {
@@ -42387,7 +42387,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowF
42387
42387
  query3.lender,
42388
42388
  query3.account,
42389
42389
  query3.params,
42390
- getEvmClient19
42390
+ getEvmClient20
42391
42391
  );
42392
42392
  return callData.map((call) => ({ call, abi: call.abi ?? abi }));
42393
42393
  })
@@ -42397,7 +42397,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient19, allowF
42397
42397
  chainId,
42398
42398
  calls.map((call) => call.abi),
42399
42399
  calls.map((call) => call.call),
42400
- getEvmClient19,
42400
+ getEvmClient20,
42401
42401
  concurrency,
42402
42402
  retries,
42403
42403
  allowFailure,
@@ -44843,8 +44843,6 @@ var stKaiaFetcher = {
44843
44843
  }
44844
44844
  }
44845
44845
  };
44846
-
44847
- // src/yields/intrinsic/fetchers/lista.ts
44848
44846
  var HISTORY_URL = "https://api.lista.org/api/datachart/history";
44849
44847
  var SLISBNB = "Lista Staked BNB::slisBNB";
44850
44848
  var DAY_SECONDS2 = 86400;
@@ -44875,6 +44873,68 @@ var slisBnbFetcher = {
44875
44873
  }
44876
44874
  }
44877
44875
  };
44876
+ var LISASTER_OVERVIEW_URL = "https://api.lista.org/api/lisaster/overview";
44877
+ var LISASTER_KEY = "Lista Staked Aster::lisAster";
44878
+ var LISASTER_SMARTLP_KEY = "lisAster & ASTER-SmartLP::lisAster & ASTER-SmartLP";
44879
+ var LISASTER_SMARTLP_DEX = "0x510d69b25a2177eddce9becdb0a66a511c944840";
44880
+ var STABLESWAP_BALANCES_ABI = [
44881
+ {
44882
+ type: "function",
44883
+ name: "balances",
44884
+ stateMutability: "view",
44885
+ inputs: [{ name: "i", type: "uint256" }],
44886
+ outputs: [{ name: "", type: "uint256" }]
44887
+ }
44888
+ ];
44889
+ var lisAsterFetcher = {
44890
+ label: "LISASTER",
44891
+ fetch: async () => {
44892
+ const controller = new AbortController();
44893
+ const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
44894
+ let apr;
44895
+ try {
44896
+ const res = await fetch(LISASTER_OVERVIEW_URL, {
44897
+ method: "GET",
44898
+ headers: { Accept: "application/json" },
44899
+ signal: controller.signal
44900
+ }).then((r) => r.json());
44901
+ const apyFraction = Number(res.data?.lisasterApy);
44902
+ if (!Number.isFinite(apyFraction) || apyFraction <= 0) {
44903
+ throw new Error(
44904
+ `lisAster: overview carried no usable lisasterApy (${String(res.data?.lisasterApy)})`
44905
+ );
44906
+ }
44907
+ apr = apyToAprPercent(apyFraction * 100);
44908
+ } finally {
44909
+ clearTimeout(timer);
44910
+ }
44911
+ const out = { [LISASTER_KEY]: apr };
44912
+ try {
44913
+ const client = getEvmClient(Chain.BNB_SMART_CHAIN_MAINNET);
44914
+ const [aster, lisAster] = await Promise.all([
44915
+ client.readContract({
44916
+ address: LISASTER_SMARTLP_DEX,
44917
+ abi: STABLESWAP_BALANCES_ABI,
44918
+ functionName: "balances",
44919
+ args: [0n]
44920
+ }),
44921
+ client.readContract({
44922
+ address: LISASTER_SMARTLP_DEX,
44923
+ abi: STABLESWAP_BALANCES_ABI,
44924
+ functionName: "balances",
44925
+ args: [1n]
44926
+ })
44927
+ ]);
44928
+ const total = aster + lisAster;
44929
+ if (total > 0n) {
44930
+ const weight = Number(lisAster) / Number(total);
44931
+ out[LISASTER_SMARTLP_KEY] = apr * weight;
44932
+ }
44933
+ } catch {
44934
+ }
44935
+ return out;
44936
+ }
44937
+ };
44878
44938
  var CHAIN_ID3 = "80094";
44879
44939
  var IBERA = "0x9b6761bf2397bb5a6624a856cc84a3a14dcd3fe5";
44880
44940
  var ONE_E182 = 10n ** 18n;
@@ -48279,6 +48339,109 @@ var scrvusdFetcher = {
48279
48339
  };
48280
48340
  }
48281
48341
  };
48342
+ var SUSDAT = "0xd166337499e176bbc38a1fbd113ab144e5bd2df7";
48343
+ var DEFILLAMA_POOL = "47e72726-3b2b-4fe6-b4a9-a26e1fcd9a50";
48344
+ var YEAR_SECONDS11 = 31536e3;
48345
+ var STRC_UNIT = 1e6;
48346
+ var SUSDAT_KEY = "Saturn sUSDat::SUSDAT";
48347
+ var SUSDAT_BRIDGED_KEY = "Staked Saturn USD::sUSDat";
48348
+ var VAULT_ABI = [
48349
+ {
48350
+ name: "vestingAmount",
48351
+ type: "function",
48352
+ stateMutability: "view",
48353
+ inputs: [],
48354
+ outputs: [{ name: "", type: "uint256" }]
48355
+ },
48356
+ {
48357
+ name: "vestingPeriod",
48358
+ type: "function",
48359
+ stateMutability: "view",
48360
+ inputs: [],
48361
+ outputs: [{ name: "", type: "uint256" }]
48362
+ },
48363
+ {
48364
+ name: "totalAssets",
48365
+ type: "function",
48366
+ stateMutability: "view",
48367
+ inputs: [],
48368
+ outputs: [{ name: "", type: "uint256" }]
48369
+ },
48370
+ {
48371
+ name: "getStrcOracle",
48372
+ type: "function",
48373
+ stateMutability: "view",
48374
+ inputs: [],
48375
+ outputs: [{ name: "", type: "address" }]
48376
+ }
48377
+ ];
48378
+ var STRC_ORACLE_ABI = [
48379
+ {
48380
+ name: "getPrice",
48381
+ type: "function",
48382
+ stateMutability: "view",
48383
+ inputs: [],
48384
+ outputs: [
48385
+ { name: "price", type: "uint256" },
48386
+ { name: "decimals", type: "uint8" }
48387
+ ]
48388
+ }
48389
+ ];
48390
+ var decodeStrcPrice = (cell) => {
48391
+ if (Array.isArray(cell) && cell.length >= 2) {
48392
+ return { price: BigInt(cell[0]), priceDecimals: Number(cell[1]) };
48393
+ }
48394
+ if (cell && typeof cell === "object") {
48395
+ const o = cell;
48396
+ if (o.price !== void 0 && o.decimals !== void 0) {
48397
+ return {
48398
+ price: BigInt(o.price),
48399
+ priceDecimals: Number(o.decimals)
48400
+ };
48401
+ }
48402
+ }
48403
+ throw new Error("sUSDat: unrecognised STRC oracle response shape");
48404
+ };
48405
+ var computeIncomeApr = async () => {
48406
+ const [vestingAmount, vestingPeriod, totalAssets, oracle] = await multicallRetryUniversal({
48407
+ chain: Chain.ETHEREUM_MAINNET,
48408
+ abi: VAULT_ABI,
48409
+ calls: [
48410
+ { address: SUSDAT, name: "vestingAmount", params: [] },
48411
+ { address: SUSDAT, name: "vestingPeriod", params: [] },
48412
+ { address: SUSDAT, name: "totalAssets", params: [] },
48413
+ { address: SUSDAT, name: "getStrcOracle", params: [] }
48414
+ ],
48415
+ allowFailure: false
48416
+ });
48417
+ if (vestingPeriod <= 0n || totalAssets <= 0n) {
48418
+ throw new Error("sUSDat: empty vault or zero vesting period");
48419
+ }
48420
+ const [oracleCell] = await multicallRetryUniversal({
48421
+ chain: Chain.ETHEREUM_MAINNET,
48422
+ abi: STRC_ORACLE_ABI,
48423
+ calls: [{ address: oracle, name: "getPrice", params: [] }],
48424
+ allowFailure: false
48425
+ });
48426
+ const { price: price2, priceDecimals } = decodeStrcPrice(oracleCell);
48427
+ if (price2 <= 0n) throw new Error("sUSDat: STRC oracle returned no price");
48428
+ const strcPriceUsd = Number(price2) / 10 ** Number(priceDecimals);
48429
+ const rewardUsd = Number(vestingAmount) / STRC_UNIT * strcPriceUsd;
48430
+ const cyclesPerYear = YEAR_SECONDS11 / Number(vestingPeriod);
48431
+ const tvlUsd = Number(totalAssets) / 1e6;
48432
+ const apr = rewardUsd * cyclesPerYear / tvlUsd * 100;
48433
+ if (!Number.isFinite(apr) || apr < 0) {
48434
+ throw new Error("sUSDat: implausible income APR");
48435
+ }
48436
+ return apr;
48437
+ };
48438
+ var saturnFetcher = {
48439
+ label: "SATURN_SUSDAT",
48440
+ fetch: async () => {
48441
+ const apr = await computeIncomeApr().catch(() => fetchDefiLlamaApy(DEFILLAMA_POOL)).catch(() => 0);
48442
+ return { [SUSDAT_KEY]: apr, [SUSDAT_BRIDGED_KEY]: apr };
48443
+ }
48444
+ };
48282
48445
  var thBill = "Theo Short Duration US Treasury Fund::THBILL";
48283
48446
  var thBillBare = "thBILL::thBILL";
48284
48447
  var THBILL_DEFILLAMA_POOL = "e17dab50-85b1-45e8-b4a5-b8ae7898c4a3";
@@ -48360,7 +48523,7 @@ var sthusdFetcher = {
48360
48523
  }
48361
48524
  };
48362
48525
  var RAY9 = 10n ** 27n;
48363
- var YEAR_SECONDS11 = 31536e3;
48526
+ var YEAR_SECONDS12 = 31536e3;
48364
48527
  var DSR_ABI = [
48365
48528
  {
48366
48529
  name: "dsr",
@@ -48388,7 +48551,7 @@ var SUSDD_GROUP_KEY = "Savings Usdd::sUSDD";
48388
48551
  var aprFromDsr = (dsr) => {
48389
48552
  if (dsr <= RAY9) return 0;
48390
48553
  const perSecond = Number(dsr - RAY9) / 1e27;
48391
- return perSecond * YEAR_SECONDS11 * 100;
48554
+ return perSecond * YEAR_SECONDS12 * 100;
48392
48555
  };
48393
48556
  var fetchChainDsr = async (chainId, pot) => {
48394
48557
  const [dsr] = await multicallRetryUniversal({
@@ -50565,6 +50728,102 @@ var VESPER_ENTRIES = {
50565
50728
  }
50566
50729
  ]
50567
50730
  };
50731
+ var VENUS_CORE_COMPTROLLER = "0xfd36e2c2a6789db23113685031d7f16329158384";
50732
+ var VENUS_RESILIENT_ORACLE = "0x6592b5de802159f3e74b2486b091d11a8256ab8a";
50733
+ var XVS = "0xcf6bb5389c92bdda8a3747ddb454cb7a64626c63";
50734
+ var hubBase = {
50735
+ reader: "venus-hub",
50736
+ brand: "Venus",
50737
+ // Share decimals are 24 — `decimalsOffset(6)` on an 18-decimal underlying.
50738
+ // Getting this wrong is silent: the exchange rate reads 1e-6 of par.
50739
+ decimals: 24,
50740
+ underlyingDecimals: 18,
50741
+ isRebasing: false,
50742
+ isMintable: true,
50743
+ withdrawalMode: "instant-capped",
50744
+ // Asserted, not assumed — every leg is collateral-backed with an on-chain
50745
+ // liquidation threshold, incl. the FRV one whose docs read like unsecured
50746
+ // credit. See the note above for the live ratios and the two qualifications
50747
+ // that live in the descriptions instead.
50748
+ solvency: "overcollateralized"
50749
+ // No `yieldFetcher`: the rate is the groups' TVL-weighted `spotAPYBps()`,
50750
+ // which the reader computes from the same block's `totalAssets()` reads.
50751
+ // There is nothing off-chain to fall back to — the Hub publishes no APY
50752
+ // view by design, `api.venus.io` has no Hub route, and DefiLlama carries
50753
+ // only `venus-core-pool` / `venus-flux` pools.
50754
+ };
50755
+ var EXIT_PROSE = "Exits are same-transaction and free, but capped at the liquid legs: anything sitting in a Fixed-Rate Vault is locked until it matures, typically a 30-day term.";
50756
+ var BACKING_PROSE = "Every leg is overcollateralised, though not all of it is Venus: Flux lends through third-party Fluid, and a Fixed-Rate Vault is one institutional borrower posting custodial or real-world-asset collateral rather than a pool.";
50757
+ var VENUS_HUB_ENTRIES = {
50758
+ [Chain.BNB_SMART_CHAIN_MAINNET]: [
50759
+ {
50760
+ ...hubBase,
50761
+ address: "0x18afdacf30f8671021dec4b78297e39d2fe87226",
50762
+ underlying: "0x55d398326f99059ff775485246999027b3197955",
50763
+ symbol: "vhUSDT",
50764
+ description: `Venus's USDT Liquidity Hub cascades one deposit across Venus Core lending, Fluid and Venus Fixed-Rate Vaults; the share price is the blend. ${EXIT_PROSE} ${BACKING_PROSE}`,
50765
+ venusHub: {
50766
+ yieldGroups: [
50767
+ "0xc9e6ced9589363f8dc5695be2c79ab4ddaecc94b",
50768
+ "0xe3df38e12e37ed80e1b3ccf2bdf84f9e1527ce14",
50769
+ "0x621ef38ce0c4e7060ff0bf3d609e3d46ec144be7"
50770
+ ],
50771
+ core: {
50772
+ yieldGroup: "0xc9e6ced9589363f8dc5695be2c79ab4ddaecc94b",
50773
+ vToken: "0xfd5840cd36d94d7229439859c0112a4185bc0255",
50774
+ comptroller: VENUS_CORE_COMPTROLLER,
50775
+ oracle: VENUS_RESILIENT_ORACLE,
50776
+ rewardToken: XVS
50777
+ }
50778
+ }
50779
+ },
50780
+ {
50781
+ ...hubBase,
50782
+ address: "0x9d2d9592cf8dfbf59107faab703d08494be14617",
50783
+ underlying: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
50784
+ symbol: "vhUSDC",
50785
+ description: `Venus's USDC Liquidity Hub cascades one deposit across Venus Core lending, Fluid and Venus Fixed-Rate Vaults; the share price is the blend. ${EXIT_PROSE} ${BACKING_PROSE}`,
50786
+ venusHub: {
50787
+ yieldGroups: [
50788
+ "0x299d9be7cefff91c68f13f267d525cfc18e965ef",
50789
+ "0xa65bb4b20542268b64cf08871a98d75342afe927",
50790
+ "0x438388847ee16850ab4f5b82dc7954c0d043b716"
50791
+ ],
50792
+ core: {
50793
+ yieldGroup: "0x299d9be7cefff91c68f13f267d525cfc18e965ef",
50794
+ vToken: "0xeca88125a5adbe82614ffc12d0db554e2e2867c8",
50795
+ comptroller: VENUS_CORE_COMPTROLLER,
50796
+ oracle: VENUS_RESILIENT_ORACLE,
50797
+ rewardToken: XVS
50798
+ }
50799
+ }
50800
+ },
50801
+ {
50802
+ ...hubBase,
50803
+ address: "0x0e5aa174d4f31b757a237eb1999de151596788b0",
50804
+ underlying: "0xce24439f2d9c6a2289f741120fe202248b666666",
50805
+ symbol: "vhU",
50806
+ description: `Venus's Liquidity Hub for U (United Stables) cascades one deposit across Venus Core lending, Fluid and Venus Fixed-Rate Vaults; the share price is the blend. ${EXIT_PROSE} ${BACKING_PROSE}`,
50807
+ venusHub: {
50808
+ yieldGroups: [
50809
+ "0x8a680f77a5367fa7cd33a02f51896cb1d55159c3",
50810
+ "0xe31b8851c3fa9b3dd39a04a2ed9493869a410616",
50811
+ "0x30908eddb9e94add7ac9944a0adda66d80b89143"
50812
+ ],
50813
+ core: {
50814
+ yieldGroup: "0x8a680f77a5367fa7cd33a02f51896cb1d55159c3",
50815
+ vToken: "0x3d5e269787d562b74acc55f18bd26c5d09fa245e",
50816
+ comptroller: VENUS_CORE_COMPTROLLER,
50817
+ oracle: VENUS_RESILIENT_ORACLE,
50818
+ rewardToken: XVS
50819
+ }
50820
+ }
50821
+ }
50822
+ ]
50823
+ };
50824
+ ({
50825
+ [Chain.BNB_SMART_CHAIN_MAINNET]: "0x6d93fd479f2d37445cfbe132412e316a0364acc2"
50826
+ });
50568
50827
 
50569
50828
  // src/vaults/savings/registry.ts
50570
50829
  var stUsdGroup = {
@@ -51255,6 +51514,68 @@ var SINGLE_CHAIN_ENTRIES = {
51255
51514
  yieldFetcher: apyxFetcher,
51256
51515
  yieldKey: APYUSD_KEY
51257
51516
  },
51517
+ // ---- Saturn (saturn.credit) — USDat / sUSDat ----------------------
51518
+ //
51519
+ // `USDat` is an M^0 extension token (a wrapped `$M` claim on tokenized
51520
+ // Treasuries) and `sUSDat` is the vault that stakes it into **Strategy's
51521
+ // STRC**, the variable-rate perpetual preferred stock, passing the
51522
+ // dividend through. Ethereum only: the same addresses on BNB (56) and
51523
+ // Monad (143) are bare LayerZero OFT mirrors whose entire 4626 surface
51524
+ // reverts, so staking round-trips to mainnet (the Cap / Apyx / Brix
51525
+ // precedent) — Monad nevertheless holds $31.1M of USDat.
51526
+ //
51527
+ // Registered `volatile`, and the reason is the whole assessment.
51528
+ // `totalAssets = usdatBalance + (strcBalance − unvested) × STRC price`,
51529
+ // and 96.5 % of NAV is STRC held outright — 723,435.68 STRC against just
51530
+ // $2.55M of actual USDat, with the implied $97.8893 matching Chainlink
51531
+ // STRC/USD to 0.01 %. So the solvency invariant is genuinely on-chain and
51532
+ // checkable (better than Spark V2 / Maple / Native, none of which can be),
51533
+ // and the share price nonetheless moves with a preferred stock. The income
51534
+ // leg is real and clockwork — 50 `transferInRewards` distributions over
51535
+ // 152.3 days at a 3.11-day cadence, 12.19 % APR, which is what DefiLlama's
51536
+ // 15.58 % and Saturn's "11 %+" both measure — while the vault's whole life
51537
+ // returned **+3.73 % with a −22.82 % max drawdown**. The rate published
51538
+ // here is the REALIZED one; see `saturnFetcher` for why there is no
51539
+ // DefiLlama fallback.
51540
+ //
51541
+ // NOT `secondaryMarketOnly`, and the fork test is why. USDat's own mint is
51542
+ // whitelist-gated (`isWhitelistEnabled()` true, `isAllowedToWrap(<random
51543
+ // EOA>)` false) — but that is a fact about the UNDERLYING, one level below
51544
+ // this row. STAKING is permissionless: `maxDeposit` is `uint256.max`,
51545
+ // `_deposit` consults no allowlist, and a fork deposit from an
51546
+ // unwhitelisted account mints at par. Marking the vault
51547
+ // `secondaryMarketOnly` made `/v1/actions/vaults/deposit` refuse a mint
51548
+ // that works, which is the Brix trap inverted — there a `maxDeposit` of
51549
+ // `uint.max` hid a gate, here a gate on a neighbouring contract hid an
51550
+ // open door. Acquiring the USDat is an ordinary swap (the Curve pool
51551
+ // round-trips 100k at −3 bps with USDat at $0.9997), i.e. a routing
51552
+ // question, not a property of this vault.
51553
+ //
51554
+ // Exit is `request-based` and there is exactly one protocol route:
51555
+ // `requestRedeem(shares, minUsdat)` escrows the shares and mints an
51556
+ // ERC-721 receipt, a `PROCESSOR_ROLE` batch sells STRC, then `claim`.
51557
+ // Measured latency ~24-25 h (Saturn documents 3-7 days) — pinned at 24 h
51558
+ // here and NOT read on-chain, because nothing on the queue publishes it:
51559
+ // it is an operator cadence, not a dial. Verified on-chain 2026-09-10.
51560
+ {
51561
+ reader: "saturn-vault",
51562
+ address: "0xd166337499e176bbc38a1fbd113ab144e5bd2df7",
51563
+ underlying: "0x23238f20b894f29041f48d88ee91131c395aaa71",
51564
+ // USDat
51565
+ symbol: "sUSDat",
51566
+ brand: "Saturn",
51567
+ solvency: "overcollateralized",
51568
+ description: "Saturn's staking vault: deposited USDat (a dollar backed by tokenized Treasuries) buys Strategy's STRC preferred stock, whose dividend is paid in every three days. Almost all the backing is that one stock, marked to market \u2014 so the share price falls when STRC does, and it has: a ~12% dividend over the first five months still returned only 3.7% annualised, after a 22.8% drawdown. Leaving is a request a Saturn operator settles in about a day by selling STRC, paying what that sale realises rather than the share price on the day you asked.",
51569
+ decimals: 18,
51570
+ underlyingDecimals: 6,
51571
+ isRebasing: false,
51572
+ isMintable: true,
51573
+ withdrawalMode: "request-based",
51574
+ withdrawalCooldownSeconds: 86400,
51575
+ withdrawQueue: "0x4bc9fec04f0f95e9b42a3ef18f3c96fb57923d2e",
51576
+ yieldFetcher: saturnFetcher,
51577
+ yieldKey: SUSDAT_KEY
51578
+ },
51258
51579
  // ---- Strata (docs.strata.markets) — senior/junior risk tranches ----
51259
51580
  //
51260
51581
  // Six CDO markets, twelve ERC-4626 tranche tokens, all Ethereum.
@@ -51263,7 +51584,8 @@ var SINGLE_CHAIN_ENTRIES = {
51263
51584
  // the senior earns a benchmark-floored rate (its `maxDeposit` is
51264
51585
  // coverage-cap-gated), the junior takes the residual — levered
51265
51586
  // upside AND first-loss capital (jrUSDat marked down to ~0.36
51266
- // absorbing the 2026-07 USDat depeg; junior redemptions pause when
51587
+ // absorbing the 2026-06/07 sUSDat drawdown the SATURN VAULT fell
51588
+ // 22.8 %, USDat itself never lost its peg; junior redemptions pause when
51267
51589
  // senior coverage drops below the market's minimum). Exits are
51268
51590
  // two-legged and both escrow through the market's cooldown
51269
51591
  // contracts, claimed via `finalize`: redeeming into the collateral
@@ -51427,7 +51749,7 @@ var SINGLE_CHAIN_ENTRIES = {
51427
51749
  symbol: "srUSDat",
51428
51750
  solvency: "tranched-senior",
51429
51751
  brand: "Strata",
51430
- description: "Strata's senior tranche over Saturn USDat (a Strategy-preferred-stock-backed dollar): fixed yield at 65% of the STRC dividend rate, junior-protected \u2014 the senior held its rate straight through the 2026-07 USDat depeg that the junior absorbed. Exits claim through cooldown contracts (the sUSDat leg effectively instant) minus a 0\u20135 bps fee.",
51752
+ description: "Strata's senior tranche over Saturn USDat (a Strategy-preferred-stock-backed dollar): fixed yield at 65% of the STRC dividend rate, junior-protected \u2014 the senior held its rate straight through the 2026-06/07 sUSDat drawdown that the junior absorbed. Exits claim through cooldown contracts (the sUSDat leg effectively instant) minus a 0\u20135 bps fee.",
51431
51753
  decimals: 18,
51432
51754
  underlyingDecimals: 6,
51433
51755
  isRebasing: false,
@@ -51444,7 +51766,7 @@ var SINGLE_CHAIN_ENTRIES = {
51444
51766
  symbol: "jrUSDat",
51445
51767
  solvency: "tranched-junior",
51446
51768
  brand: "Strata",
51447
- description: "Strata's junior tranche over Saturn USDat \u2014 first-loss capital that proved it: the 2026-07 USDat collateral depeg marked jrUSDat down to ~0.36 while the senior stayed whole, and its trailing APR is depeg-recovery-inflated. Exits claim through cooldown contracts and pause while senior coverage is below the market minimum.",
51769
+ description: "Strata's junior tranche over Saturn USDat \u2014 first-loss capital that proved it: the 2026-06/07 drawdown in the collateral \u2014 Saturn's sUSDat vault, which is marked to Strategy's STRC preferred stock and fell 22.8%; USDat itself held its peg \u2014 marked jrUSDat down to ~0.36 while the senior stayed whole, and its trailing APR is recovery-inflated. Exits claim through cooldown contracts and pause while senior coverage is below the market minimum.",
51448
51770
  decimals: 18,
51449
51771
  underlyingDecimals: 6,
51450
51772
  isRebasing: false,
@@ -52441,6 +52763,10 @@ var SAVINGS_REGISTRY = (() => {
52441
52763
  if (!out[chainId]) out[chainId] = [];
52442
52764
  out[chainId].push(...entries);
52443
52765
  }
52766
+ for (const [chainId, entries] of Object.entries(VENUS_HUB_ENTRIES)) {
52767
+ if (!out[chainId]) out[chainId] = [];
52768
+ out[chainId].push(...entries);
52769
+ }
52444
52770
  return out;
52445
52771
  })();
52446
52772
  var savingsBalanceKind = (chainId, address) => {
@@ -53283,6 +53609,10 @@ var LENDING_ONLY_FETCHERS = [
53283
53609
  // by reference, so removing it here changes nothing at runtime.
53284
53610
  nestFetcher,
53285
53611
  accountableFetcher,
53612
+ // slisBnbFetcher is NOT here (LST-wired); lisAster has no vault row — it
53613
+ // is a lock receipt with no rate and no exit — so its reward stream is
53614
+ // lending-only, surfaced for the Moolah lisAster/ASTER collateral join.
53615
+ lisAsterFetcher,
53286
53616
  upshiftFetcher,
53287
53617
  // Every endorsed Yearn V3 vault on every Yearn chain (Katana included —
53288
53618
  // it superseded the Katana-only fetcher, which double-counted).
@@ -64074,9 +64404,24 @@ var queuedRoute = (i) => ({
64074
64404
  kind: "queued",
64075
64405
  label: asyncLabel(i.withdrawalCooldownSeconds),
64076
64406
  settlement: "async",
64077
- waitSeconds: i.withdrawalCooldownSeconds
64407
+ waitSeconds: i.withdrawalCooldownSeconds,
64408
+ ...i.exitMinAmount !== void 0 ? {
64409
+ minAmount: i.exitMinAmount,
64410
+ minAmountFormatted: i.exitMinAmountFormatted
64411
+ } : {}
64412
+ });
64413
+ var marketRoute = () => ({
64414
+ id: "market",
64415
+ kind: "market",
64416
+ label: "Sell on the market",
64417
+ settlement: "market",
64418
+ description: "The protocol's own mint and redeem are permissioned, so for a holder without that permission this is the route: sell the share token at whatever the book bids, with price impact that grows with size. It fills at the MARKET price, which is not the row's `exchangeRate` \u2014 that stays the NAV \u2014 so the leg must be built with a slippage bound."
64078
64419
  });
64079
64420
  var deriveExitRoutes = (i) => {
64421
+ const routes2 = deriveProtocolExitRoutes(i);
64422
+ return i.secondaryMarketOnly ? [...routes2, marketRoute()] : routes2;
64423
+ };
64424
+ var deriveProtocolExitRoutes = (i) => {
64080
64425
  switch (i.withdrawalMode) {
64081
64426
  // The instant leg pays the fee; the queue pays at par. That is the
64082
64427
  // convention `SavingsVault.withdrawFeeBps` already documents — and
@@ -68481,6 +68826,166 @@ var YieldBasisAmmReadAbi = [
68481
68826
  }
68482
68827
  ];
68483
68828
 
68829
+ // src/vaults/savings/abis/venusHub.ts
68830
+ var VenusHubReadAbi = [
68831
+ {
68832
+ name: "maxDeposit",
68833
+ type: "function",
68834
+ stateMutability: "view",
68835
+ inputs: [{ type: "address" }],
68836
+ outputs: [{ type: "uint256" }]
68837
+ },
68838
+ {
68839
+ name: "hubPaused",
68840
+ type: "function",
68841
+ stateMutability: "view",
68842
+ inputs: [],
68843
+ outputs: [{ type: "bool" }]
68844
+ },
68845
+ {
68846
+ name: "maxWithdrawalSize",
68847
+ type: "function",
68848
+ stateMutability: "view",
68849
+ inputs: [],
68850
+ outputs: [{ type: "uint256" }]
68851
+ },
68852
+ {
68853
+ name: "redeemFeeBps",
68854
+ type: "function",
68855
+ stateMutability: "view",
68856
+ inputs: [],
68857
+ outputs: [{ type: "uint16" }]
68858
+ },
68859
+ {
68860
+ name: "registeredYieldGroups",
68861
+ type: "function",
68862
+ stateMutability: "view",
68863
+ inputs: [],
68864
+ outputs: [{ type: "address[]" }]
68865
+ }
68866
+ ];
68867
+ var VenusYieldGroupReadAbi = [
68868
+ {
68869
+ name: "maxWithdraw",
68870
+ type: "function",
68871
+ stateMutability: "view",
68872
+ inputs: [],
68873
+ outputs: [{ type: "uint256" }]
68874
+ },
68875
+ {
68876
+ name: "totalAssets",
68877
+ type: "function",
68878
+ stateMutability: "view",
68879
+ inputs: [],
68880
+ outputs: [{ type: "uint256" }]
68881
+ },
68882
+ {
68883
+ name: "spotAPYBps",
68884
+ type: "function",
68885
+ stateMutability: "view",
68886
+ inputs: [],
68887
+ outputs: [{ type: "uint64" }]
68888
+ },
68889
+ {
68890
+ name: "blocksPerYear",
68891
+ type: "function",
68892
+ stateMutability: "view",
68893
+ inputs: [],
68894
+ outputs: [{ type: "uint256" }]
68895
+ },
68896
+ {
68897
+ name: "resources",
68898
+ type: "function",
68899
+ stateMutability: "view",
68900
+ inputs: [],
68901
+ outputs: [{ type: "address[]" }]
68902
+ }
68903
+ ];
68904
+ var VenusComptrollerRewardsAbi = [
68905
+ {
68906
+ name: "venusSupplySpeeds",
68907
+ type: "function",
68908
+ stateMutability: "view",
68909
+ inputs: [{ type: "address" }],
68910
+ outputs: [{ type: "uint256" }]
68911
+ },
68912
+ {
68913
+ name: "oracle",
68914
+ type: "function",
68915
+ stateMutability: "view",
68916
+ inputs: [],
68917
+ outputs: [{ type: "address" }]
68918
+ }
68919
+ ];
68920
+ var VenusResilientOracleAbi = [
68921
+ {
68922
+ name: "getPrice",
68923
+ type: "function",
68924
+ stateMutability: "view",
68925
+ inputs: [{ type: "address" }],
68926
+ outputs: [{ type: "uint256" }]
68927
+ },
68928
+ {
68929
+ name: "getUnderlyingPrice",
68930
+ type: "function",
68931
+ stateMutability: "view",
68932
+ inputs: [{ type: "address" }],
68933
+ outputs: [{ type: "uint256" }]
68934
+ }
68935
+ ];
68936
+ var VTokenSizeReadAbi = [
68937
+ {
68938
+ name: "totalSupply",
68939
+ type: "function",
68940
+ stateMutability: "view",
68941
+ inputs: [],
68942
+ outputs: [{ type: "uint256" }]
68943
+ },
68944
+ {
68945
+ name: "exchangeRateStored",
68946
+ type: "function",
68947
+ stateMutability: "view",
68948
+ inputs: [],
68949
+ outputs: [{ type: "uint256" }]
68950
+ },
68951
+ {
68952
+ name: "comptroller",
68953
+ type: "function",
68954
+ stateMutability: "view",
68955
+ inputs: [],
68956
+ outputs: [{ type: "address" }]
68957
+ }
68958
+ ];
68959
+
68960
+ // src/vaults/savings/abis/saturn.ts
68961
+ var SaturnMinWithdrawalAbi = [
68962
+ {
68963
+ name: "MIN_WITHDRAWAL",
68964
+ type: "function",
68965
+ stateMutability: "view",
68966
+ inputs: [],
68967
+ outputs: [{ name: "", type: "uint256" }]
68968
+ }
68969
+ ];
68970
+ var SaturnDepositFeeAbi = [
68971
+ {
68972
+ name: "depositFeeBps",
68973
+ type: "function",
68974
+ stateMutability: "view",
68975
+ inputs: [],
68976
+ outputs: [{ name: "", type: "uint256" }]
68977
+ }
68978
+ ];
68979
+ var SaturnPreviewDepositAbi = [
68980
+ {
68981
+ name: "previewDeposit",
68982
+ type: "function",
68983
+ stateMutability: "view",
68984
+ inputs: [{ name: "assets", type: "uint256" }],
68985
+ outputs: [{ name: "", type: "uint256" }]
68986
+ }
68987
+ ];
68988
+
68484
68989
  // src/vaults/savings/readers/erc4626Idle.ts
68485
68990
  var readerErc4626Idle = (entry) => {
68486
68991
  const shareUnit = 10n ** BigInt(entry.decimals);
@@ -68913,6 +69418,208 @@ var readerNativeWnlp = (entry) => {
68913
69418
  };
68914
69419
  };
68915
69420
 
69421
+ // src/vaults/savings/readers/saturn.ts
69422
+ var readerSaturnVault = (entry) => {
69423
+ const shareUnit = 10n ** BigInt(entry.decimals);
69424
+ const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
69425
+ return {
69426
+ calls: [
69427
+ { address: entry.address, name: "totalAssets", params: [] },
69428
+ { address: entry.address, name: "totalSupply", params: [] },
69429
+ { address: entry.address, name: "convertToAssets", params: [shareUnit] },
69430
+ {
69431
+ address: entry.address,
69432
+ name: "previewDeposit",
69433
+ params: [underlyingUnit]
69434
+ },
69435
+ { address: entry.address, name: "depositFeeBps", params: [] },
69436
+ { address: entry.address, name: "MIN_WITHDRAWAL", params: [] }
69437
+ ],
69438
+ abis: [
69439
+ Erc4626ReadAbi2,
69440
+ TotalSupplyAbi2,
69441
+ Erc4626ReadAbi2,
69442
+ SaturnPreviewDepositAbi,
69443
+ SaturnDepositFeeAbi,
69444
+ SaturnMinWithdrawalAbi
69445
+ ],
69446
+ parse: ([assets, supply, rate, previewShares, feeBps, minWithdrawal]) => {
69447
+ const totalAssets = toBigInt15(assets);
69448
+ const totalSupply = toBigInt15(supply);
69449
+ const convertToAssetsRaw = toBigInt15(rate);
69450
+ if (totalAssets === void 0 || totalSupply === void 0 || convertToAssetsRaw === void 0) {
69451
+ return void 0;
69452
+ }
69453
+ const entryShares = toBigInt15(previewShares);
69454
+ const depositFeeBps = toBigInt15(feeBps);
69455
+ const exitMinAmount = toBigInt15(minWithdrawal);
69456
+ return {
69457
+ totalAssets,
69458
+ totalSupply,
69459
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit,
69460
+ // Shares minted for ONE underlying unit, net of the fee. Equals the
69461
+ // derived `1/exchangeRate` while the dial is 0, and diverges the
69462
+ // moment it is not.
69463
+ convertToShares: entryShares,
69464
+ depositFeeBps: depositFeeBps !== void 0 ? Number(depositFeeBps) : void 0,
69465
+ exitMinAmount
69466
+ };
69467
+ }
69468
+ };
69469
+ };
69470
+
69471
+ // src/vaults/savings/readers/venusHub.ts
69472
+ var NEUTRAL_PROBE2 = "0x000000000000000000000000000000000000dead";
69473
+ var BPS_TO_PCT = 100;
69474
+ var readerVenusHub = (entry) => {
69475
+ const shareUnit = 10n ** BigInt(entry.decimals);
69476
+ const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
69477
+ const cfg = entry.venusHub;
69478
+ const groups = cfg?.yieldGroups ?? [];
69479
+ const coreGroup = cfg?.core?.yieldGroup;
69480
+ const calls = [
69481
+ { address: entry.address, name: "totalAssets", params: [] },
69482
+ { address: entry.address, name: "totalSupply", params: [] },
69483
+ { address: entry.address, name: "convertToAssets", params: [shareUnit] },
69484
+ { address: entry.address, name: "maxDeposit", params: [NEUTRAL_PROBE2] },
69485
+ { address: entry.address, name: "hubPaused", params: [] },
69486
+ { address: entry.address, name: "maxWithdrawalSize", params: [] },
69487
+ { address: entry.address, name: "redeemFeeBps", params: [] },
69488
+ { address: entry.underlying, name: "balanceOf", params: [entry.address] }
69489
+ ];
69490
+ const abis = [
69491
+ Erc4626ReadAbi2,
69492
+ TotalSupplyAbi2,
69493
+ Erc4626ReadAbi2,
69494
+ VenusHubReadAbi,
69495
+ VenusHubReadAbi,
69496
+ VenusHubReadAbi,
69497
+ VenusHubReadAbi,
69498
+ BalanceOfAbi
69499
+ ];
69500
+ for (const group of groups) {
69501
+ calls.push({ address: group, name: "maxWithdraw", params: [] });
69502
+ calls.push({ address: group, name: "totalAssets", params: [] });
69503
+ calls.push({ address: group, name: "spotAPYBps", params: [] });
69504
+ abis.push(
69505
+ VenusYieldGroupReadAbi,
69506
+ VenusYieldGroupReadAbi,
69507
+ VenusYieldGroupReadAbi
69508
+ );
69509
+ }
69510
+ const emissionCallCount = cfg?.core ? 6 : 0;
69511
+ if (cfg?.core) {
69512
+ const { yieldGroup, vToken, comptroller, oracle, rewardToken } = cfg.core;
69513
+ calls.push({ address: yieldGroup, name: "blocksPerYear", params: [] });
69514
+ calls.push({
69515
+ address: comptroller,
69516
+ name: "venusSupplySpeeds",
69517
+ params: [vToken]
69518
+ });
69519
+ calls.push({ address: oracle, name: "getPrice", params: [rewardToken] });
69520
+ calls.push({
69521
+ address: oracle,
69522
+ name: "getUnderlyingPrice",
69523
+ params: [vToken]
69524
+ });
69525
+ calls.push({ address: vToken, name: "totalSupply", params: [] });
69526
+ calls.push({ address: vToken, name: "exchangeRateStored", params: [] });
69527
+ abis.push(
69528
+ VenusYieldGroupReadAbi,
69529
+ VenusComptrollerRewardsAbi,
69530
+ VenusResilientOracleAbi,
69531
+ VenusResilientOracleAbi,
69532
+ VTokenSizeReadAbi,
69533
+ VTokenSizeReadAbi
69534
+ );
69535
+ }
69536
+ return {
69537
+ calls,
69538
+ abis,
69539
+ parse: (slice2) => {
69540
+ const totalAssets = toBigInt15(slice2[0]);
69541
+ const totalSupply = toBigInt15(slice2[1]);
69542
+ const convertToAssetsRaw = toBigInt15(slice2[2]);
69543
+ if (totalAssets === void 0 || totalSupply === void 0 || convertToAssetsRaw === void 0) {
69544
+ return void 0;
69545
+ }
69546
+ const paused = slice2[4] === true;
69547
+ const maxWithdrawalSize = toBigInt15(slice2[5]);
69548
+ const redeemFeeBps = toBigInt15(slice2[6]);
69549
+ const idle = toBigInt15(slice2[7]);
69550
+ const depositCapacity = toBigInt15(slice2[3]);
69551
+ let groupLiquid = 0n;
69552
+ let weightedBps = 0n;
69553
+ let rateWeight = 0n;
69554
+ let coreGroupAssets = 0n;
69555
+ let groupsOk = groups.length > 0;
69556
+ for (let i = 0; i < groups.length; i++) {
69557
+ const base = 8 + i * 3;
69558
+ const liquid = toBigInt15(slice2[base]);
69559
+ const assets = toBigInt15(slice2[base + 1]);
69560
+ const apyBps = toBigInt15(slice2[base + 2]);
69561
+ if (liquid === void 0 || assets === void 0 || apyBps === void 0) {
69562
+ groupsOk = false;
69563
+ continue;
69564
+ }
69565
+ if (groups[i] === coreGroup) coreGroupAssets = assets;
69566
+ groupLiquid += liquid;
69567
+ weightedBps += apyBps * assets;
69568
+ rateWeight += assets;
69569
+ }
69570
+ let instantRedeemCapacity;
69571
+ if (groupsOk && idle !== void 0) {
69572
+ const aggregate = groupLiquid + idle;
69573
+ instantRedeemCapacity = maxWithdrawalSize !== void 0 && maxWithdrawalSize < aggregate ? maxWithdrawalSize : aggregate;
69574
+ }
69575
+ const supplyRate = rateWeight > 0n ? Number(weightedBps * 1000000n / rateWeight) / 1e6 / BPS_TO_PCT : void 0;
69576
+ return {
69577
+ totalAssets,
69578
+ totalSupply,
69579
+ exchangeRate: convertToAssetsRaw * ONE_E1814 / underlyingUnit,
69580
+ ...supplyRate !== void 0 ? { supplyRate } : {},
69581
+ ...instantRedeemCapacity !== void 0 ? {
69582
+ instantRedeemCapacity: paused ? 0n : instantRedeemCapacity,
69583
+ instantRedeemEnabled: !paused,
69584
+ // Retained in the vault rather than paid out, and 0 on every
69585
+ // live Hub — but it IS deducted from a redeemer's payout, so
69586
+ // it belongs on the same field every other two-legged row uses.
69587
+ withdrawFeeBps: redeemFeeBps !== void 0 ? Number(redeemFeeBps) : 0
69588
+ } : {},
69589
+ ...depositCapacity !== void 0 ? { depositCapacity } : {},
69590
+ ...cfg?.core ? {
69591
+ strandedRewardsRate: parseStrandedRewards(
69592
+ slice2,
69593
+ calls.length - emissionCallCount,
69594
+ coreGroupAssets,
69595
+ totalAssets
69596
+ )
69597
+ } : {}
69598
+ };
69599
+ }
69600
+ };
69601
+ };
69602
+ var parseStrandedRewards = (slice2, base, coreGroupAssets, hubTotalAssets) => {
69603
+ const blocksPerYear = toBigInt15(slice2[base]);
69604
+ const supplySpeed = toBigInt15(slice2[base + 1]);
69605
+ const rewardPrice = toBigInt15(slice2[base + 2]);
69606
+ const underlyingPrice = toBigInt15(slice2[base + 3]);
69607
+ const vTokenSupply = toBigInt15(slice2[base + 4]);
69608
+ const exchangeRateStored = toBigInt15(slice2[base + 5]);
69609
+ if (blocksPerYear === void 0 || supplySpeed === void 0 || rewardPrice === void 0 || underlyingPrice === void 0 || vTokenSupply === void 0 || exchangeRateStored === void 0) {
69610
+ return void 0;
69611
+ }
69612
+ if (supplySpeed === 0n) return 0;
69613
+ const rewardsPerYearUsd = supplySpeed * blocksPerYear * rewardPrice;
69614
+ const suppliedRaw = vTokenSupply * exchangeRateStored / ONE_E1814;
69615
+ const suppliedUsd = suppliedRaw * underlyingPrice;
69616
+ if (suppliedUsd === 0n || hubTotalAssets === 0n) return void 0;
69617
+ const marketAprPct = Number(rewardsPerYearUsd * 1000000000n / suppliedUsd) / 1e9;
69618
+ const hubShare = Number(coreGroupAssets * 1000000000n / hubTotalAssets) / 1e9;
69619
+ const scale3 = hubShare > 1 ? 1 : hubShare;
69620
+ return marketAprPct * scale3 * 100;
69621
+ };
69622
+
68916
69623
  // src/vaults/savings/readers/vesperPool.ts
68917
69624
  var readerVesperPool = (entry) => {
68918
69625
  const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
@@ -69046,6 +69753,10 @@ var buildReader2 = (entry) => {
69046
69753
  return readerWrenNav(entry);
69047
69754
  case "vesper-pool":
69048
69755
  return readerVesperPool(entry);
69756
+ case "venus-hub":
69757
+ return readerVenusHub(entry);
69758
+ case "saturn-vault":
69759
+ return readerSaturnVault(entry);
69049
69760
  case "erc4626-cooldown":
69050
69761
  return readerErc4626Cooldown(entry);
69051
69762
  case "erc4626-idle":
@@ -69098,7 +69809,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69098
69809
  const underlyingLc = entry.underlying.toLowerCase();
69099
69810
  const asset = tokenList[underlyingLc];
69100
69811
  const priceUsd = prices[underlyingLc];
69101
- const supplyRate = aprByAddress[addressLc] ?? 0;
69812
+ const supplyRate = state.supplyRate ?? aprByAddress[addressLc] ?? 0;
69102
69813
  const rewardsRate = 0;
69103
69814
  const depositRate = supplyRate + rewardsRate;
69104
69815
  const shareDec = entry.decimals;
@@ -69120,7 +69831,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69120
69831
  Number(liquidityAmount * 1000000n / state.totalAssets) / 1e6
69121
69832
  ) : 1;
69122
69833
  const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1815;
69123
- const convertToShares = state.exchangeRate > 0n ? ONE_E1815 * shareUnit / state.exchangeRate : 0n;
69834
+ const convertToShares = state.convertToShares ?? (state.exchangeRate > 0n ? ONE_E1815 * shareUnit / state.exchangeRate : 0n);
69124
69835
  const depositCapacity = state.depositCapacity?.toString();
69125
69836
  const depositCapacityFormatted = state.depositCapacity !== void 0 ? Number(state.depositCapacity) / 10 ** underlyingDec : void 0;
69126
69837
  const depositCapacityUsd = depositCapacityFormatted !== void 0 && priceUsd !== void 0 ? depositCapacityFormatted * priceUsd : void 0;
@@ -69156,6 +69867,9 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69156
69867
  supplyRate,
69157
69868
  rewardsRate,
69158
69869
  depositRate,
69870
+ // NOT part of `depositRate` — it is the incentive the vault's position
69871
+ // earns and the depositor does not. See the field's docstring.
69872
+ strandedRewardsRate: state.strandedRewardsRate,
69159
69873
  // Opt-IN, not opt-out: a new bespoke reader exists precisely
69160
69874
  // because its token is not a conforming vault, so the default for
69161
69875
  // an unlisted reader must be `false`. `erc4626-idle`,
@@ -69164,7 +69878,11 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69164
69878
  // limit view / the exit lock), so they count; Native's wNLP and Re's
69165
69879
  // NAV-oracle tokens revert on
69166
69880
  // `asset()`/`totalAssets()`/`convertToAssets()` and do not.
69167
- isErc4626: entry.reader === void 0 || entry.reader === "erc4626" || entry.reader === "erc4626-cooldown" || entry.reader === "erc4626-idle" || entry.reader === "erc4626-withdraw-limit" || // hbfUSD / pbfUSD ARE conforming 4626 the bespoke reader exists for
69881
+ isErc4626: entry.reader === void 0 || entry.reader === "erc4626" || entry.reader === "erc4626-cooldown" || entry.reader === "erc4626-idle" || entry.reader === "erc4626-withdraw-limit" || // Venus's Liquidity Hub IS a conforming 4626 on every leg
69882
+ // (`deposit(assets, receiver)`, `redeem(shares, receiver, owner)`);
69883
+ // the bespoke reader exists for the FRV lock, the rate blend and the
69884
+ // emission read, not because the standard surface is missing.
69885
+ entry.reader === "venus-hub" || // hbfUSD / pbfUSD ARE conforming 4626 — the bespoke reader exists for
69168
69886
  // the epoch ledger and the share-denominated supply cap, not because
69169
69887
  // the standard surface is missing. bfBTC (`bitfi-bfbtc`) is the
69170
69888
  // opposite and correctly falls through to `false`.
@@ -69180,6 +69898,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69180
69898
  // queue window is per-asset and governance-mutable.
69181
69899
  withdrawalCooldownSeconds: state.withdrawalCooldownSeconds ?? entry.withdrawalCooldownSeconds,
69182
69900
  withdrawFeeBps: state.withdrawFeeBps,
69901
+ depositFeeBps: state.depositFeeBps,
69183
69902
  // Term-sheet inputs that no reader can derive — see the registry's
69184
69903
  // docstrings. Passed through verbatim so the sheet can stop hardcoding
69185
69904
  // "compounds per second" and "needs an approval" for every vault.
@@ -69204,7 +69923,13 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
69204
69923
  withdrawalCooldownSeconds: state.withdrawalCooldownSeconds ?? entry.withdrawalCooldownSeconds,
69205
69924
  liquidity: liquidityRaw,
69206
69925
  liquidityFormatted,
69207
- liquidityUsd
69926
+ liquidityUsd,
69927
+ // The floor that decides whether a single-route exit is reachable.
69928
+ exitMinAmount: state.exitMinAmount?.toString(),
69929
+ exitMinAmountFormatted: state.exitMinAmount !== void 0 ? Number(state.exitMinAmount) / 10 ** underlyingDec : void 0,
69930
+ // Adds the `market` leg — the only route a holder without the
69931
+ // protocol's mint/redeem permission actually has.
69932
+ secondaryMarketOnly: entry.secondaryMarketOnly
69208
69933
  }),
69209
69934
  resolveSelfOnly(chainId, entry.address)
69210
69935
  ),
@@ -70259,8 +70984,20 @@ var VOLATILE_VAULT_OVERRIDES = /* @__PURE__ */ new Set([
70259
70984
  // yb-cbBTC
70260
70985
  "1-0x771f7290428d830ecd41e980745c327e507823ec",
70261
70986
  // yb-tBTC
70262
- "1-0x2b9c9f3bdceb5d8e36a4704f08a78fca53343cea"
70987
+ "1-0x2b9c9f3bdceb5d8e36a4704f08a78fca53343cea",
70263
70988
  // yb-WETH
70989
+ // Saturn sUSDat — a savings vault whose assets are 96.5 % Strategy's STRC
70990
+ // preferred stock, held outright and MARKED to an oracle
70991
+ // (`totalAssets = usdatBalance + (strcBalance − unvested) × price`). Unlike
70992
+ // Yield Basis this one has a real, clockwork income leg — 50
70993
+ // `transferInRewards` distributions on a 3.11-day cadence, 12.19 % APR
70994
+ // measured over 152 days, which is what DefiLlama's 15.58 % reports — and it
70995
+ // is still not a yield-bearing row, because the mark moves further than the
70996
+ // coupon does. Over the vault's whole life: +3.73 % realized APR, −22.82 %
70997
+ // max drawdown (1.00954 on 2026-05-15 → 0.77915 on 2026-06-28), 33 % of
70998
+ // two-day samples negative. See SATURN.md.
70999
+ "1-0xd166337499e176bbc38a1fbd113ab144e5bd2df7"
71000
+ // sUSDat
70264
71001
  ]);
70265
71002
  var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
70266
71003
  // USD majors
@@ -70356,6 +71093,12 @@ var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
70356
71093
  "USG",
70357
71094
  "BOB"
70358
71095
  ]);
71096
+ var STABLECOIN_UNDERLYING_OVERRIDES = /* @__PURE__ */ new Set([
71097
+ // United Stables (`U`) — a USD stablecoin on BNB Chain, a Venus Core market
71098
+ // and the underlying of the vhU Liquidity Hub. Priced at $0.999 by Venus's
71099
+ // own ResilientOracle.
71100
+ "56-0xce24439f2d9c6a2289f741120fe202248b666666"
71101
+ ]);
70359
71102
  var normalizeSymbol = (s) => (s ?? "").trim().toUpperCase();
70360
71103
  var isStablecoinSymbol = (symbol) => {
70361
71104
  const s = normalizeSymbol(symbol);
@@ -70366,7 +71109,8 @@ var isStablecoinSymbol = (symbol) => {
70366
71109
  var classifyVault = (input) => {
70367
71110
  const key3 = `${input.chainId}-${input.address.toLowerCase()}`;
70368
71111
  const yieldProfile2 = VOLATILE_VAULT_OVERRIDES.has(key3) || VOLATILE_PROVIDERS.has(input.provider) ? "volatile" : "yield-bearing";
70369
- const denomination2 = isStablecoinSymbol(input.underlyingSymbol) ? "stable" : "volatile";
71112
+ const underlyingKey = input.underlyingAddress !== void 0 ? `${input.chainId}-${input.underlyingAddress.toLowerCase()}` : void 0;
71113
+ const denomination2 = underlyingKey !== void 0 && STABLECOIN_UNDERLYING_OVERRIDES.has(underlyingKey) || isStablecoinSymbol(input.underlyingSymbol) ? "stable" : "volatile";
70370
71114
  return { yieldProfile: yieldProfile2, denomination: denomination2 };
70371
71115
  };
70372
71116
  var stampVaultClassification = (data, chainId, tokenList = {}) => {
@@ -70387,7 +71131,8 @@ var stampVaultClassification = (data, chainId, tokenList = {}) => {
70387
71131
  provider,
70388
71132
  chainId,
70389
71133
  address: v.address,
70390
- underlyingSymbol: v.asset?.symbol ?? v.symbol
71134
+ underlyingSymbol: v.asset?.symbol ?? v.symbol,
71135
+ underlyingAddress: v.underlying
70391
71136
  });
70392
71137
  v.yieldProfile = c.yieldProfile;
70393
71138
  v.denomination = c.denomination;
@@ -72118,7 +72863,7 @@ var readVaultSharePrices = async (chainId, addresses, multicallRetry) => {
72118
72863
  };
72119
72864
 
72120
72865
  // src/vaults/yield/annualize.ts
72121
- var YEAR_SECONDS12 = 365 * 24 * 60 * 60;
72866
+ var YEAR_SECONDS13 = 365 * 24 * 60 * 60;
72122
72867
  var SCALE = 10n ** 18n;
72123
72868
  var appendSnapshot = (points, snap, options) => {
72124
72869
  const maxPoints = options?.maxPoints ?? 90;
@@ -72147,7 +72892,7 @@ var computeVaultApr = (points, options) => {
72147
72892
  if (pThen === 0n) return void 0;
72148
72893
  const ratioScaled = BigInt(now.p) * SCALE / pThen;
72149
72894
  const ratio = Number(ratioScaled) / 1e18;
72150
- const apr = (ratio - 1) * (YEAR_SECONDS12 / windowSeconds);
72895
+ const apr = (ratio - 1) * (YEAR_SECONDS13 / windowSeconds);
72151
72896
  return {
72152
72897
  apr,
72153
72898
  sharePriceNow: now.p,