@1delta/margin-fetcher 5.0.13 → 5.0.14

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
@@ -24352,6 +24352,23 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
24352
24352
  // --- LlamaLend descriptor (consumed by the calldata builders,
24353
24353
  // the leverage sizer and worker-api resolvers) ---
24354
24354
  llamalend: {
24355
+ /**
24356
+ * The market's LLAMMA, and the ONLY readable oracle for it:
24357
+ * `price_oracle()` lives here, quoted in the BORROWED token.
24358
+ *
24359
+ * Carried on the descriptor — not only under `addresses` — because
24360
+ * this object is what consumers persist verbatim (yield-tracer
24361
+ * serialises it into the `llamalend` column of the shared isolated-
24362
+ * market table) and the oracle-price path resolves the AMM from it.
24363
+ * Omitting it does not fail loudly: the reader finds `undefined`,
24364
+ * skips the market, and the lender ends up with NO prices at all
24365
+ * while every row still looks present and correct.
24366
+ *
24367
+ * Do not "clean this up" as a duplicate of `addresses.amm` — the two
24368
+ * are read by different consumers, and only this one survives into
24369
+ * the descriptor column.
24370
+ */
24371
+ amm: market.amm,
24355
24372
  /** 1 = `oneway` (v1), 2 = `oneway-v2`. Branch every encoder on this. */
24356
24373
  version: market.version,
24357
24374
  /** FAIL CLOSED — an unknown market is not delegatable. */
@@ -42547,6 +42564,32 @@ var sreusdSavingsFetcher = {
42547
42564
  return { [SREUSD_KEY]: apr, [SREUSD_GROUP_KEY]: apr };
42548
42565
  }
42549
42566
  };
42567
+
42568
+ // src/yields/intrinsic/fetchers/fxProtocol.ts
42569
+ var ALADDIN_APY_URL = "https://api.aladdin.club/api1/concentrator_aToken_tvl_apy";
42570
+ var FXSAVE_DEFILLAMA_POOL = "ee0b7069-f8f3-4aa2-a415-728f13e6cc3d";
42571
+ var FXSAVE_KEY = "FXSAVE";
42572
+ var FXSAVE_GROUP_KEY = "f(x) USD Saving::fxSAVE";
42573
+ var fetchAladdinApyPercent = async () => {
42574
+ const res = await fetch(ALADDIN_APY_URL, {
42575
+ headers: { accept: "application/json" },
42576
+ signal: AbortSignal.timeout(8e3)
42577
+ });
42578
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
42579
+ const apy = Number((await res.json())?.data?.fxSave?.apy);
42580
+ if (Number.isFinite(apy) && apy > 0) return apy;
42581
+ throw new Error("apy missing");
42582
+ };
42583
+ var fxSaveFetcher = {
42584
+ label: "FXSAVE",
42585
+ fetch: async () => {
42586
+ const apy = await fetchAladdinApyPercent().catch(
42587
+ () => fetchDefiLlamaApy(FXSAVE_DEFILLAMA_POOL)
42588
+ );
42589
+ const apr = apyToAprPercent(apy);
42590
+ return { [FXSAVE_KEY]: apr, [FXSAVE_GROUP_KEY]: apr };
42591
+ }
42592
+ };
42550
42593
  var RATE_ABI = [
42551
42594
  {
42552
42595
  name: "rate",
@@ -45023,6 +45066,31 @@ var SINGLE_CHAIN_ENTRIES = {
45023
45066
  yieldFetcher: sreusdSavingsFetcher,
45024
45067
  yieldKey: "SREUSD"
45025
45068
  },
45069
+ {
45070
+ // f(x) Protocol fxSAVE — 4626 auto-compounder over `fxSP`, the f(x)
45071
+ // Stability Pool share (it holds 57.4M of fxSP's 59.4M supply, i.e.
45072
+ // ~97% of the pool). Plain instant exit: `maxDeposit = uint.max`,
45073
+ // `maxRedeem == balanceOf` on a live holder, `previewRedeem ==
45074
+ // convertToAssets` (no fee, no cooldown) — verified on-chain 2026-08-09.
45075
+ //
45076
+ // The underlying is fxSP and NOT fxUSD: fxSP appreciates on its own
45077
+ // ($1.0101 vs fxUSD's $1.0000 at integration), so pricing `totalAssets`
45078
+ // off fxUSD would understate TVL by ~1%. The token-list row's
45079
+ // `props.savings.underlying: 'fxUSD'` is the classifier's economic
45080
+ // underlying, a different question from `asset()`.
45081
+ address: "0x7743e50f534a7f9f1791dde7dcd89f7783eefc39",
45082
+ underlying: "0x65c9a641afceb9c0e6034e558a319488fa0fa3be",
45083
+ // fxSP
45084
+ symbol: "fxSAVE",
45085
+ brand: "f(x) Protocol",
45086
+ description: "fxUSD is f(x) Protocol's stablecoin; its Stability Pool (fxSP) backstops leveraged positions and earns the protocol's rebalance and liquidation revenue. fxSAVE auto-compounds that revenue back into fxSP, so the share price appreciates. Instant permissionless exit, no fee or cooldown.",
45087
+ decimals: 18,
45088
+ isRebasing: false,
45089
+ isMintable: true,
45090
+ withdrawalMode: "instant",
45091
+ yieldFetcher: fxSaveFetcher,
45092
+ yieldKey: FXSAVE_KEY
45093
+ },
45026
45094
  {
45027
45095
  // Frax sFRAX — the pre-rename sibling of sfrxUSD, over legacy
45028
45096
  // FRAX. Still live and roughly 2x sfrxUSD's size, so it stays a