@1delta/margin-fetcher 5.0.86 → 5.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +408 -153
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -10328,13 +10328,13 @@ var REPAIR_BACKOFF_JITTER_MS = 60;
|
|
|
10328
10328
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
10329
10329
|
var backoffForRound = (round) => REPAIR_BACKOFF_BASE_MS * 2 ** round + Math.random() * REPAIR_BACKOFF_JITTER_MS;
|
|
10330
10330
|
var endpointUrl = (client, rpcId) => client?.transport?.url ?? `rpc#${rpcId}`;
|
|
10331
|
-
var resolveEndpoint = (chainId,
|
|
10331
|
+
var resolveEndpoint = (chainId, getEvmClient21, startRpcId, tried, maxProbe = 12, timeoutMs) => {
|
|
10332
10332
|
let fallback = null;
|
|
10333
10333
|
for (let probe = 0; probe < maxProbe; probe++) {
|
|
10334
10334
|
const rpcId = startRpcId + probe;
|
|
10335
10335
|
let client;
|
|
10336
10336
|
try {
|
|
10337
|
-
client =
|
|
10337
|
+
client = getEvmClient21(chainId, rpcId, { timeoutMs });
|
|
10338
10338
|
} catch {
|
|
10339
10339
|
break;
|
|
10340
10340
|
}
|
|
@@ -10363,7 +10363,7 @@ var recordPermanentFailures = (slots, offset, collector) => {
|
|
|
10363
10363
|
if (slots[i].permanent) collector.add(offset + i);
|
|
10364
10364
|
}
|
|
10365
10365
|
};
|
|
10366
|
-
var repairFailedSlots = async (chainId, contracts, slots,
|
|
10366
|
+
var repairFailedSlots = async (chainId, contracts, slots, getEvmClient21, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
|
|
10367
10367
|
let searchFrom = nextRpcId;
|
|
10368
10368
|
for (let round = 0; round < rounds; round++) {
|
|
10369
10369
|
const failedIdx = [];
|
|
@@ -10373,7 +10373,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient20, nextRp
|
|
|
10373
10373
|
if (failedIdx.length === 0) return slots;
|
|
10374
10374
|
const endpoint = resolveEndpoint(
|
|
10375
10375
|
chainId,
|
|
10376
|
-
|
|
10376
|
+
getEvmClient21,
|
|
10377
10377
|
searchFrom,
|
|
10378
10378
|
options?.tried
|
|
10379
10379
|
);
|
|
@@ -10425,7 +10425,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient20, nextRp
|
|
|
10425
10425
|
}
|
|
10426
10426
|
return slots;
|
|
10427
10427
|
};
|
|
10428
|
-
var multicallShardedAbiArray = async (chainId, abi, calls,
|
|
10428
|
+
var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient21, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
|
|
10429
10429
|
const abiIsArray = isArray(abi[0]);
|
|
10430
10430
|
const contracts = calls.map(({ address, name, params }, i) => ({
|
|
10431
10431
|
abi: abiIsArray ? abi?.[i] : abi,
|
|
@@ -10499,7 +10499,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolS
|
|
|
10499
10499
|
const attemptHedged = async (items, startRpcId, tried) => {
|
|
10500
10500
|
const primary = resolveEndpoint(
|
|
10501
10501
|
chainId,
|
|
10502
|
-
|
|
10502
|
+
getEvmClient21,
|
|
10503
10503
|
startRpcId,
|
|
10504
10504
|
tried,
|
|
10505
10505
|
12,
|
|
@@ -10523,7 +10523,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolS
|
|
|
10523
10523
|
clearTimeout(timer);
|
|
10524
10524
|
const alt = resolveEndpoint(
|
|
10525
10525
|
chainId,
|
|
10526
|
-
|
|
10526
|
+
getEvmClient21,
|
|
10527
10527
|
primary.rpcId + 1,
|
|
10528
10528
|
tried,
|
|
10529
10529
|
12,
|
|
@@ -10575,7 +10575,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolS
|
|
|
10575
10575
|
chainId,
|
|
10576
10576
|
batch.items,
|
|
10577
10577
|
slots,
|
|
10578
|
-
|
|
10578
|
+
getEvmClient21,
|
|
10579
10579
|
won.rpcId + 1,
|
|
10580
10580
|
requestBytes,
|
|
10581
10581
|
logs,
|
|
@@ -10597,7 +10597,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient20, poolS
|
|
|
10597
10597
|
const tried = /* @__PURE__ */ new Set();
|
|
10598
10598
|
const start = resolveEndpoint(
|
|
10599
10599
|
chainId,
|
|
10600
|
-
|
|
10600
|
+
getEvmClient21,
|
|
10601
10601
|
workerId,
|
|
10602
10602
|
void 0,
|
|
10603
10603
|
12,
|
|
@@ -42630,7 +42630,7 @@ function unflattenLenderData(pools) {
|
|
|
42630
42630
|
}
|
|
42631
42631
|
return result;
|
|
42632
42632
|
}
|
|
42633
|
-
var getLenderUserDataResult = async (chainId, queriesRaw,
|
|
42633
|
+
var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient21, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
|
|
42634
42634
|
const queries = organizeUserQueries(queriesRaw);
|
|
42635
42635
|
const builtCalls = await Promise.all(
|
|
42636
42636
|
queries.map(async (query3) => {
|
|
@@ -42640,7 +42640,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient20, allowF
|
|
|
42640
42640
|
query3.lender,
|
|
42641
42641
|
query3.account,
|
|
42642
42642
|
query3.params,
|
|
42643
|
-
|
|
42643
|
+
getEvmClient21
|
|
42644
42644
|
);
|
|
42645
42645
|
return callData.map((call) => ({ call, abi: call.abi ?? abi }));
|
|
42646
42646
|
})
|
|
@@ -42650,7 +42650,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient20, allowF
|
|
|
42650
42650
|
chainId,
|
|
42651
42651
|
calls.map((call) => call.abi),
|
|
42652
42652
|
calls.map((call) => call.call),
|
|
42653
|
-
|
|
42653
|
+
getEvmClient21,
|
|
42654
42654
|
concurrency,
|
|
42655
42655
|
retries,
|
|
42656
42656
|
allowFailure,
|
|
@@ -45913,6 +45913,73 @@ var tavaxFetcher = {
|
|
|
45913
45913
|
)
|
|
45914
45914
|
})
|
|
45915
45915
|
};
|
|
45916
|
+
var CHAIN_ID7 = "14";
|
|
45917
|
+
var VAULT2 = "0x4c18ff3c89632c3dd62e796c0afa5c07c4c1b2b3";
|
|
45918
|
+
var ONE_E187 = 10n ** 18n;
|
|
45919
|
+
var WINDOW_SECONDS6 = 7 * 24 * 60 * 60;
|
|
45920
|
+
var VAULT_ABI = [
|
|
45921
|
+
{
|
|
45922
|
+
name: "convertToAssets",
|
|
45923
|
+
type: "function",
|
|
45924
|
+
stateMutability: "view",
|
|
45925
|
+
inputs: [{ type: "uint256", name: "shares" }],
|
|
45926
|
+
outputs: [{ type: "uint256" }]
|
|
45927
|
+
},
|
|
45928
|
+
{
|
|
45929
|
+
name: "totalAssetsAt",
|
|
45930
|
+
type: "function",
|
|
45931
|
+
stateMutability: "view",
|
|
45932
|
+
inputs: [{ type: "uint48", name: "timestamp" }],
|
|
45933
|
+
outputs: [{ type: "uint256" }]
|
|
45934
|
+
},
|
|
45935
|
+
{
|
|
45936
|
+
name: "totalSupplyAt",
|
|
45937
|
+
type: "function",
|
|
45938
|
+
stateMutability: "view",
|
|
45939
|
+
inputs: [{ type: "uint48", name: "timestamp" }],
|
|
45940
|
+
outputs: [{ type: "uint256" }]
|
|
45941
|
+
}
|
|
45942
|
+
];
|
|
45943
|
+
var computeApr6 = async () => {
|
|
45944
|
+
const client = getEvmClient(CHAIN_ID7);
|
|
45945
|
+
const head = await client.getBlockNumber();
|
|
45946
|
+
const headBlock = await client.getBlock({ blockNumber: head });
|
|
45947
|
+
const then = Number(headBlock.timestamp) - WINDOW_SECONDS6;
|
|
45948
|
+
const [rateNow, assetsThen, supplyThen] = await Promise.all([
|
|
45949
|
+
client.readContract({
|
|
45950
|
+
address: VAULT2,
|
|
45951
|
+
abi: VAULT_ABI,
|
|
45952
|
+
functionName: "convertToAssets",
|
|
45953
|
+
args: [ONE_E187]
|
|
45954
|
+
}),
|
|
45955
|
+
client.readContract({
|
|
45956
|
+
address: VAULT2,
|
|
45957
|
+
abi: VAULT_ABI,
|
|
45958
|
+
functionName: "totalAssetsAt",
|
|
45959
|
+
args: [then]
|
|
45960
|
+
}),
|
|
45961
|
+
client.readContract({
|
|
45962
|
+
address: VAULT2,
|
|
45963
|
+
abi: VAULT_ABI,
|
|
45964
|
+
functionName: "totalSupplyAt",
|
|
45965
|
+
args: [then]
|
|
45966
|
+
})
|
|
45967
|
+
]);
|
|
45968
|
+
if (supplyThen === 0n) throw new Error("stXRP: zero historical totalSupply");
|
|
45969
|
+
const rateThen = assetsThen * ONE_E187 / supplyThen;
|
|
45970
|
+
if (rateNow < ONE_E187 || rateThen < ONE_E187 || rateNow < rateThen) {
|
|
45971
|
+
throw new Error(`stXRP: invalid rates (now=${rateNow}, then=${rateThen})`);
|
|
45972
|
+
}
|
|
45973
|
+
const apr = annualizeRateDeltaPercent(rateNow, rateThen, WINDOW_SECONDS6);
|
|
45974
|
+
if (!Number.isFinite(apr) || apr < 0) {
|
|
45975
|
+
throw new Error(`stXRP: bad apr ${apr}`);
|
|
45976
|
+
}
|
|
45977
|
+
return apr;
|
|
45978
|
+
};
|
|
45979
|
+
var stxrpFetcher = {
|
|
45980
|
+
label: "STXRP",
|
|
45981
|
+
fetch: async () => ({ "Firelight stXRP::stXRP": await computeApr6() })
|
|
45982
|
+
};
|
|
45916
45983
|
|
|
45917
45984
|
// src/vaults/lst/registry.ts
|
|
45918
45985
|
var LST_REGISTRY = {
|
|
@@ -47425,6 +47492,81 @@ var LST_REGISTRY = {
|
|
|
47425
47492
|
isNativeUnderlying: false,
|
|
47426
47493
|
withdrawalMode: "dex-only"
|
|
47427
47494
|
}
|
|
47495
|
+
],
|
|
47496
|
+
// Flare (14) — Firelight stXRP, the XRP cover-vault share token.
|
|
47497
|
+
"14": [
|
|
47498
|
+
{
|
|
47499
|
+
// Firelight stXRP — ERC-4626 vault share over FXRP (6-dec / 6-dec).
|
|
47500
|
+
// Non-rebasing: coverage premiums stream into the vault and compound
|
|
47501
|
+
// into `convertToAssets`; supply does not expand. Withdrawal is
|
|
47502
|
+
// period-based and delayed — `withdraw`/`redeem` create a
|
|
47503
|
+
// `WithdrawRequest` (shares burned immediately), `claimWithdraw` pays
|
|
47504
|
+
// out after the period ends (1–2 days with 1-day periods, 30–60 days
|
|
47505
|
+
// at feature-complete). No same-block redemption, so instant
|
|
47506
|
+
// `liquidity` is 0. Principal is slashable pro-rata after the
|
|
47507
|
+
// protocol's First-Loss Buffer.
|
|
47508
|
+
address: "0x4c18ff3c89632c3dd62e796c0afa5c07c4c1b2b3",
|
|
47509
|
+
underlying: "0xad552a648c74d49e10027ab8a618a3ad4901c5be",
|
|
47510
|
+
// FXRP
|
|
47511
|
+
symbol: "stXRP",
|
|
47512
|
+
brand: "Firelight",
|
|
47513
|
+
decimals: 6,
|
|
47514
|
+
underlyingDecimals: 6,
|
|
47515
|
+
reader: "erc4626",
|
|
47516
|
+
isErc4626: true,
|
|
47517
|
+
isRebasing: false,
|
|
47518
|
+
isMintable: true,
|
|
47519
|
+
isNativeUnderlying: false,
|
|
47520
|
+
mintContract: "0x4c18ff3c89632c3dd62e796c0afa5c07c4c1b2b3",
|
|
47521
|
+
mintInputAsset: "0xad552a648c74d49e10027ab8a618a3ad4901c5be",
|
|
47522
|
+
// FXRP
|
|
47523
|
+
withdrawalMode: "queued",
|
|
47524
|
+
// APR from the on-chain rate delta (no public APY API yet). Key is the
|
|
47525
|
+
// canonical token-list assetGroup — stXRP carries its own group.
|
|
47526
|
+
yieldFetcher: stxrpFetcher,
|
|
47527
|
+
yieldKey: "Firelight stXRP::stXRP"
|
|
47528
|
+
},
|
|
47529
|
+
{
|
|
47530
|
+
// SparkDEX stFLR — Lido-style rebasing share token over native FLR.
|
|
47531
|
+
// Deposit via `submit()` (native FLR) or `submitWrapped()` (WFLR);
|
|
47532
|
+
// withdrawal via `requestWithdrawal()`/`claimWithdrawal()` (queued) or
|
|
47533
|
+
// `instantWithdrawal()` (fee). `brand` is the disambiguator against
|
|
47534
|
+
// Sceptre's sFLR — both wrap FLR.
|
|
47535
|
+
address: "0x0988c6ba244a90c07a917ebe609eb3264be716ff",
|
|
47536
|
+
underlying: "0x0000000000000000000000000000000000000000",
|
|
47537
|
+
// native FLR
|
|
47538
|
+
symbol: "stFLR",
|
|
47539
|
+
brand: "SparkDEX",
|
|
47540
|
+
decimals: 18,
|
|
47541
|
+
reader: "flarePooledFlr",
|
|
47542
|
+
isErc4626: false,
|
|
47543
|
+
isRebasing: true,
|
|
47544
|
+
isMintable: true,
|
|
47545
|
+
isNativeUnderlying: true,
|
|
47546
|
+
mintContract: "0x0988c6ba244a90c07a917ebe609eb3264be716ff",
|
|
47547
|
+
mintInputAsset: "native",
|
|
47548
|
+
withdrawalMode: "queued"
|
|
47549
|
+
},
|
|
47550
|
+
{
|
|
47551
|
+
// Sceptre sFLR — Lido-style rebasing share token over native FLR
|
|
47552
|
+
// (native Flare staking). Deposit via `deposit()` (native FLR);
|
|
47553
|
+
// withdrawal via unlock requests (`cooldownPeriod()`) or
|
|
47554
|
+
// `instantRedeem()` (fee). Distinct `brand` from SparkDEX stFLR.
|
|
47555
|
+
address: "0x12e605bc104e93b45e1ad99f9e555f659051c2bb",
|
|
47556
|
+
underlying: "0x0000000000000000000000000000000000000000",
|
|
47557
|
+
// native FLR
|
|
47558
|
+
symbol: "sFLR",
|
|
47559
|
+
brand: "Sceptre",
|
|
47560
|
+
decimals: 18,
|
|
47561
|
+
reader: "flarePooledFlr",
|
|
47562
|
+
isErc4626: false,
|
|
47563
|
+
isRebasing: true,
|
|
47564
|
+
isMintable: true,
|
|
47565
|
+
isNativeUnderlying: true,
|
|
47566
|
+
mintContract: "0x12e605bc104e93b45e1ad99f9e555f659051c2bb",
|
|
47567
|
+
mintInputAsset: "native",
|
|
47568
|
+
withdrawalMode: "queued"
|
|
47569
|
+
}
|
|
47428
47570
|
]
|
|
47429
47571
|
};
|
|
47430
47572
|
var getLstRegistry = (chainId) => LST_REGISTRY[chainId] ?? [];
|
|
@@ -47810,7 +47952,7 @@ var sparkSavingsFetcher = {
|
|
|
47810
47952
|
return out;
|
|
47811
47953
|
}
|
|
47812
47954
|
};
|
|
47813
|
-
var
|
|
47955
|
+
var CHAIN_ID8 = Chain.ETHEREUM_MAINNET;
|
|
47814
47956
|
var SREUSD = "0x557ab1e003951a73c12d16f0fea8490e39c33c35";
|
|
47815
47957
|
var SREUSD_KEY = "SREUSD";
|
|
47816
47958
|
var SREUSD_GROUP_KEY = "Savings reUSD::sreUSD";
|
|
@@ -47818,7 +47960,7 @@ var sreusdSavingsFetcher = {
|
|
|
47818
47960
|
label: "SREUSD",
|
|
47819
47961
|
fetch: async () => {
|
|
47820
47962
|
const results = await multicallRetryUniversal({
|
|
47821
|
-
chain:
|
|
47963
|
+
chain: CHAIN_ID8,
|
|
47822
47964
|
abi: LINEAR_REWARDS_APR_ABI,
|
|
47823
47965
|
calls: linearRewardsCalls(SREUSD),
|
|
47824
47966
|
allowFailure: false
|
|
@@ -48102,10 +48244,10 @@ var toriFetcher = {
|
|
|
48102
48244
|
return { [STRUSD_KEY]: apr, [STRUSD_GROUP_KEY]: apr };
|
|
48103
48245
|
}
|
|
48104
48246
|
};
|
|
48105
|
-
var
|
|
48247
|
+
var CHAIN_ID9 = Chain.ETHEREUM_MAINNET;
|
|
48106
48248
|
var SNUSD = "0x08efcc2f3e61185d0ea7f8830b3fec9bfa2ee313";
|
|
48107
48249
|
var YEAR_SECONDS8 = 31536000n;
|
|
48108
|
-
var
|
|
48250
|
+
var ONE_E188 = 10n ** 18n;
|
|
48109
48251
|
var SNUSD_KEY = "SNUSD";
|
|
48110
48252
|
var SNUSD_GROUP_KEY = "Staked NUSD::sNUSD";
|
|
48111
48253
|
var SNUSD_LEGACY_GROUP_KEY = "sNUSD::Staked NUSD";
|
|
@@ -48141,7 +48283,7 @@ var STAKED_NUSD_ABI = [
|
|
|
48141
48283
|
];
|
|
48142
48284
|
var fetchSnusdAprOnChain = async () => {
|
|
48143
48285
|
const [vestingAmount, lastDistribution, vestingPeriod, totalAssets] = await multicallRetryUniversal({
|
|
48144
|
-
chain:
|
|
48286
|
+
chain: CHAIN_ID9,
|
|
48145
48287
|
abi: STAKED_NUSD_ABI,
|
|
48146
48288
|
calls: [
|
|
48147
48289
|
{ address: SNUSD, name: "vestingAmount", params: [] },
|
|
@@ -48156,7 +48298,7 @@ var fetchSnusdAprOnChain = async () => {
|
|
|
48156
48298
|
const window = elapsed > vestingPeriod ? elapsed : vestingPeriod;
|
|
48157
48299
|
if (window <= 0n) return 0;
|
|
48158
48300
|
const perSecond = vestingAmount / window;
|
|
48159
|
-
return Number(perSecond * YEAR_SECONDS8 *
|
|
48301
|
+
return Number(perSecond * YEAR_SECONDS8 * ONE_E188 / totalAssets) / 1e16;
|
|
48160
48302
|
};
|
|
48161
48303
|
var snusdFetcher = {
|
|
48162
48304
|
label: "SNUSD",
|
|
@@ -48169,13 +48311,13 @@ var snusdFetcher = {
|
|
|
48169
48311
|
};
|
|
48170
48312
|
}
|
|
48171
48313
|
};
|
|
48172
|
-
var
|
|
48314
|
+
var CHAIN_ID10 = Chain.ETHEREUM_MAINNET;
|
|
48173
48315
|
var WITRY = "0xe346c29b5b60ef870b9724c57ccfbbc631e47dee";
|
|
48174
48316
|
var BRIX_APY_URL = "https://brix.money/api/witry/apy-snapshot?windowDays=30&method=realized";
|
|
48175
48317
|
var BRIX_DEFILLAMA_POOL = "da8c4ac9-733d-4a98-85a5-83b76b7e84d1";
|
|
48176
48318
|
var VESTING_PERIOD = 248400n;
|
|
48177
48319
|
var YEAR_SECONDS9 = 31536000n;
|
|
48178
|
-
var
|
|
48320
|
+
var ONE_E189 = 10n ** 18n;
|
|
48179
48321
|
var WITRY_KEY = "WITRY";
|
|
48180
48322
|
var WITRY_GROUP_KEY = "Wrapped iTRY::WITRY";
|
|
48181
48323
|
var STAKED_ITRY_ABI = [
|
|
@@ -48213,7 +48355,7 @@ var fetchBrixAprPercent = async () => {
|
|
|
48213
48355
|
};
|
|
48214
48356
|
var fetchWitryAprOnChain = async () => {
|
|
48215
48357
|
const [vestingAmount, lastDistribution, totalAssets] = await multicallRetryUniversal({
|
|
48216
|
-
chain:
|
|
48358
|
+
chain: CHAIN_ID10,
|
|
48217
48359
|
abi: STAKED_ITRY_ABI,
|
|
48218
48360
|
calls: [
|
|
48219
48361
|
{ address: WITRY, name: "vestingAmount", params: [] },
|
|
@@ -48227,7 +48369,7 @@ var fetchWitryAprOnChain = async () => {
|
|
|
48227
48369
|
const window = elapsed > VESTING_PERIOD ? elapsed : VESTING_PERIOD;
|
|
48228
48370
|
if (window <= 0n) throw new Error("wiTRY: bad vesting window");
|
|
48229
48371
|
const perSecond = vestingAmount / window;
|
|
48230
|
-
const apr = Number(perSecond * YEAR_SECONDS9 *
|
|
48372
|
+
const apr = Number(perSecond * YEAR_SECONDS9 * ONE_E189 / totalAssets) / 1e16;
|
|
48231
48373
|
if (!Number.isFinite(apr) || apr <= 0) throw new Error("wiTRY: no yield");
|
|
48232
48374
|
return apr;
|
|
48233
48375
|
};
|
|
@@ -48255,13 +48397,13 @@ var capFetcher = {
|
|
|
48255
48397
|
return { [STCUSD_KEY]: apr, [STCUSD_BRIDGED_GROUP_KEY]: apr };
|
|
48256
48398
|
}
|
|
48257
48399
|
};
|
|
48258
|
-
var
|
|
48400
|
+
var CHAIN_ID11 = "1";
|
|
48259
48401
|
var WSTGBP = "0x57c3571f10767e49c9d7b60feb6c67804783b7ae";
|
|
48260
48402
|
var WREN_NAV_GROWTH_URL = "https://wstgbp.com/api/nav-growth";
|
|
48261
|
-
var
|
|
48262
|
-
var
|
|
48403
|
+
var ONE_E1810 = 10n ** 18n;
|
|
48404
|
+
var WINDOW_SECONDS7 = 90 * 24 * 60 * 60;
|
|
48263
48405
|
var BLOCK_TIME_SECONDS5 = 12;
|
|
48264
|
-
var WINDOW_BLOCKS5 = BigInt(Math.floor(
|
|
48406
|
+
var WINDOW_BLOCKS5 = BigInt(Math.floor(WINDOW_SECONDS7 / BLOCK_TIME_SECONDS5));
|
|
48265
48407
|
var MAX_RPC_TRIES5 = 2;
|
|
48266
48408
|
var ONCHAIN_DEADLINE_MS = 12e3;
|
|
48267
48409
|
var WSTGBP_KEY = "WSTGBP";
|
|
@@ -48298,7 +48440,7 @@ var computeAprOnChain = async () => {
|
|
|
48298
48440
|
for (let rpcId = 0; rpcId < MAX_RPC_TRIES5; rpcId++) {
|
|
48299
48441
|
if (Date.now() > deadline) break;
|
|
48300
48442
|
try {
|
|
48301
|
-
const client = getEvmClient(
|
|
48443
|
+
const client = getEvmClient(CHAIN_ID11, rpcId);
|
|
48302
48444
|
const head = await client.getBlockNumber();
|
|
48303
48445
|
const pastBlock = head > WINDOW_BLOCKS5 ? head - WINDOW_BLOCKS5 : 0n;
|
|
48304
48446
|
const [navNow, navThen, headBlock, thenBlock] = await Promise.all([
|
|
@@ -48307,7 +48449,7 @@ var computeAprOnChain = async () => {
|
|
|
48307
48449
|
client.getBlock({ blockNumber: head }),
|
|
48308
48450
|
client.getBlock({ blockNumber: pastBlock })
|
|
48309
48451
|
]);
|
|
48310
|
-
if (navNow <
|
|
48452
|
+
if (navNow < ONE_E1810 || navThen < ONE_E1810) {
|
|
48311
48453
|
throw new Error("wstGBP: navprice below par \u2014 pruned or bad read");
|
|
48312
48454
|
}
|
|
48313
48455
|
if (navNow < navThen) {
|
|
@@ -48329,13 +48471,13 @@ var wrenFetcher = {
|
|
|
48329
48471
|
return { [WSTGBP_KEY]: apr, [WSTGBP_GROUP_KEY]: apr };
|
|
48330
48472
|
}
|
|
48331
48473
|
};
|
|
48332
|
-
var
|
|
48474
|
+
var CHAIN_ID12 = Chain.ETHEREUM_MAINNET;
|
|
48333
48475
|
var APYUSD = "0x38eeb52f0771140d10c4e9a9a72349a329fe8a6a";
|
|
48334
48476
|
var APYX_LINEAR_VEST = "0x0d62b4cc02b4b51ed19ddf41d7a7979cf394c99f";
|
|
48335
48477
|
var APYX_DISCOVER_URL = "https://api.apyx.fi/v1/rewards/seasons/2/discover";
|
|
48336
48478
|
var APYX_DEFILLAMA_POOL = "cb6139f9-4a68-4efd-8245-0312a92aee55";
|
|
48337
48479
|
var YEAR_SECONDS10 = 31536000n;
|
|
48338
|
-
var
|
|
48480
|
+
var ONE_E1811 = 10n ** 18n;
|
|
48339
48481
|
var APYUSD_KEY = "APYUSD";
|
|
48340
48482
|
var APYUSD_GROUP_KEY = "apyUSD::APYUSD";
|
|
48341
48483
|
var APYUSD_LEGACY_GROUP_KEY = "apyUSD::apyUSD";
|
|
@@ -48364,7 +48506,7 @@ var APYX_READ_ABI = [
|
|
|
48364
48506
|
];
|
|
48365
48507
|
var fetchApyusdAprOnChain = async () => {
|
|
48366
48508
|
const [totalAssets, unvested, periodRemaining] = await multicallRetryUniversal({
|
|
48367
|
-
chain:
|
|
48509
|
+
chain: CHAIN_ID12,
|
|
48368
48510
|
abi: APYX_READ_ABI,
|
|
48369
48511
|
calls: [
|
|
48370
48512
|
{ address: APYUSD, name: "totalAssets", params: [] },
|
|
@@ -48381,7 +48523,7 @@ var fetchApyusdAprOnChain = async () => {
|
|
|
48381
48523
|
throw new Error("apyx vesting state empty");
|
|
48382
48524
|
}
|
|
48383
48525
|
const perSecond = unvested / periodRemaining;
|
|
48384
|
-
return Number(perSecond * YEAR_SECONDS10 *
|
|
48526
|
+
return Number(perSecond * YEAR_SECONDS10 * ONE_E1811 / totalAssets) / 1e16;
|
|
48385
48527
|
};
|
|
48386
48528
|
var fetchApyusdApyFromApi = async () => {
|
|
48387
48529
|
const res = await fetch(APYX_DISCOVER_URL, {
|
|
@@ -48500,12 +48642,12 @@ var strataFetcher = {
|
|
|
48500
48642
|
return out;
|
|
48501
48643
|
}
|
|
48502
48644
|
};
|
|
48503
|
-
var
|
|
48645
|
+
var CHAIN_ID13 = "1";
|
|
48504
48646
|
var SCRVUSD = "0x0655977feb2f289a4ab78af67bab0d17aab84367";
|
|
48505
|
-
var
|
|
48506
|
-
var
|
|
48647
|
+
var ONE_E1812 = 10n ** 18n;
|
|
48648
|
+
var WINDOW_SECONDS8 = 30 * 24 * 60 * 60;
|
|
48507
48649
|
var BLOCK_TIME_SECONDS6 = 12;
|
|
48508
|
-
var WINDOW_BLOCKS6 = BigInt(Math.floor(
|
|
48650
|
+
var WINDOW_BLOCKS6 = BigInt(Math.floor(WINDOW_SECONDS8 / BLOCK_TIME_SECONDS6));
|
|
48509
48651
|
var SERIES_SPAN_SECONDS = 45 * 24 * 60 * 60;
|
|
48510
48652
|
var MAX_RPC_TRIES6 = 2;
|
|
48511
48653
|
var ONCHAIN_DEADLINE_MS2 = 12e3;
|
|
@@ -48540,7 +48682,7 @@ var fetchCurveSeriesAprPercent = async (nowSeconds) => {
|
|
|
48540
48682
|
).sort((a, b) => a.timestamp - b.timestamp);
|
|
48541
48683
|
if (points.length < 2) throw new Error("scrvUSD: series too short");
|
|
48542
48684
|
const last = points[points.length - 1];
|
|
48543
|
-
const base = [...points].reverse().find((p) => p.timestamp <= last.timestamp -
|
|
48685
|
+
const base = [...points].reverse().find((p) => p.timestamp <= last.timestamp - WINDOW_SECONDS8);
|
|
48544
48686
|
if (!base) throw new Error("scrvUSD: series does not span the window");
|
|
48545
48687
|
const elapsed = last.timestamp - base.timestamp;
|
|
48546
48688
|
if (elapsed <= 0) throw new Error("scrvUSD: non-positive window");
|
|
@@ -48550,7 +48692,7 @@ var readRateAt5 = (client, blockNumber) => client.readContract({
|
|
|
48550
48692
|
address: SCRVUSD,
|
|
48551
48693
|
abi: CONVERT_TO_ASSETS_ABI4,
|
|
48552
48694
|
functionName: "convertToAssets",
|
|
48553
|
-
args: [
|
|
48695
|
+
args: [ONE_E1812],
|
|
48554
48696
|
...blockNumber !== void 0 ? { blockNumber } : {}
|
|
48555
48697
|
});
|
|
48556
48698
|
var computeAprOnChain2 = async () => {
|
|
@@ -48559,7 +48701,7 @@ var computeAprOnChain2 = async () => {
|
|
|
48559
48701
|
for (let rpcId = 0; rpcId < MAX_RPC_TRIES6; rpcId++) {
|
|
48560
48702
|
if (Date.now() > deadline) break;
|
|
48561
48703
|
try {
|
|
48562
|
-
const client = getEvmClient(
|
|
48704
|
+
const client = getEvmClient(CHAIN_ID13, rpcId);
|
|
48563
48705
|
const head = await client.getBlockNumber();
|
|
48564
48706
|
const pastBlock = head > WINDOW_BLOCKS6 ? head - WINDOW_BLOCKS6 : 0n;
|
|
48565
48707
|
const [rateNow, rateThen, headBlock, thenBlock] = await Promise.all([
|
|
@@ -48568,7 +48710,7 @@ var computeAprOnChain2 = async () => {
|
|
|
48568
48710
|
client.getBlock({ blockNumber: head }),
|
|
48569
48711
|
client.getBlock({ blockNumber: pastBlock })
|
|
48570
48712
|
]);
|
|
48571
|
-
if (rateNow <
|
|
48713
|
+
if (rateNow < ONE_E1812 || rateThen < ONE_E1812) {
|
|
48572
48714
|
throw new Error("scrvUSD: share price below par \u2014 pruned or bad read");
|
|
48573
48715
|
}
|
|
48574
48716
|
const elapsed = Number(headBlock.timestamp - thenBlock.timestamp);
|
|
@@ -48598,7 +48740,7 @@ var YEAR_SECONDS11 = 31536e3;
|
|
|
48598
48740
|
var STRC_UNIT = 1e6;
|
|
48599
48741
|
var SUSDAT_KEY = "Saturn sUSDat::SUSDAT";
|
|
48600
48742
|
var SUSDAT_BRIDGED_KEY = "Staked Saturn USD::sUSDat";
|
|
48601
|
-
var
|
|
48743
|
+
var VAULT_ABI2 = [
|
|
48602
48744
|
{
|
|
48603
48745
|
name: "vestingAmount",
|
|
48604
48746
|
type: "function",
|
|
@@ -48658,7 +48800,7 @@ var decodeStrcPrice = (cell) => {
|
|
|
48658
48800
|
var computeIncomeApr = async () => {
|
|
48659
48801
|
const [vestingAmount, vestingPeriod, totalAssets, oracle] = await multicallRetryUniversal({
|
|
48660
48802
|
chain: Chain.ETHEREUM_MAINNET,
|
|
48661
|
-
abi:
|
|
48803
|
+
abi: VAULT_ABI2,
|
|
48662
48804
|
calls: [
|
|
48663
48805
|
{ address: SUSDAT, name: "vestingAmount", params: [] },
|
|
48664
48806
|
{ address: SUSDAT, name: "vestingPeriod", params: [] },
|
|
@@ -48775,7 +48917,7 @@ var sthusdFetcher = {
|
|
|
48775
48917
|
};
|
|
48776
48918
|
}
|
|
48777
48919
|
};
|
|
48778
|
-
var
|
|
48920
|
+
var CHAIN_ID14 = Chain.ETHEREUM_MAINNET;
|
|
48779
48921
|
var HUMA_PST_FEED = "0x4be50be32db1510240d542f77c5b36ca0d0965e6";
|
|
48780
48922
|
var HUMA_PST_KEY = "HUMA::PST";
|
|
48781
48923
|
var HUMA_PST_GROUP_KEY = "PayFi Strategy Token::PST";
|
|
@@ -48852,7 +48994,7 @@ var windowAprFromRounds = (latest, candidates, nowSeconds, windowSeconds = HUMA_
|
|
|
48852
48994
|
};
|
|
48853
48995
|
var fetchPstAprOnChain = async () => {
|
|
48854
48996
|
const [latestRaw] = await multicallRetryUniversal({
|
|
48855
|
-
chain:
|
|
48997
|
+
chain: CHAIN_ID14,
|
|
48856
48998
|
abi: FEED_ABI,
|
|
48857
48999
|
calls: [{ address: HUMA_PST_FEED, name: "latestRoundData", params: [] }],
|
|
48858
49000
|
allowFailure: false
|
|
@@ -48874,7 +49016,7 @@ var fetchPstAprOnChain = async () => {
|
|
|
48874
49016
|
)
|
|
48875
49017
|
];
|
|
48876
49018
|
const results = await multicallRetryUniversal({
|
|
48877
|
-
chain:
|
|
49019
|
+
chain: CHAIN_ID14,
|
|
48878
49020
|
abi: FEED_ABI,
|
|
48879
49021
|
calls: probeRounds.map((r) => ({
|
|
48880
49022
|
address: HUMA_PST_FEED,
|
|
@@ -58405,7 +58547,8 @@ function safeGetCalls(fetcherName, fn, errors) {
|
|
|
58405
58547
|
return [];
|
|
58406
58548
|
}
|
|
58407
58549
|
}
|
|
58408
|
-
|
|
58550
|
+
var isCallTarget = (a) => typeof a === "string" && /^0x[0-9a-fA-F]{40}$/.test(a);
|
|
58551
|
+
function buildGroup(fetcherName, results, parse, abi, derivation, getCallsErrors) {
|
|
58409
58552
|
const group = {
|
|
58410
58553
|
fetcherName,
|
|
58411
58554
|
calls: [],
|
|
@@ -58414,6 +58557,14 @@ function buildGroup(fetcherName, results, parse, abi, derivation) {
|
|
|
58414
58557
|
trackers: []
|
|
58415
58558
|
};
|
|
58416
58559
|
for (const fr of results) {
|
|
58560
|
+
const bad = fr.calls.filter((c) => !isCallTarget(c?.address));
|
|
58561
|
+
if (bad.length > 0) {
|
|
58562
|
+
const sample = bad[0];
|
|
58563
|
+
const msg = `${bad.length}/${fr.calls.length} calls target an invalid address (${JSON.stringify(sample?.address)} ${sample?.name ?? "?"}) \u2014 lender dropped from the batch; fix the registry entry (lender-metadata), this is not an RPC failure`;
|
|
58564
|
+
if (getCallsErrors) getCallsErrors[`${fetcherName}:${fr.lender}`] = msg;
|
|
58565
|
+
console.warn(`[oracle-prices] ${fetcherName} ${fr.lender}: ${msg}`);
|
|
58566
|
+
continue;
|
|
58567
|
+
}
|
|
58417
58568
|
group.trackers.push({
|
|
58418
58569
|
lender: fr.lender,
|
|
58419
58570
|
meta: fr.meta,
|
|
@@ -58658,140 +58809,160 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
58658
58809
|
aaveResults,
|
|
58659
58810
|
aaveFetcher.parse,
|
|
58660
58811
|
AaveOracleAbi,
|
|
58661
|
-
"direct"
|
|
58812
|
+
"direct",
|
|
58813
|
+
getCallsErrors
|
|
58662
58814
|
);
|
|
58663
58815
|
const compoundV2Group = buildGroup(
|
|
58664
58816
|
"compoundV2",
|
|
58665
58817
|
compoundV2Results,
|
|
58666
58818
|
compoundV2Fetcher.parse,
|
|
58667
58819
|
CompoundV2OracleAbi,
|
|
58668
|
-
"direct"
|
|
58820
|
+
"direct",
|
|
58821
|
+
getCallsErrors
|
|
58669
58822
|
);
|
|
58670
58823
|
const compoundV3Group = buildGroup(
|
|
58671
58824
|
"compoundV3",
|
|
58672
58825
|
compoundV3Results,
|
|
58673
58826
|
compoundV3Fetcher.parse,
|
|
58674
58827
|
ChainlinkAggregatorAbi,
|
|
58675
|
-
"direct"
|
|
58828
|
+
"direct",
|
|
58829
|
+
getCallsErrors
|
|
58676
58830
|
);
|
|
58677
58831
|
const listaGroup = buildGroup(
|
|
58678
58832
|
"lista",
|
|
58679
58833
|
listaResults,
|
|
58680
58834
|
listaFetcher.parse,
|
|
58681
58835
|
ProxyOracleAbi,
|
|
58682
|
-
"direct"
|
|
58836
|
+
"direct",
|
|
58837
|
+
getCallsErrors
|
|
58683
58838
|
);
|
|
58684
58839
|
const llamaLendGroup = buildGroup(
|
|
58685
58840
|
"llamaLend",
|
|
58686
58841
|
llamaLendResults,
|
|
58687
58842
|
llamaLendFetcher.parse,
|
|
58688
58843
|
getLlamaLendAbi(),
|
|
58689
|
-
"derived"
|
|
58844
|
+
"derived",
|
|
58845
|
+
getCallsErrors
|
|
58690
58846
|
);
|
|
58691
58847
|
const eulerGroup = buildGroup(
|
|
58692
58848
|
"eulerV2",
|
|
58693
58849
|
eulerResults,
|
|
58694
58850
|
eulerV2Fetcher.parse,
|
|
58695
58851
|
getEulerV2Abi(),
|
|
58696
|
-
"direct"
|
|
58852
|
+
"direct",
|
|
58853
|
+
getCallsErrors
|
|
58697
58854
|
);
|
|
58698
58855
|
const aaveV4Group = buildGroup(
|
|
58699
58856
|
"aaveV4",
|
|
58700
58857
|
aaveV4Results,
|
|
58701
58858
|
aaveV4Fetcher.parse,
|
|
58702
58859
|
getAaveV4Abi(),
|
|
58703
|
-
"direct"
|
|
58860
|
+
"direct",
|
|
58861
|
+
getCallsErrors
|
|
58704
58862
|
);
|
|
58705
58863
|
const morphoGroup = buildGroup(
|
|
58706
58864
|
"morpho",
|
|
58707
58865
|
morphoResults,
|
|
58708
58866
|
morphoFetcher.parse,
|
|
58709
58867
|
ProxyOracleAbi,
|
|
58710
|
-
"derived"
|
|
58868
|
+
"derived",
|
|
58869
|
+
getCallsErrors
|
|
58711
58870
|
);
|
|
58712
58871
|
const midnightGroup = buildGroup(
|
|
58713
58872
|
"midnight",
|
|
58714
58873
|
midnightResults,
|
|
58715
58874
|
midnightFetcher.parse,
|
|
58716
58875
|
ProxyOracleAbi,
|
|
58717
|
-
"derived"
|
|
58876
|
+
"derived",
|
|
58877
|
+
getCallsErrors
|
|
58718
58878
|
);
|
|
58719
58879
|
const exactlyGroup = buildGroup(
|
|
58720
58880
|
"exactly",
|
|
58721
58881
|
exactlyResults,
|
|
58722
58882
|
exactlyFetcher.parse,
|
|
58723
58883
|
getExactlyAbi(),
|
|
58724
|
-
"direct"
|
|
58884
|
+
"direct",
|
|
58885
|
+
getCallsErrors
|
|
58725
58886
|
);
|
|
58726
58887
|
const flyingTulipGroup = buildGroup(
|
|
58727
58888
|
"flyingTulip",
|
|
58728
58889
|
flyingTulipResults,
|
|
58729
58890
|
flyingTulipFetcher.parse,
|
|
58730
58891
|
getFlyingTulipAbi(),
|
|
58731
|
-
"direct"
|
|
58892
|
+
"direct",
|
|
58893
|
+
getCallsErrors
|
|
58732
58894
|
);
|
|
58733
58895
|
const termGroup = buildGroup(
|
|
58734
58896
|
"term",
|
|
58735
58897
|
termResults,
|
|
58736
58898
|
termFetcher.parse,
|
|
58737
58899
|
getTermAbi(),
|
|
58738
|
-
"direct"
|
|
58900
|
+
"direct",
|
|
58901
|
+
getCallsErrors
|
|
58739
58902
|
);
|
|
58740
58903
|
const liquityGroup = buildGroup(
|
|
58741
58904
|
"liquity",
|
|
58742
58905
|
liquityResults,
|
|
58743
58906
|
liquityFetcher.parse,
|
|
58744
58907
|
getLiquityAbi(),
|
|
58745
|
-
"direct"
|
|
58908
|
+
"direct",
|
|
58909
|
+
getCallsErrors
|
|
58746
58910
|
);
|
|
58747
58911
|
const riverGroup = buildGroup(
|
|
58748
58912
|
"river",
|
|
58749
58913
|
riverResults,
|
|
58750
58914
|
riverFetcher.parse,
|
|
58751
58915
|
getRiverAbi(),
|
|
58752
|
-
"direct"
|
|
58916
|
+
"direct",
|
|
58917
|
+
getCallsErrors
|
|
58753
58918
|
);
|
|
58754
58919
|
const dssGroup = buildGroup(
|
|
58755
58920
|
"dss",
|
|
58756
58921
|
dssResults,
|
|
58757
58922
|
dssFetcher.parse,
|
|
58758
58923
|
dssFetcher.getAbi(),
|
|
58759
|
-
"direct"
|
|
58924
|
+
"direct",
|
|
58925
|
+
getCallsErrors
|
|
58760
58926
|
);
|
|
58761
58927
|
const curvanceGroup = buildGroup(
|
|
58762
58928
|
"curvance",
|
|
58763
58929
|
curvanceResults,
|
|
58764
58930
|
curvanceFetcher.parse,
|
|
58765
58931
|
curvanceFetcher.getAbi(),
|
|
58766
|
-
"direct"
|
|
58932
|
+
"direct",
|
|
58933
|
+
getCallsErrors
|
|
58767
58934
|
);
|
|
58768
58935
|
const resupplyGroup = buildGroup(
|
|
58769
58936
|
"resupply",
|
|
58770
58937
|
resupplyResults,
|
|
58771
58938
|
resupplyFetcher.parse,
|
|
58772
58939
|
resupplyFetcher.getAbi(),
|
|
58773
|
-
"direct"
|
|
58940
|
+
"direct",
|
|
58941
|
+
getCallsErrors
|
|
58774
58942
|
);
|
|
58775
58943
|
const inverseGroup = buildGroup(
|
|
58776
58944
|
"inverse",
|
|
58777
58945
|
inverseResults,
|
|
58778
58946
|
inverseFetcher.parse,
|
|
58779
58947
|
getInverseAbi(),
|
|
58780
|
-
"direct"
|
|
58948
|
+
"direct",
|
|
58949
|
+
getCallsErrors
|
|
58781
58950
|
);
|
|
58782
58951
|
const tellerGroup = buildGroup(
|
|
58783
58952
|
"teller",
|
|
58784
58953
|
tellerResults,
|
|
58785
58954
|
tellerFetcher.parse,
|
|
58786
58955
|
getTellerAbi(),
|
|
58787
|
-
"derived"
|
|
58956
|
+
"derived",
|
|
58957
|
+
getCallsErrors
|
|
58788
58958
|
);
|
|
58789
58959
|
const fraxlendGroup = buildGroup(
|
|
58790
58960
|
"fraxlend",
|
|
58791
58961
|
fraxlendResults,
|
|
58792
58962
|
fraxlendFetcher.parse,
|
|
58793
58963
|
getFraxlendAbi(),
|
|
58794
|
-
"derived"
|
|
58964
|
+
"derived",
|
|
58965
|
+
getCallsErrors
|
|
58795
58966
|
);
|
|
58796
58967
|
const termMaxGroup = buildGroup(
|
|
58797
58968
|
"termmax",
|
|
@@ -58800,42 +58971,48 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
58800
58971
|
getTermMaxAbi(),
|
|
58801
58972
|
// DIRECT: `OracleAggregatorV2.getPrice` returns a USD price outright —
|
|
58802
58973
|
// nothing is derived from another asset's price.
|
|
58803
|
-
"direct"
|
|
58974
|
+
"direct",
|
|
58975
|
+
getCallsErrors
|
|
58804
58976
|
);
|
|
58805
58977
|
const siloV2Group = buildGroup(
|
|
58806
58978
|
"siloV2",
|
|
58807
58979
|
siloV2Results,
|
|
58808
58980
|
siloV2Fetcher.parse,
|
|
58809
58981
|
getSiloV2Abi(),
|
|
58810
|
-
"derived"
|
|
58982
|
+
"derived",
|
|
58983
|
+
getCallsErrors
|
|
58811
58984
|
);
|
|
58812
58985
|
const siloV3Group = buildGroup(
|
|
58813
58986
|
"siloV3",
|
|
58814
58987
|
siloV3Results,
|
|
58815
58988
|
siloV3Fetcher.parse,
|
|
58816
58989
|
getSiloV3Abi(),
|
|
58817
|
-
"derived"
|
|
58990
|
+
"derived",
|
|
58991
|
+
getCallsErrors
|
|
58818
58992
|
);
|
|
58819
58993
|
const fluidGroup = buildGroup(
|
|
58820
58994
|
"fluid",
|
|
58821
58995
|
fluidResults,
|
|
58822
58996
|
fluidFetcher.parse,
|
|
58823
58997
|
getFluidAbi(),
|
|
58824
|
-
"derived"
|
|
58998
|
+
"derived",
|
|
58999
|
+
getCallsErrors
|
|
58825
59000
|
);
|
|
58826
59001
|
const gearboxV3Group = buildGroup(
|
|
58827
59002
|
"gearboxV3",
|
|
58828
59003
|
gearboxV3Results,
|
|
58829
59004
|
gearboxV3Fetcher.parse,
|
|
58830
59005
|
getGearboxV3Abi(),
|
|
58831
|
-
"derived"
|
|
59006
|
+
"derived",
|
|
59007
|
+
getCallsErrors
|
|
58832
59008
|
);
|
|
58833
59009
|
const dolomiteGroup = buildGroup(
|
|
58834
59010
|
"dolomite",
|
|
58835
59011
|
dolomiteResults,
|
|
58836
59012
|
dolomiteFetcher.parse,
|
|
58837
59013
|
getDolomiteAbi(),
|
|
58838
|
-
"direct"
|
|
59014
|
+
"direct",
|
|
59015
|
+
getCallsErrors
|
|
58839
59016
|
);
|
|
58840
59017
|
const allGroups = [
|
|
58841
59018
|
aaveGroup,
|
|
@@ -63143,7 +63320,7 @@ var Erc4626PreviewRedeemAbi = [
|
|
|
63143
63320
|
];
|
|
63144
63321
|
|
|
63145
63322
|
// src/vaults/lst/readers/shared.ts
|
|
63146
|
-
var
|
|
63323
|
+
var ONE_E1813 = 10n ** 18n;
|
|
63147
63324
|
var rescaleDecimals = (v, fromDec, toDec) => toDec >= fromDec ? v * 10n ** BigInt(toDec - fromDec) : v / 10n ** BigInt(fromDec - toDec);
|
|
63148
63325
|
var MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
63149
63326
|
var Multicall3BalanceAbi = [
|
|
@@ -63186,7 +63363,7 @@ var readerBeetsStS = (entry) => ({
|
|
|
63186
63363
|
}
|
|
63187
63364
|
const liquidity = toBigInt14(pool);
|
|
63188
63365
|
return {
|
|
63189
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63366
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63190
63367
|
totalSupply,
|
|
63191
63368
|
exchangeRate,
|
|
63192
63369
|
liquidity
|
|
@@ -63219,7 +63396,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
63219
63396
|
{
|
|
63220
63397
|
address: entry.address,
|
|
63221
63398
|
name: "getPooledAvaxByShares",
|
|
63222
|
-
params: [
|
|
63399
|
+
params: [ONE_E1813]
|
|
63223
63400
|
},
|
|
63224
63401
|
{ address: entry.address, name: "totalPooledAvax", params: [] }
|
|
63225
63402
|
],
|
|
@@ -63230,7 +63407,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
63230
63407
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
63231
63408
|
return void 0;
|
|
63232
63409
|
}
|
|
63233
|
-
const totalAssets = toBigInt14(totalPooled) ?? totalSupply * exchangeRate /
|
|
63410
|
+
const totalAssets = toBigInt14(totalPooled) ?? totalSupply * exchangeRate / ONE_E1813;
|
|
63234
63411
|
return {
|
|
63235
63412
|
totalAssets,
|
|
63236
63413
|
totalSupply,
|
|
@@ -63249,7 +63426,7 @@ var readerBgtWrapper1to1 = (entry) => ({
|
|
|
63249
63426
|
return {
|
|
63250
63427
|
totalAssets: totalSupply,
|
|
63251
63428
|
totalSupply,
|
|
63252
|
-
exchangeRate:
|
|
63429
|
+
exchangeRate: ONE_E1813
|
|
63253
63430
|
};
|
|
63254
63431
|
}
|
|
63255
63432
|
});
|
|
@@ -63279,7 +63456,7 @@ var readerDineroBeraEth = (entry) => ({
|
|
|
63279
63456
|
return void 0;
|
|
63280
63457
|
}
|
|
63281
63458
|
return {
|
|
63282
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63459
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63283
63460
|
totalSupply,
|
|
63284
63461
|
exchangeRate
|
|
63285
63462
|
};
|
|
@@ -63291,7 +63468,7 @@ var readerErc4626 = (entry) => ({
|
|
|
63291
63468
|
calls: [
|
|
63292
63469
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
63293
63470
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63294
|
-
{ address: entry.address, name: "convertToAssets", params: [
|
|
63471
|
+
{ address: entry.address, name: "convertToAssets", params: [ONE_E1813] }
|
|
63295
63472
|
],
|
|
63296
63473
|
abis: [Erc4626ReadAbi, TotalSupplyAbi, Erc4626ReadAbi],
|
|
63297
63474
|
parse: ([assets, supply, rate]) => {
|
|
@@ -63308,7 +63485,7 @@ var readerErc4626PreviewRedeem = (entry) => ({
|
|
|
63308
63485
|
calls: [
|
|
63309
63486
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
63310
63487
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63311
|
-
{ address: entry.address, name: "previewRedeem", params: [
|
|
63488
|
+
{ address: entry.address, name: "previewRedeem", params: [ONE_E1813] }
|
|
63312
63489
|
],
|
|
63313
63490
|
abis: [Erc4626PreviewRedeemAbi, TotalSupplyAbi, Erc4626PreviewRedeemAbi],
|
|
63314
63491
|
parse: ([assets, supply, rate]) => {
|
|
@@ -63388,7 +63565,7 @@ var readerEtherFiWeEth = (entry) => {
|
|
|
63388
63565
|
}
|
|
63389
63566
|
}
|
|
63390
63567
|
return {
|
|
63391
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63568
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63392
63569
|
totalSupply,
|
|
63393
63570
|
exchangeRate,
|
|
63394
63571
|
liquidity
|
|
@@ -63397,6 +63574,50 @@ var readerEtherFiWeEth = (entry) => {
|
|
|
63397
63574
|
};
|
|
63398
63575
|
};
|
|
63399
63576
|
|
|
63577
|
+
// src/vaults/lst/abis/flarePooled.ts
|
|
63578
|
+
var FlarePooledFlrAbi = [
|
|
63579
|
+
{
|
|
63580
|
+
name: "totalPooledFlr",
|
|
63581
|
+
type: "function",
|
|
63582
|
+
stateMutability: "view",
|
|
63583
|
+
inputs: [],
|
|
63584
|
+
outputs: [{ type: "uint256" }]
|
|
63585
|
+
},
|
|
63586
|
+
{
|
|
63587
|
+
name: "totalShares",
|
|
63588
|
+
type: "function",
|
|
63589
|
+
stateMutability: "view",
|
|
63590
|
+
inputs: [],
|
|
63591
|
+
outputs: [{ type: "uint256" }]
|
|
63592
|
+
},
|
|
63593
|
+
{
|
|
63594
|
+
name: "getPooledFlrByShares",
|
|
63595
|
+
type: "function",
|
|
63596
|
+
stateMutability: "view",
|
|
63597
|
+
inputs: [{ name: "shares", type: "uint256" }],
|
|
63598
|
+
outputs: [{ type: "uint256" }]
|
|
63599
|
+
}
|
|
63600
|
+
];
|
|
63601
|
+
|
|
63602
|
+
// src/vaults/lst/readers/flarePooled.ts
|
|
63603
|
+
var readerFlarePooledFlr = (entry) => ({
|
|
63604
|
+
calls: [
|
|
63605
|
+
{ address: entry.address, name: "totalPooledFlr", params: [] },
|
|
63606
|
+
{ address: entry.address, name: "totalShares", params: [] },
|
|
63607
|
+
{ address: entry.address, name: "getPooledFlrByShares", params: [ONE_E1813] }
|
|
63608
|
+
],
|
|
63609
|
+
abis: [FlarePooledFlrAbi, FlarePooledFlrAbi, FlarePooledFlrAbi],
|
|
63610
|
+
parse: ([pooledFlr, shares, rate]) => {
|
|
63611
|
+
const totalAssets = toBigInt14(pooledFlr);
|
|
63612
|
+
const totalSupply = toBigInt14(shares);
|
|
63613
|
+
const exchangeRate = toBigInt14(rate);
|
|
63614
|
+
if (totalAssets === void 0 || totalSupply === void 0 || exchangeRate === void 0) {
|
|
63615
|
+
return void 0;
|
|
63616
|
+
}
|
|
63617
|
+
return { totalAssets, totalSupply, exchangeRate };
|
|
63618
|
+
}
|
|
63619
|
+
});
|
|
63620
|
+
|
|
63400
63621
|
// src/vaults/lst/abis/hyperbeat.ts
|
|
63401
63622
|
var HyperbeatStakingCoreAbi = [
|
|
63402
63623
|
{
|
|
@@ -63421,7 +63642,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
63421
63642
|
return {
|
|
63422
63643
|
totalAssets: totalSupply,
|
|
63423
63644
|
totalSupply,
|
|
63424
|
-
exchangeRate:
|
|
63645
|
+
exchangeRate: ONE_E1813
|
|
63425
63646
|
};
|
|
63426
63647
|
}
|
|
63427
63648
|
};
|
|
@@ -63429,7 +63650,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
63429
63650
|
return {
|
|
63430
63651
|
calls: [
|
|
63431
63652
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63432
|
-
{ address: stakingCore, name: "BeHYPEToHYPE", params: [
|
|
63653
|
+
{ address: stakingCore, name: "BeHYPEToHYPE", params: [ONE_E1813] }
|
|
63433
63654
|
],
|
|
63434
63655
|
abis: [TotalSupplyAbi, HyperbeatStakingCoreAbi],
|
|
63435
63656
|
parse: ([supply, rate]) => {
|
|
@@ -63439,7 +63660,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
63439
63660
|
return void 0;
|
|
63440
63661
|
}
|
|
63441
63662
|
return {
|
|
63442
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63663
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63443
63664
|
totalSupply,
|
|
63444
63665
|
exchangeRate
|
|
63445
63666
|
};
|
|
@@ -63471,7 +63692,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
63471
63692
|
return {
|
|
63472
63693
|
totalAssets: totalSupply,
|
|
63473
63694
|
totalSupply,
|
|
63474
|
-
exchangeRate:
|
|
63695
|
+
exchangeRate: ONE_E1813
|
|
63475
63696
|
};
|
|
63476
63697
|
}
|
|
63477
63698
|
};
|
|
@@ -63489,7 +63710,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
63489
63710
|
return void 0;
|
|
63490
63711
|
}
|
|
63491
63712
|
return {
|
|
63492
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63713
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63493
63714
|
totalSupply,
|
|
63494
63715
|
exchangeRate
|
|
63495
63716
|
};
|
|
@@ -63521,7 +63742,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
63521
63742
|
return {
|
|
63522
63743
|
totalAssets: totalSupply,
|
|
63523
63744
|
totalSupply,
|
|
63524
|
-
exchangeRate:
|
|
63745
|
+
exchangeRate: ONE_E1813
|
|
63525
63746
|
};
|
|
63526
63747
|
}
|
|
63527
63748
|
};
|
|
@@ -63529,7 +63750,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
63529
63750
|
return {
|
|
63530
63751
|
calls: [
|
|
63531
63752
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63532
|
-
{ address: accountant, name: "kHYPEToHYPE", params: [
|
|
63753
|
+
{ address: accountant, name: "kHYPEToHYPE", params: [ONE_E1813] }
|
|
63533
63754
|
],
|
|
63534
63755
|
abis: [TotalSupplyAbi, KinetiqStakingAccountantAbi],
|
|
63535
63756
|
parse: ([supply, rate]) => {
|
|
@@ -63539,7 +63760,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
63539
63760
|
return void 0;
|
|
63540
63761
|
}
|
|
63541
63762
|
return {
|
|
63542
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63763
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63543
63764
|
totalSupply,
|
|
63544
63765
|
exchangeRate
|
|
63545
63766
|
};
|
|
@@ -63579,7 +63800,7 @@ var readerLairStKaia = (entry) => ({
|
|
|
63579
63800
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
63580
63801
|
return void 0;
|
|
63581
63802
|
}
|
|
63582
|
-
const totalAssets = toBigInt14(totalStaking) ?? totalSupply * exchangeRate /
|
|
63803
|
+
const totalAssets = toBigInt14(totalStaking) ?? totalSupply * exchangeRate / ONE_E1813;
|
|
63583
63804
|
return {
|
|
63584
63805
|
totalAssets,
|
|
63585
63806
|
totalSupply,
|
|
@@ -63613,7 +63834,7 @@ var readerLidoWstEth = (entry) => ({
|
|
|
63613
63834
|
return void 0;
|
|
63614
63835
|
}
|
|
63615
63836
|
return {
|
|
63616
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63837
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63617
63838
|
totalSupply,
|
|
63618
63839
|
exchangeRate
|
|
63619
63840
|
};
|
|
@@ -63651,7 +63872,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
63651
63872
|
return {
|
|
63652
63873
|
totalAssets: totalSupply,
|
|
63653
63874
|
totalSupply,
|
|
63654
|
-
exchangeRate:
|
|
63875
|
+
exchangeRate: ONE_E1813
|
|
63655
63876
|
};
|
|
63656
63877
|
}
|
|
63657
63878
|
};
|
|
@@ -63659,7 +63880,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
63659
63880
|
return {
|
|
63660
63881
|
calls: [
|
|
63661
63882
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63662
|
-
{ address: manager, name: "convertSnBnbToBnb", params: [
|
|
63883
|
+
{ address: manager, name: "convertSnBnbToBnb", params: [ONE_E1813] },
|
|
63663
63884
|
{ address: manager, name: "getTotalPooledBnb", params: [] }
|
|
63664
63885
|
],
|
|
63665
63886
|
abis: [TotalSupplyAbi, ListaStakeManagerReadAbi, ListaStakeManagerReadAbi],
|
|
@@ -63670,7 +63891,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
63670
63891
|
return void 0;
|
|
63671
63892
|
}
|
|
63672
63893
|
const pooledBnb = toBigInt14(pooled);
|
|
63673
|
-
const totalAssets = pooledBnb ?? totalSupply * exchangeRate /
|
|
63894
|
+
const totalAssets = pooledBnb ?? totalSupply * exchangeRate / ONE_E1813;
|
|
63674
63895
|
return { totalAssets, totalSupply, exchangeRate };
|
|
63675
63896
|
}
|
|
63676
63897
|
};
|
|
@@ -63700,7 +63921,7 @@ var readerMantleMEth = (entry) => {
|
|
|
63700
63921
|
return {
|
|
63701
63922
|
totalAssets: totalSupply,
|
|
63702
63923
|
totalSupply,
|
|
63703
|
-
exchangeRate:
|
|
63924
|
+
exchangeRate: ONE_E1813
|
|
63704
63925
|
};
|
|
63705
63926
|
}
|
|
63706
63927
|
};
|
|
@@ -63708,7 +63929,7 @@ var readerMantleMEth = (entry) => {
|
|
|
63708
63929
|
return {
|
|
63709
63930
|
calls: [
|
|
63710
63931
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63711
|
-
{ address: staking, name: "mETHToETH", params: [
|
|
63932
|
+
{ address: staking, name: "mETHToETH", params: [ONE_E1813] }
|
|
63712
63933
|
],
|
|
63713
63934
|
abis: [TotalSupplyAbi, MantleStakingAbi],
|
|
63714
63935
|
parse: ([supply, rate]) => {
|
|
@@ -63718,7 +63939,7 @@ var readerMantleMEth = (entry) => {
|
|
|
63718
63939
|
return void 0;
|
|
63719
63940
|
}
|
|
63720
63941
|
return {
|
|
63721
|
-
totalAssets: totalSupply * exchangeRate /
|
|
63942
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63722
63943
|
totalSupply,
|
|
63723
63944
|
exchangeRate
|
|
63724
63945
|
};
|
|
@@ -63739,7 +63960,7 @@ var readerOffChain = (entry) => {
|
|
|
63739
63960
|
return {
|
|
63740
63961
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
63741
63962
|
totalSupply,
|
|
63742
|
-
exchangeRate:
|
|
63963
|
+
exchangeRate: ONE_E1813
|
|
63743
63964
|
};
|
|
63744
63965
|
}
|
|
63745
63966
|
};
|
|
@@ -63773,7 +63994,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
63773
63994
|
return {
|
|
63774
63995
|
totalAssets: totalSupply,
|
|
63775
63996
|
totalSupply,
|
|
63776
|
-
exchangeRate:
|
|
63997
|
+
exchangeRate: ONE_E1813
|
|
63777
63998
|
};
|
|
63778
63999
|
}
|
|
63779
64000
|
};
|
|
@@ -63792,7 +64013,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
63792
64013
|
return {
|
|
63793
64014
|
totalAssets: totalTvl,
|
|
63794
64015
|
totalSupply,
|
|
63795
|
-
exchangeRate: totalTvl *
|
|
64016
|
+
exchangeRate: totalTvl * ONE_E1813 / totalSupply
|
|
63796
64017
|
};
|
|
63797
64018
|
}
|
|
63798
64019
|
};
|
|
@@ -63848,7 +64069,7 @@ var readerRocketReth = (entry) => {
|
|
|
63848
64069
|
}
|
|
63849
64070
|
const liquidity = depositPool ? toBigInt14(slice2[2]) : void 0;
|
|
63850
64071
|
return {
|
|
63851
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64072
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63852
64073
|
totalSupply,
|
|
63853
64074
|
exchangeRate,
|
|
63854
64075
|
liquidity
|
|
@@ -63890,7 +64111,7 @@ var readerStaderEthx = (entry) => {
|
|
|
63890
64111
|
return {
|
|
63891
64112
|
totalAssets: totalSupply,
|
|
63892
64113
|
totalSupply,
|
|
63893
|
-
exchangeRate:
|
|
64114
|
+
exchangeRate: ONE_E1813
|
|
63894
64115
|
};
|
|
63895
64116
|
}
|
|
63896
64117
|
};
|
|
@@ -63908,7 +64129,7 @@ var readerStaderEthx = (entry) => {
|
|
|
63908
64129
|
return void 0;
|
|
63909
64130
|
}
|
|
63910
64131
|
return {
|
|
63911
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64132
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63912
64133
|
totalSupply,
|
|
63913
64134
|
exchangeRate
|
|
63914
64135
|
};
|
|
@@ -63925,7 +64146,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
63925
64146
|
{
|
|
63926
64147
|
address: rateAddress,
|
|
63927
64148
|
name: "convertMaticXToMatic",
|
|
63928
|
-
params: [
|
|
64149
|
+
params: [ONE_E1813],
|
|
63929
64150
|
chainId: homeChainId
|
|
63930
64151
|
}
|
|
63931
64152
|
],
|
|
@@ -63940,7 +64161,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
63940
64161
|
}
|
|
63941
64162
|
const isCrossChain = homeContract !== void 0;
|
|
63942
64163
|
return {
|
|
63943
|
-
totalAssets: isCrossChain ? totalSupply * amountInMatic /
|
|
64164
|
+
totalAssets: isCrossChain ? totalSupply * amountInMatic / ONE_E1813 : totalPooledMatic ?? totalSupply * amountInMatic / ONE_E1813,
|
|
63944
64165
|
totalSupply,
|
|
63945
64166
|
exchangeRate: amountInMatic
|
|
63946
64167
|
};
|
|
@@ -63972,7 +64193,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
63972
64193
|
return {
|
|
63973
64194
|
totalAssets: totalSupply,
|
|
63974
64195
|
totalSupply,
|
|
63975
|
-
exchangeRate:
|
|
64196
|
+
exchangeRate: ONE_E1813
|
|
63976
64197
|
};
|
|
63977
64198
|
}
|
|
63978
64199
|
};
|
|
@@ -63980,7 +64201,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
63980
64201
|
return {
|
|
63981
64202
|
calls: [
|
|
63982
64203
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
63983
|
-
{ address: controller, name: "convertToAssets", params: [
|
|
64204
|
+
{ address: controller, name: "convertToAssets", params: [ONE_E1813] }
|
|
63984
64205
|
],
|
|
63985
64206
|
abis: [TotalSupplyAbi, StakeWiseOsTokenAbi],
|
|
63986
64207
|
parse: ([supply, rate]) => {
|
|
@@ -63990,7 +64211,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
63990
64211
|
return void 0;
|
|
63991
64212
|
}
|
|
63992
64213
|
return {
|
|
63993
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64214
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
63994
64215
|
totalSupply,
|
|
63995
64216
|
exchangeRate
|
|
63996
64217
|
};
|
|
@@ -64022,7 +64243,7 @@ var readerStCelo = (entry) => {
|
|
|
64022
64243
|
return {
|
|
64023
64244
|
totalAssets: totalSupply,
|
|
64024
64245
|
totalSupply,
|
|
64025
|
-
exchangeRate:
|
|
64246
|
+
exchangeRate: ONE_E1813
|
|
64026
64247
|
};
|
|
64027
64248
|
}
|
|
64028
64249
|
};
|
|
@@ -64030,7 +64251,7 @@ var readerStCelo = (entry) => {
|
|
|
64030
64251
|
return {
|
|
64031
64252
|
calls: [
|
|
64032
64253
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
64033
|
-
{ address: manager, name: "toCelo", params: [
|
|
64254
|
+
{ address: manager, name: "toCelo", params: [ONE_E1813] }
|
|
64034
64255
|
],
|
|
64035
64256
|
abis: [TotalSupplyAbi, StCeloManagerAbi],
|
|
64036
64257
|
parse: ([supply, rate]) => {
|
|
@@ -64040,7 +64261,7 @@ var readerStCelo = (entry) => {
|
|
|
64040
64261
|
return void 0;
|
|
64041
64262
|
}
|
|
64042
64263
|
return {
|
|
64043
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64264
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
64044
64265
|
totalSupply,
|
|
64045
64266
|
exchangeRate
|
|
64046
64267
|
};
|
|
@@ -64073,7 +64294,7 @@ var readerSwellGetRate = (entry) => ({
|
|
|
64073
64294
|
return void 0;
|
|
64074
64295
|
}
|
|
64075
64296
|
return {
|
|
64076
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64297
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
64077
64298
|
totalSupply,
|
|
64078
64299
|
exchangeRate
|
|
64079
64300
|
};
|
|
@@ -64104,7 +64325,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
64104
64325
|
return {
|
|
64105
64326
|
totalAssets: totalSupply,
|
|
64106
64327
|
totalSupply,
|
|
64107
|
-
exchangeRate:
|
|
64328
|
+
exchangeRate: ONE_E1813
|
|
64108
64329
|
};
|
|
64109
64330
|
}
|
|
64110
64331
|
};
|
|
@@ -64122,7 +64343,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
64122
64343
|
return void 0;
|
|
64123
64344
|
}
|
|
64124
64345
|
return {
|
|
64125
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64346
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
64126
64347
|
totalSupply,
|
|
64127
64348
|
exchangeRate
|
|
64128
64349
|
};
|
|
@@ -64156,7 +64377,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
64156
64377
|
return {
|
|
64157
64378
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
64158
64379
|
totalSupply,
|
|
64159
|
-
exchangeRate:
|
|
64380
|
+
exchangeRate: ONE_E1813
|
|
64160
64381
|
};
|
|
64161
64382
|
}
|
|
64162
64383
|
};
|
|
@@ -64175,7 +64396,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
64175
64396
|
const exchangeRate = rawRate * scale3;
|
|
64176
64397
|
return {
|
|
64177
64398
|
totalAssets: rescaleDecimals(
|
|
64178
|
-
totalSupply * exchangeRate /
|
|
64399
|
+
totalSupply * exchangeRate / ONE_E1813,
|
|
64179
64400
|
shareDec,
|
|
64180
64401
|
underlyingDec
|
|
64181
64402
|
),
|
|
@@ -64211,9 +64432,9 @@ var readerAnkrRatio = (entry) => ({
|
|
|
64211
64432
|
return void 0;
|
|
64212
64433
|
}
|
|
64213
64434
|
return {
|
|
64214
|
-
totalAssets: totalSupply *
|
|
64435
|
+
totalAssets: totalSupply * ONE_E1813 / r,
|
|
64215
64436
|
totalSupply,
|
|
64216
|
-
exchangeRate:
|
|
64437
|
+
exchangeRate: ONE_E1813 * ONE_E1813 / r
|
|
64217
64438
|
};
|
|
64218
64439
|
}
|
|
64219
64440
|
});
|
|
@@ -64243,7 +64464,7 @@ var readerBinanceWbeth = (entry) => ({
|
|
|
64243
64464
|
return void 0;
|
|
64244
64465
|
}
|
|
64245
64466
|
return {
|
|
64246
|
-
totalAssets: totalSupply * exchangeRate /
|
|
64467
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
64247
64468
|
totalSupply,
|
|
64248
64469
|
exchangeRate
|
|
64249
64470
|
};
|
|
@@ -64289,7 +64510,7 @@ var readerCoreEarnRate = (entry) => {
|
|
|
64289
64510
|
return {
|
|
64290
64511
|
totalAssets: totalSupply * r / CORE_RATE_DENOM,
|
|
64291
64512
|
totalSupply,
|
|
64292
|
-
exchangeRate: r *
|
|
64513
|
+
exchangeRate: r * ONE_E1813 / CORE_RATE_DENOM
|
|
64293
64514
|
};
|
|
64294
64515
|
}
|
|
64295
64516
|
};
|
|
@@ -64311,7 +64532,7 @@ var readerCoreStakedRatio = (entry) => {
|
|
|
64311
64532
|
return {
|
|
64312
64533
|
totalAssets: totalStaked,
|
|
64313
64534
|
totalSupply,
|
|
64314
|
-
exchangeRate: totalStaked *
|
|
64535
|
+
exchangeRate: totalStaked * ONE_E1813 / totalSupply
|
|
64315
64536
|
};
|
|
64316
64537
|
}
|
|
64317
64538
|
};
|
|
@@ -64346,7 +64567,7 @@ var readerKintsuSMon = (entry) => ({
|
|
|
64346
64567
|
const totalAssets = toBigInt14(pooled);
|
|
64347
64568
|
const totalSupply = toBigInt14(shares);
|
|
64348
64569
|
if (totalAssets === void 0 || totalSupply === void 0) return void 0;
|
|
64349
|
-
const exchangeRate = totalSupply > 0n ? totalAssets *
|
|
64570
|
+
const exchangeRate = totalSupply > 0n ? totalAssets * ONE_E1813 / totalSupply : ONE_E1813;
|
|
64350
64571
|
return { totalAssets, totalSupply, exchangeRate };
|
|
64351
64572
|
}
|
|
64352
64573
|
});
|
|
@@ -64421,7 +64642,7 @@ var readerTreehouseTAsset = (entry) => {
|
|
|
64421
64642
|
calls: [
|
|
64422
64643
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
64423
64644
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
64424
|
-
{ address: entry.address, name: "convertToAssets", params: [
|
|
64645
|
+
{ address: entry.address, name: "convertToAssets", params: [ONE_E1813] },
|
|
64425
64646
|
{ address: fl, name: "getRedeemableAmount", params: [] },
|
|
64426
64647
|
{ address: fl, name: "redemptionFee", params: [] },
|
|
64427
64648
|
{ address: fl, name: "minRedeemInUnderlying", params: [] },
|
|
@@ -64519,6 +64740,8 @@ var buildReader = (entry) => {
|
|
|
64519
64740
|
return readerErc4626PreviewRedeem(entry);
|
|
64520
64741
|
case "lidoWstEth":
|
|
64521
64742
|
return readerLidoWstEth(entry);
|
|
64743
|
+
case "flarePooledFlr":
|
|
64744
|
+
return readerFlarePooledFlr(entry);
|
|
64522
64745
|
case "listaSlisBnb":
|
|
64523
64746
|
return readerListaSlisBnb(entry);
|
|
64524
64747
|
case "rocketReth":
|
|
@@ -65050,7 +65273,7 @@ var deriveProtocolExitRoutes = (i) => {
|
|
|
65050
65273
|
};
|
|
65051
65274
|
|
|
65052
65275
|
// src/vaults/lst/fetchPublic.ts
|
|
65053
|
-
var
|
|
65276
|
+
var ONE_E1814 = 10n ** 18n;
|
|
65054
65277
|
var ERC20_BALANCE_ABI = parseAbi([
|
|
65055
65278
|
"function balanceOf(address) view returns (uint256)"
|
|
65056
65279
|
]);
|
|
@@ -65181,8 +65404,8 @@ var fetchLstShareTokens = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
65181
65404
|
const underlyingUnit = 10n ** BigInt(underlyingDec);
|
|
65182
65405
|
const totalAssetsFormatted = Number(state.totalAssets) / 10 ** underlyingDec;
|
|
65183
65406
|
const totalAssetsUsd = priceUsd !== void 0 ? totalAssetsFormatted * priceUsd : 0;
|
|
65184
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
65185
|
-
const convertToShares = state.exchangeRate > 0n ?
|
|
65407
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1814;
|
|
65408
|
+
const convertToShares = state.exchangeRate > 0n ? ONE_E1814 * shareUnit / state.exchangeRate : 0n;
|
|
65186
65409
|
let liquidityRaw;
|
|
65187
65410
|
if (state.liquidity !== void 0) {
|
|
65188
65411
|
liquidityRaw = state.liquidity;
|
|
@@ -68686,6 +68909,38 @@ var LST_WITHDRAWAL_REGISTRY = {
|
|
|
68686
68909
|
symbol: "pumpBTC",
|
|
68687
68910
|
reader: "noQueue"
|
|
68688
68911
|
}
|
|
68912
|
+
],
|
|
68913
|
+
// Flare (14) — Firelight stXRP. Period-based queue: `withdraw`/`redeem`
|
|
68914
|
+
// create a `WithdrawRequest` for `currentPeriod() + 1`; `claimWithdraw(period)`
|
|
68915
|
+
// pays out after the period ends. The surface (`withdrawSharesOf(period, account)`,
|
|
68916
|
+
// `withdrawalsOf(period, account)`, `isWithdrawClaimed(period, account)`) is
|
|
68917
|
+
// verified on-chain, but the period-window enumeration reader is not yet
|
|
68918
|
+
// built — placeholder so the orchestrator surfaces the asset (returns []).
|
|
68919
|
+
"14": [
|
|
68920
|
+
{
|
|
68921
|
+
lst: "0x4c18ff3c89632c3dd62e796c0afa5c07c4c1b2b3",
|
|
68922
|
+
brand: "Firelight",
|
|
68923
|
+
symbol: "stXRP",
|
|
68924
|
+
reader: "unverified"
|
|
68925
|
+
},
|
|
68926
|
+
{
|
|
68927
|
+
// SparkDEX stFLR — `requestWithdrawal()` / `claimWithdrawal()` queue +
|
|
68928
|
+
// `instantWithdrawal()` fee leg. Reader not built yet; placeholder so
|
|
68929
|
+
// the orchestrator surfaces the asset.
|
|
68930
|
+
lst: "0x0988c6ba244a90c07a917ebe609eb3264be716ff",
|
|
68931
|
+
brand: "SparkDEX",
|
|
68932
|
+
symbol: "stFLR",
|
|
68933
|
+
reader: "unverified"
|
|
68934
|
+
},
|
|
68935
|
+
{
|
|
68936
|
+
// Sceptre sFLR — unlock-request queue (`cooldownPeriod()`) +
|
|
68937
|
+
// `instantRedeem()` fee leg. Reader not built yet; placeholder so the
|
|
68938
|
+
// orchestrator surfaces the asset.
|
|
68939
|
+
lst: "0x12e605bc104e93b45e1ad99f9e555f659051c2bb",
|
|
68940
|
+
brand: "Sceptre",
|
|
68941
|
+
symbol: "sFLR",
|
|
68942
|
+
reader: "unverified"
|
|
68943
|
+
}
|
|
68689
68944
|
]
|
|
68690
68945
|
};
|
|
68691
68946
|
var getLstWithdrawalRegistry = (chainId, extraEntries) => {
|
|
@@ -68819,7 +69074,7 @@ var NavOracleReadAbi = [
|
|
|
68819
69074
|
];
|
|
68820
69075
|
|
|
68821
69076
|
// src/vaults/savings/readers/shared.ts
|
|
68822
|
-
var
|
|
69077
|
+
var ONE_E1815 = 10n ** 18n;
|
|
68823
69078
|
var toBigInt16 = (v) => {
|
|
68824
69079
|
if (v === void 0 || v === null) return void 0;
|
|
68825
69080
|
if (typeof v === "bigint") return v;
|
|
@@ -68860,7 +69115,7 @@ var readerErc46262 = (entry) => {
|
|
|
68860
69115
|
return {
|
|
68861
69116
|
totalAssets,
|
|
68862
69117
|
totalSupply,
|
|
68863
|
-
exchangeRate: convertToAssetsRaw *
|
|
69118
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit
|
|
68864
69119
|
};
|
|
68865
69120
|
}
|
|
68866
69121
|
};
|
|
@@ -68891,7 +69146,7 @@ var readerErc4626Cooldown = (entry) => {
|
|
|
68891
69146
|
return {
|
|
68892
69147
|
totalAssets,
|
|
68893
69148
|
totalSupply,
|
|
68894
|
-
exchangeRate: convertToAssetsRaw *
|
|
69149
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit,
|
|
68895
69150
|
withdrawalCooldownSeconds: cooldownSecs === void 0 ? void 0 : Number(cooldownSecs)
|
|
68896
69151
|
};
|
|
68897
69152
|
}
|
|
@@ -69576,7 +69831,7 @@ var readerErc4626Idle = (entry) => {
|
|
|
69576
69831
|
return {
|
|
69577
69832
|
totalAssets,
|
|
69578
69833
|
totalSupply,
|
|
69579
|
-
exchangeRate: convertToAssetsRaw *
|
|
69834
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit,
|
|
69580
69835
|
...capacity !== void 0 ? {
|
|
69581
69836
|
instantRedeemCapacity: capacity,
|
|
69582
69837
|
instantRedeemEnabled: true,
|
|
@@ -69625,7 +69880,7 @@ var readerErc4626WithdrawLimit = (entry) => {
|
|
|
69625
69880
|
return {
|
|
69626
69881
|
totalAssets,
|
|
69627
69882
|
totalSupply,
|
|
69628
|
-
exchangeRate: convertToAssetsRaw *
|
|
69883
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit,
|
|
69629
69884
|
...capacity !== void 0 ? {
|
|
69630
69885
|
instantRedeemCapacity: capacity,
|
|
69631
69886
|
instantRedeemEnabled: true,
|
|
@@ -69665,8 +69920,8 @@ var readerBitfiBfbtc = (entry) => {
|
|
|
69665
69920
|
const currentRatio = toBigInt16(ratio);
|
|
69666
69921
|
if (totalSupply === void 0) return void 0;
|
|
69667
69922
|
if (currentRatio === void 0 || currentRatio <= 0n) return void 0;
|
|
69668
|
-
const exchangeRate =
|
|
69669
|
-
const totalAssets = totalSupply * exchangeRate * underlyingUnit / (
|
|
69923
|
+
const exchangeRate = ONE_E1815 * BITFI_RATIO_SCALE / currentRatio;
|
|
69924
|
+
const totalAssets = totalSupply * exchangeRate * underlyingUnit / (ONE_E1815 * shareUnit);
|
|
69670
69925
|
const feeOf = (cell) => {
|
|
69671
69926
|
if (!Array.isArray(cell)) return void 0;
|
|
69672
69927
|
const pct3 = toBigInt16(cell[0]);
|
|
@@ -69734,9 +69989,9 @@ var readerBitfiVault = (entry) => {
|
|
|
69734
69989
|
if (totalAssets === void 0 || totalSupply === void 0)
|
|
69735
69990
|
return void 0;
|
|
69736
69991
|
if (currentRatio === void 0 || currentRatio <= 0n) return void 0;
|
|
69737
|
-
const exchangeRate = currentRatio *
|
|
69992
|
+
const exchangeRate = currentRatio * ONE_E1815 / BITFI_RATIO_SCALE;
|
|
69738
69993
|
const depRatio = toBigInt16(depositRatio);
|
|
69739
|
-
const fundamentalExchangeRate = depRatio !== void 0 && depRatio > 0n ? depRatio *
|
|
69994
|
+
const fundamentalExchangeRate = depRatio !== void 0 && depRatio > 0n ? depRatio * ONE_E1815 / BITFI_RATIO_SCALE : void 0;
|
|
69740
69995
|
const supplyCap = toBigInt16(cap);
|
|
69741
69996
|
const isPaused = paused === true;
|
|
69742
69997
|
let depositCapacity;
|
|
@@ -69779,7 +70034,7 @@ var readerBitwayVault = (entry) => {
|
|
|
69779
70034
|
{
|
|
69780
70035
|
address: vault,
|
|
69781
70036
|
name: "convertToAssets",
|
|
69782
|
-
params: [
|
|
70037
|
+
params: [ONE_E1815, underlying]
|
|
69783
70038
|
},
|
|
69784
70039
|
{ address: vault, name: "getContractBalance", params: [underlying] },
|
|
69785
70040
|
{ address: vault, name: "WAITING_TIME", params: [] }
|
|
@@ -69802,7 +70057,7 @@ var readerBitwayVault = (entry) => {
|
|
|
69802
70057
|
// totalSupply is in raw share units; convert to raw underlying.
|
|
69803
70058
|
// (Every live leg is 18/18-dec — BSC stables are 18-dec — but the
|
|
69804
70059
|
// rescale keeps a future 6-dec listing honest.)
|
|
69805
|
-
totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit *
|
|
70060
|
+
totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1815),
|
|
69806
70061
|
totalSupply,
|
|
69807
70062
|
exchangeRate,
|
|
69808
70063
|
withdrawFeeBps: penaltyBps,
|
|
@@ -69837,7 +70092,7 @@ var readerFrankencoinSavings = (entry) => ({
|
|
|
69837
70092
|
// `fetchPublic` derives `convertToAssets` / `convertToShares` from
|
|
69838
70093
|
// `exchangeRate`, and 1e18 makes them the identity.
|
|
69839
70094
|
totalSupply: deposits,
|
|
69840
|
-
exchangeRate:
|
|
70095
|
+
exchangeRate: ONE_E1815
|
|
69841
70096
|
};
|
|
69842
70097
|
}
|
|
69843
70098
|
});
|
|
@@ -69884,7 +70139,7 @@ var readerHyperbeatVault = (entry) => {
|
|
|
69884
70139
|
const feeRaw = toBigInt16(fee);
|
|
69885
70140
|
return {
|
|
69886
70141
|
// totalSupply is in raw share units; convert to raw underlying.
|
|
69887
|
-
totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit *
|
|
70142
|
+
totalAssets: totalSupply * exchangeRate * underlyingUnit / (shareUnit * ONE_E1815),
|
|
69888
70143
|
totalSupply,
|
|
69889
70144
|
exchangeRate,
|
|
69890
70145
|
// `instantWithdrawalFee` is over a base of 10 000, so the raw
|
|
@@ -69921,9 +70176,9 @@ var readerNavOracle = (entry) => {
|
|
|
69921
70176
|
const raw = Array.isArray(round) ? round[1] : round?.answer;
|
|
69922
70177
|
const answer = toBigInt16(raw);
|
|
69923
70178
|
if (answer === void 0 || answer <= 0n) return void 0;
|
|
69924
|
-
const exchangeRate = answer *
|
|
70179
|
+
const exchangeRate = answer * ONE_E1815 / oracleScale;
|
|
69925
70180
|
return {
|
|
69926
|
-
totalAssets: totalSupply * exchangeRate * underlyingUnit / (
|
|
70181
|
+
totalAssets: totalSupply * exchangeRate * underlyingUnit / (ONE_E1815 * shareUnit),
|
|
69927
70182
|
totalSupply,
|
|
69928
70183
|
exchangeRate
|
|
69929
70184
|
};
|
|
@@ -69937,7 +70192,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
69937
70192
|
return {
|
|
69938
70193
|
calls: [
|
|
69939
70194
|
{ address, name: "totalSupply", params: [] },
|
|
69940
|
-
{ address, name: "getNlpByWnlp", params: [
|
|
70195
|
+
{ address, name: "getNlpByWnlp", params: [ONE_E1815] },
|
|
69941
70196
|
{ address, name: "instantRedeemFeeBips", params: [] },
|
|
69942
70197
|
{ address, name: "instantRedeemEnabled", params: [] },
|
|
69943
70198
|
// Falls back to the vault itself when no CreditVault is pinned —
|
|
@@ -69971,7 +70226,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
69971
70226
|
const windowSeconds = toBigInt16(window);
|
|
69972
70227
|
const bips = toBigInt16(feeBips);
|
|
69973
70228
|
return {
|
|
69974
|
-
totalAssets: totalSupply * exchangeRate /
|
|
70229
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1815,
|
|
69975
70230
|
totalSupply,
|
|
69976
70231
|
exchangeRate,
|
|
69977
70232
|
// `instantRedeemFeeBips` on-chain is already basis points, so it
|
|
@@ -70026,7 +70281,7 @@ var readerSaturnVault = (entry) => {
|
|
|
70026
70281
|
return {
|
|
70027
70282
|
totalAssets,
|
|
70028
70283
|
totalSupply,
|
|
70029
|
-
exchangeRate: convertToAssetsRaw *
|
|
70284
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit,
|
|
70030
70285
|
// Shares minted for ONE underlying unit, net of the fee. Equals the
|
|
70031
70286
|
// derived `1/exchangeRate` while the dial is 0, and diverges the
|
|
70032
70287
|
// moment it is not.
|
|
@@ -70146,7 +70401,7 @@ var readerVenusHub = (entry) => {
|
|
|
70146
70401
|
return {
|
|
70147
70402
|
totalAssets,
|
|
70148
70403
|
totalSupply,
|
|
70149
|
-
exchangeRate: convertToAssetsRaw *
|
|
70404
|
+
exchangeRate: convertToAssetsRaw * ONE_E1815 / underlyingUnit,
|
|
70150
70405
|
...supplyRate !== void 0 ? { supplyRate } : {},
|
|
70151
70406
|
...instantRedeemCapacity !== void 0 ? {
|
|
70152
70407
|
instantRedeemCapacity: paused ? 0n : instantRedeemCapacity,
|
|
@@ -70181,7 +70436,7 @@ var parseStrandedRewards = (slice2, base, coreGroupAssets, hubTotalAssets) => {
|
|
|
70181
70436
|
}
|
|
70182
70437
|
if (supplySpeed === 0n) return 0;
|
|
70183
70438
|
const rewardsPerYearUsd = supplySpeed * blocksPerYear * rewardPrice;
|
|
70184
|
-
const suppliedRaw = vTokenSupply * exchangeRateStored /
|
|
70439
|
+
const suppliedRaw = vTokenSupply * exchangeRateStored / ONE_E1815;
|
|
70185
70440
|
const suppliedUsd = suppliedRaw * underlyingPrice;
|
|
70186
70441
|
if (suppliedUsd === 0n || hubTotalAssets === 0n) return void 0;
|
|
70187
70442
|
const marketAprPct = Number(rewardsPerYearUsd * 1000000000n / suppliedUsd) / 1e9;
|
|
@@ -70208,7 +70463,7 @@ var readerVesperPool = (entry) => {
|
|
|
70208
70463
|
return void 0;
|
|
70209
70464
|
}
|
|
70210
70465
|
if (pricePerShare === void 0 || pricePerShare <= 0n) return void 0;
|
|
70211
|
-
const exchangeRate = pricePerShare *
|
|
70466
|
+
const exchangeRate = pricePerShare * ONE_E1815 / underlyingUnit;
|
|
70212
70467
|
return {
|
|
70213
70468
|
totalAssets,
|
|
70214
70469
|
totalSupply,
|
|
@@ -70238,7 +70493,7 @@ var readerWrenNav = (entry) => {
|
|
|
70238
70493
|
const burncost = toBigInt16(burn);
|
|
70239
70494
|
const hasBurncost = burncost !== void 0 && burncost > 0n;
|
|
70240
70495
|
const exchangeRate = hasBurncost ? burncost : navPrice;
|
|
70241
|
-
const totalAssets = totalSupply * exchangeRate * underlyingUnit / (
|
|
70496
|
+
const totalAssets = totalSupply * exchangeRate * underlyingUnit / (ONE_E1815 * shareUnit);
|
|
70242
70497
|
const burnFlag = toBigInt16(burnable);
|
|
70243
70498
|
const instantRedeemEnabled = burnFlag === void 0 ? true : burnFlag > 0n;
|
|
70244
70499
|
return {
|
|
@@ -70253,7 +70508,7 @@ var readerWrenNav = (entry) => {
|
|
|
70253
70508
|
};
|
|
70254
70509
|
|
|
70255
70510
|
// src/vaults/savings/readers/yieldBasisLt.ts
|
|
70256
|
-
var ONE_SHARE =
|
|
70511
|
+
var ONE_SHARE = ONE_E1815;
|
|
70257
70512
|
var readerYieldBasisLt = (entry) => {
|
|
70258
70513
|
const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
|
|
70259
70514
|
const amm = entry.capacityContract ?? entry.address;
|
|
@@ -70281,7 +70536,7 @@ var readerYieldBasisLt = (entry) => {
|
|
|
70281
70536
|
}
|
|
70282
70537
|
if (totalSupply === 0n || redeemRaw === 0n) return void 0;
|
|
70283
70538
|
const totalAssets = totalSupply * redeemRaw / ONE_SHARE;
|
|
70284
|
-
const exchangeRate = redeemRaw *
|
|
70539
|
+
const exchangeRate = redeemRaw * ONE_E1815 / underlyingUnit;
|
|
70285
70540
|
const equity = Array.isArray(valueOracle) ? toBigInt16(valueOracle[1]) : toBigInt16(valueOracle?.value);
|
|
70286
70541
|
const cap = toBigInt16(maxDebt);
|
|
70287
70542
|
let depositCapacity;
|
|
@@ -70343,7 +70598,7 @@ var buildReader2 = (entry) => {
|
|
|
70343
70598
|
var resolveYieldApr2 = async (entries) => (await resolveEntryApr(entries)).apr;
|
|
70344
70599
|
|
|
70345
70600
|
// src/vaults/savings/fetchPublic.ts
|
|
70346
|
-
var
|
|
70601
|
+
var ONE_E1816 = 10n ** 18n;
|
|
70347
70602
|
var resolveSelfOnly = (chainId, vault) => {
|
|
70348
70603
|
const entry = findSavingsWithdrawEntry(chainId, vault);
|
|
70349
70604
|
if (!entry) return void 0;
|
|
@@ -70430,8 +70685,8 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
70430
70685
|
1,
|
|
70431
70686
|
Number(liquidityAmount * 1000000n / state.totalAssets) / 1e6
|
|
70432
70687
|
) : 1;
|
|
70433
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
70434
|
-
const convertToShares = state.convertToShares ?? (state.exchangeRate > 0n ?
|
|
70688
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1816;
|
|
70689
|
+
const convertToShares = state.convertToShares ?? (state.exchangeRate > 0n ? ONE_E1816 * shareUnit / state.exchangeRate : 0n);
|
|
70435
70690
|
const depositCapacity = state.depositCapacity?.toString();
|
|
70436
70691
|
const depositCapacityFormatted = state.depositCapacity !== void 0 ? Number(state.depositCapacity) / 10 ** underlyingDec : void 0;
|
|
70437
70692
|
const depositCapacityUsd = depositCapacityFormatted !== void 0 && priceUsd !== void 0 ? depositCapacityFormatted * priceUsd : void 0;
|