@1delta/margin-fetcher 5.0.109 → 5.0.111
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 +120 -3
- package/dist/index.js +586 -65
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -45252,31 +45252,23 @@ var stKaiaFetcher = {
|
|
|
45252
45252
|
}
|
|
45253
45253
|
}
|
|
45254
45254
|
};
|
|
45255
|
-
var
|
|
45255
|
+
var YIELD_APY_URL = "https://api.lista.org/v1/stakes/yield-apy";
|
|
45256
45256
|
var SLISBNB = "Lista Staked BNB::slisBNB";
|
|
45257
|
-
var DAY_SECONDS2 = 86400;
|
|
45258
|
-
var LOOKBACK_SECONDS = 14 * DAY_SECONDS2;
|
|
45259
45257
|
var TIMEOUT_MS = 8e3;
|
|
45260
45258
|
var slisBnbFetcher = {
|
|
45261
45259
|
label: "SLISBNB",
|
|
45262
45260
|
fetch: async () => {
|
|
45263
|
-
const nowSec9 = Math.floor(Date.now() / 1e3);
|
|
45264
|
-
const url = `${HISTORY_URL}?name=slisBNBRate&cycle=1&startTime=${nowSec9 - LOOKBACK_SECONDS}&endTime=${nowSec9}`;
|
|
45265
45261
|
const controller = new AbortController();
|
|
45266
45262
|
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
45267
45263
|
try {
|
|
45268
|
-
const res = await fetch(
|
|
45264
|
+
const res = await fetch(YIELD_APY_URL, {
|
|
45269
45265
|
method: "GET",
|
|
45270
45266
|
headers: { Accept: "application/json" },
|
|
45271
45267
|
signal: controller.signal
|
|
45272
45268
|
}).then((r) => r.json());
|
|
45273
|
-
const
|
|
45274
|
-
if (
|
|
45275
|
-
|
|
45276
|
-
(a, b) => b.chartTime > a.chartTime ? b : a
|
|
45277
|
-
);
|
|
45278
|
-
const apr = Number(latest.amount);
|
|
45279
|
-
return { [SLISBNB]: Number.isFinite(apr) && apr > 0 ? apr : 0 };
|
|
45269
|
+
const apy = Number(res.data?.staking?.month3Apy);
|
|
45270
|
+
if (!Number.isFinite(apy) || apy <= 0) return {};
|
|
45271
|
+
return { [SLISBNB]: apyToAprPercent(apy * 100) };
|
|
45280
45272
|
} finally {
|
|
45281
45273
|
clearTimeout(timer);
|
|
45282
45274
|
}
|
|
@@ -46038,7 +46030,7 @@ var fraxSavingsFetcher = {
|
|
|
46038
46030
|
};
|
|
46039
46031
|
|
|
46040
46032
|
// src/yields/intrinsic/fetchers/binance.ts
|
|
46041
|
-
var
|
|
46033
|
+
var HISTORY_URL = "https://www.binance.com/bapi/earn/v1/public/pos/cftoken/project/exchange-rate/history";
|
|
46042
46034
|
var WBETH = "Wrapped Binance Beacon ETH::wBETH";
|
|
46043
46035
|
var LLAMA_POOL = "80b8bf92-b953-4c20-98ea-c9653ef2bb98";
|
|
46044
46036
|
var DAY_MS = 864e5;
|
|
@@ -46048,7 +46040,7 @@ var wbethFetcher = {
|
|
|
46048
46040
|
label: "WBETH",
|
|
46049
46041
|
fetch: async () => {
|
|
46050
46042
|
const now = Date.now();
|
|
46051
|
-
const url = `${
|
|
46043
|
+
const url = `${HISTORY_URL}?startTime=${now - LOOKBACK_MS}&endTime=${now}`;
|
|
46052
46044
|
try {
|
|
46053
46045
|
const res = await fetch(url, {
|
|
46054
46046
|
method: "GET",
|
|
@@ -49133,6 +49125,49 @@ var sthusdFetcher = {
|
|
|
49133
49125
|
};
|
|
49134
49126
|
}
|
|
49135
49127
|
};
|
|
49128
|
+
|
|
49129
|
+
// src/yields/intrinsic/fetchers/usual.ts
|
|
49130
|
+
var USDZEROPLUS_URL = "https://app.usual.money/api/rewards/rates/USD0++";
|
|
49131
|
+
var ETHZERO_URL = "https://app.usual.money/api/rewards/rates/ETH0";
|
|
49132
|
+
var BUSD0_KEY = "Staked USD0::USD0++";
|
|
49133
|
+
var usdZeroPlus = BUSD0_KEY;
|
|
49134
|
+
var ethZero = "ETH0::ETH0";
|
|
49135
|
+
var usdZeroPlusFetcher = {
|
|
49136
|
+
label: "USDZEROPLUS",
|
|
49137
|
+
fetch: async () => {
|
|
49138
|
+
const res = await fetch(USDZEROPLUS_URL, {
|
|
49139
|
+
method: "GET",
|
|
49140
|
+
headers: { Accept: "application/json" }
|
|
49141
|
+
}).then((r) => r.json());
|
|
49142
|
+
return { [usdZeroPlus]: Number(res?.rewards[0]?.apr ?? 0) * 100 };
|
|
49143
|
+
}
|
|
49144
|
+
};
|
|
49145
|
+
var ethZeroFetcher = {
|
|
49146
|
+
label: "ETHZERO",
|
|
49147
|
+
fetch: async () => {
|
|
49148
|
+
const res = await fetch(ETHZERO_URL, {
|
|
49149
|
+
method: "GET",
|
|
49150
|
+
headers: { Accept: "application/json" }
|
|
49151
|
+
}).then((r) => r.json());
|
|
49152
|
+
return { [ethZero]: Number(res?.rewards[0]?.apr ?? 0) * 100 };
|
|
49153
|
+
}
|
|
49154
|
+
};
|
|
49155
|
+
var USUAL_TOKEN = "0xc4441c2be5d8fa8126822b9929ca0b81ea0de38e";
|
|
49156
|
+
var fetchBusd0UsualPerDay = async () => {
|
|
49157
|
+
try {
|
|
49158
|
+
const res = await fetch(USDZEROPLUS_URL, {
|
|
49159
|
+
method: "GET",
|
|
49160
|
+
headers: { Accept: "application/json" }
|
|
49161
|
+
}).then((r) => r.json());
|
|
49162
|
+
const leg = res?.rewards?.find(
|
|
49163
|
+
(r) => r.rewardToken?.toLowerCase() === USUAL_TOKEN
|
|
49164
|
+
);
|
|
49165
|
+
const rate = Number(leg?.rate);
|
|
49166
|
+
return Number.isFinite(rate) && rate >= 0 ? rate : void 0;
|
|
49167
|
+
} catch {
|
|
49168
|
+
return void 0;
|
|
49169
|
+
}
|
|
49170
|
+
};
|
|
49136
49171
|
var CHAIN_ID14 = Chain.ETHEREUM_MAINNET;
|
|
49137
49172
|
var HUMA_PST_FEED = "0x4be50be32db1510240d542f77c5b36ca0d0965e6";
|
|
49138
49173
|
var HUMA_PST_KEY = "HUMA::PST";
|
|
@@ -52479,6 +52514,77 @@ var SINGLE_CHAIN_ENTRIES = {
|
|
|
52479
52514
|
yieldFetcher: saturnFetcher,
|
|
52480
52515
|
yieldKey: SUSDAT_KEY
|
|
52481
52516
|
},
|
|
52517
|
+
// ---- Usual (usual.money) — bUSD0, Bond USD0 (ex-USD0++) ------------
|
|
52518
|
+
//
|
|
52519
|
+
// A fixed-maturity BOND over USD0, not a staked stablecoin: one bUSD0 is
|
|
52520
|
+
// one USD0 at `getEndTime()` = 1844335800 (2028-06-11 11:30 UTC; the bond
|
|
52521
|
+
// started 2024-06-11 and runs `totalBondTimes()` = 4 years). Not ERC-4626
|
|
52522
|
+
// in any part, hence the `usual-bond` reader. Fully backed 1:1 — the
|
|
52523
|
+
// contract held exactly its supply in USD0 (518,288,230.80 each) on
|
|
52524
|
+
// 2026-10-07 — but the backing is admin-sweepable (`emergencyWithdraw`),
|
|
52525
|
+
// so `solvency` stays unasserted and the reader clamps the rate to it.
|
|
52526
|
+
//
|
|
52527
|
+
// The rate is par and NEVER drifts: the yield is a USUAL reward stream
|
|
52528
|
+
// (Usual's `rewards/rates/USD0++` API, ~5.6 % at integration), published
|
|
52529
|
+
// as `rewardsRate` with `supplyRate` 0 (`yieldLeg: 'rewards'`). The
|
|
52530
|
+
// interesting numbers are the early exits — `unlockUsd0ppFloorPrice` at
|
|
52531
|
+
// `getFloorPrice()` (0.92 → `withdrawFeeBps` 800), `unlockUSD0ppWithUsual`
|
|
52532
|
+
// at par for `calculateRequiredUsual` (2.147 USUAL per bUSD0 ≈ 2.6 % at
|
|
52533
|
+
// $0.0122), and `reconstruct` at par for an equal rt-bUSD0 burn, which only
|
|
52534
|
+
// V3 mints receive (~337.9k rt against ~518M bUSD0). The market sat at
|
|
52535
|
+
// ~0.971, so the floor is NOT the cheapest exit — the market and the USUAL
|
|
52536
|
+
// unlock both beat it. Every user path is `whenNotPaused`, and transfers
|
|
52537
|
+
// revert for USD0-blacklisted addresses.
|
|
52538
|
+
{
|
|
52539
|
+
reader: "usual-bond",
|
|
52540
|
+
address: "0x35d8949372d46b7a3d5a56006ae77b215fc69bc0",
|
|
52541
|
+
underlying: "0x73a15fed60bf67631dc6cd7bc5b6e8da8190acf5",
|
|
52542
|
+
// USD0
|
|
52543
|
+
symbol: "bUSD0",
|
|
52544
|
+
brand: "Usual",
|
|
52545
|
+
description: "Usual's four-year bond on its USD0 stablecoin: each bUSD0 is backed by one USD0 held in the contract and redeems for it at par on 11 June 2028. The yield is paid separately in USUAL tokens, not added to the bond. Leaving before maturity costs something \u2014 the guaranteed floor price (currently 0.92), a fee paid in USUAL for par, or a sale on the market below par \u2014 unless you still hold the redemption token from minting.",
|
|
52546
|
+
decimals: 18,
|
|
52547
|
+
isRebasing: false,
|
|
52548
|
+
isMintable: true,
|
|
52549
|
+
withdrawalMode: "fee-or-maturity",
|
|
52550
|
+
expiry: 1844335800,
|
|
52551
|
+
// getEndTime() — 2028-06-11 11:30 UTC
|
|
52552
|
+
usualBond: {
|
|
52553
|
+
redemptionToken: "0x82dca22b48b14de38ccf83b03330120c4b8acfe9",
|
|
52554
|
+
// rt-bUSD0
|
|
52555
|
+
parUnlockToken: "0xc4441c2be5d8fa8126822b9929ca0b81ea0de38e",
|
|
52556
|
+
// USUAL
|
|
52557
|
+
parUnlockTokenSymbol: "USUAL"
|
|
52558
|
+
},
|
|
52559
|
+
// The yield is USUAL, paid outside the share price and claimed from
|
|
52560
|
+
// Usual's DistributionModule against an off-chain cumulative merkle.
|
|
52561
|
+
// `rewardsRate` is priced on the PAR basis from the per-day emission;
|
|
52562
|
+
// the API's market-basis `apr` (the `yieldFetcher`) is the fallback.
|
|
52563
|
+
yieldLeg: "rewards",
|
|
52564
|
+
rewardStream: {
|
|
52565
|
+
token: {
|
|
52566
|
+
address: "0xc4441c2be5d8fa8126822b9929ca0b81ea0de38e",
|
|
52567
|
+
chainId: "1",
|
|
52568
|
+
symbol: "USUAL",
|
|
52569
|
+
decimals: 18
|
|
52570
|
+
},
|
|
52571
|
+
source: {
|
|
52572
|
+
id: "usual:busd0",
|
|
52573
|
+
label: "Usual \xB7 bUSD0",
|
|
52574
|
+
link: "https://app.usual.money/rewards",
|
|
52575
|
+
platform: "usual",
|
|
52576
|
+
refs: {
|
|
52577
|
+
distribution: "usual-merkle",
|
|
52578
|
+
claimContract: "0x75cc0c0ddd2ccafe6ec415be686267588011e36a",
|
|
52579
|
+
proofApi: "https://app.usual.money/api/rewards/<account>"
|
|
52580
|
+
}
|
|
52581
|
+
},
|
|
52582
|
+
claim: "manual",
|
|
52583
|
+
emissionPerSharePerDay: fetchBusd0UsualPerDay
|
|
52584
|
+
},
|
|
52585
|
+
yieldFetcher: usdZeroPlusFetcher,
|
|
52586
|
+
yieldKey: BUSD0_KEY
|
|
52587
|
+
},
|
|
52482
52588
|
// ---- Strata (docs.strata.markets) — senior/junior risk tranches ----
|
|
52483
52589
|
//
|
|
52484
52590
|
// Six CDO markets, twelve ERC-4626 tranche tokens, all Ethereum.
|
|
@@ -55516,9 +55622,9 @@ function averageDataLastN(arr, n = 7) {
|
|
|
55516
55622
|
if (last.length === 0) return 0;
|
|
55517
55623
|
return last.reduce((sum3, x) => sum3 + x.data, 0) / last.length;
|
|
55518
55624
|
}
|
|
55519
|
-
var safeFetch = async (label,
|
|
55625
|
+
var safeFetch = async (label, fn2) => {
|
|
55520
55626
|
try {
|
|
55521
|
-
return await
|
|
55627
|
+
return await fn2();
|
|
55522
55628
|
} catch (e) {
|
|
55523
55629
|
console.error(`Error fetching ${label}:`, e);
|
|
55524
55630
|
return void 0;
|
|
@@ -55558,32 +55664,6 @@ var csusdlFetcher = {
|
|
|
55558
55664
|
}
|
|
55559
55665
|
};
|
|
55560
55666
|
|
|
55561
|
-
// src/yields/intrinsic/fetchers/usual.ts
|
|
55562
|
-
var USDZEROPLUS_URL = "https://app.usual.money/api/rewards/rates/USD0++";
|
|
55563
|
-
var ETHZERO_URL = "https://app.usual.money/api/rewards/rates/ETH0";
|
|
55564
|
-
var usdZeroPlus = "Staked USD0::USD0++";
|
|
55565
|
-
var ethZero = "ETH0::ETH0";
|
|
55566
|
-
var usdZeroPlusFetcher = {
|
|
55567
|
-
label: "USDZEROPLUS",
|
|
55568
|
-
fetch: async () => {
|
|
55569
|
-
const res = await fetch(USDZEROPLUS_URL, {
|
|
55570
|
-
method: "GET",
|
|
55571
|
-
headers: { Accept: "application/json" }
|
|
55572
|
-
}).then((r) => r.json());
|
|
55573
|
-
return { [usdZeroPlus]: Number(res?.rewards[0]?.apr ?? 0) * 100 };
|
|
55574
|
-
}
|
|
55575
|
-
};
|
|
55576
|
-
var ethZeroFetcher = {
|
|
55577
|
-
label: "ETHZERO",
|
|
55578
|
-
fetch: async () => {
|
|
55579
|
-
const res = await fetch(ETHZERO_URL, {
|
|
55580
|
-
method: "GET",
|
|
55581
|
-
headers: { Accept: "application/json" }
|
|
55582
|
-
}).then((r) => r.json());
|
|
55583
|
-
return { [ethZero]: Number(res?.rewards[0]?.apr ?? 0) * 100 };
|
|
55584
|
-
}
|
|
55585
|
-
};
|
|
55586
|
-
|
|
55587
55667
|
// src/yields/intrinsic/fetchers/jito.ts
|
|
55588
55668
|
var JITOSOL_URL = "https://www.jito.network/api/getJitoPoolStats/";
|
|
55589
55669
|
var jitoSol = "Jito Staked SOL::JitoSOL";
|
|
@@ -60889,9 +60969,9 @@ function countFailures(data, offset, count) {
|
|
|
60889
60969
|
}
|
|
60890
60970
|
return failures;
|
|
60891
60971
|
}
|
|
60892
|
-
function safeGetCalls(fetcherName,
|
|
60972
|
+
function safeGetCalls(fetcherName, fn2, errors) {
|
|
60893
60973
|
try {
|
|
60894
|
-
return
|
|
60974
|
+
return fn2();
|
|
60895
60975
|
} catch (e) {
|
|
60896
60976
|
errors[fetcherName] = e instanceof Error ? e.message : String(e);
|
|
60897
60977
|
return [];
|
|
@@ -65256,14 +65336,14 @@ function mapApiDetail(d, chainId, prices, tokenList, shareDecimalsByVault, entit
|
|
|
65256
65336
|
liquidityUsd
|
|
65257
65337
|
};
|
|
65258
65338
|
}
|
|
65259
|
-
async function mapWithConcurrency(items, limit,
|
|
65339
|
+
async function mapWithConcurrency(items, limit, fn2) {
|
|
65260
65340
|
const out = new Array(items.length);
|
|
65261
65341
|
let cursor = 0;
|
|
65262
65342
|
const worker = async () => {
|
|
65263
65343
|
while (true) {
|
|
65264
65344
|
const i = cursor++;
|
|
65265
65345
|
if (i >= items.length) break;
|
|
65266
|
-
out[i] = await
|
|
65346
|
+
out[i] = await fn2(items[i]);
|
|
65267
65347
|
}
|
|
65268
65348
|
};
|
|
65269
65349
|
await Promise.all(
|
|
@@ -67581,6 +67661,87 @@ var marketRoute = () => ({
|
|
|
67581
67661
|
settlement: "market",
|
|
67582
67662
|
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."
|
|
67583
67663
|
});
|
|
67664
|
+
var capped = (a, b) => {
|
|
67665
|
+
if (a === void 0) return b;
|
|
67666
|
+
if (b === void 0) return a;
|
|
67667
|
+
return BigInt(a) < BigInt(b) ? a : b;
|
|
67668
|
+
};
|
|
67669
|
+
var bondExitRoutes = (i) => {
|
|
67670
|
+
const routes2 = [];
|
|
67671
|
+
const now = i.now ?? Math.floor(Date.now() / 1e3);
|
|
67672
|
+
const matured = i.expiry !== void 0 && now >= i.expiry;
|
|
67673
|
+
const capacity = {
|
|
67674
|
+
capacity: i.liquidity,
|
|
67675
|
+
capacityFormatted: i.liquidityFormatted,
|
|
67676
|
+
capacityUsd: i.liquidityUsd
|
|
67677
|
+
};
|
|
67678
|
+
if (i.withdrawFeeBps != null)
|
|
67679
|
+
routes2.push({
|
|
67680
|
+
id: "floor",
|
|
67681
|
+
kind: "instant",
|
|
67682
|
+
label: "Early exit at the floor price",
|
|
67683
|
+
settlement: "sync",
|
|
67684
|
+
feeBps: i.withdrawFeeBps,
|
|
67685
|
+
waitSeconds: 0,
|
|
67686
|
+
...capacity,
|
|
67687
|
+
selfOnly: true,
|
|
67688
|
+
description: "Burns the bond now for the protocol's floor price; the difference to par goes to the protocol's treasury, not to you. Pays the sender only."
|
|
67689
|
+
});
|
|
67690
|
+
if (i.parUnlockAvailable) {
|
|
67691
|
+
const token = i.parUnlockTokenSymbol ?? "the protocol token";
|
|
67692
|
+
routes2.push({
|
|
67693
|
+
id: "usual-unlock",
|
|
67694
|
+
kind: "instant",
|
|
67695
|
+
label: `Early exit at par (pays ${token})`,
|
|
67696
|
+
settlement: "sync",
|
|
67697
|
+
feeBps: i.parUnlockFeeBps,
|
|
67698
|
+
...i.parUnlockFeeBps == null ? { feeUnknown: true } : {},
|
|
67699
|
+
waitSeconds: 0,
|
|
67700
|
+
...capacity,
|
|
67701
|
+
selfOnly: true,
|
|
67702
|
+
description: `Pays par in the underlying, but you must also pay ${token} \u2014 a fixed amount per bond, so its cost in dollars moves with ${token}'s price. Pays the sender only.`
|
|
67703
|
+
});
|
|
67704
|
+
}
|
|
67705
|
+
if (i.redemptionTokenCapacity !== void 0)
|
|
67706
|
+
routes2.push({
|
|
67707
|
+
id: "reconstruct",
|
|
67708
|
+
kind: "instant",
|
|
67709
|
+
label: "Par with the redemption token",
|
|
67710
|
+
settlement: "sync",
|
|
67711
|
+
feeBps: 0,
|
|
67712
|
+
waitSeconds: 0,
|
|
67713
|
+
capacity: capped(i.liquidity, i.redemptionTokenCapacity),
|
|
67714
|
+
capacityFormatted: i.liquidityFormatted !== void 0 && i.redemptionTokenCapacityFormatted !== void 0 ? Math.min(i.liquidityFormatted, i.redemptionTokenCapacityFormatted) : i.redemptionTokenCapacityFormatted ?? i.liquidityFormatted,
|
|
67715
|
+
description: "Free and at par any time, but it burns an equal amount of the redemption token, which only fresh mints receive \u2014 a holder who bought the bond, or minted it before the token existed, cannot take this route. Capacity is the token supply across everyone."
|
|
67716
|
+
});
|
|
67717
|
+
routes2.push(
|
|
67718
|
+
matured ? {
|
|
67719
|
+
id: "maturity",
|
|
67720
|
+
kind: "instant",
|
|
67721
|
+
label: "Par at maturity",
|
|
67722
|
+
settlement: "sync",
|
|
67723
|
+
feeBps: 0,
|
|
67724
|
+
waitSeconds: 0,
|
|
67725
|
+
description: "The bond has matured: redeem at par. Burns your WHOLE balance in one call."
|
|
67726
|
+
} : {
|
|
67727
|
+
id: "maturity",
|
|
67728
|
+
kind: "queued",
|
|
67729
|
+
label: i.expiry !== void 0 ? `Par at maturity (${new Date(i.expiry * 1e3).toISOString().slice(0, 10)})` : "Par at maturity",
|
|
67730
|
+
settlement: "async",
|
|
67731
|
+
feeBps: 0,
|
|
67732
|
+
waitSeconds: i.expiry !== void 0 ? Math.max(0, i.expiry - now) : void 0,
|
|
67733
|
+
description: "Hold to the maturity date and redeem at par \u2014 nothing to request in the meantime. The redemption burns your WHOLE balance in one call."
|
|
67734
|
+
}
|
|
67735
|
+
);
|
|
67736
|
+
routes2.push({
|
|
67737
|
+
id: "market",
|
|
67738
|
+
kind: "market",
|
|
67739
|
+
label: "Sell on the market",
|
|
67740
|
+
settlement: "market",
|
|
67741
|
+
description: "Sell the bond to somebody else. It fills at the market price \u2014 usually a discount to par that closes toward maturity \u2014 not at the row's `exchangeRate`, with price impact that grows with size, so the leg must be built with a slippage bound."
|
|
67742
|
+
});
|
|
67743
|
+
return routes2;
|
|
67744
|
+
};
|
|
67584
67745
|
var deriveExitRoutes = (i) => {
|
|
67585
67746
|
const routes2 = deriveProtocolExitRoutes(i);
|
|
67586
67747
|
return i.secondaryMarketOnly ? [...routes2, marketRoute()] : routes2;
|
|
@@ -67607,6 +67768,8 @@ var deriveProtocolExitRoutes = (i) => {
|
|
|
67607
67768
|
// inventory instead.
|
|
67608
67769
|
case "instant-or-queued":
|
|
67609
67770
|
return [instantRoute(i, i.withdrawFeeBps ?? 0), queuedRoute(i)];
|
|
67771
|
+
case "fee-or-maturity":
|
|
67772
|
+
return bondExitRoutes(i);
|
|
67610
67773
|
case "instant":
|
|
67611
67774
|
return [
|
|
67612
67775
|
{
|
|
@@ -72236,6 +72399,30 @@ var NEST_FEE_INSTANT_REDEMPTION = 0;
|
|
|
72236
72399
|
var NEST_FEE_DEPOSIT = 1;
|
|
72237
72400
|
var NEST_FEE_REDEMPTION = 2;
|
|
72238
72401
|
|
|
72402
|
+
// src/vaults/savings/abis/usual.ts
|
|
72403
|
+
var view = (name, inputs = []) => ({
|
|
72404
|
+
name,
|
|
72405
|
+
type: "function",
|
|
72406
|
+
stateMutability: "view",
|
|
72407
|
+
inputs,
|
|
72408
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
72409
|
+
});
|
|
72410
|
+
var UsualBondFloorPriceAbi = [view("getFloorPrice")];
|
|
72411
|
+
var UsualBondStartTimeAbi = [view("getStartTime")];
|
|
72412
|
+
var UsualBondEndTimeAbi = [view("getEndTime")];
|
|
72413
|
+
var UsualBondRequiredUsualAbi = [
|
|
72414
|
+
view("calculateRequiredUsual", [{ name: "usd0ppAmount", type: "uint256" }])
|
|
72415
|
+
];
|
|
72416
|
+
var UsualBondPausedAbi = [
|
|
72417
|
+
{
|
|
72418
|
+
name: "paused",
|
|
72419
|
+
type: "function",
|
|
72420
|
+
stateMutability: "view",
|
|
72421
|
+
inputs: [],
|
|
72422
|
+
outputs: [{ name: "", type: "bool" }]
|
|
72423
|
+
}
|
|
72424
|
+
];
|
|
72425
|
+
|
|
72239
72426
|
// src/vaults/savings/readers/erc4626Idle.ts
|
|
72240
72427
|
var readerErc4626Idle = (entry) => {
|
|
72241
72428
|
const shareUnit = 10n ** BigInt(entry.decimals);
|
|
@@ -72801,6 +72988,88 @@ var readerSaturnVault = (entry) => {
|
|
|
72801
72988
|
};
|
|
72802
72989
|
};
|
|
72803
72990
|
|
|
72991
|
+
// src/vaults/savings/readers/usualBond.ts
|
|
72992
|
+
var readerUsualBond = (entry) => {
|
|
72993
|
+
const cfg = entry.usualBond;
|
|
72994
|
+
const shareUnit = 10n ** BigInt(entry.decimals);
|
|
72995
|
+
return {
|
|
72996
|
+
calls: [
|
|
72997
|
+
{ address: entry.address, name: "totalSupply", params: [] },
|
|
72998
|
+
{ address: entry.underlying, name: "balanceOf", params: [entry.address] },
|
|
72999
|
+
{ address: entry.address, name: "getFloorPrice", params: [] },
|
|
73000
|
+
{ address: entry.address, name: "getStartTime", params: [] },
|
|
73001
|
+
{ address: entry.address, name: "getEndTime", params: [] },
|
|
73002
|
+
{ address: entry.address, name: "paused", params: [] },
|
|
73003
|
+
// No pinned rt token ⇒ read the bond's own supply in its place and
|
|
73004
|
+
// discard it, keeping the slice width fixed.
|
|
73005
|
+
{
|
|
73006
|
+
address: cfg?.redemptionToken ?? entry.address,
|
|
73007
|
+
name: "totalSupply",
|
|
73008
|
+
params: []
|
|
73009
|
+
},
|
|
73010
|
+
{
|
|
73011
|
+
address: entry.address,
|
|
73012
|
+
name: "calculateRequiredUsual",
|
|
73013
|
+
params: [shareUnit]
|
|
73014
|
+
}
|
|
73015
|
+
],
|
|
73016
|
+
abis: [
|
|
73017
|
+
TotalSupplyAbi2,
|
|
73018
|
+
BalanceOfAbi,
|
|
73019
|
+
UsualBondFloorPriceAbi,
|
|
73020
|
+
UsualBondStartTimeAbi,
|
|
73021
|
+
UsualBondEndTimeAbi,
|
|
73022
|
+
UsualBondPausedAbi,
|
|
73023
|
+
TotalSupplyAbi2,
|
|
73024
|
+
UsualBondRequiredUsualAbi
|
|
73025
|
+
],
|
|
73026
|
+
parse: ([
|
|
73027
|
+
supply,
|
|
73028
|
+
backingRaw,
|
|
73029
|
+
floor,
|
|
73030
|
+
start,
|
|
73031
|
+
end,
|
|
73032
|
+
paused,
|
|
73033
|
+
rtSupply,
|
|
73034
|
+
usual
|
|
73035
|
+
]) => {
|
|
73036
|
+
const totalSupply = toBigInt16(supply);
|
|
73037
|
+
const backing = toBigInt16(backingRaw);
|
|
73038
|
+
const endTime = toBigInt16(end);
|
|
73039
|
+
if (totalSupply === void 0 || backing === void 0 || endTime === void 0 || endTime <= 0n)
|
|
73040
|
+
return void 0;
|
|
73041
|
+
const exchangeRate = totalSupply > 0n && backing < totalSupply ? backing * ONE_E1815 / totalSupply : ONE_E1815;
|
|
73042
|
+
const floorPrice = toBigInt16(floor);
|
|
73043
|
+
const startTime = toBigInt16(start);
|
|
73044
|
+
const isPaused = typeof paused === "boolean" ? paused : void 0;
|
|
73045
|
+
const parUnlockCostPerShare = toBigInt16(usual);
|
|
73046
|
+
return {
|
|
73047
|
+
totalAssets: backing,
|
|
73048
|
+
totalSupply,
|
|
73049
|
+
exchangeRate,
|
|
73050
|
+
expiry: Number(endTime),
|
|
73051
|
+
paused: isPaused,
|
|
73052
|
+
// The floor exit's haircut, in the field every reader uses for "what
|
|
73053
|
+
// the immediate exit costs". Rounded UP: 0.92 → 800 bps exactly, and a
|
|
73054
|
+
// floor that is not a whole bps never reads cheaper than it is.
|
|
73055
|
+
withdrawFeeBps: floorPrice !== void 0 && floorPrice > 0n && floorPrice <= ONE_E1815 ? Number((ONE_E1815 - floorPrice + 10n ** 14n - 1n) / 10n ** 14n) : void 0,
|
|
73056
|
+
// Unread ⇒ assume open (the immediate exits are the norm); a READ pause
|
|
73057
|
+
// closes every leg, maturity included.
|
|
73058
|
+
instantRedeemEnabled: isPaused !== true,
|
|
73059
|
+
// Every immediate exit pays out of the bond's own USD0 — at most the
|
|
73060
|
+
// whole backing, never more.
|
|
73061
|
+
instantRedeemCapacity: isPaused === true ? 0n : backing,
|
|
73062
|
+
bond: {
|
|
73063
|
+
floorPrice,
|
|
73064
|
+
startTime: startTime !== void 0 ? Number(startTime) : void 0,
|
|
73065
|
+
redemptionTokenSupply: cfg?.redemptionToken ? toBigInt16(rtSupply) : void 0,
|
|
73066
|
+
parUnlockCostPerShare
|
|
73067
|
+
}
|
|
73068
|
+
};
|
|
73069
|
+
}
|
|
73070
|
+
};
|
|
73071
|
+
};
|
|
73072
|
+
|
|
72804
73073
|
// src/vaults/savings/readers/venusHub.ts
|
|
72805
73074
|
var NEUTRAL_PROBE2 = "0x000000000000000000000000000000000000dead";
|
|
72806
73075
|
var BPS_TO_PCT = 100;
|
|
@@ -73092,6 +73361,8 @@ var buildReader2 = (entry) => {
|
|
|
73092
73361
|
return readerSaturnVault(entry);
|
|
73093
73362
|
case "nest-vault":
|
|
73094
73363
|
return readerNestVault(entry);
|
|
73364
|
+
case "usual-bond":
|
|
73365
|
+
return readerUsualBond(entry);
|
|
73095
73366
|
case "erc4626-cooldown":
|
|
73096
73367
|
return readerErc4626Cooldown(entry);
|
|
73097
73368
|
case "erc4626-idle":
|
|
@@ -73147,19 +73418,64 @@ var bitfiExitRoutes = (exit, waitSeconds) => {
|
|
|
73147
73418
|
}
|
|
73148
73419
|
return routes2;
|
|
73149
73420
|
};
|
|
73421
|
+
var resolveRewardEmissions = async (entries) => {
|
|
73422
|
+
const byFn = /* @__PURE__ */ new Map();
|
|
73423
|
+
const out = /* @__PURE__ */ new Map();
|
|
73424
|
+
await Promise.all(
|
|
73425
|
+
entries.map(async (e) => {
|
|
73426
|
+
const fn2 = e.rewardStream?.emissionPerSharePerDay;
|
|
73427
|
+
if (!fn2) return;
|
|
73428
|
+
if (!byFn.has(fn2))
|
|
73429
|
+
byFn.set(
|
|
73430
|
+
fn2,
|
|
73431
|
+
fn2().catch(() => void 0)
|
|
73432
|
+
);
|
|
73433
|
+
out.set(e.address.toLowerCase(), await byFn.get(fn2));
|
|
73434
|
+
})
|
|
73435
|
+
);
|
|
73436
|
+
return out;
|
|
73437
|
+
};
|
|
73438
|
+
var rewardsLeg = (entry, i) => {
|
|
73439
|
+
const cfg = entry.rewardStream;
|
|
73440
|
+
const tokenPrice = cfg ? i.prices[cfg.token.address.toLowerCase()] : void 0;
|
|
73441
|
+
const redeemUsd = i.underlyingPriceUsd !== void 0 ? Number(i.exchangeRate) / 1e18 * i.underlyingPriceUsd : void 0;
|
|
73442
|
+
const parApr = i.perSharePerDay !== void 0 && tokenPrice !== void 0 && redeemUsd !== void 0 && redeemUsd > 0 ? i.perSharePerDay * 365 * tokenPrice / redeemUsd * 100 : void 0;
|
|
73443
|
+
const apr = parApr ?? i.fetcherApr ?? 0;
|
|
73444
|
+
if (!cfg) return { apr };
|
|
73445
|
+
return {
|
|
73446
|
+
apr,
|
|
73447
|
+
streams: [
|
|
73448
|
+
{
|
|
73449
|
+
side: "deposit",
|
|
73450
|
+
apr,
|
|
73451
|
+
kind: "token",
|
|
73452
|
+
token: { ...cfg.token, priceUsd: tokenPrice },
|
|
73453
|
+
source: {
|
|
73454
|
+
...cfg.source,
|
|
73455
|
+
refs: {
|
|
73456
|
+
...cfg.source.refs ?? {},
|
|
73457
|
+
aprBasis: parApr !== void 0 ? "redemption-value" : i.fetcherApr !== void 0 ? "source" : "unknown"
|
|
73458
|
+
}
|
|
73459
|
+
},
|
|
73460
|
+
claim: cfg.claim
|
|
73461
|
+
}
|
|
73462
|
+
]
|
|
73463
|
+
};
|
|
73464
|
+
};
|
|
73150
73465
|
var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList = {}) => {
|
|
73151
73466
|
const entries = getSavingsRegistry(chainId);
|
|
73152
73467
|
if (entries.length === 0) return {};
|
|
73153
73468
|
const readers = entries.map(buildReader2);
|
|
73154
73469
|
const allCalls = readers.flatMap((r) => r.calls);
|
|
73155
73470
|
const allAbis = readers.flatMap((r) => r.abis);
|
|
73156
|
-
const [rawResults, aprByAddress] = await Promise.all([
|
|
73471
|
+
const [rawResults, aprByAddress, emissionByAddress] = await Promise.all([
|
|
73157
73472
|
allCalls.length > 0 ? multicallRetry({
|
|
73158
73473
|
chain: chainId,
|
|
73159
73474
|
calls: allCalls,
|
|
73160
73475
|
abi: allAbis
|
|
73161
73476
|
}) : Promise.resolve([]),
|
|
73162
|
-
resolveYieldApr2(entries)
|
|
73477
|
+
resolveYieldApr2(entries),
|
|
73478
|
+
resolveRewardEmissions(entries)
|
|
73163
73479
|
]);
|
|
73164
73480
|
const out = {};
|
|
73165
73481
|
let cursor = 0;
|
|
@@ -73174,8 +73490,16 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73174
73490
|
const underlyingLc = entry.underlying.toLowerCase();
|
|
73175
73491
|
const asset = tokenList[underlyingLc];
|
|
73176
73492
|
const priceUsd = prices[underlyingLc];
|
|
73177
|
-
const
|
|
73178
|
-
const
|
|
73493
|
+
const fetcherApr = aprByAddress[addressLc];
|
|
73494
|
+
const rewards = entry.yieldLeg === "rewards" ? rewardsLeg(entry, {
|
|
73495
|
+
perSharePerDay: emissionByAddress.get(addressLc),
|
|
73496
|
+
fetcherApr,
|
|
73497
|
+
exchangeRate: state.exchangeRate,
|
|
73498
|
+
underlyingPriceUsd: priceUsd,
|
|
73499
|
+
prices
|
|
73500
|
+
}) : void 0;
|
|
73501
|
+
const supplyRate = state.supplyRate ?? (rewards ? 0 : fetcherApr ?? 0);
|
|
73502
|
+
const rewardsRate = rewards?.apr ?? 0;
|
|
73179
73503
|
const depositRate = supplyRate + rewardsRate;
|
|
73180
73504
|
const shareDec = entry.decimals;
|
|
73181
73505
|
const underlyingDec = entry.underlyingDecimals ?? entry.decimals;
|
|
@@ -73203,6 +73527,18 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73203
73527
|
const redemptionDiscountBps = state.fundamentalExchangeRate !== void 0 && state.fundamentalExchangeRate > 0n ? Number(
|
|
73204
73528
|
state.exchangeRate * 100000000n / state.fundamentalExchangeRate - 100000000n
|
|
73205
73529
|
) / 1e4 : void 0;
|
|
73530
|
+
const bond = state.bond;
|
|
73531
|
+
const isBond = entry.withdrawalMode === "fee-or-maturity";
|
|
73532
|
+
const sharePriceUsd = prices[addressLc];
|
|
73533
|
+
const redeemableUsd = priceUsd !== void 0 ? Number(state.exchangeRate) / 1e18 * priceUsd : 0;
|
|
73534
|
+
const marketDiscountBps = isBond && sharePriceUsd !== void 0 && redeemableUsd > 0 ? Math.round((sharePriceUsd / redeemableUsd - 1) * 1e5) / 10 : void 0;
|
|
73535
|
+
const parToken = entry.usualBond?.parUnlockToken.toLowerCase();
|
|
73536
|
+
const parTokenPrice = parToken !== void 0 ? prices[parToken] : void 0;
|
|
73537
|
+
const parTokenDec = parToken !== void 0 ? tokenList[parToken]?.decimals ?? 18 : 18;
|
|
73538
|
+
const parUnlockFeeBps = bond?.parUnlockCostPerShare !== void 0 && parTokenPrice !== void 0 && redeemableUsd > 0 ? Math.round(
|
|
73539
|
+
Number(bond.parUnlockCostPerShare) / 10 ** parTokenDec * parTokenPrice * 1e4 / redeemableUsd
|
|
73540
|
+
) : void 0;
|
|
73541
|
+
const rtSupply = bond?.redemptionTokenSupply;
|
|
73206
73542
|
const productName = entry.label ?? entry.symbol;
|
|
73207
73543
|
const displayName = entry.label ? `${entry.brand} ${entry.label}` : composeVaultDisplayName(
|
|
73208
73544
|
entry.brand,
|
|
@@ -73232,6 +73568,9 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73232
73568
|
supplyRate,
|
|
73233
73569
|
rewardsRate,
|
|
73234
73570
|
depositRate,
|
|
73571
|
+
// What `rewardsRate` is paid in and how it is claimed — only on
|
|
73572
|
+
// `yieldLeg: 'rewards'` entries.
|
|
73573
|
+
rewardStreams: rewards?.streams,
|
|
73235
73574
|
// NOT part of `depositRate` — it is the incentive the vault's position
|
|
73236
73575
|
// earns and the depositor does not. See the field's docstring.
|
|
73237
73576
|
strandedRewardsRate: state.strandedRewardsRate,
|
|
@@ -73264,6 +73603,18 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73264
73603
|
withdrawalCooldownSeconds: state.withdrawalCooldownSeconds ?? entry.withdrawalCooldownSeconds,
|
|
73265
73604
|
withdrawFeeBps: state.withdrawFeeBps,
|
|
73266
73605
|
depositFeeBps: state.depositFeeBps,
|
|
73606
|
+
// Bond terms — absent on every perpetual vault. See the type.
|
|
73607
|
+
expiry: state.expiry ?? entry.expiry,
|
|
73608
|
+
isPaused: state.paused,
|
|
73609
|
+
floorPrice: bond?.floorPrice?.toString(),
|
|
73610
|
+
marketDiscountBps,
|
|
73611
|
+
bond: bond ? {
|
|
73612
|
+
startTime: bond.startTime,
|
|
73613
|
+
redemptionToken: entry.usualBond?.redemptionToken.toLowerCase(),
|
|
73614
|
+
redemptionTokenSupply: rtSupply?.toString(),
|
|
73615
|
+
parUnlockToken: parToken,
|
|
73616
|
+
parUnlockCostPerShare: bond.parUnlockCostPerShare?.toString()
|
|
73617
|
+
} : void 0,
|
|
73267
73618
|
// Term-sheet inputs that no reader can derive — see the registry's
|
|
73268
73619
|
// docstrings. Passed through verbatim so the sheet can stop hardcoding
|
|
73269
73620
|
// "compounds per second" and "needs an approval" for every vault.
|
|
@@ -73298,7 +73649,14 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73298
73649
|
exitMinAmountFormatted: state.exitMinAmount !== void 0 ? Number(state.exitMinAmount) / 10 ** underlyingDec : void 0,
|
|
73299
73650
|
// Adds the `market` leg — the only route a holder without the
|
|
73300
73651
|
// protocol's mint/redeem permission actually has.
|
|
73301
|
-
secondaryMarketOnly: entry.secondaryMarketOnly
|
|
73652
|
+
secondaryMarketOnly: entry.secondaryMarketOnly,
|
|
73653
|
+
// Bond legs (`fee-or-maturity` only; ignored by every other mode).
|
|
73654
|
+
expiry: state.expiry ?? entry.expiry,
|
|
73655
|
+
redemptionTokenCapacity: rtSupply?.toString(),
|
|
73656
|
+
redemptionTokenCapacityFormatted: rtSupply !== void 0 ? Number(rtSupply) / 10 ** underlyingDec : void 0,
|
|
73657
|
+
parUnlockAvailable: bond?.parUnlockCostPerShare !== void 0 && bond.parUnlockCostPerShare > 0n,
|
|
73658
|
+
parUnlockFeeBps,
|
|
73659
|
+
parUnlockTokenSymbol: entry.usualBond?.parUnlockTokenSymbol
|
|
73302
73660
|
}),
|
|
73303
73661
|
resolveSelfOnly(chainId, entry.address)
|
|
73304
73662
|
),
|
|
@@ -73325,6 +73683,143 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
73325
73683
|
return out;
|
|
73326
73684
|
};
|
|
73327
73685
|
|
|
73686
|
+
// src/vaults/savings/usualRewards.ts
|
|
73687
|
+
var USUAL_DISTRIBUTION_MODULE = "0x75cc0c0ddd2ccafe6ec415be686267588011e36a";
|
|
73688
|
+
var USUAL_REWARDS_API = "https://app.usual.money/api/rewards";
|
|
73689
|
+
var ZERO7 = "0x0000000000000000000000000000000000000000";
|
|
73690
|
+
var fn = (name, inputs, outputs) => ({ name, type: "function", stateMutability: "view", inputs, outputs });
|
|
73691
|
+
var acct = [{ name: "account", type: "address" }];
|
|
73692
|
+
var UsualDistributionModuleReadAbi = [
|
|
73693
|
+
fn(
|
|
73694
|
+
"getOffChainDistributionData",
|
|
73695
|
+
[],
|
|
73696
|
+
[
|
|
73697
|
+
{ name: "timestamp", type: "uint256" },
|
|
73698
|
+
{ name: "merkleRoot", type: "bytes32" }
|
|
73699
|
+
]
|
|
73700
|
+
),
|
|
73701
|
+
fn("getOffChainTokensClaimed", acct, [{ name: "", type: "uint256" }]),
|
|
73702
|
+
fn("getClaimOnlySelf", acct, [{ name: "", type: "bool" }]),
|
|
73703
|
+
fn("getRedirectedAccount", acct, [{ name: "", type: "address" }]),
|
|
73704
|
+
fn("paused", [], [{ name: "", type: "bool" }]),
|
|
73705
|
+
fn("getOffChainDistributionMintCap", [], [{ name: "", type: "uint256" }])
|
|
73706
|
+
];
|
|
73707
|
+
var isHex32 = (v) => typeof v === "string" && /^0x[0-9a-fA-F]{64}$/.test(v);
|
|
73708
|
+
var selectUsualRewardEntry = (entries, onchainRoot) => {
|
|
73709
|
+
if (!Array.isArray(entries))
|
|
73710
|
+
return {
|
|
73711
|
+
status: "unknown",
|
|
73712
|
+
reason: "Usual rewards API reply is not a list"
|
|
73713
|
+
};
|
|
73714
|
+
if (entries.length === 0)
|
|
73715
|
+
return { status: "ok", cumulative: 0n, proof: [], pending: 0n };
|
|
73716
|
+
const parsed = [];
|
|
73717
|
+
for (const e of entries) {
|
|
73718
|
+
try {
|
|
73719
|
+
if (!isHex32(e?.merkleRoot) || !Array.isArray(e.merkleProof)) continue;
|
|
73720
|
+
if (!e.merkleProof.every(isHex32)) continue;
|
|
73721
|
+
parsed.push({
|
|
73722
|
+
root: e.merkleRoot.toLowerCase(),
|
|
73723
|
+
value: BigInt(e.value),
|
|
73724
|
+
proof: e.merkleProof,
|
|
73725
|
+
block: Number(e.blockNumber)
|
|
73726
|
+
});
|
|
73727
|
+
} catch {
|
|
73728
|
+
}
|
|
73729
|
+
}
|
|
73730
|
+
const root = onchainRoot.toLowerCase();
|
|
73731
|
+
const match = parsed.find((p) => p.root === root);
|
|
73732
|
+
if (!match)
|
|
73733
|
+
return {
|
|
73734
|
+
status: "unknown",
|
|
73735
|
+
reason: `Usual rewards API has no entry for the approved on-chain root ${onchainRoot} (it lists ${parsed.length} other root(s)) \u2014 the API and the chain are out of step`
|
|
73736
|
+
};
|
|
73737
|
+
const newest = parsed.reduce((a, b) => b.block > a.block ? b : a, match);
|
|
73738
|
+
const pending = newest.value > match.value ? newest.value - match.value : 0n;
|
|
73739
|
+
return {
|
|
73740
|
+
status: "ok",
|
|
73741
|
+
cumulative: match.value,
|
|
73742
|
+
proof: match.proof,
|
|
73743
|
+
pending
|
|
73744
|
+
};
|
|
73745
|
+
};
|
|
73746
|
+
var fetchUsualRewardsClaimData = async (account, multicallRetry, opts = {}) => {
|
|
73747
|
+
const dm = (opts.distributionModule ?? USUAL_DISTRIBUTION_MODULE).toLowerCase();
|
|
73748
|
+
const who = account.toLowerCase();
|
|
73749
|
+
let res;
|
|
73750
|
+
try {
|
|
73751
|
+
res = await multicallRetry({
|
|
73752
|
+
chain: "1",
|
|
73753
|
+
calls: [
|
|
73754
|
+
{ address: dm, name: "getOffChainDistributionData", params: [] },
|
|
73755
|
+
{ address: dm, name: "getOffChainTokensClaimed", params: [who] },
|
|
73756
|
+
{ address: dm, name: "getClaimOnlySelf", params: [who] },
|
|
73757
|
+
{ address: dm, name: "getRedirectedAccount", params: [who] },
|
|
73758
|
+
{ address: dm, name: "paused", params: [] },
|
|
73759
|
+
{ address: dm, name: "getOffChainDistributionMintCap", params: [] }
|
|
73760
|
+
],
|
|
73761
|
+
abi: UsualDistributionModuleReadAbi,
|
|
73762
|
+
allowFailure: true
|
|
73763
|
+
});
|
|
73764
|
+
} catch (e) {
|
|
73765
|
+
return {
|
|
73766
|
+
status: "unknown",
|
|
73767
|
+
account: who,
|
|
73768
|
+
reason: `DistributionModule read failed: ${e?.message ?? e}`
|
|
73769
|
+
};
|
|
73770
|
+
}
|
|
73771
|
+
const [data, claimedRaw, onlySelf, redirect, paused, cap] = res;
|
|
73772
|
+
const tuple = Array.isArray(data) ? data : void 0;
|
|
73773
|
+
const root = tuple?.[1];
|
|
73774
|
+
const rootTs = tuple?.[0];
|
|
73775
|
+
if (!isHex32(root) || typeof rootTs !== "bigint" || typeof claimedRaw !== "bigint" || typeof onlySelf !== "boolean" || typeof paused !== "boolean")
|
|
73776
|
+
return {
|
|
73777
|
+
status: "unknown",
|
|
73778
|
+
account: who,
|
|
73779
|
+
reason: "DistributionModule read returned an unexpected shape"
|
|
73780
|
+
};
|
|
73781
|
+
let entries;
|
|
73782
|
+
try {
|
|
73783
|
+
const r = await (opts.fetchImpl ?? fetch)(
|
|
73784
|
+
`${opts.apiBase ?? USUAL_REWARDS_API}/${who}`,
|
|
73785
|
+
{ headers: { Accept: "application/json" } }
|
|
73786
|
+
);
|
|
73787
|
+
if (!r.ok)
|
|
73788
|
+
return {
|
|
73789
|
+
status: "unknown",
|
|
73790
|
+
account: who,
|
|
73791
|
+
reason: `Usual rewards API answered HTTP ${r.status}`
|
|
73792
|
+
};
|
|
73793
|
+
entries = await r.json();
|
|
73794
|
+
} catch (e) {
|
|
73795
|
+
return {
|
|
73796
|
+
status: "unknown",
|
|
73797
|
+
account: who,
|
|
73798
|
+
reason: `Usual rewards API unreachable: ${e?.message ?? e}`
|
|
73799
|
+
};
|
|
73800
|
+
}
|
|
73801
|
+
const sel = selectUsualRewardEntry(entries, root);
|
|
73802
|
+
if (sel.status !== "ok") return { ...sel, account: who };
|
|
73803
|
+
const claimable = sel.cumulative > claimedRaw ? sel.cumulative - claimedRaw : 0n;
|
|
73804
|
+
const redirectTo = typeof redirect === "string" && redirect.toLowerCase() !== ZERO7 ? redirect.toLowerCase() : who;
|
|
73805
|
+
return {
|
|
73806
|
+
status: "ok",
|
|
73807
|
+
account: who,
|
|
73808
|
+
distributionModule: dm,
|
|
73809
|
+
merkleRoot: root.toLowerCase(),
|
|
73810
|
+
rootTimestamp: Number(rootTs),
|
|
73811
|
+
cumulative: sel.cumulative,
|
|
73812
|
+
claimed: claimedRaw,
|
|
73813
|
+
claimable,
|
|
73814
|
+
pending: sel.pending,
|
|
73815
|
+
proof: sel.proof,
|
|
73816
|
+
recipient: redirectTo,
|
|
73817
|
+
claimOnlySelf: onlySelf,
|
|
73818
|
+
paused,
|
|
73819
|
+
exceedsMintCap: typeof cap === "bigint" ? claimable > cap : false
|
|
73820
|
+
};
|
|
73821
|
+
};
|
|
73822
|
+
|
|
73328
73823
|
// src/vaults/lagoon/api.ts
|
|
73329
73824
|
var LAGOON_API_URL = "https://api.lagoon.finance/query";
|
|
73330
73825
|
var LAGOON_CHAIN_IDS = /* @__PURE__ */ new Set([
|
|
@@ -74333,6 +74828,7 @@ var classifyRedemption = (provider, v) => {
|
|
|
74333
74828
|
if (SYNC_REDEMPTION_PROVIDERS.has(provider)) return "sync";
|
|
74334
74829
|
if (provider === "lst") return "async";
|
|
74335
74830
|
if (provider === "savings") {
|
|
74831
|
+
if (v.withdrawalMode === "fee-or-maturity") return void 0;
|
|
74336
74832
|
return v.withdrawalMode === "instant" && !v.withdrawalCooldownSeconds ? "sync" : "async";
|
|
74337
74833
|
}
|
|
74338
74834
|
return "sync";
|
|
@@ -75474,7 +75970,7 @@ var getGmxUserPositions = async (chainId, account, multicallRetry, options) => {
|
|
|
75474
75970
|
};
|
|
75475
75971
|
const c = getGmxReadContracts(chainId);
|
|
75476
75972
|
if (!c) return empty;
|
|
75477
|
-
const
|
|
75973
|
+
const acct2 = account.toLowerCase();
|
|
75478
75974
|
const cap = BigInt(options?.cap ?? DEFAULT_CAP);
|
|
75479
75975
|
const tokens = options?.tokens ?? [];
|
|
75480
75976
|
const safe = async (p, fallback) => {
|
|
@@ -75491,7 +75987,7 @@ var getGmxUserPositions = async (chainId, account, multicallRetry, options) => {
|
|
|
75491
75987
|
calls: tokens.map((t) => ({
|
|
75492
75988
|
address: t.address,
|
|
75493
75989
|
name: "balanceOf",
|
|
75494
|
-
params: [
|
|
75990
|
+
params: [acct2]
|
|
75495
75991
|
})),
|
|
75496
75992
|
abi: GmxErc20BalanceAbi,
|
|
75497
75993
|
maxRetries: 3,
|
|
@@ -75506,12 +76002,12 @@ var getGmxUserPositions = async (chainId, account, multicallRetry, options) => {
|
|
|
75506
76002
|
{
|
|
75507
76003
|
address: c.glvReader,
|
|
75508
76004
|
name: "getAccountGlvDeposits",
|
|
75509
|
-
params: [c.dataStore,
|
|
76005
|
+
params: [c.dataStore, acct2, 0n, cap]
|
|
75510
76006
|
},
|
|
75511
76007
|
{
|
|
75512
76008
|
address: c.glvReader,
|
|
75513
76009
|
name: "getAccountGlvWithdrawals",
|
|
75514
|
-
params: [c.dataStore,
|
|
76010
|
+
params: [c.dataStore, acct2, 0n, cap]
|
|
75515
76011
|
}
|
|
75516
76012
|
],
|
|
75517
76013
|
abi: GmxGlvReaderAbi,
|
|
@@ -75527,12 +76023,12 @@ var getGmxUserPositions = async (chainId, account, multicallRetry, options) => {
|
|
|
75527
76023
|
{
|
|
75528
76024
|
address: c.dataStore,
|
|
75529
76025
|
name: "getBytes32ValuesAt",
|
|
75530
|
-
params: [accountDepositListKey(
|
|
76026
|
+
params: [accountDepositListKey(acct2), 0n, cap]
|
|
75531
76027
|
},
|
|
75532
76028
|
{
|
|
75533
76029
|
address: c.dataStore,
|
|
75534
76030
|
name: "getBytes32ValuesAt",
|
|
75535
|
-
params: [accountWithdrawalListKey(
|
|
76031
|
+
params: [accountWithdrawalListKey(acct2), 0n, cap]
|
|
75536
76032
|
}
|
|
75537
76033
|
],
|
|
75538
76034
|
abi: GmxDataStoreAbi,
|
|
@@ -76676,6 +77172,7 @@ var exitPhrase = {
|
|
|
76676
77172
|
"request-based": "withdrawals need a request",
|
|
76677
77173
|
"market-sale": "exit by selling on the market",
|
|
76678
77174
|
"at-maturity": "locked until maturity",
|
|
77175
|
+
"fee-or-maturity": "exit early at a discount, or at par at maturity",
|
|
76679
77176
|
"off-chain": "exit off-chain",
|
|
76680
77177
|
"dex-only": "exit only via a DEX"
|
|
76681
77178
|
};
|
|
@@ -76715,6 +77212,7 @@ function headlineExitFromRoutes(routes2, symbol) {
|
|
|
76715
77212
|
const fastPart = fast.feeBps == null ? "instant exit" : fast.feeBps === 0 ? "free instant exit" : `instant exit for ${(fast.feeBps / 100).toFixed(2)} %`;
|
|
76716
77213
|
const slowCost = slow.feeBps === 0 ? "free" : slow.feeBps != null ? `${(slow.feeBps / 100).toFixed(2)} %` : void 0;
|
|
76717
77214
|
const floor = slow.minAmountFormatted != null && slow.minAmountFormatted > 0 ? ` above ${amount(slow.minAmountFormatted)}${symbol ? ` ${symbol}` : ""}` : "";
|
|
77215
|
+
if (slow.id === "maturity") return `${fastPart}, or par at maturity`;
|
|
76718
77216
|
const slowPart = slowCost ? `queue${floor} for ${slowCost}` : `queue${floor}`;
|
|
76719
77217
|
return `${fastPart}, or ${slowPart}`;
|
|
76720
77218
|
}
|
|
@@ -79067,6 +79565,7 @@ var EXIT_MODE_LABELS = {
|
|
|
79067
79565
|
"request-based": "Request",
|
|
79068
79566
|
"market-sale": "Market sale",
|
|
79069
79567
|
"at-maturity": "At maturity",
|
|
79568
|
+
"fee-or-maturity": "Fee or maturity",
|
|
79070
79569
|
"off-chain": "Off-chain",
|
|
79071
79570
|
"dex-only": "DEX only"
|
|
79072
79571
|
};
|
|
@@ -79080,6 +79579,7 @@ var EXIT_MODE_DESCRIPTIONS = {
|
|
|
79080
79579
|
"request-based": "Withdrawals need a request and a later claim.",
|
|
79081
79580
|
"market-sale": "Exit by selling the position on a market.",
|
|
79082
79581
|
"at-maturity": "Locked until maturity.",
|
|
79582
|
+
"fee-or-maturity": "Exit early at a discount, or at par at maturity.",
|
|
79083
79583
|
"off-chain": "Exit is settled off-chain.",
|
|
79084
79584
|
"dex-only": "Exit only by selling on a DEX."
|
|
79085
79585
|
};
|
|
@@ -79386,7 +79886,10 @@ var UNCAPPED_EXIT_MODES = /* @__PURE__ */ new Set([
|
|
|
79386
79886
|
"instant-or-queued",
|
|
79387
79887
|
"request-based",
|
|
79388
79888
|
"off-chain",
|
|
79389
|
-
"at-maturity"
|
|
79889
|
+
"at-maturity",
|
|
79890
|
+
// A bond's par leg is the maturity, uncapped like `at-maturity`; the early
|
|
79891
|
+
// legs are bounded by the backing, which `liquidity` already reports.
|
|
79892
|
+
"fee-or-maturity"
|
|
79390
79893
|
]);
|
|
79391
79894
|
function meetsLiquidityFloor(input, minUsd) {
|
|
79392
79895
|
if (input.canWithdraw === false) return false;
|
|
@@ -79947,7 +80450,10 @@ function savingsCuration(provider, chainId, address) {
|
|
|
79947
80450
|
solvency: e.solvency,
|
|
79948
80451
|
accrual: e.accrual,
|
|
79949
80452
|
yieldWarmupSeconds: e.yieldWarmupSeconds,
|
|
79950
|
-
needsDepositApproval: e.needsDepositApproval
|
|
80453
|
+
needsDepositApproval: e.needsDepositApproval,
|
|
80454
|
+
// A dated bond's maturity (Usual bUSD0) — static, and the one fact that
|
|
80455
|
+
// keeps a proxied bond row from rendering as perpetual.
|
|
80456
|
+
expiry: e.expiry
|
|
79951
80457
|
};
|
|
79952
80458
|
}
|
|
79953
80459
|
function vaultTermInputFromEarnMarket(m) {
|
|
@@ -80007,7 +80513,7 @@ function vaultTermInputFromEarnMarket(m) {
|
|
|
80007
80513
|
withdrawalsPaused: m.availability.canWithdraw ? void 0 : true,
|
|
80008
80514
|
isClosed: bool2(meta.isClosed),
|
|
80009
80515
|
whitelisted: bool2(meta.whitelisted),
|
|
80010
|
-
expiry: m.maturity?.maturity,
|
|
80516
|
+
expiry: m.maturity?.maturity ?? curated.expiry,
|
|
80011
80517
|
timelock: num14(meta.timelock),
|
|
80012
80518
|
allocators: strArray(meta.allocators),
|
|
80013
80519
|
owner: str7(meta.owner),
|
|
@@ -80089,7 +80595,7 @@ function vaultTermInputFromSourceRow(row, chainId) {
|
|
|
80089
80595
|
withdrawalsPaused: bool2(meta.isWithdrawalPaused),
|
|
80090
80596
|
isClosed: bool2(meta.isClosed),
|
|
80091
80597
|
whitelisted: bool2(meta.whitelisted),
|
|
80092
|
-
expiry: num14(meta.expiry) ?? num14(meta.maturity),
|
|
80598
|
+
expiry: num14(meta.expiry) ?? num14(meta.maturity) ?? curated.expiry,
|
|
80093
80599
|
timelock: num14(meta.timelock),
|
|
80094
80600
|
allocators: strArray(meta.allocators),
|
|
80095
80601
|
owner: str7(meta.owner),
|
|
@@ -82893,6 +83399,11 @@ var isNum4 = (v) => typeof v === "number" && Number.isFinite(v);
|
|
|
82893
83399
|
function build2(input) {
|
|
82894
83400
|
const vault = jupiterLendVaultFromKey(input.lender);
|
|
82895
83401
|
const address = input.asset?.address ?? input.underlying;
|
|
83402
|
+
const smart = input.market?.fluid ?? {};
|
|
83403
|
+
const isSmartCol = !!smart.isSmartCol;
|
|
83404
|
+
const isSmartDebt = !!smart.isSmartDebt;
|
|
83405
|
+
const isSmart = isSmartCol || isSmartDebt;
|
|
83406
|
+
const pair = (p) => Array.isArray(p) ? p.join(" + ") : void 0;
|
|
82896
83407
|
const pending = {
|
|
82897
83408
|
"borrow.liquidation.liquidationMaxLimit": "the max liquidation limit (the LTV past which a position is liquidated ENTIRELY) is not served",
|
|
82898
83409
|
"borrow.availability.cap": "the layer's EXPANDING borrow limit (current, hard max, expand percent and duration) is not served \u2014 it is not a cap, so the row carries none",
|
|
@@ -82953,12 +83464,22 @@ function build2(input) {
|
|
|
82953
83464
|
constraints: {
|
|
82954
83465
|
crossMargin: false,
|
|
82955
83466
|
positionModel: "nft",
|
|
82956
|
-
positionIdMeaning: "The vault position NFT id (per vault; one collateral / debt pair each). positionId 0 MINTS a new position \u2014 only an opening deposit may pass 0; any other action sent with 0 acts on a fresh empty position and reports success."
|
|
83467
|
+
positionIdMeaning: "The vault position NFT id (per vault; one collateral / debt pair each). positionId 0 MINTS a new position \u2014 only an opening deposit may pass 0; any other action sent with 0 acts on a fresh empty position and reports success.",
|
|
83468
|
+
...isSmart ? {
|
|
83469
|
+
// the fluid adapter's notes: a smart side is a DEX share, not a token
|
|
83470
|
+
notes: [
|
|
83471
|
+
isSmartCol ? `Collateral is a Jupiter Lend DEX position (shares) over ${pair(smart.collateralPair) ?? "two tokens"}; this row is one leg of it.` : void 0,
|
|
83472
|
+
isSmartDebt ? `Debt is a Jupiter Lend DEX position (shares) over ${pair(smart.debtPair) ?? "two tokens"}; this row is one leg of it.` : void 0,
|
|
83473
|
+
isSmartDebt ? "The borrow rate is NET of the trading yield the debt LP earns, so it can be negative." : void 0,
|
|
83474
|
+
isSmartCol ? "The supply rate INCLUDES the DEX trading yield (trailing 7 days, after the protocol revenue cut) on top of the liquidity-layer rate." : void 0,
|
|
83475
|
+
"Both legs of a side move together \u2014 a leg cannot be supplied, borrowed or withdrawn on its own; the pool rebalances the split."
|
|
83476
|
+
].filter(Boolean)
|
|
83477
|
+
} : {}
|
|
82957
83478
|
},
|
|
82958
83479
|
ext: {
|
|
82959
83480
|
jupiterLend: {
|
|
82960
83481
|
...vault ? { market: vault.market, vaultId: vault.vaultId } : {},
|
|
82961
|
-
fluidVaultType: FLUID_VAULT_TYPE_T1,
|
|
83482
|
+
fluidVaultType: isNum4(smart.vaultType) ? smart.vaultType : FLUID_VAULT_TYPE_T1,
|
|
82962
83483
|
...vault?.market === "main" ? { programs: JL_MAIN_PROGRAMS } : {},
|
|
82963
83484
|
/** The marketUid ref is the leg's MINT. */
|
|
82964
83485
|
marketUidRef: "mint"
|
|
@@ -84859,6 +85380,6 @@ function earnPositionTotals(items) {
|
|
|
84859
85380
|
};
|
|
84860
85381
|
}
|
|
84861
85382
|
|
|
84862
|
-
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, DOLOMITE_ISO_ID_PREFIX, EARN_DESCRIPTIONS, EARN_LABELS, EARN_RATE_SOURCE_BY_PROVIDER, EMPTY_BALANCE, EXACTLY_LENDER_KEY, FLYING_TULIP_LENDER_KEY, FRACTION_RATE_PROVIDERS, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, NON_EVM_VAULT_PROVIDERS, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, PREFIX_LENDERS, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, SVM_EARN_VAULT_BUILDERS, TELLER_CALLS_PER_BID, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyEarnSanity, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, blockNumberFromTag, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildQueriesFromMeta, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertCoolerMarketsToResponse, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFlyingTulipMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMultiAccountTypeUserState, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dexResolverFor, disambiguateEarnNames, dolomiteVaultAddress, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRateAtMaturity, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, emitterCoverage, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, enumerateEmitters, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchCoolerMarkets, fetchDolomiteAccountNumbers, fetchDolomiteSubAccounts, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidDexState, fetchFluidFTokens, fetchFlyingTulipMarkets, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, fillableRemaining, filterActiveLenders, filterLenderMeta, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getResolvedDolomiteSubAccounts, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, injectLenderInfoIntoEntries, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLenderVenueKey, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isMaturedTerm, isSecondaryMarketOnly, isStablecoinSymbol, isUnearnableEarnRate, isUnrealizableEarnRate, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, marketKeysOf, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, parseBalanceFetcherResult, parseDolomiteSubAccountId, parseEarnUid, parseLenderKey, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readUserPositions, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, repairImpossibleTvl, resolveAdapter, resolveDerivation, resolveDolomiteRowIdentity, resolveEarnIdentity, resolveModeConfig, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, secondaryMarketVault, selectAssetGroupPrices, setMysticApiKey, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, subAccountsOf, supplyDescription, supplyFindings, supplyHeadline, svmEarnBuildability, swapRoutedProvidersArePriceConsistent, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termApiBaseUrl, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toDolomiteSubAccountId, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
|
|
85383
|
+
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, DOLOMITE_ISO_ID_PREFIX, EARN_DESCRIPTIONS, EARN_LABELS, EARN_RATE_SOURCE_BY_PROVIDER, EMPTY_BALANCE, EXACTLY_LENDER_KEY, FLYING_TULIP_LENDER_KEY, FRACTION_RATE_PROVIDERS, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, NON_EVM_VAULT_PROVIDERS, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, PREFIX_LENDERS, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, SVM_EARN_VAULT_BUILDERS, TELLER_CALLS_PER_BID, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyEarnSanity, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, blockNumberFromTag, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildQueriesFromMeta, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertCoolerMarketsToResponse, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFlyingTulipMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMultiAccountTypeUserState, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dexResolverFor, disambiguateEarnNames, dolomiteVaultAddress, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRateAtMaturity, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, emitterCoverage, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, enumerateEmitters, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchCoolerMarkets, fetchDolomiteAccountNumbers, fetchDolomiteSubAccounts, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidDexState, fetchFluidFTokens, fetchFlyingTulipMarkets, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchUsualRewardsClaimData, fetchYearnApiVaults, fetchYearnVaults, fillableRemaining, filterActiveLenders, filterLenderMeta, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getResolvedDolomiteSubAccounts, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, injectLenderInfoIntoEntries, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLenderVenueKey, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isMaturedTerm, isSecondaryMarketOnly, isStablecoinSymbol, isUnearnableEarnRate, isUnrealizableEarnRate, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, marketKeysOf, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, parseBalanceFetcherResult, parseDolomiteSubAccountId, parseEarnUid, parseLenderKey, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readUserPositions, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, repairImpossibleTvl, resolveAdapter, resolveDerivation, resolveDolomiteRowIdentity, resolveEarnIdentity, resolveModeConfig, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, secondaryMarketVault, selectAssetGroupPrices, selectUsualRewardEntry, setMysticApiKey, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, subAccountsOf, supplyDescription, supplyFindings, supplyHeadline, svmEarnBuildability, swapRoutedProvidersArePriceConsistent, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termApiBaseUrl, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toDolomiteSubAccountId, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, withMaturityLabel, withTrancheLabel };
|
|
84863
85384
|
//# sourceMappingURL=index.js.map
|
|
84864
85385
|
//# sourceMappingURL=index.js.map
|