@1delta/margin-fetcher 5.0.107 → 5.0.108

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
@@ -47989,26 +47989,39 @@ var wstusrFetcher = {
47989
47989
  // src/yields/intrinsic/fetchers/hastra.ts
47990
47990
  var HASTRA_POR_URL = "https://www.hastra.io/hastra-pulse/public/api/v1/por";
47991
47991
  var HASTRA_PRIME_KEY = "Hastra PRIME::PRIME";
47992
- var hastraPrimeFetcher = {
47992
+ var HASTRA_AUTO_KEY = "Hastra AUTO::AUTO";
47993
+ var HASTRA_TOKEN_KEYS = {
47994
+ prime: HASTRA_PRIME_KEY,
47995
+ auto: HASTRA_AUTO_KEY
47996
+ };
47997
+ var MAX_PLAUSIBLE_APR = 50;
47998
+ function parseHastraPor(res) {
47999
+ const tokens = res?.demo_prime_card?.tokens;
48000
+ const out = {};
48001
+ if (!Array.isArray(tokens)) return out;
48002
+ for (const t of tokens) {
48003
+ const key3 = HASTRA_TOKEN_KEYS[String(t?.token ?? "").toLowerCase()];
48004
+ if (!key3) continue;
48005
+ const apr = Number(t?.effective_rate);
48006
+ if (Number.isFinite(apr) && apr > 0 && apr < MAX_PLAUSIBLE_APR)
48007
+ out[key3] = apr;
48008
+ }
48009
+ return out;
48010
+ }
48011
+ var hastraFetcher = {
47993
48012
  label: "Hastra",
47994
48013
  fetch: async () => {
47995
48014
  const res = await fetch(HASTRA_POR_URL, {
47996
48015
  method: "GET",
47997
48016
  headers: { Accept: "application/json" }
47998
- }).then((r) => r.json());
47999
- const card = res?.demo_prime_card ?? {};
48000
- const current = Number(card.current_rate);
48001
- const fee = Number(card.fee);
48002
- const lifetimePct = Number(card.lifetime_average_rate) * 100;
48003
- let apr;
48004
- if (Number.isFinite(current)) {
48005
- apr = current - (Number.isFinite(fee) ? fee : 0);
48006
- } else if (Number.isFinite(lifetimePct)) {
48007
- apr = lifetimePct;
48008
- } else {
48009
- apr = 0;
48010
- }
48011
- return { [HASTRA_PRIME_KEY]: Math.max(0, apr) };
48017
+ }).then((r) => {
48018
+ if (!r.ok) throw new Error(`Hastra PoR answered HTTP ${r.status}`);
48019
+ return r.json();
48020
+ });
48021
+ const out = parseHastraPor(res);
48022
+ if (Object.keys(out).length === 0)
48023
+ console.warn("[hastra] PoR feed carried no usable effective_rate");
48024
+ return out;
48012
48025
  }
48013
48026
  };
48014
48027
  var RAY8 = 10n ** 27n;
@@ -52978,29 +52991,51 @@ var SINGLE_CHAIN_ENTRIES = {
52978
52991
  yieldKey: "SYRUPUSDG"
52979
52992
  },
52980
52993
  {
52981
- // Hastra Democratized PRIME — ERC-4626 over wYLDS (itself ERC-4626 over
52982
- // USDC), so the share/asset ratio accrues on-chain (`convertToAssets`).
52983
- // Solana-primary; the Ethereum deployment exists (verified on-chain:
52984
- // symbol PRIME, 6 decimals, asset() = wYLDS) but carries no user holders
52985
- // yet. Deposits are whitelist-gated, so `isMintable` is false — we list
52986
- // + price it, but don't advertise a permissionless mint that would
52987
- // revert. Two-phase exit (`requestRedeem` → `completeRedeem`). APR from
52988
- // the public Proof-of-Reserve feed via `hastraPrimeFetcher`.
52994
+ // Hastra (Figure / Provenance) PRIME — ERC-4626 over wYLDS (itself a
52995
+ // 4626 over USDC, held 1:1), the same product as the Solana
52996
+ // `vault-stake` pool and priced at the same rate. FORK-PROVEN
52997
+ // 2026-10-06: `deposit` from an arbitrary EOA and an immediate
52998
+ // `redeem` both settle at `convertToAssets` (`maxDeposit` is
52999
+ // uint.max; the only gate is `freezeAccount`). The previous row said
53000
+ // whitelist-gated + request-based, which described an older surface.
53001
+ // The exit pays wYLDS; wYLDS → USDC is Hastra's own queued redemption.
53002
+ // APR = the PoR feed's `effective_rate` (`hastraFetcher`).
52989
53003
  address: "0x19ebb35279a16207ec4ba82799cc64715065f7f6",
52990
53004
  underlying: "0x6ad038ca6c04e885630851278ca0a856ad9a66cc",
52991
53005
  // wYLDS
52992
53006
  symbol: "PRIME",
52993
53007
  solvency: "nav-attested",
52994
53008
  brand: "Hastra",
52995
- description: "Hastra's Democratized PRIME: an ERC-4626 over wYLDS (itself a vault over USDC), with the rate published via Hastra's Proof-of-Reserve feed. Deposits are whitelist-gated; exit is a two-phase request-then-complete redemption.",
53009
+ description: "Hastra's PRIME: wYLDS (Figure's USDC-backed YLDS, 1:1 with USDC) lent into home-equity (HELOC) loans through Figure's Democratized Prime marketplace, paid as a rising share price. Deposit and redeem are instant against wYLDS at the published rate; turning wYLDS back into USDC is a separate queued redemption with Hastra. The price is an operator-attested NAV of off-chain loans.",
52996
53010
  decimals: 6,
52997
53011
  underlyingDecimals: 6,
52998
53012
  isRebasing: false,
52999
- isMintable: false,
53000
- withdrawalMode: "request-based",
53001
- yieldFetcher: hastraPrimeFetcher,
53013
+ isMintable: true,
53014
+ withdrawalMode: "instant",
53015
+ yieldFetcher: hastraFetcher,
53002
53016
  yieldKey: "Hastra PRIME::PRIME"
53003
53017
  },
53018
+ {
53019
+ // Hastra AUTO — PRIME's sibling over the same wYLDS, lending into
53020
+ // consumer auto loans on Figure's Democratized Prime. Same contract family (4626, fork-proven the
53021
+ // same way 2026-10-06), same exit into wYLDS. ~$1M on Ethereum against
53022
+ // ~$70M on Solana, so the Solana row is the one that matters; this one
53023
+ // exists so the EVM share has a rate and an exit.
53024
+ address: "0x997e2efbce91d170b00ea402e35a66c887ee1da9",
53025
+ underlying: "0x6ad038ca6c04e885630851278ca0a856ad9a66cc",
53026
+ // wYLDS
53027
+ symbol: "AUTO",
53028
+ solvency: "nav-attested",
53029
+ brand: "Hastra",
53030
+ description: "Hastra's AUTO: wYLDS (Figure's USDC-backed YLDS, 1:1 with USDC) lent into a pool of consumer auto loans (originated and serviced by a third-party auto lender, offered through Figure's Democratized Prime marketplace), paid as a rising share price. Deposit and redeem are instant against wYLDS at the published rate; turning wYLDS back into USDC is a separate queued redemption with Hastra. The price is an operator-attested NAV of off-chain loans.",
53031
+ decimals: 6,
53032
+ underlyingDecimals: 6,
53033
+ isRebasing: false,
53034
+ isMintable: true,
53035
+ withdrawalMode: "instant",
53036
+ yieldFetcher: hastraFetcher,
53037
+ yieldKey: "Hastra AUTO::AUTO"
53038
+ },
53004
53039
  {
53005
53040
  // 3Jane USD3 — senior tranche of the credit-based money market
53006
53041
  // (docs.3jane.xyz): USDC funds unsecured fintech/crypto credit
@@ -84160,7 +84195,10 @@ var SVM_EARN_VAULT_BUILDERS = {
84160
84195
  nativeWithdraw: true
84161
84196
  },
84162
84197
  // USDC in over CCTP, a request out — settled by Nest, nothing to claim
84163
- "savings:Nest": { verbs: ["deposit", "request-withdraw"] }
84198
+ "savings:Nest": { verbs: ["deposit", "request-withdraw"] },
84199
+ // PRIME / AUTO: the vault-stake pool's own stake / redeem, same
84200
+ // transaction; wYLDS in (or USDC, minted 1:1 first), wYLDS out
84201
+ "savings:Hastra": { verbs: ["deposit", "withdraw"], payAsset: true }
84164
84202
  };
84165
84203
  var UNBUILT_REASONS = {
84166
84204
  exponent: "Exponent PTs are not tradable through this API yet",