@1delta/margin-fetcher 5.0.151 → 5.0.152
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.d.ts +6 -0
- package/dist/index.js +296 -52
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -7130,6 +7130,12 @@ interface ShareRate {
|
|
|
7130
7130
|
* this chain's list may not carry. Wins over the `underlying` lookup.
|
|
7131
7131
|
*/
|
|
7132
7132
|
underlyingGroup?: string;
|
|
7133
|
+
/**
|
|
7134
|
+
* `rate` is already dollars: the issuer quotes the asset in USD and there is
|
|
7135
|
+
* no underlying to resolve (`fetchers/shareRate.ts` `USD_ISSUER_PRICE_SPECS`).
|
|
7136
|
+
* The entry's `priceUSD` is the rate, and it keeps the tier-0 rank.
|
|
7137
|
+
*/
|
|
7138
|
+
usd?: boolean;
|
|
7133
7139
|
/** What was read (`'convertToAssets'`, `'mellow:getReport'`) — diagnostics. */
|
|
7134
7140
|
source?: string;
|
|
7135
7141
|
}
|
package/dist/index.js
CHANGED
|
@@ -57192,8 +57192,8 @@ var NEST_VAULT_PROSE = {
|
|
|
57192
57192
|
var NEST_ENTRIES = (() => {
|
|
57193
57193
|
const out = {};
|
|
57194
57194
|
for (const v of NEST_SAVINGS_VAULTS) {
|
|
57195
|
-
const
|
|
57196
|
-
if (!
|
|
57195
|
+
const prose2 = NEST_VAULT_PROSE[v.symbol];
|
|
57196
|
+
if (!prose2) continue;
|
|
57197
57197
|
for (const chainId of v.chains) {
|
|
57198
57198
|
(out[chainId] ??= []).push({
|
|
57199
57199
|
reader: "nest-vault",
|
|
@@ -57201,7 +57201,7 @@ var NEST_ENTRIES = (() => {
|
|
|
57201
57201
|
underlying: NEST_USDC[chainId],
|
|
57202
57202
|
symbol: v.symbol,
|
|
57203
57203
|
brand: "Nest",
|
|
57204
|
-
description: `${
|
|
57204
|
+
description: `${prose2.description} ${EXIT}`,
|
|
57205
57205
|
decimals: 6,
|
|
57206
57206
|
underlyingDecimals: 6,
|
|
57207
57207
|
isRebasing: false,
|
|
@@ -57211,7 +57211,7 @@ var NEST_ENTRIES = (() => {
|
|
|
57211
57211
|
withdrawalMode: "fee-or-queued",
|
|
57212
57212
|
solvency: "nav-attested",
|
|
57213
57213
|
yieldFetcher: nestFetcher,
|
|
57214
|
-
yieldKey:
|
|
57214
|
+
yieldKey: prose2.yieldKey
|
|
57215
57215
|
});
|
|
57216
57216
|
}
|
|
57217
57217
|
}
|
|
@@ -57661,10 +57661,16 @@ var IPOR_FUSION_ENTRIES = (() => {
|
|
|
57661
57661
|
return out;
|
|
57662
57662
|
})();
|
|
57663
57663
|
var COMMON = "Mezzanine's Hastra Optimizer, which loops Hastra PRIME and AUTO through Morpho and Kamino. The curator reports its NAV through RedStone each weekly epoch, so the rate is one epoch's result and can swing, or turn negative, from week to week. MZUSD not staked in a tranche earns nothing and its yield goes to the tranches: about half of all MZUSD sat unstaked in one Safe at listing, roughly doubling both rates, which fall if it is staked or redeemed.";
|
|
57664
|
-
var
|
|
57664
|
+
var HASTRA_PROSE = {
|
|
57665
57665
|
senior: `The SENIOR tranche of ${COMMON} It takes losses only after the junior tranche is gone.`,
|
|
57666
57666
|
junior: `The JUNIOR, FIRST-LOSS tranche of ${COMMON} It takes every loss first, for a yield premium that grows as this tranche shrinks against the senior.`
|
|
57667
57667
|
};
|
|
57668
|
+
var PRIME = "Mezzanine's undocumented PRIME vault, seeded by the operator's Safe, which holds nearly all of it. Its USDC is swept into the same strategy as the Hastra Optimizer. No NAV report has ever been applied, so it has earned nothing and a withdrawal request cannot settle. Deposits are refused while its epochs stay stalled.";
|
|
57669
|
+
var PRIME_PROSE = {
|
|
57670
|
+
senior: `The SENIOR tranche of ${PRIME} It takes losses only after the junior tranche is gone.`,
|
|
57671
|
+
junior: `The JUNIOR, FIRST-LOSS tranche of ${PRIME} It takes every loss first.`
|
|
57672
|
+
};
|
|
57673
|
+
var prose = (t) => (t.vaultName === "PRIME" ? PRIME_PROSE : HASTRA_PROSE)[t.tranche];
|
|
57668
57674
|
var toEntry3 = (t) => ({
|
|
57669
57675
|
reader: "mezzanine-tranche",
|
|
57670
57676
|
address: t.address,
|
|
@@ -57672,7 +57678,7 @@ var toEntry3 = (t) => ({
|
|
|
57672
57678
|
underlying: t.depositAsset,
|
|
57673
57679
|
symbol: t.symbol,
|
|
57674
57680
|
brand: "Mezzanine",
|
|
57675
|
-
description:
|
|
57681
|
+
description: prose(t),
|
|
57676
57682
|
decimals: 21,
|
|
57677
57683
|
underlyingDecimals: 6,
|
|
57678
57684
|
isRebasing: false,
|
|
@@ -57689,7 +57695,9 @@ var toEntry3 = (t) => ({
|
|
|
57689
57695
|
mzusd: t.mzusd,
|
|
57690
57696
|
reservoir: t.reservoir,
|
|
57691
57697
|
allowlist: t.allowlist,
|
|
57692
|
-
pauseManager: t.pauseManager
|
|
57698
|
+
pauseManager: t.pauseManager,
|
|
57699
|
+
depositSymbol: t.depositSymbol,
|
|
57700
|
+
funded: t.fundingAsset !== void 0
|
|
57693
57701
|
}
|
|
57694
57702
|
});
|
|
57695
57703
|
var MEZZANINE_ENTRIES = (() => {
|
|
@@ -73132,7 +73140,8 @@ function getEulerV2Calls(chainId) {
|
|
|
73132
73140
|
meta.push({
|
|
73133
73141
|
vault: entry2.vault.toLowerCase(),
|
|
73134
73142
|
lender,
|
|
73135
|
-
usePriceLens
|
|
73143
|
+
usePriceLens,
|
|
73144
|
+
...entry2.fixedRate ? { fixedRate: true } : {}
|
|
73136
73145
|
});
|
|
73137
73146
|
}
|
|
73138
73147
|
if (calls.length > 0) {
|
|
@@ -73197,7 +73206,12 @@ function parseEulerV2Results(data, meta, context) {
|
|
|
73197
73206
|
queryMeta.lender,
|
|
73198
73207
|
queryMeta.vault
|
|
73199
73208
|
),
|
|
73200
|
-
derivation
|
|
73209
|
+
derivation,
|
|
73210
|
+
// A `FixedRateOracle` is the vault creator's assumption, not a reading:
|
|
73211
|
+
// the row keeps it, a group takes it only with no live source. Reading
|
|
73212
|
+
// as `direct`, these held USDf and lvlUSD at 1.00 (0.9943, 0.9968) and
|
|
73213
|
+
// bUSD0 at 1.00 (0.9768).
|
|
73214
|
+
...queryMeta.fixedRate ? { fallbackOnly: true } : {}
|
|
73201
73215
|
});
|
|
73202
73216
|
} catch {
|
|
73203
73217
|
}
|
|
@@ -74487,6 +74501,176 @@ var YEARN_V3_SHARE_RATE_PRICE_SPECS = [
|
|
|
74487
74501
|
),
|
|
74488
74502
|
yearnV3("yvWETH-2", "0xac37729b76db6438ce62042ae1270ee574ca7571", WETH_1, 18)
|
|
74489
74503
|
];
|
|
74504
|
+
var erc46263 = (tag, share, shareDecimals, underlying, underlyingDecimals, groups) => ({
|
|
74505
|
+
tag,
|
|
74506
|
+
chainId: "1",
|
|
74507
|
+
share,
|
|
74508
|
+
shareDecimals,
|
|
74509
|
+
underlying,
|
|
74510
|
+
underlyingDecimals,
|
|
74511
|
+
read: {
|
|
74512
|
+
kind: "assets",
|
|
74513
|
+
address: share,
|
|
74514
|
+
fn: "convertToAssets",
|
|
74515
|
+
arg: 10n ** BigInt(shareDecimals)
|
|
74516
|
+
},
|
|
74517
|
+
...groups
|
|
74518
|
+
});
|
|
74519
|
+
var USD3_1 = "0x056b269eb1f75477a8666ae8c7fe01b64dd55ecc";
|
|
74520
|
+
var SAVINGS_SHARE_RATE_PRICE_SPECS = [
|
|
74521
|
+
erc46263(
|
|
74522
|
+
"slvlUSD",
|
|
74523
|
+
"0x4737d9b4592b40d51e110b94c9c043c6654067ae",
|
|
74524
|
+
18,
|
|
74525
|
+
"0x7c1156e515aa1a2e851674120074968c905aaf37",
|
|
74526
|
+
// lvlUSD
|
|
74527
|
+
18
|
|
74528
|
+
),
|
|
74529
|
+
// the Tempo, Katana and MegaETH mirrors have no vault of their own
|
|
74530
|
+
erc46263(
|
|
74531
|
+
"stcUSD",
|
|
74532
|
+
"0x88887be419578051ff9f4eb6c858a951921d8888",
|
|
74533
|
+
18,
|
|
74534
|
+
"0xcccc62962d17b8914c62d74ffb843d73b2a3cccc",
|
|
74535
|
+
// cUSD
|
|
74536
|
+
18,
|
|
74537
|
+
{
|
|
74538
|
+
assetGroup: "Staked cap USD::stcUSD",
|
|
74539
|
+
underlyingGroup: "Cap USD::CUSD"
|
|
74540
|
+
}
|
|
74541
|
+
),
|
|
74542
|
+
erc46263(
|
|
74543
|
+
"sDOLA",
|
|
74544
|
+
"0xb45ad160634c528cc3d2926d9807104fa3157305",
|
|
74545
|
+
18,
|
|
74546
|
+
"0x865377367054516e17014ccded1e7d814edc9ce4",
|
|
74547
|
+
// DOLA
|
|
74548
|
+
18
|
|
74549
|
+
),
|
|
74550
|
+
erc46263(
|
|
74551
|
+
"sUSDf",
|
|
74552
|
+
"0xc8cf6d7991f15525488b2a83df53468d682ba4b0",
|
|
74553
|
+
18,
|
|
74554
|
+
"0xfa2b947eec368f42195f24f36d2af29f7c24cec2",
|
|
74555
|
+
// USDf
|
|
74556
|
+
18
|
|
74557
|
+
),
|
|
74558
|
+
erc46263(
|
|
74559
|
+
"sreUSD",
|
|
74560
|
+
"0x557ab1e003951a73c12d16f0fea8490e39c33c35",
|
|
74561
|
+
18,
|
|
74562
|
+
"0x57ab1e0003f623289cd798b1824be09a793e4bec",
|
|
74563
|
+
// reUSD
|
|
74564
|
+
18
|
|
74565
|
+
),
|
|
74566
|
+
erc46263(
|
|
74567
|
+
"ssftUSD",
|
|
74568
|
+
"0x232128844e5af56fd4b3f8bf97e08ab477282ab5",
|
|
74569
|
+
18,
|
|
74570
|
+
"0xf7d85ec4e7710f71992752eac2111312e73e9c9c",
|
|
74571
|
+
// ftUSD
|
|
74572
|
+
6
|
|
74573
|
+
),
|
|
74574
|
+
// the BNB and Monad mirrors have no vault of their own
|
|
74575
|
+
erc46263(
|
|
74576
|
+
"sUSDat",
|
|
74577
|
+
"0xd166337499e176bbc38a1fbd113ab144e5bd2df7",
|
|
74578
|
+
18,
|
|
74579
|
+
"0x23238f20b894f29041f48d88ee91131c395aaa71",
|
|
74580
|
+
// USDat
|
|
74581
|
+
6,
|
|
74582
|
+
{
|
|
74583
|
+
assetGroup: "Saturn sUSDat::SUSDAT",
|
|
74584
|
+
underlyingGroup: "Saturn Dollar::USDAT"
|
|
74585
|
+
}
|
|
74586
|
+
),
|
|
74587
|
+
erc46263("sUSD3", "0xf689555121e529ff0463e191f9bd9d1e496164a7", 6, USD3_1, 6),
|
|
74588
|
+
erc46263("USD3", USD3_1, 6, USDC_1, 6),
|
|
74589
|
+
// wstUSR priced as if USR were $1: lenders kept 1.1330 while USR fell to 0.04
|
|
74590
|
+
// (read 2026-11-06; DefiLlama 0.0453). The rate × USR's market price is the
|
|
74591
|
+
// value of the share, on every chain's mirror.
|
|
74592
|
+
erc46263(
|
|
74593
|
+
"wstUSR",
|
|
74594
|
+
"0x1202f5c7b4b9e47a1a484e8b270be34dbbc75055",
|
|
74595
|
+
18,
|
|
74596
|
+
"0x66a1e37c9b0eaddca17d3662d6c05f4decf3e110",
|
|
74597
|
+
// USR
|
|
74598
|
+
18,
|
|
74599
|
+
{
|
|
74600
|
+
assetGroup: "Resolv wstUSR::WSTUSR",
|
|
74601
|
+
underlyingGroup: "Resolv USD::USR"
|
|
74602
|
+
}
|
|
74603
|
+
),
|
|
74604
|
+
// Angle stEUR: 1.098481 EURA; the group sat 5 % under it, at 1.1670. The L2
|
|
74605
|
+
// copies are bridged and lag this vault.
|
|
74606
|
+
erc46263(
|
|
74607
|
+
"stEUR",
|
|
74608
|
+
"0x004626a008b1acdc4c74ab51644093b155e59a23",
|
|
74609
|
+
18,
|
|
74610
|
+
"0x1a7e4e63778b4f12a199c062f3efdd288afcbce8",
|
|
74611
|
+
// EURA
|
|
74612
|
+
18,
|
|
74613
|
+
{ assetGroup: "STEUR", underlyingGroup: "EURA" }
|
|
74614
|
+
),
|
|
74615
|
+
// The funded svZCHF (836k ZCHF). A dust vault `0x637f00ca…` (1.14 ZCHF, rate
|
|
74616
|
+
// 1.0438) shares its group; this rate keeps the group off that one.
|
|
74617
|
+
erc46263(
|
|
74618
|
+
"svZCHF",
|
|
74619
|
+
"0xe5f130253ff137f9917c0107659a4c5262abf6b0",
|
|
74620
|
+
18,
|
|
74621
|
+
"0xb58e61c3098d85632df34eecfb899a1ed80921cb",
|
|
74622
|
+
// ZCHF
|
|
74623
|
+
18
|
|
74624
|
+
),
|
|
74625
|
+
// Pareto USP: the Inverter oracle's redemption price, 6 decimals of USDC
|
|
74626
|
+
{
|
|
74627
|
+
tag: "USP",
|
|
74628
|
+
chainId: "1",
|
|
74629
|
+
share: "0x098697ba3fee4ea76294c5d6a466a4e3b3e95fe6",
|
|
74630
|
+
shareDecimals: 18,
|
|
74631
|
+
underlying: USDC_1,
|
|
74632
|
+
underlyingDecimals: 6,
|
|
74633
|
+
read: {
|
|
74634
|
+
kind: "assets",
|
|
74635
|
+
address: "0x433471901ba1a8bde764e8421790c7d9bab33552",
|
|
74636
|
+
fn: "getPriceForRedemption",
|
|
74637
|
+
arg: null
|
|
74638
|
+
}
|
|
74639
|
+
},
|
|
74640
|
+
// Hyperbeat: `getRate()` on the vault's Pricer, 8 decimals of USDT0
|
|
74641
|
+
{
|
|
74642
|
+
tag: "hbUSDT",
|
|
74643
|
+
chainId: "999",
|
|
74644
|
+
share: "0x5e105266db42f78fa814322bce7f388b4c2e61eb",
|
|
74645
|
+
shareDecimals: 18,
|
|
74646
|
+
underlying: "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
|
|
74647
|
+
// USDT0
|
|
74648
|
+
underlyingDecimals: 8,
|
|
74649
|
+
read: {
|
|
74650
|
+
kind: "assets",
|
|
74651
|
+
address: "0x3636a26ec1d512c5ecff42f7adaa5ce7964c6579",
|
|
74652
|
+
fn: "getRate",
|
|
74653
|
+
arg: null
|
|
74654
|
+
}
|
|
74655
|
+
}
|
|
74656
|
+
];
|
|
74657
|
+
var USD_ISSUER_PRICE_SPECS = [
|
|
74658
|
+
{
|
|
74659
|
+
tag: "USDY",
|
|
74660
|
+
chainId: "1",
|
|
74661
|
+
share: "0x96f6ef951840721adbf46ac996b59e0235cb985c",
|
|
74662
|
+
shareDecimals: 18,
|
|
74663
|
+
underlying: "",
|
|
74664
|
+
underlyingDecimals: 18,
|
|
74665
|
+
assetGroup: "USDY",
|
|
74666
|
+
read: {
|
|
74667
|
+
kind: "usd-price",
|
|
74668
|
+
address: "0xa0219aa5b31e65bc920b5b6dfb8edf0988121de0",
|
|
74669
|
+
fn: "getPrice",
|
|
74670
|
+
decimals: 18
|
|
74671
|
+
}
|
|
74672
|
+
}
|
|
74673
|
+
];
|
|
74490
74674
|
var SHARE_RATE_PRICE_SPECS = [
|
|
74491
74675
|
// Makina machines moved to `gapSweep.ts` with their savings rows — still
|
|
74492
74676
|
// priced here off the same machine read.
|
|
@@ -74499,14 +74683,20 @@ var SHARE_RATE_PRICE_SPECS = [
|
|
|
74499
74683
|
].filter((s) => !(s.tag in NOT_PRICED)).map(priceSpecFromRateSpec),
|
|
74500
74684
|
...MELLOW_SHARE_RATE_PRICE_SPECS,
|
|
74501
74685
|
...ERC4626_SHARE_RATE_PRICE_SPECS,
|
|
74502
|
-
...YEARN_V3_SHARE_RATE_PRICE_SPECS
|
|
74686
|
+
...YEARN_V3_SHARE_RATE_PRICE_SPECS,
|
|
74687
|
+
...SAVINGS_SHARE_RATE_PRICE_SPECS,
|
|
74688
|
+
...USD_ISSUER_PRICE_SPECS
|
|
74503
74689
|
];
|
|
74504
74690
|
var ABI6 = parseAbi([
|
|
74505
74691
|
"function getReport(address asset) view returns (uint224 priceD18, uint32 timestamp, bool isSuspicious)"
|
|
74506
74692
|
]);
|
|
74507
|
-
var abiItemFor = (read) =>
|
|
74508
|
-
read.
|
|
74509
|
-
|
|
74693
|
+
var abiItemFor = (read) => {
|
|
74694
|
+
if (read.kind === "mellow-report") return ABI6;
|
|
74695
|
+
const noArg = read.kind === "usd-price" || read.arg === null;
|
|
74696
|
+
return parseAbi([
|
|
74697
|
+
noArg ? `function ${read.fn}() view returns (uint256)` : `function ${read.fn}(uint256) view returns (uint256)`
|
|
74698
|
+
]);
|
|
74699
|
+
};
|
|
74510
74700
|
function shareRateCalls(chainId, specs = SHARE_RATE_PRICE_SPECS) {
|
|
74511
74701
|
const mine = specs.filter((s) => s.chainId === chainId);
|
|
74512
74702
|
const abi = [];
|
|
@@ -74519,10 +74709,16 @@ function shareRateCalls(chainId, specs = SHARE_RATE_PRICE_SPECS) {
|
|
|
74519
74709
|
abi.push(item);
|
|
74520
74710
|
}
|
|
74521
74711
|
}
|
|
74522
|
-
|
|
74712
|
+
if (s.read.kind === "mellow-report")
|
|
74713
|
+
return {
|
|
74714
|
+
address: s.read.oracle,
|
|
74715
|
+
name: "getReport",
|
|
74716
|
+
params: [s.read.asset]
|
|
74717
|
+
};
|
|
74718
|
+
return {
|
|
74523
74719
|
address: s.read.address,
|
|
74524
74720
|
name: s.read.fn,
|
|
74525
|
-
params: s.read.arg === null ? [] : [s.read.arg]
|
|
74721
|
+
params: s.read.kind === "usd-price" || s.read.arg === null ? [] : [s.read.arg]
|
|
74526
74722
|
};
|
|
74527
74723
|
});
|
|
74528
74724
|
return { specs: mine, calls, abi };
|
|
@@ -74549,7 +74745,7 @@ function decodeShareRate(spec, raw) {
|
|
|
74549
74745
|
} else {
|
|
74550
74746
|
const v = toBig9(raw);
|
|
74551
74747
|
if (v === void 0 || v <= 0n) return void 0;
|
|
74552
|
-
rate = Number(v) / 10 ** spec.underlyingDecimals;
|
|
74748
|
+
rate = Number(v) / 10 ** (spec.read.kind === "usd-price" ? spec.read.decimals : spec.underlyingDecimals);
|
|
74553
74749
|
}
|
|
74554
74750
|
return Number.isFinite(rate) && rate >= SHARE_RATE_MIN && rate <= SHARE_RATE_MAX ? rate : void 0;
|
|
74555
74751
|
}
|
|
@@ -74577,26 +74773,43 @@ async function fetchShareRatesRaw(chainId, rpcOverrides, retries = 3, specs = SH
|
|
|
74577
74773
|
return [];
|
|
74578
74774
|
}
|
|
74579
74775
|
}
|
|
74776
|
+
var sourceOf = (read) => read.kind === "mellow-report" ? "mellow:getReport" : read.fn;
|
|
74777
|
+
function rateEntryFields(spec, rate) {
|
|
74778
|
+
if (spec.read.kind === "usd-price")
|
|
74779
|
+
return {
|
|
74780
|
+
price: rate,
|
|
74781
|
+
priceUSD: rate,
|
|
74782
|
+
derivation: "direct",
|
|
74783
|
+
shareRate: {
|
|
74784
|
+
rate,
|
|
74785
|
+
underlying: "",
|
|
74786
|
+
usd: true,
|
|
74787
|
+
source: sourceOf(spec.read)
|
|
74788
|
+
}
|
|
74789
|
+
};
|
|
74790
|
+
return {
|
|
74791
|
+
price: rate,
|
|
74792
|
+
priceUSD: 0,
|
|
74793
|
+
baseAsset: spec.underlying,
|
|
74794
|
+
derivation: "quoted",
|
|
74795
|
+
shareRate: {
|
|
74796
|
+
rate,
|
|
74797
|
+
underlying: spec.underlying,
|
|
74798
|
+
...spec.underlyingGroup ? { underlyingGroup: spec.underlyingGroup } : {},
|
|
74799
|
+
source: sourceOf(spec.read)
|
|
74800
|
+
}
|
|
74801
|
+
};
|
|
74802
|
+
}
|
|
74580
74803
|
function shareRateEntries(chainId, tokenList, rates) {
|
|
74581
74804
|
const out = [];
|
|
74582
74805
|
for (const { spec, rate } of rates) {
|
|
74583
74806
|
if (!tokenList[spec.share]) continue;
|
|
74584
|
-
|
|
74807
|
+
out.push({
|
|
74585
74808
|
asset: spec.share,
|
|
74586
|
-
price: rate,
|
|
74587
|
-
priceUSD: 0,
|
|
74588
74809
|
marketUid: `${SHARE_RATE_PRICE_KEY}:${chainId}:${spec.share}`,
|
|
74589
74810
|
description: `Issuer share rate (${spec.tag}): ${rate.toPrecision(10)} underlying per share`,
|
|
74590
|
-
|
|
74591
|
-
|
|
74592
|
-
shareRate: {
|
|
74593
|
-
rate,
|
|
74594
|
-
underlying: spec.underlying,
|
|
74595
|
-
...spec.underlyingGroup ? { underlyingGroup: spec.underlyingGroup } : {},
|
|
74596
|
-
source: spec.read.kind === "mellow-report" ? "mellow:getReport" : `${spec.read.fn}`
|
|
74597
|
-
}
|
|
74598
|
-
};
|
|
74599
|
-
out.push(entry2);
|
|
74811
|
+
...rateEntryFields(spec, rate)
|
|
74812
|
+
});
|
|
74600
74813
|
}
|
|
74601
74814
|
return out;
|
|
74602
74815
|
}
|
|
@@ -74622,25 +74835,17 @@ async function fetchGroupShareRatesRaw(rpcOverrides, retries = 3, specs = GROUP_
|
|
|
74622
74835
|
function crossChainShareRateEntries(chainId, tokenList, rates) {
|
|
74623
74836
|
const out = [];
|
|
74624
74837
|
for (const { spec, rate } of rates) {
|
|
74625
|
-
|
|
74838
|
+
const dollars = spec.read.kind === "usd-price";
|
|
74839
|
+
if (!spec.assetGroup || !spec.underlyingGroup && !dollars) continue;
|
|
74626
74840
|
for (const [address, t] of Object.entries(tokenList)) {
|
|
74627
74841
|
if (t?.assetGroup !== spec.assetGroup) continue;
|
|
74628
74842
|
const asset = address.toLowerCase();
|
|
74629
74843
|
if (spec.chainId === chainId && asset === spec.share) continue;
|
|
74630
74844
|
out.push({
|
|
74631
74845
|
asset,
|
|
74632
|
-
price: rate,
|
|
74633
|
-
priceUSD: 0,
|
|
74634
74846
|
marketUid: `${SHARE_RATE_PRICE_KEY}:${spec.chainId}:${spec.share}`,
|
|
74635
74847
|
description: `Issuer share rate (${spec.tag}, read on chain ${spec.chainId}): ${rate.toPrecision(10)} underlying per share`,
|
|
74636
|
-
|
|
74637
|
-
derivation: "quoted",
|
|
74638
|
-
shareRate: {
|
|
74639
|
-
rate,
|
|
74640
|
-
underlying: spec.underlying,
|
|
74641
|
-
underlyingGroup: spec.underlyingGroup,
|
|
74642
|
-
source: spec.read.kind === "mellow-report" ? "mellow:getReport" : spec.read.fn
|
|
74643
|
-
}
|
|
74848
|
+
...rateEntryFields(spec, rate)
|
|
74644
74849
|
});
|
|
74645
74850
|
}
|
|
74646
74851
|
}
|
|
@@ -74773,7 +74978,7 @@ async function probeAaveFeedTimestamps(chainId, options = {}) {
|
|
|
74773
74978
|
overrdies: rpcOverrides,
|
|
74774
74979
|
logErrors: false
|
|
74775
74980
|
});
|
|
74776
|
-
const
|
|
74981
|
+
const sourceOf2 = /* @__PURE__ */ new Map();
|
|
74777
74982
|
const uniqueSources = [];
|
|
74778
74983
|
const sourceIndex = /* @__PURE__ */ new Map();
|
|
74779
74984
|
jobs.forEach((_3, i) => {
|
|
@@ -74781,7 +74986,7 @@ async function probeAaveFeedTimestamps(chainId, options = {}) {
|
|
|
74781
74986
|
if (isFailed2(raw)) return;
|
|
74782
74987
|
const source = String(raw).toLowerCase();
|
|
74783
74988
|
if (source === ZERO_ADDRESS11) return;
|
|
74784
|
-
|
|
74989
|
+
sourceOf2.set(i, source);
|
|
74785
74990
|
if (!sourceIndex.has(source)) {
|
|
74786
74991
|
sourceIndex.set(source, uniqueSources.length);
|
|
74787
74992
|
uniqueSources.push(source);
|
|
@@ -74815,7 +75020,7 @@ async function probeAaveFeedTimestamps(chainId, options = {}) {
|
|
|
74815
75020
|
description: isFailed2(description) ? void 0 : String(description)
|
|
74816
75021
|
});
|
|
74817
75022
|
});
|
|
74818
|
-
for (const [i, source] of
|
|
75023
|
+
for (const [i, source] of sourceOf2) {
|
|
74819
75024
|
const info = infoOfSource.get(source);
|
|
74820
75025
|
if (!info) continue;
|
|
74821
75026
|
const { lender, asset } = jobs[i];
|
|
@@ -76300,6 +76505,31 @@ function disagreesWith(priceUSD, reference, cfg = DEFAULT_CONSENSUS_DEMOTION) {
|
|
|
76300
76505
|
return Math.abs(priceUSD / reference - 1) > cfg.demoteDeviation;
|
|
76301
76506
|
}
|
|
76302
76507
|
|
|
76508
|
+
// src/prices/oracle-prices/placeholderFeeds.ts
|
|
76509
|
+
var PLACEHOLDER_FEEDS = {
|
|
76510
|
+
// LayerBank V3 answers its USDC feed for the legacy Nest vaults, whose
|
|
76511
|
+
// `hook()` is 0 (read 2026-11-06: 0.99979849 for all four, against Morpho's
|
|
76512
|
+
// 1.0092 / 1.0188 / 1.0464 for the first three). Its other Nest rows are right.
|
|
76513
|
+
"98866": [
|
|
76514
|
+
["LAYERBANK_V3", "0xdea736937d464d288ec80138bcd1a2e109a200e3"],
|
|
76515
|
+
// nETF
|
|
76516
|
+
["LAYERBANK_V3", "0xbfc5770631641719cd1cf809d8325b146aed19de"],
|
|
76517
|
+
// nINSTO
|
|
76518
|
+
["LAYERBANK_V3", "0x9fbc367b9bb966a2a537989817a088afcaffdc4c"],
|
|
76519
|
+
// nELIXIR
|
|
76520
|
+
["LAYERBANK_V3", "0xb52b090837a035f93a84487e5a7d3719c32aa8a9"]
|
|
76521
|
+
// nPAYFI
|
|
76522
|
+
],
|
|
76523
|
+
// YEI's USDY source does not track Ondo's accrual (`USDY_GROUP_PRICE.md`).
|
|
76524
|
+
"1329": [["YEI", "0x54cd901491aef397084453f4372b93c33260e2a6"]]
|
|
76525
|
+
};
|
|
76526
|
+
function isPlaceholderFeed(chainId, lender, asset) {
|
|
76527
|
+
const lc2 = asset.toLowerCase();
|
|
76528
|
+
return (PLACEHOLDER_FEEDS[chainId] ?? []).some(
|
|
76529
|
+
([prefix, a]) => a === lc2 && lender.startsWith(prefix)
|
|
76530
|
+
);
|
|
76531
|
+
}
|
|
76532
|
+
|
|
76303
76533
|
// src/prices/oracle-prices/feedStats.ts
|
|
76304
76534
|
var EWMA_ALPHA = 0.1;
|
|
76305
76535
|
var MIN_DEVIATION_SAMPLES = 5;
|
|
@@ -76609,7 +76839,7 @@ function selectAssetGroupPrices(structuredPrices, lists = {}, depthOrTvl = {}, p
|
|
|
76609
76839
|
// `fallbackOnly` wins over `shareRate`: a share rate can be a
|
|
76610
76840
|
// last resort too (a registry-wide sweep of vault rates), and is
|
|
76611
76841
|
// then resolved the same way but ranked as a fallback
|
|
76612
|
-
sourceRank: entry2.fallbackOnly ? SOURCE_RANK.fallback : shareRate ? SOURCE_RANK.shareRate : SOURCE_RANK.oracle,
|
|
76842
|
+
sourceRank: entry2.fallbackOnly || isPlaceholderFeed(chainId, lender, entry2.asset) ? SOURCE_RANK.fallback : shareRate ? SOURCE_RANK.shareRate : SOURCE_RANK.oracle,
|
|
76613
76843
|
consensusRank: 0,
|
|
76614
76844
|
oracleKey,
|
|
76615
76845
|
priceUSD: entry2.priceUSD,
|
|
@@ -76625,7 +76855,7 @@ function selectAssetGroupPrices(structuredPrices, lists = {}, depthOrTvl = {}, p
|
|
|
76625
76855
|
depth: depthOf(entry2.marketUid, lender, depth),
|
|
76626
76856
|
chainRank
|
|
76627
76857
|
};
|
|
76628
|
-
if (shareRate) {
|
|
76858
|
+
if (shareRate && !shareRate.usd) {
|
|
76629
76859
|
const u = shareRate.underlying;
|
|
76630
76860
|
const uGroup = shareRate.underlyingGroup ?? tokenList[u]?.assetGroup ?? tokenList[u.toLowerCase()]?.assetGroup;
|
|
76631
76861
|
pendingShareRates.push({
|
|
@@ -76690,7 +76920,10 @@ function selectAssetGroupPrices(structuredPrices, lists = {}, depthOrTvl = {}, p
|
|
|
76690
76920
|
chainId: best.chainId,
|
|
76691
76921
|
lender: best.lender,
|
|
76692
76922
|
feedKey: best.feedKey,
|
|
76693
|
-
|
|
76923
|
+
// The arbiter between writer boxes ranks by this and does not know
|
|
76924
|
+
// `fallbackOnly`: a box left with only a last resort (a fixed-rate
|
|
76925
|
+
// oracle) must not look like a live feed against another box's reading.
|
|
76926
|
+
derivation: best.sourceRank === SOURCE_RANK.fallback ? "derived" : derivationOfRank(best.derivationRank),
|
|
76694
76927
|
candidates,
|
|
76695
76928
|
rejected,
|
|
76696
76929
|
...demoted ? { demoted, consensusUSD } : {}
|
|
@@ -89965,16 +90198,17 @@ var mezzanineStreamRate = (args) => {
|
|
|
89965
90198
|
const perAsset = Number(amount5 * 1000000000000n / totalAssets) / 1e12;
|
|
89966
90199
|
return perAsset / period * SECONDS_PER_YEAR23 * 100;
|
|
89967
90200
|
};
|
|
90201
|
+
var mezzanineEpochStalled = (args) => args.now >= args.epochStart + 2 * args.epochDuration;
|
|
89968
90202
|
var mezzanineExitWait = (args) => {
|
|
89969
90203
|
const { epochStart, epochDuration, delayEpochs, now } = args;
|
|
89970
90204
|
const remainder = Math.max(0, epochStart + epochDuration - now);
|
|
89971
90205
|
return remainder + delayEpochs * epochDuration;
|
|
89972
90206
|
};
|
|
89973
90207
|
var exitDescription = (args) => {
|
|
89974
|
-
const { delayEpochs, yieldCutBps, capacity } = args;
|
|
90208
|
+
const { delayEpochs, yieldCutBps, capacity, depositSymbol, funded, stalled } = args;
|
|
89975
90209
|
const epochs = `${delayEpochs} weekly epoch${delayEpochs === 1 ? "" : "s"}`;
|
|
89976
90210
|
const cut = yieldCutBps / 100;
|
|
89977
|
-
return `Settles after ${epochs}, once Mezzanine's automation applies the NAV report and finalizes the epoch; a late report delays it. Queued shares stay in the loss waterfall, and ${cut} % of the yield they earn while queued is forfeited. The claim pays MZUSD, which redeems 1:1 for
|
|
90211
|
+
return (stalled ? `This vault has missed its epoch reports, so a request made now does not settle until they resume. ` : "") + `Settles after ${epochs}, once Mezzanine's automation applies the NAV report and finalizes the epoch; a late report delays it. Queued shares stay in the loss waterfall, and ${cut} % of the yield they earn while queued is forfeited. The claim pays MZUSD, which redeems 1:1 for ${depositSymbol} only while the vault holds idle ${depositSymbol}` + (capacity !== void 0 ? ` (${(Number(capacity) / 1e6).toLocaleString("en-US", { maximumFractionDigits: 0 })} right now)` : "") + `; the curator has to move it there.` + (funded ? ` ${depositSymbol} turns into USDC through Hastra's own redemption.` : "");
|
|
89978
90212
|
};
|
|
89979
90213
|
var readerMezzanine = (entry2) => {
|
|
89980
90214
|
const cfg = entry2.mezzanine;
|
|
@@ -90090,6 +90324,11 @@ var readerMezzanine = (entry2) => {
|
|
|
90090
90324
|
delayEpochs: Number(delayEpochs),
|
|
90091
90325
|
now
|
|
90092
90326
|
}) : void 0;
|
|
90327
|
+
const stalled = epochStart !== void 0 && epochDuration !== void 0 && mezzanineEpochStalled({
|
|
90328
|
+
epochStart: Number(epochStart),
|
|
90329
|
+
epochDuration: Number(epochDuration),
|
|
90330
|
+
now
|
|
90331
|
+
});
|
|
90093
90332
|
const vaultBalance = toBigInt16(vaultIdle);
|
|
90094
90333
|
const reservoirBalance = toBigInt16(reservoirIdle);
|
|
90095
90334
|
const cap = toBigInt16(redemptionCap);
|
|
@@ -90102,7 +90341,7 @@ var readerMezzanine = (entry2) => {
|
|
|
90102
90341
|
label: delayEpochs !== void 0 ? `${delayEpochs}-epoch queue` : "Epoch queue",
|
|
90103
90342
|
settlement: "async",
|
|
90104
90343
|
...exitFeeBps !== void 0 ? { feeBps: Number(exitFeeBps) } : {},
|
|
90105
|
-
...wait !== void 0 ? { waitSeconds: wait } : {},
|
|
90344
|
+
...wait !== void 0 && !stalled ? { waitSeconds: wait } : {},
|
|
90106
90345
|
...capacity !== void 0 ? {
|
|
90107
90346
|
capacity: capacity.toString(),
|
|
90108
90347
|
capacityFormatted: Number(capacity) / 1e6
|
|
@@ -90111,13 +90350,16 @@ var readerMezzanine = (entry2) => {
|
|
|
90111
90350
|
description: exitDescription({
|
|
90112
90351
|
delayEpochs: Number(delayEpochs ?? 1n),
|
|
90113
90352
|
yieldCutBps: Number(yieldCutBps ?? 0n),
|
|
90114
|
-
capacity
|
|
90353
|
+
capacity,
|
|
90354
|
+
depositSymbol: cfg?.depositSymbol ?? "wYLDS",
|
|
90355
|
+
funded: cfg?.funded ?? true,
|
|
90356
|
+
stalled
|
|
90115
90357
|
})
|
|
90116
90358
|
};
|
|
90117
90359
|
const perf = toBigInt16(perfFee);
|
|
90118
90360
|
const protocol = toBigInt16(protocolFee);
|
|
90119
90361
|
const maxDeposit = toBigInt16(maxDep);
|
|
90120
|
-
const closed = allowed === false || depositsPaused === true;
|
|
90362
|
+
const closed = allowed === false || depositsPaused === true || stalled;
|
|
90121
90363
|
const depositCapacity = closed ? 0n : maxDeposit !== void 0 && maxDeposit < 2n ** 255n ? maxDeposit / BASE_SCALE : void 0;
|
|
90122
90364
|
return {
|
|
90123
90365
|
// The virtual NAV: balance less the unstreamed yield and the assets
|
|
@@ -90129,7 +90371,7 @@ var readerMezzanine = (entry2) => {
|
|
|
90129
90371
|
exchangeRate: assetsPerShare,
|
|
90130
90372
|
...supplyRate !== void 0 ? { supplyRate } : {},
|
|
90131
90373
|
exitRoutes: [route],
|
|
90132
|
-
...wait !== void 0 ? { withdrawalCooldownSeconds: wait } : {},
|
|
90374
|
+
...wait !== void 0 && !stalled ? { withdrawalCooldownSeconds: wait } : {},
|
|
90133
90375
|
...perf !== void 0 && protocol !== void 0 ? { performanceFeeBps: Number(perf + protocol) } : {},
|
|
90134
90376
|
...exitFeeBps !== void 0 ? { queuedFeeBps: Number(exitFeeBps) } : {},
|
|
90135
90377
|
depositFeeBps: 0,
|
|
@@ -93862,6 +94104,8 @@ var VOLATILE_VAULT_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
93862
94104
|
// that one NAV report can triple. Pinned in `mezzanine.test.ts`.
|
|
93863
94105
|
"1-0x6f5d94dc0c8bbf052abf024259d087da45ad96a1",
|
|
93864
94106
|
// mjHastra
|
|
94107
|
+
"1-0x95a3956dd49bd5efe7bf3edb199ddecc68057695",
|
|
94108
|
+
// mjPRIME
|
|
93865
94109
|
// IPOR Fusion loops and carries — the share price is collateral at an
|
|
93866
94110
|
// oracle mark minus debt, levered 5–9× on the loops, and on the carries the
|
|
93867
94111
|
// debt sits in a different currency than the vault (dollars against ETH or
|