@1delta/margin-fetcher 5.0.44 → 5.0.46
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 +328 -102
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -27679,13 +27679,13 @@ var REPAIR_BACKOFF_JITTER_MS = 60;
|
|
|
27679
27679
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
27680
27680
|
var backoffForRound = (round) => REPAIR_BACKOFF_BASE_MS * 2 ** round + Math.random() * REPAIR_BACKOFF_JITTER_MS;
|
|
27681
27681
|
var endpointUrl = (client, rpcId) => client?.transport?.url ?? `rpc#${rpcId}`;
|
|
27682
|
-
var resolveEndpoint = (chainId,
|
|
27682
|
+
var resolveEndpoint = (chainId, getEvmClient17, startRpcId, tried, maxProbe = 12) => {
|
|
27683
27683
|
let fallback = null;
|
|
27684
27684
|
for (let probe = 0; probe < maxProbe; probe++) {
|
|
27685
27685
|
const rpcId = startRpcId + probe;
|
|
27686
27686
|
let client;
|
|
27687
27687
|
try {
|
|
27688
|
-
client =
|
|
27688
|
+
client = getEvmClient17(chainId, rpcId);
|
|
27689
27689
|
} catch {
|
|
27690
27690
|
break;
|
|
27691
27691
|
}
|
|
@@ -27715,7 +27715,7 @@ var recordPermanentFailures = (slots, offset, collector) => {
|
|
|
27715
27715
|
if (slots[i].permanent) collector.add(offset + i);
|
|
27716
27716
|
}
|
|
27717
27717
|
};
|
|
27718
|
-
var repairFailedSlots = async (chainId, contracts, slots,
|
|
27718
|
+
var repairFailedSlots = async (chainId, contracts, slots, getEvmClient17, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
|
|
27719
27719
|
let searchFrom = nextRpcId;
|
|
27720
27720
|
for (let round = 0; round < rounds; round++) {
|
|
27721
27721
|
const failedIdx = [];
|
|
@@ -27725,7 +27725,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient16, nextRp
|
|
|
27725
27725
|
if (failedIdx.length === 0) return slots;
|
|
27726
27726
|
const endpoint = resolveEndpoint(
|
|
27727
27727
|
chainId,
|
|
27728
|
-
|
|
27728
|
+
getEvmClient17,
|
|
27729
27729
|
searchFrom,
|
|
27730
27730
|
options?.tried
|
|
27731
27731
|
);
|
|
@@ -27777,9 +27777,9 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient16, nextRp
|
|
|
27777
27777
|
}
|
|
27778
27778
|
return slots;
|
|
27779
27779
|
};
|
|
27780
|
-
var multicallViemAbiArray = async (chainId, abi, calls,
|
|
27780
|
+
var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient17, retry = true, providerId = 0, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
|
|
27781
27781
|
const tried = options?.tried ?? /* @__PURE__ */ new Set();
|
|
27782
|
-
const endpoint = resolveEndpoint(chainId,
|
|
27782
|
+
const endpoint = resolveEndpoint(chainId, getEvmClient17, providerId, tried);
|
|
27783
27783
|
if (!endpoint) throw new Error("No usable RPC endpoint for " + chainId);
|
|
27784
27784
|
const endpointOptions = {
|
|
27785
27785
|
tried,
|
|
@@ -27816,7 +27816,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient16, retry =
|
|
|
27816
27816
|
chainId,
|
|
27817
27817
|
abi,
|
|
27818
27818
|
calls,
|
|
27819
|
-
|
|
27819
|
+
getEvmClient17,
|
|
27820
27820
|
retry,
|
|
27821
27821
|
endpoint.rpcId + 1,
|
|
27822
27822
|
retries - 1,
|
|
@@ -27832,7 +27832,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient16, retry =
|
|
|
27832
27832
|
chainId,
|
|
27833
27833
|
contracts,
|
|
27834
27834
|
slots,
|
|
27835
|
-
|
|
27835
|
+
getEvmClient17,
|
|
27836
27836
|
endpoint.rpcId + 1,
|
|
27837
27837
|
batchSize,
|
|
27838
27838
|
logs,
|
|
@@ -27856,7 +27856,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient16, retry =
|
|
|
27856
27856
|
chainId,
|
|
27857
27857
|
abi,
|
|
27858
27858
|
calls,
|
|
27859
|
-
|
|
27859
|
+
getEvmClient17,
|
|
27860
27860
|
retry,
|
|
27861
27861
|
endpoint.rpcId + 1,
|
|
27862
27862
|
retries,
|
|
@@ -27869,13 +27869,13 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient16, retry =
|
|
|
27869
27869
|
);
|
|
27870
27870
|
}
|
|
27871
27871
|
};
|
|
27872
|
-
var multicallShardedAbiArray = async (chainId, abi, calls,
|
|
27872
|
+
var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient17, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
|
|
27873
27873
|
if (poolSize <= 1) {
|
|
27874
27874
|
return multicallViemAbiArray(
|
|
27875
27875
|
chainId,
|
|
27876
27876
|
abi,
|
|
27877
27877
|
calls,
|
|
27878
|
-
|
|
27878
|
+
getEvmClient17,
|
|
27879
27879
|
true,
|
|
27880
27880
|
0,
|
|
27881
27881
|
retries,
|
|
@@ -27904,7 +27904,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient16, poolS
|
|
|
27904
27904
|
}
|
|
27905
27905
|
const results = new Array(contracts.length);
|
|
27906
27906
|
const runBatch = async (batch, rpcId, attemptsLeft, size, tried) => {
|
|
27907
|
-
const endpoint = resolveEndpoint(chainId,
|
|
27907
|
+
const endpoint = resolveEndpoint(chainId, getEvmClient17, rpcId, tried);
|
|
27908
27908
|
if (!endpoint) {
|
|
27909
27909
|
if (logs)
|
|
27910
27910
|
console.log(
|
|
@@ -27948,7 +27948,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient16, poolS
|
|
|
27948
27948
|
chainId,
|
|
27949
27949
|
batch.items,
|
|
27950
27950
|
slots,
|
|
27951
|
-
|
|
27951
|
+
getEvmClient17,
|
|
27952
27952
|
endpoint.rpcId + 1,
|
|
27953
27953
|
size,
|
|
27954
27954
|
logs,
|
|
@@ -38778,7 +38778,7 @@ function unflattenLenderData(pools) {
|
|
|
38778
38778
|
}
|
|
38779
38779
|
return result;
|
|
38780
38780
|
}
|
|
38781
|
-
var getLenderUserDataResult = async (chainId, queriesRaw,
|
|
38781
|
+
var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient17, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
|
|
38782
38782
|
const queries = organizeUserQueries(queriesRaw);
|
|
38783
38783
|
const builtCalls = await Promise.all(
|
|
38784
38784
|
queries.map(async (query3) => {
|
|
@@ -38788,7 +38788,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient16, allowF
|
|
|
38788
38788
|
query3.lender,
|
|
38789
38789
|
query3.account,
|
|
38790
38790
|
query3.params,
|
|
38791
|
-
|
|
38791
|
+
getEvmClient17
|
|
38792
38792
|
);
|
|
38793
38793
|
return callData.map((call) => ({ call, abi: call.abi ?? abi }));
|
|
38794
38794
|
})
|
|
@@ -38798,7 +38798,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient16, allowF
|
|
|
38798
38798
|
chainId,
|
|
38799
38799
|
calls.map((call) => call.abi),
|
|
38800
38800
|
calls.map((call) => call.call),
|
|
38801
|
-
|
|
38801
|
+
getEvmClient17,
|
|
38802
38802
|
concurrency,
|
|
38803
38803
|
retries,
|
|
38804
38804
|
allowFailure,
|
|
@@ -44103,13 +44103,102 @@ var brixFetcher = {
|
|
|
44103
44103
|
return { [WITRY_KEY]: apr, [WITRY_GROUP_KEY]: apr };
|
|
44104
44104
|
}
|
|
44105
44105
|
};
|
|
44106
|
-
|
|
44106
|
+
|
|
44107
|
+
// src/yields/intrinsic/fetchers/cap.ts
|
|
44108
|
+
var CAP_CUSD_TIMESERIES_URL = "https://api.cap.app/v1/vaults/1/0xcCcc62962d17b8914c62D74FfB843d73B2a3cccC/timeseries/1d_1M";
|
|
44109
|
+
var STCUSD_KEY = "Staked cap USD::stcUSD";
|
|
44110
|
+
var STCUSD_BRIDGED_GROUP_KEY = "Staked Cap USD::stcUSD";
|
|
44111
|
+
var capFetcher = {
|
|
44112
|
+
label: "CAP",
|
|
44113
|
+
fetch: async () => {
|
|
44114
|
+
const res = await fetch(CAP_CUSD_TIMESERIES_URL).then((r) => r.json());
|
|
44115
|
+
const ts = res?.timeseries ?? [];
|
|
44116
|
+
const last7 = ts.slice(-7);
|
|
44117
|
+
const apr = last7.length === 0 ? 0 : last7.reduce((sum3, e) => sum3 + Number(e.stakingApr), 0) / last7.length * 100;
|
|
44118
|
+
return { [STCUSD_KEY]: apr, [STCUSD_BRIDGED_GROUP_KEY]: apr };
|
|
44119
|
+
}
|
|
44120
|
+
};
|
|
44121
|
+
var CHAIN_ID10 = "1";
|
|
44122
|
+
var WSTGBP = "0x57c3571f10767e49c9d7b60feb6c67804783b7ae";
|
|
44123
|
+
var WREN_NAV_GROWTH_URL = "https://wstgbp.com/api/nav-growth";
|
|
44124
|
+
var ONE_E189 = 10n ** 18n;
|
|
44125
|
+
var WINDOW_SECONDS6 = 90 * 24 * 60 * 60;
|
|
44126
|
+
var BLOCK_TIME_SECONDS5 = 12;
|
|
44127
|
+
var WINDOW_BLOCKS5 = BigInt(Math.floor(WINDOW_SECONDS6 / BLOCK_TIME_SECONDS5));
|
|
44128
|
+
var MAX_RPC_TRIES5 = 2;
|
|
44129
|
+
var ONCHAIN_DEADLINE_MS = 12e3;
|
|
44130
|
+
var WSTGBP_KEY = "WSTGBP";
|
|
44131
|
+
var WSTGBP_GROUP_KEY = "Wren Staked tGBP::wstGBP";
|
|
44132
|
+
var NAVPRICE_ABI = [
|
|
44133
|
+
{
|
|
44134
|
+
name: "navprice",
|
|
44135
|
+
type: "function",
|
|
44136
|
+
stateMutability: "view",
|
|
44137
|
+
inputs: [],
|
|
44138
|
+
outputs: [{ type: "uint256" }]
|
|
44139
|
+
}
|
|
44140
|
+
];
|
|
44141
|
+
var fetchWrenAprPercent = async () => {
|
|
44142
|
+
const res = await fetch(WREN_NAV_GROWTH_URL, {
|
|
44143
|
+
headers: { accept: "application/json" },
|
|
44144
|
+
signal: AbortSignal.timeout(8e3)
|
|
44145
|
+
});
|
|
44146
|
+
if (!res.ok) throw new Error(`Wren HTTP ${res.status}`);
|
|
44147
|
+
const json = await res.json();
|
|
44148
|
+
const apr = Number(json?.aprWad) / 1e16;
|
|
44149
|
+
if (!Number.isFinite(apr) || apr <= 0) throw new Error("aprWad missing");
|
|
44150
|
+
return apr;
|
|
44151
|
+
};
|
|
44152
|
+
var readNavAt = (client, blockNumber) => client.readContract({
|
|
44153
|
+
address: WSTGBP,
|
|
44154
|
+
abi: NAVPRICE_ABI,
|
|
44155
|
+
functionName: "navprice",
|
|
44156
|
+
...blockNumber !== void 0 ? { blockNumber } : {}
|
|
44157
|
+
});
|
|
44158
|
+
var computeAprOnChain = async () => {
|
|
44159
|
+
let lastErr;
|
|
44160
|
+
const deadline = Date.now() + ONCHAIN_DEADLINE_MS;
|
|
44161
|
+
for (let rpcId = 0; rpcId < MAX_RPC_TRIES5; rpcId++) {
|
|
44162
|
+
if (Date.now() > deadline) break;
|
|
44163
|
+
try {
|
|
44164
|
+
const client = getEvmClient(CHAIN_ID10, rpcId);
|
|
44165
|
+
const head = await client.getBlockNumber();
|
|
44166
|
+
const pastBlock = head > WINDOW_BLOCKS5 ? head - WINDOW_BLOCKS5 : 0n;
|
|
44167
|
+
const [navNow, navThen, headBlock, thenBlock] = await Promise.all([
|
|
44168
|
+
readNavAt(client),
|
|
44169
|
+
readNavAt(client, pastBlock),
|
|
44170
|
+
client.getBlock({ blockNumber: head }),
|
|
44171
|
+
client.getBlock({ blockNumber: pastBlock })
|
|
44172
|
+
]);
|
|
44173
|
+
if (navNow < ONE_E189 || navThen < ONE_E189) {
|
|
44174
|
+
throw new Error("wstGBP: navprice below par \u2014 pruned or bad read");
|
|
44175
|
+
}
|
|
44176
|
+
if (navNow < navThen) {
|
|
44177
|
+
throw new Error("wstGBP: navprice decreased \u2014 non-archival RPC");
|
|
44178
|
+
}
|
|
44179
|
+
const elapsed = Number(headBlock.timestamp - thenBlock.timestamp);
|
|
44180
|
+
if (elapsed <= 0) throw new Error("wstGBP: non-positive window");
|
|
44181
|
+
return annualizeRateDeltaPercent(navNow, navThen, elapsed);
|
|
44182
|
+
} catch (e) {
|
|
44183
|
+
lastErr = e;
|
|
44184
|
+
}
|
|
44185
|
+
}
|
|
44186
|
+
throw lastErr ?? new Error("wstGBP: no RPC served archive state");
|
|
44187
|
+
};
|
|
44188
|
+
var wrenFetcher = {
|
|
44189
|
+
label: "WREN",
|
|
44190
|
+
fetch: async () => {
|
|
44191
|
+
const apr = await fetchWrenAprPercent().catch(() => computeAprOnChain()).catch(() => 0);
|
|
44192
|
+
return { [WSTGBP_KEY]: apr, [WSTGBP_GROUP_KEY]: apr };
|
|
44193
|
+
}
|
|
44194
|
+
};
|
|
44195
|
+
var CHAIN_ID11 = Chain.ETHEREUM_MAINNET;
|
|
44107
44196
|
var APYUSD = "0x38eeb52f0771140d10c4e9a9a72349a329fe8a6a";
|
|
44108
44197
|
var APYX_LINEAR_VEST = "0x0d62b4cc02b4b51ed19ddf41d7a7979cf394c99f";
|
|
44109
44198
|
var APYX_DISCOVER_URL = "https://api.apyx.fi/v1/rewards/seasons/2/discover";
|
|
44110
44199
|
var APYX_DEFILLAMA_POOL = "cb6139f9-4a68-4efd-8245-0312a92aee55";
|
|
44111
44200
|
var YEAR_SECONDS10 = 31536000n;
|
|
44112
|
-
var
|
|
44201
|
+
var ONE_E1810 = 10n ** 18n;
|
|
44113
44202
|
var APYUSD_KEY = "APYUSD";
|
|
44114
44203
|
var APYUSD_GROUP_KEY = "apyUSD::APYUSD";
|
|
44115
44204
|
var APYUSD_LEGACY_GROUP_KEY = "apyUSD::apyUSD";
|
|
@@ -44138,7 +44227,7 @@ var APYX_READ_ABI = [
|
|
|
44138
44227
|
];
|
|
44139
44228
|
var fetchApyusdAprOnChain = async () => {
|
|
44140
44229
|
const [totalAssets, unvested, periodRemaining] = await multicallRetryUniversal({
|
|
44141
|
-
chain:
|
|
44230
|
+
chain: CHAIN_ID11,
|
|
44142
44231
|
abi: APYX_READ_ABI,
|
|
44143
44232
|
calls: [
|
|
44144
44233
|
{ address: APYUSD, name: "totalAssets", params: [] },
|
|
@@ -44155,7 +44244,7 @@ var fetchApyusdAprOnChain = async () => {
|
|
|
44155
44244
|
throw new Error("apyx vesting state empty");
|
|
44156
44245
|
}
|
|
44157
44246
|
const perSecond = unvested / periodRemaining;
|
|
44158
|
-
return Number(perSecond * YEAR_SECONDS10 *
|
|
44247
|
+
return Number(perSecond * YEAR_SECONDS10 * ONE_E1810 / totalAssets) / 1e16;
|
|
44159
44248
|
};
|
|
44160
44249
|
var fetchApyusdApyFromApi = async () => {
|
|
44161
44250
|
const res = await fetch(APYX_DISCOVER_URL, {
|
|
@@ -46212,6 +46301,94 @@ var SINGLE_CHAIN_ENTRIES = {
|
|
|
46212
46301
|
yieldFetcher: brixFetcher,
|
|
46213
46302
|
yieldKey: WITRY_KEY
|
|
46214
46303
|
},
|
|
46304
|
+
{
|
|
46305
|
+
// Cap stcUSD — a plain instant ERC-4626 over cUSD, Cap's stablecoin.
|
|
46306
|
+
// 98.1M cUSD held / 91.3M shares, price 1.0751 (2026-08-14). Yield is
|
|
46307
|
+
// what Cap's whitelisted operators pay to borrow the backing (56 % drawn
|
|
46308
|
+
// at integration) plus its reserve strategies.
|
|
46309
|
+
//
|
|
46310
|
+
// `lockDuration()` = 86400 is NOT a user lock — it is the window over
|
|
46311
|
+
// which a notified reward batch vests, the Ethena `VESTING_PERIOD` shape
|
|
46312
|
+
// under different names (`totalLocked` = unvested, `lastNotify` = the
|
|
46313
|
+
// batch stamp). Fork-verified 2026-08-14: deposit 1,000 cUSD and redeem
|
|
46314
|
+
// in the SAME transaction sequence returns 999.999999999999999999 cUSD —
|
|
46315
|
+
// instant, permissionless, no cooldown, no fee. `maxDeposit` is uint.max
|
|
46316
|
+
// and `maxRedeem` tracks the balance.
|
|
46317
|
+
//
|
|
46318
|
+
// No `solvency`: 56 % of the backing is lent to operators covered by
|
|
46319
|
+
// third-party restaker delegation rather than by borrower collateral,
|
|
46320
|
+
// and that mechanism is not assessed here. Absent is the honest answer —
|
|
46321
|
+
// the builder marks `coverage.pending.counterparty` rather than
|
|
46322
|
+
// defaulting to `overcollateralized`.
|
|
46323
|
+
//
|
|
46324
|
+
// Ethereum only. The same vanity address on MegaETH (4326, 25.2M — 21.6 %
|
|
46325
|
+
// of supply) and Katana (747474, 0.92M) is a bridged ERC-20 whose
|
|
46326
|
+
// `asset()` / `totalAssets()` / `convertToAssets()` all revert, and whose
|
|
46327
|
+
// `name()` differs by one character ("Staked Cap USD" vs mainnet's
|
|
46328
|
+
// "Staked cap USD") — the split that cost those chains their intrinsic
|
|
46329
|
+
// yield until `capFetcher` began emitting both group keys.
|
|
46330
|
+
address: "0x88887be419578051ff9f4eb6c858a951921d8888",
|
|
46331
|
+
underlying: "0xcccc62962d17b8914c62d74ffb843d73b2a3cccc",
|
|
46332
|
+
// cUSD
|
|
46333
|
+
symbol: "stcUSD",
|
|
46334
|
+
brand: "Cap",
|
|
46335
|
+
description: "cUSD is Cap's stablecoin, minted against stablecoin deposits. stcUSD stakes it with an appreciating share price: the yield is the interest Cap's whitelisted operators pay to borrow the backing, plus its reserve strategies, notified in batches that vest into the share price over 24 hours. Stake and unstake are instant, permissionless and free \u2014 a redeem in the same block as the deposit settles at par.",
|
|
46336
|
+
decimals: 18,
|
|
46337
|
+
isRebasing: false,
|
|
46338
|
+
isMintable: true,
|
|
46339
|
+
withdrawalMode: "instant",
|
|
46340
|
+
yieldFetcher: capFetcher,
|
|
46341
|
+
yieldKey: STCUSD_KEY
|
|
46342
|
+
},
|
|
46343
|
+
{
|
|
46344
|
+
// Wren wstGBP — a value-accruing wrapper over tGBP, the FCA-registered
|
|
46345
|
+
// GBP stablecoin issued by BCP Technologies (cash + short-dated gilts,
|
|
46346
|
+
// 1:1 redeemable, listed on Coinbase and Kraken). **The second non-USD
|
|
46347
|
+
// row on this surface after Brix's wiTRY** — see the lira note there:
|
|
46348
|
+
// `supplyRate` is asset-denominated, so a GBP rate belongs beside a
|
|
46349
|
+
// dollar one only with the currency stated, which is why it is in the
|
|
46350
|
+
// description and in `props.savings.base: 'GBP'`. The FX exposure is far
|
|
46351
|
+
// milder than the lira's, but it is the same axis.
|
|
46352
|
+
//
|
|
46353
|
+
// NOT ERC-4626 in any part — `asset()`, `totalAssets()`,
|
|
46354
|
+
// `convertToAssets()` and every `max*` view revert. The token prices
|
|
46355
|
+
// ITSELF through `navprice()`, a figure the issuer restates roughly
|
|
46356
|
+
// weekly in ~6.7 bps steps, hence the `wren-nav` reader.
|
|
46357
|
+
//
|
|
46358
|
+
// Fork-verified 2026-08-14 on the live contract:
|
|
46359
|
+
// - `mint(uint256)` is PERMISSIONLESS and settles at NAV with no entry
|
|
46360
|
+
// fee (`mintcost() == navprice()`): 100 tGBP → 99.1355 wstGBP from a
|
|
46361
|
+
// fresh address. tGBP itself transfers freely (the iTRY check).
|
|
46362
|
+
// - `redeem(uint256)` is the instant exit and pays `burncost()`, which
|
|
46363
|
+
// is ~25 bps BELOW the NAV — 10 wstGBP returned exactly
|
|
46364
|
+
// 10.061984858035600520 tGBP. That gap is reported as the signed
|
|
46365
|
+
// `redemptionDiscountBps`, not smoothed into the share price.
|
|
46366
|
+
// - **`smelt(uint256)` burns shares and pays NOTHING immediately**,
|
|
46367
|
+
// booking a record under `redemptions(i)` for later settlement. It is
|
|
46368
|
+
// a distinct, uncharacterised path — never route an exit to it.
|
|
46369
|
+
// `exit(uint256)` reverts `0x9b604d0b` for an ordinary caller.
|
|
46370
|
+
//
|
|
46371
|
+
// Small: ~83.3k wstGBP over ~84.0k tGBP (≈ $114k at 1.352 GBP/USD).
|
|
46372
|
+
// Ethereum only — no other chain carries the contract, though tGBP
|
|
46373
|
+
// itself is a LayerZero OFT on six.
|
|
46374
|
+
reader: "wren-nav",
|
|
46375
|
+
address: "0x57c3571f10767e49c9d7b60feb6c67804783b7ae",
|
|
46376
|
+
underlying: "0x27f6c8289550fce67f6b50bed1f519966afe5287",
|
|
46377
|
+
// tGBP
|
|
46378
|
+
symbol: "wstGBP",
|
|
46379
|
+
brand: "Wren",
|
|
46380
|
+
// The backing is an FCA-registered issuer's segregated cash and gilt
|
|
46381
|
+
// reserves, and the share price is a NAV the issuer restates — attested,
|
|
46382
|
+
// not verifiable on-chain. Same class as Apyx and Brix.
|
|
46383
|
+
solvency: "nav-attested",
|
|
46384
|
+
description: "tGBP is a pound-sterling stablecoin from BCP Technologies, an FCA-registered issuer, backed 1:1 by cash and short-dated UK gilts held in segregated accounts. wstGBP wraps it and accrues the gilt yield through a NAV the issuer restates weekly \u2014 so the rate is earned in POUNDS, and a dollar-based holder keeps only what is left after the GBP/USD move. Minting is permissionless and free; redeeming is instant but settles ~25 bps below NAV.",
|
|
46385
|
+
decimals: 18,
|
|
46386
|
+
isRebasing: false,
|
|
46387
|
+
isMintable: true,
|
|
46388
|
+
withdrawalMode: "instant",
|
|
46389
|
+
yieldFetcher: wrenFetcher,
|
|
46390
|
+
yieldKey: WSTGBP_KEY
|
|
46391
|
+
},
|
|
46215
46392
|
{
|
|
46216
46393
|
// Apyx apyUSD — ERC-4626 over apxUSD, the "Dividend-Backed
|
|
46217
46394
|
// Dollar" (variable-rate perpetual preferred stock of DAT
|
|
@@ -47623,21 +47800,6 @@ var midasFetcher = {
|
|
|
47623
47800
|
}
|
|
47624
47801
|
};
|
|
47625
47802
|
|
|
47626
|
-
// src/yields/intrinsic/fetchers/cap.ts
|
|
47627
|
-
var CAP_CUSD_TIMESERIES_URL = "https://api.cap.app/v1/vaults/1/0xcCcc62962d17b8914c62D74FfB843d73B2a3cccC/timeseries/1d_1M";
|
|
47628
|
-
var stcUSD = "Staked cap USD::stcUSD";
|
|
47629
|
-
var capFetcher = {
|
|
47630
|
-
label: "CAP",
|
|
47631
|
-
fetch: async () => {
|
|
47632
|
-
const res = await fetch(CAP_CUSD_TIMESERIES_URL).then((r) => r.json());
|
|
47633
|
-
const ts = res?.timeseries ?? [];
|
|
47634
|
-
const last7 = ts.slice(-7);
|
|
47635
|
-
if (last7.length === 0) return { [stcUSD]: 0 };
|
|
47636
|
-
const avg = last7.reduce((sum3, e) => sum3 + Number(e.stakingApr), 0) / last7.length;
|
|
47637
|
-
return { [stcUSD]: avg * 100 };
|
|
47638
|
-
}
|
|
47639
|
-
};
|
|
47640
|
-
|
|
47641
47803
|
// src/yields/intrinsic/fetchers/nest.ts
|
|
47642
47804
|
var NEST_API_URL = "https://api.nest.credit/v1";
|
|
47643
47805
|
var NEST_VAULT_GROUPS = {
|
|
@@ -56509,7 +56671,7 @@ var Erc4626PreviewRedeemAbi = [
|
|
|
56509
56671
|
];
|
|
56510
56672
|
|
|
56511
56673
|
// src/vaults/lst/readers/shared.ts
|
|
56512
|
-
var
|
|
56674
|
+
var ONE_E1811 = 10n ** 18n;
|
|
56513
56675
|
var rescaleDecimals = (v, fromDec, toDec) => toDec >= fromDec ? v * 10n ** BigInt(toDec - fromDec) : v / 10n ** BigInt(fromDec - toDec);
|
|
56514
56676
|
var MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
56515
56677
|
var Multicall3BalanceAbi = [
|
|
@@ -56552,7 +56714,7 @@ var readerBeetsStS = (entry) => ({
|
|
|
56552
56714
|
}
|
|
56553
56715
|
const liquidity = toBigInt14(pool);
|
|
56554
56716
|
return {
|
|
56555
|
-
totalAssets: totalSupply * exchangeRate /
|
|
56717
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56556
56718
|
totalSupply,
|
|
56557
56719
|
exchangeRate,
|
|
56558
56720
|
liquidity
|
|
@@ -56585,7 +56747,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
56585
56747
|
{
|
|
56586
56748
|
address: entry.address,
|
|
56587
56749
|
name: "getPooledAvaxByShares",
|
|
56588
|
-
params: [
|
|
56750
|
+
params: [ONE_E1811]
|
|
56589
56751
|
},
|
|
56590
56752
|
{ address: entry.address, name: "totalPooledAvax", params: [] }
|
|
56591
56753
|
],
|
|
@@ -56596,7 +56758,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
56596
56758
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
56597
56759
|
return void 0;
|
|
56598
56760
|
}
|
|
56599
|
-
const totalAssets = toBigInt14(totalPooled) ?? totalSupply * exchangeRate /
|
|
56761
|
+
const totalAssets = toBigInt14(totalPooled) ?? totalSupply * exchangeRate / ONE_E1811;
|
|
56600
56762
|
return {
|
|
56601
56763
|
totalAssets,
|
|
56602
56764
|
totalSupply,
|
|
@@ -56615,7 +56777,7 @@ var readerBgtWrapper1to1 = (entry) => ({
|
|
|
56615
56777
|
return {
|
|
56616
56778
|
totalAssets: totalSupply,
|
|
56617
56779
|
totalSupply,
|
|
56618
|
-
exchangeRate:
|
|
56780
|
+
exchangeRate: ONE_E1811
|
|
56619
56781
|
};
|
|
56620
56782
|
}
|
|
56621
56783
|
});
|
|
@@ -56645,7 +56807,7 @@ var readerDineroBeraEth = (entry) => ({
|
|
|
56645
56807
|
return void 0;
|
|
56646
56808
|
}
|
|
56647
56809
|
return {
|
|
56648
|
-
totalAssets: totalSupply * exchangeRate /
|
|
56810
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56649
56811
|
totalSupply,
|
|
56650
56812
|
exchangeRate
|
|
56651
56813
|
};
|
|
@@ -56657,7 +56819,7 @@ var readerErc4626 = (entry) => ({
|
|
|
56657
56819
|
calls: [
|
|
56658
56820
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
56659
56821
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
56660
|
-
{ address: entry.address, name: "convertToAssets", params: [
|
|
56822
|
+
{ address: entry.address, name: "convertToAssets", params: [ONE_E1811] }
|
|
56661
56823
|
],
|
|
56662
56824
|
abis: [Erc4626ReadAbi, TotalSupplyAbi, Erc4626ReadAbi],
|
|
56663
56825
|
parse: ([assets, supply, rate]) => {
|
|
@@ -56674,7 +56836,7 @@ var readerErc4626PreviewRedeem = (entry) => ({
|
|
|
56674
56836
|
calls: [
|
|
56675
56837
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
56676
56838
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
56677
|
-
{ address: entry.address, name: "previewRedeem", params: [
|
|
56839
|
+
{ address: entry.address, name: "previewRedeem", params: [ONE_E1811] }
|
|
56678
56840
|
],
|
|
56679
56841
|
abis: [Erc4626PreviewRedeemAbi, TotalSupplyAbi, Erc4626PreviewRedeemAbi],
|
|
56680
56842
|
parse: ([assets, supply, rate]) => {
|
|
@@ -56754,7 +56916,7 @@ var readerEtherFiWeEth = (entry) => {
|
|
|
56754
56916
|
}
|
|
56755
56917
|
}
|
|
56756
56918
|
return {
|
|
56757
|
-
totalAssets: totalSupply * exchangeRate /
|
|
56919
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56758
56920
|
totalSupply,
|
|
56759
56921
|
exchangeRate,
|
|
56760
56922
|
liquidity
|
|
@@ -56787,7 +56949,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
56787
56949
|
return {
|
|
56788
56950
|
totalAssets: totalSupply,
|
|
56789
56951
|
totalSupply,
|
|
56790
|
-
exchangeRate:
|
|
56952
|
+
exchangeRate: ONE_E1811
|
|
56791
56953
|
};
|
|
56792
56954
|
}
|
|
56793
56955
|
};
|
|
@@ -56795,7 +56957,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
56795
56957
|
return {
|
|
56796
56958
|
calls: [
|
|
56797
56959
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
56798
|
-
{ address: stakingCore, name: "BeHYPEToHYPE", params: [
|
|
56960
|
+
{ address: stakingCore, name: "BeHYPEToHYPE", params: [ONE_E1811] }
|
|
56799
56961
|
],
|
|
56800
56962
|
abis: [TotalSupplyAbi, HyperbeatStakingCoreAbi],
|
|
56801
56963
|
parse: ([supply, rate]) => {
|
|
@@ -56805,7 +56967,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
56805
56967
|
return void 0;
|
|
56806
56968
|
}
|
|
56807
56969
|
return {
|
|
56808
|
-
totalAssets: totalSupply * exchangeRate /
|
|
56970
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56809
56971
|
totalSupply,
|
|
56810
56972
|
exchangeRate
|
|
56811
56973
|
};
|
|
@@ -56837,7 +56999,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
56837
56999
|
return {
|
|
56838
57000
|
totalAssets: totalSupply,
|
|
56839
57001
|
totalSupply,
|
|
56840
|
-
exchangeRate:
|
|
57002
|
+
exchangeRate: ONE_E1811
|
|
56841
57003
|
};
|
|
56842
57004
|
}
|
|
56843
57005
|
};
|
|
@@ -56855,7 +57017,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
56855
57017
|
return void 0;
|
|
56856
57018
|
}
|
|
56857
57019
|
return {
|
|
56858
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57020
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56859
57021
|
totalSupply,
|
|
56860
57022
|
exchangeRate
|
|
56861
57023
|
};
|
|
@@ -56887,7 +57049,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
56887
57049
|
return {
|
|
56888
57050
|
totalAssets: totalSupply,
|
|
56889
57051
|
totalSupply,
|
|
56890
|
-
exchangeRate:
|
|
57052
|
+
exchangeRate: ONE_E1811
|
|
56891
57053
|
};
|
|
56892
57054
|
}
|
|
56893
57055
|
};
|
|
@@ -56895,7 +57057,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
56895
57057
|
return {
|
|
56896
57058
|
calls: [
|
|
56897
57059
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
56898
|
-
{ address: accountant, name: "kHYPEToHYPE", params: [
|
|
57060
|
+
{ address: accountant, name: "kHYPEToHYPE", params: [ONE_E1811] }
|
|
56899
57061
|
],
|
|
56900
57062
|
abis: [TotalSupplyAbi, KinetiqStakingAccountantAbi],
|
|
56901
57063
|
parse: ([supply, rate]) => {
|
|
@@ -56905,7 +57067,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
56905
57067
|
return void 0;
|
|
56906
57068
|
}
|
|
56907
57069
|
return {
|
|
56908
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57070
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56909
57071
|
totalSupply,
|
|
56910
57072
|
exchangeRate
|
|
56911
57073
|
};
|
|
@@ -56945,7 +57107,7 @@ var readerLairStKaia = (entry) => ({
|
|
|
56945
57107
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
56946
57108
|
return void 0;
|
|
56947
57109
|
}
|
|
56948
|
-
const totalAssets = toBigInt14(totalStaking) ?? totalSupply * exchangeRate /
|
|
57110
|
+
const totalAssets = toBigInt14(totalStaking) ?? totalSupply * exchangeRate / ONE_E1811;
|
|
56949
57111
|
return {
|
|
56950
57112
|
totalAssets,
|
|
56951
57113
|
totalSupply,
|
|
@@ -56979,7 +57141,7 @@ var readerLidoWstEth = (entry) => ({
|
|
|
56979
57141
|
return void 0;
|
|
56980
57142
|
}
|
|
56981
57143
|
return {
|
|
56982
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57144
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
56983
57145
|
totalSupply,
|
|
56984
57146
|
exchangeRate
|
|
56985
57147
|
};
|
|
@@ -57017,7 +57179,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
57017
57179
|
return {
|
|
57018
57180
|
totalAssets: totalSupply,
|
|
57019
57181
|
totalSupply,
|
|
57020
|
-
exchangeRate:
|
|
57182
|
+
exchangeRate: ONE_E1811
|
|
57021
57183
|
};
|
|
57022
57184
|
}
|
|
57023
57185
|
};
|
|
@@ -57025,7 +57187,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
57025
57187
|
return {
|
|
57026
57188
|
calls: [
|
|
57027
57189
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
57028
|
-
{ address: manager, name: "convertSnBnbToBnb", params: [
|
|
57190
|
+
{ address: manager, name: "convertSnBnbToBnb", params: [ONE_E1811] },
|
|
57029
57191
|
{ address: manager, name: "getTotalPooledBnb", params: [] }
|
|
57030
57192
|
],
|
|
57031
57193
|
abis: [TotalSupplyAbi, ListaStakeManagerReadAbi, ListaStakeManagerReadAbi],
|
|
@@ -57036,7 +57198,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
57036
57198
|
return void 0;
|
|
57037
57199
|
}
|
|
57038
57200
|
const pooledBnb = toBigInt14(pooled);
|
|
57039
|
-
const totalAssets = pooledBnb ?? totalSupply * exchangeRate /
|
|
57201
|
+
const totalAssets = pooledBnb ?? totalSupply * exchangeRate / ONE_E1811;
|
|
57040
57202
|
return { totalAssets, totalSupply, exchangeRate };
|
|
57041
57203
|
}
|
|
57042
57204
|
};
|
|
@@ -57066,7 +57228,7 @@ var readerMantleMEth = (entry) => {
|
|
|
57066
57228
|
return {
|
|
57067
57229
|
totalAssets: totalSupply,
|
|
57068
57230
|
totalSupply,
|
|
57069
|
-
exchangeRate:
|
|
57231
|
+
exchangeRate: ONE_E1811
|
|
57070
57232
|
};
|
|
57071
57233
|
}
|
|
57072
57234
|
};
|
|
@@ -57074,7 +57236,7 @@ var readerMantleMEth = (entry) => {
|
|
|
57074
57236
|
return {
|
|
57075
57237
|
calls: [
|
|
57076
57238
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
57077
|
-
{ address: staking, name: "mETHToETH", params: [
|
|
57239
|
+
{ address: staking, name: "mETHToETH", params: [ONE_E1811] }
|
|
57078
57240
|
],
|
|
57079
57241
|
abis: [TotalSupplyAbi, MantleStakingAbi],
|
|
57080
57242
|
parse: ([supply, rate]) => {
|
|
@@ -57084,7 +57246,7 @@ var readerMantleMEth = (entry) => {
|
|
|
57084
57246
|
return void 0;
|
|
57085
57247
|
}
|
|
57086
57248
|
return {
|
|
57087
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57249
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57088
57250
|
totalSupply,
|
|
57089
57251
|
exchangeRate
|
|
57090
57252
|
};
|
|
@@ -57105,7 +57267,7 @@ var readerOffChain = (entry) => {
|
|
|
57105
57267
|
return {
|
|
57106
57268
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
57107
57269
|
totalSupply,
|
|
57108
|
-
exchangeRate:
|
|
57270
|
+
exchangeRate: ONE_E1811
|
|
57109
57271
|
};
|
|
57110
57272
|
}
|
|
57111
57273
|
};
|
|
@@ -57139,7 +57301,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
57139
57301
|
return {
|
|
57140
57302
|
totalAssets: totalSupply,
|
|
57141
57303
|
totalSupply,
|
|
57142
|
-
exchangeRate:
|
|
57304
|
+
exchangeRate: ONE_E1811
|
|
57143
57305
|
};
|
|
57144
57306
|
}
|
|
57145
57307
|
};
|
|
@@ -57158,7 +57320,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
57158
57320
|
return {
|
|
57159
57321
|
totalAssets: totalTvl,
|
|
57160
57322
|
totalSupply,
|
|
57161
|
-
exchangeRate: totalTvl *
|
|
57323
|
+
exchangeRate: totalTvl * ONE_E1811 / totalSupply
|
|
57162
57324
|
};
|
|
57163
57325
|
}
|
|
57164
57326
|
};
|
|
@@ -57214,7 +57376,7 @@ var readerRocketReth = (entry) => {
|
|
|
57214
57376
|
}
|
|
57215
57377
|
const liquidity = depositPool ? toBigInt14(slice2[2]) : void 0;
|
|
57216
57378
|
return {
|
|
57217
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57379
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57218
57380
|
totalSupply,
|
|
57219
57381
|
exchangeRate,
|
|
57220
57382
|
liquidity
|
|
@@ -57256,7 +57418,7 @@ var readerStaderEthx = (entry) => {
|
|
|
57256
57418
|
return {
|
|
57257
57419
|
totalAssets: totalSupply,
|
|
57258
57420
|
totalSupply,
|
|
57259
|
-
exchangeRate:
|
|
57421
|
+
exchangeRate: ONE_E1811
|
|
57260
57422
|
};
|
|
57261
57423
|
}
|
|
57262
57424
|
};
|
|
@@ -57274,7 +57436,7 @@ var readerStaderEthx = (entry) => {
|
|
|
57274
57436
|
return void 0;
|
|
57275
57437
|
}
|
|
57276
57438
|
return {
|
|
57277
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57439
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57278
57440
|
totalSupply,
|
|
57279
57441
|
exchangeRate
|
|
57280
57442
|
};
|
|
@@ -57291,7 +57453,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
57291
57453
|
{
|
|
57292
57454
|
address: rateAddress,
|
|
57293
57455
|
name: "convertMaticXToMatic",
|
|
57294
|
-
params: [
|
|
57456
|
+
params: [ONE_E1811],
|
|
57295
57457
|
chainId: homeChainId
|
|
57296
57458
|
}
|
|
57297
57459
|
],
|
|
@@ -57306,7 +57468,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
57306
57468
|
}
|
|
57307
57469
|
const isCrossChain = homeContract !== void 0;
|
|
57308
57470
|
return {
|
|
57309
|
-
totalAssets: isCrossChain ? totalSupply * amountInMatic /
|
|
57471
|
+
totalAssets: isCrossChain ? totalSupply * amountInMatic / ONE_E1811 : totalPooledMatic ?? totalSupply * amountInMatic / ONE_E1811,
|
|
57310
57472
|
totalSupply,
|
|
57311
57473
|
exchangeRate: amountInMatic
|
|
57312
57474
|
};
|
|
@@ -57338,7 +57500,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
57338
57500
|
return {
|
|
57339
57501
|
totalAssets: totalSupply,
|
|
57340
57502
|
totalSupply,
|
|
57341
|
-
exchangeRate:
|
|
57503
|
+
exchangeRate: ONE_E1811
|
|
57342
57504
|
};
|
|
57343
57505
|
}
|
|
57344
57506
|
};
|
|
@@ -57346,7 +57508,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
57346
57508
|
return {
|
|
57347
57509
|
calls: [
|
|
57348
57510
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
57349
|
-
{ address: controller, name: "convertToAssets", params: [
|
|
57511
|
+
{ address: controller, name: "convertToAssets", params: [ONE_E1811] }
|
|
57350
57512
|
],
|
|
57351
57513
|
abis: [TotalSupplyAbi, StakeWiseOsTokenAbi],
|
|
57352
57514
|
parse: ([supply, rate]) => {
|
|
@@ -57356,7 +57518,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
57356
57518
|
return void 0;
|
|
57357
57519
|
}
|
|
57358
57520
|
return {
|
|
57359
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57521
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57360
57522
|
totalSupply,
|
|
57361
57523
|
exchangeRate
|
|
57362
57524
|
};
|
|
@@ -57388,7 +57550,7 @@ var readerStCelo = (entry) => {
|
|
|
57388
57550
|
return {
|
|
57389
57551
|
totalAssets: totalSupply,
|
|
57390
57552
|
totalSupply,
|
|
57391
|
-
exchangeRate:
|
|
57553
|
+
exchangeRate: ONE_E1811
|
|
57392
57554
|
};
|
|
57393
57555
|
}
|
|
57394
57556
|
};
|
|
@@ -57396,7 +57558,7 @@ var readerStCelo = (entry) => {
|
|
|
57396
57558
|
return {
|
|
57397
57559
|
calls: [
|
|
57398
57560
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
57399
|
-
{ address: manager, name: "toCelo", params: [
|
|
57561
|
+
{ address: manager, name: "toCelo", params: [ONE_E1811] }
|
|
57400
57562
|
],
|
|
57401
57563
|
abis: [TotalSupplyAbi, StCeloManagerAbi],
|
|
57402
57564
|
parse: ([supply, rate]) => {
|
|
@@ -57406,7 +57568,7 @@ var readerStCelo = (entry) => {
|
|
|
57406
57568
|
return void 0;
|
|
57407
57569
|
}
|
|
57408
57570
|
return {
|
|
57409
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57571
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57410
57572
|
totalSupply,
|
|
57411
57573
|
exchangeRate
|
|
57412
57574
|
};
|
|
@@ -57439,7 +57601,7 @@ var readerSwellGetRate = (entry) => ({
|
|
|
57439
57601
|
return void 0;
|
|
57440
57602
|
}
|
|
57441
57603
|
return {
|
|
57442
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57604
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57443
57605
|
totalSupply,
|
|
57444
57606
|
exchangeRate
|
|
57445
57607
|
};
|
|
@@ -57470,7 +57632,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
57470
57632
|
return {
|
|
57471
57633
|
totalAssets: totalSupply,
|
|
57472
57634
|
totalSupply,
|
|
57473
|
-
exchangeRate:
|
|
57635
|
+
exchangeRate: ONE_E1811
|
|
57474
57636
|
};
|
|
57475
57637
|
}
|
|
57476
57638
|
};
|
|
@@ -57488,7 +57650,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
57488
57650
|
return void 0;
|
|
57489
57651
|
}
|
|
57490
57652
|
return {
|
|
57491
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57653
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57492
57654
|
totalSupply,
|
|
57493
57655
|
exchangeRate
|
|
57494
57656
|
};
|
|
@@ -57522,7 +57684,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
57522
57684
|
return {
|
|
57523
57685
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
57524
57686
|
totalSupply,
|
|
57525
|
-
exchangeRate:
|
|
57687
|
+
exchangeRate: ONE_E1811
|
|
57526
57688
|
};
|
|
57527
57689
|
}
|
|
57528
57690
|
};
|
|
@@ -57541,7 +57703,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
57541
57703
|
const exchangeRate = rawRate * scale3;
|
|
57542
57704
|
return {
|
|
57543
57705
|
totalAssets: rescaleDecimals(
|
|
57544
|
-
totalSupply * exchangeRate /
|
|
57706
|
+
totalSupply * exchangeRate / ONE_E1811,
|
|
57545
57707
|
shareDec,
|
|
57546
57708
|
underlyingDec
|
|
57547
57709
|
),
|
|
@@ -57577,9 +57739,9 @@ var readerAnkrRatio = (entry) => ({
|
|
|
57577
57739
|
return void 0;
|
|
57578
57740
|
}
|
|
57579
57741
|
return {
|
|
57580
|
-
totalAssets: totalSupply *
|
|
57742
|
+
totalAssets: totalSupply * ONE_E1811 / r,
|
|
57581
57743
|
totalSupply,
|
|
57582
|
-
exchangeRate:
|
|
57744
|
+
exchangeRate: ONE_E1811 * ONE_E1811 / r
|
|
57583
57745
|
};
|
|
57584
57746
|
}
|
|
57585
57747
|
});
|
|
@@ -57609,7 +57771,7 @@ var readerBinanceWbeth = (entry) => ({
|
|
|
57609
57771
|
return void 0;
|
|
57610
57772
|
}
|
|
57611
57773
|
return {
|
|
57612
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57774
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57613
57775
|
totalSupply,
|
|
57614
57776
|
exchangeRate
|
|
57615
57777
|
};
|
|
@@ -57655,7 +57817,7 @@ var readerCoreEarnRate = (entry) => {
|
|
|
57655
57817
|
return {
|
|
57656
57818
|
totalAssets: totalSupply * r / CORE_RATE_DENOM,
|
|
57657
57819
|
totalSupply,
|
|
57658
|
-
exchangeRate: r *
|
|
57820
|
+
exchangeRate: r * ONE_E1811 / CORE_RATE_DENOM
|
|
57659
57821
|
};
|
|
57660
57822
|
}
|
|
57661
57823
|
};
|
|
@@ -57677,7 +57839,7 @@ var readerCoreStakedRatio = (entry) => {
|
|
|
57677
57839
|
return {
|
|
57678
57840
|
totalAssets: totalStaked,
|
|
57679
57841
|
totalSupply,
|
|
57680
|
-
exchangeRate: totalStaked *
|
|
57842
|
+
exchangeRate: totalStaked * ONE_E1811 / totalSupply
|
|
57681
57843
|
};
|
|
57682
57844
|
}
|
|
57683
57845
|
};
|
|
@@ -57712,7 +57874,7 @@ var readerKintsuSMon = (entry) => ({
|
|
|
57712
57874
|
const totalAssets = toBigInt14(pooled);
|
|
57713
57875
|
const totalSupply = toBigInt14(shares);
|
|
57714
57876
|
if (totalAssets === void 0 || totalSupply === void 0) return void 0;
|
|
57715
|
-
const exchangeRate = totalSupply > 0n ? totalAssets *
|
|
57877
|
+
const exchangeRate = totalSupply > 0n ? totalAssets * ONE_E1811 / totalSupply : ONE_E1811;
|
|
57716
57878
|
return { totalAssets, totalSupply, exchangeRate };
|
|
57717
57879
|
}
|
|
57718
57880
|
});
|
|
@@ -58148,7 +58310,7 @@ var getLstValidators = async (chainId, shareToken) => {
|
|
|
58148
58310
|
};
|
|
58149
58311
|
|
|
58150
58312
|
// src/vaults/lst/fetchPublic.ts
|
|
58151
|
-
var
|
|
58313
|
+
var ONE_E1812 = 10n ** 18n;
|
|
58152
58314
|
var ERC20_BALANCE_ABI = parseAbi([
|
|
58153
58315
|
"function balanceOf(address) view returns (uint256)"
|
|
58154
58316
|
]);
|
|
@@ -58263,8 +58425,8 @@ var fetchLstShareTokens = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
58263
58425
|
const underlyingUnit = 10n ** BigInt(underlyingDec);
|
|
58264
58426
|
const totalAssetsFormatted = Number(state.totalAssets) / 10 ** underlyingDec;
|
|
58265
58427
|
const totalAssetsUsd = priceUsd !== void 0 ? totalAssetsFormatted * priceUsd : 0;
|
|
58266
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
58267
|
-
const convertToShares = state.exchangeRate > 0n ?
|
|
58428
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1812;
|
|
58429
|
+
const convertToShares = state.exchangeRate > 0n ? ONE_E1812 * shareUnit / state.exchangeRate : 0n;
|
|
58268
58430
|
let liquidityRaw;
|
|
58269
58431
|
if (state.liquidity !== void 0) {
|
|
58270
58432
|
liquidityRaw = state.liquidity;
|
|
@@ -61716,6 +61878,29 @@ var CooldownDurationAbi = [
|
|
|
61716
61878
|
outputs: [{ type: "uint24" }]
|
|
61717
61879
|
}
|
|
61718
61880
|
];
|
|
61881
|
+
var WrenNavReadAbi = [
|
|
61882
|
+
{
|
|
61883
|
+
name: "navprice",
|
|
61884
|
+
type: "function",
|
|
61885
|
+
stateMutability: "view",
|
|
61886
|
+
inputs: [],
|
|
61887
|
+
outputs: [{ type: "uint256" }]
|
|
61888
|
+
},
|
|
61889
|
+
{
|
|
61890
|
+
name: "burncost",
|
|
61891
|
+
type: "function",
|
|
61892
|
+
stateMutability: "view",
|
|
61893
|
+
inputs: [],
|
|
61894
|
+
outputs: [{ type: "uint256" }]
|
|
61895
|
+
},
|
|
61896
|
+
{
|
|
61897
|
+
name: "burnable",
|
|
61898
|
+
type: "function",
|
|
61899
|
+
stateMutability: "view",
|
|
61900
|
+
inputs: [],
|
|
61901
|
+
outputs: [{ type: "uint256" }]
|
|
61902
|
+
}
|
|
61903
|
+
];
|
|
61719
61904
|
var NavOracleReadAbi = [
|
|
61720
61905
|
{
|
|
61721
61906
|
name: "latestRoundData",
|
|
@@ -61733,7 +61918,7 @@ var NavOracleReadAbi = [
|
|
|
61733
61918
|
];
|
|
61734
61919
|
|
|
61735
61920
|
// src/vaults/savings/readers/shared.ts
|
|
61736
|
-
var
|
|
61921
|
+
var ONE_E1813 = 10n ** 18n;
|
|
61737
61922
|
var toBigInt16 = (v) => {
|
|
61738
61923
|
if (v === void 0 || v === null) return void 0;
|
|
61739
61924
|
if (typeof v === "bigint") return v;
|
|
@@ -61774,7 +61959,7 @@ var readerErc46262 = (entry) => {
|
|
|
61774
61959
|
return {
|
|
61775
61960
|
totalAssets,
|
|
61776
61961
|
totalSupply,
|
|
61777
|
-
exchangeRate: convertToAssetsRaw *
|
|
61962
|
+
exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit
|
|
61778
61963
|
};
|
|
61779
61964
|
}
|
|
61780
61965
|
};
|
|
@@ -61803,7 +61988,7 @@ var readerErc4626Cooldown = (entry) => {
|
|
|
61803
61988
|
return {
|
|
61804
61989
|
totalAssets,
|
|
61805
61990
|
totalSupply,
|
|
61806
|
-
exchangeRate: convertToAssetsRaw *
|
|
61991
|
+
exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
|
|
61807
61992
|
withdrawalCooldownSeconds: cooldownSecs === void 0 ? void 0 : Number(cooldownSecs)
|
|
61808
61993
|
};
|
|
61809
61994
|
}
|
|
@@ -61993,7 +62178,7 @@ var readerErc4626Idle = (entry) => {
|
|
|
61993
62178
|
return {
|
|
61994
62179
|
totalAssets,
|
|
61995
62180
|
totalSupply,
|
|
61996
|
-
exchangeRate: convertToAssetsRaw *
|
|
62181
|
+
exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
|
|
61997
62182
|
...capacity !== void 0 ? {
|
|
61998
62183
|
instantRedeemCapacity: capacity,
|
|
61999
62184
|
instantRedeemEnabled: true,
|
|
@@ -62042,7 +62227,7 @@ var readerErc4626WithdrawLimit = (entry) => {
|
|
|
62042
62227
|
return {
|
|
62043
62228
|
totalAssets,
|
|
62044
62229
|
totalSupply,
|
|
62045
|
-
exchangeRate: convertToAssetsRaw *
|
|
62230
|
+
exchangeRate: convertToAssetsRaw * ONE_E1813 / underlyingUnit,
|
|
62046
62231
|
...capacity !== void 0 ? {
|
|
62047
62232
|
instantRedeemCapacity: capacity,
|
|
62048
62233
|
instantRedeemEnabled: true,
|
|
@@ -62071,7 +62256,7 @@ var readerFrankencoinSavings = (entry) => ({
|
|
|
62071
62256
|
// `fetchPublic` derives `convertToAssets` / `convertToShares` from
|
|
62072
62257
|
// `exchangeRate`, and 1e18 makes them the identity.
|
|
62073
62258
|
totalSupply: deposits,
|
|
62074
|
-
exchangeRate:
|
|
62259
|
+
exchangeRate: ONE_E1813
|
|
62075
62260
|
};
|
|
62076
62261
|
}
|
|
62077
62262
|
});
|
|
@@ -62097,7 +62282,7 @@ var readerNavOracle = (entry) => {
|
|
|
62097
62282
|
const exchangeRate = toBigInt16(raw);
|
|
62098
62283
|
if (exchangeRate === void 0 || exchangeRate <= 0n) return void 0;
|
|
62099
62284
|
return {
|
|
62100
|
-
totalAssets: totalSupply * exchangeRate * underlyingUnit / (
|
|
62285
|
+
totalAssets: totalSupply * exchangeRate * underlyingUnit / (ONE_E1813 * shareUnit),
|
|
62101
62286
|
totalSupply,
|
|
62102
62287
|
exchangeRate
|
|
62103
62288
|
};
|
|
@@ -62111,7 +62296,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
62111
62296
|
return {
|
|
62112
62297
|
calls: [
|
|
62113
62298
|
{ address, name: "totalSupply", params: [] },
|
|
62114
|
-
{ address, name: "getNlpByWnlp", params: [
|
|
62299
|
+
{ address, name: "getNlpByWnlp", params: [ONE_E1813] },
|
|
62115
62300
|
{ address, name: "instantRedeemFeeBips", params: [] },
|
|
62116
62301
|
{ address, name: "instantRedeemEnabled", params: [] },
|
|
62117
62302
|
// Falls back to the vault itself when no CreditVault is pinned —
|
|
@@ -62145,7 +62330,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
62145
62330
|
const windowSeconds = toBigInt16(window);
|
|
62146
62331
|
const bips = toBigInt16(feeBips);
|
|
62147
62332
|
return {
|
|
62148
|
-
totalAssets: totalSupply * exchangeRate /
|
|
62333
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1813,
|
|
62149
62334
|
totalSupply,
|
|
62150
62335
|
exchangeRate,
|
|
62151
62336
|
// `instantRedeemFeeBips` on-chain is already basis points, so it
|
|
@@ -62162,8 +62347,42 @@ var readerNativeWnlp = (entry) => {
|
|
|
62162
62347
|
};
|
|
62163
62348
|
};
|
|
62164
62349
|
|
|
62350
|
+
// src/vaults/savings/readers/wrenNav.ts
|
|
62351
|
+
var readerWrenNav = (entry) => {
|
|
62352
|
+
const shareUnit = 10n ** BigInt(entry.decimals);
|
|
62353
|
+
const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
|
|
62354
|
+
return {
|
|
62355
|
+
calls: [
|
|
62356
|
+
{ address: entry.address, name: "totalSupply", params: [] },
|
|
62357
|
+
{ address: entry.address, name: "burncost", params: [] },
|
|
62358
|
+
{ address: entry.address, name: "navprice", params: [] },
|
|
62359
|
+
{ address: entry.address, name: "burnable", params: [] }
|
|
62360
|
+
],
|
|
62361
|
+
abis: [TotalSupplyAbi2, WrenNavReadAbi, WrenNavReadAbi, WrenNavReadAbi],
|
|
62362
|
+
parse: ([supply, burn, nav, burnable]) => {
|
|
62363
|
+
const totalSupply = toBigInt16(supply);
|
|
62364
|
+
const navPrice = toBigInt16(nav);
|
|
62365
|
+
if (totalSupply === void 0) return void 0;
|
|
62366
|
+
if (navPrice === void 0 || navPrice <= 0n) return void 0;
|
|
62367
|
+
const burncost = toBigInt16(burn);
|
|
62368
|
+
const hasBurncost = burncost !== void 0 && burncost > 0n;
|
|
62369
|
+
const exchangeRate = hasBurncost ? burncost : navPrice;
|
|
62370
|
+
const totalAssets = totalSupply * exchangeRate * underlyingUnit / (ONE_E1813 * shareUnit);
|
|
62371
|
+
const burnFlag = toBigInt16(burnable);
|
|
62372
|
+
const instantRedeemEnabled = burnFlag === void 0 ? true : burnFlag > 0n;
|
|
62373
|
+
return {
|
|
62374
|
+
totalAssets,
|
|
62375
|
+
totalSupply,
|
|
62376
|
+
exchangeRate,
|
|
62377
|
+
fundamentalExchangeRate: hasBurncost ? navPrice : void 0,
|
|
62378
|
+
instantRedeemEnabled
|
|
62379
|
+
};
|
|
62380
|
+
}
|
|
62381
|
+
};
|
|
62382
|
+
};
|
|
62383
|
+
|
|
62165
62384
|
// src/vaults/savings/readers/yieldBasisLt.ts
|
|
62166
|
-
var ONE_SHARE =
|
|
62385
|
+
var ONE_SHARE = ONE_E1813;
|
|
62167
62386
|
var readerYieldBasisLt = (entry) => {
|
|
62168
62387
|
const underlyingUnit = 10n ** BigInt(entry.underlyingDecimals ?? entry.decimals);
|
|
62169
62388
|
const amm = entry.capacityContract ?? entry.address;
|
|
@@ -62191,7 +62410,7 @@ var readerYieldBasisLt = (entry) => {
|
|
|
62191
62410
|
}
|
|
62192
62411
|
if (totalSupply === 0n || redeemRaw === 0n) return void 0;
|
|
62193
62412
|
const totalAssets = totalSupply * redeemRaw / ONE_SHARE;
|
|
62194
|
-
const exchangeRate = redeemRaw *
|
|
62413
|
+
const exchangeRate = redeemRaw * ONE_E1813 / underlyingUnit;
|
|
62195
62414
|
const equity = Array.isArray(valueOracle) ? toBigInt16(valueOracle[1]) : toBigInt16(valueOracle?.value);
|
|
62196
62415
|
const cap = toBigInt16(maxDebt);
|
|
62197
62416
|
let depositCapacity;
|
|
@@ -62221,6 +62440,8 @@ var buildReader2 = (entry) => {
|
|
|
62221
62440
|
return readerFrankencoinSavings(entry);
|
|
62222
62441
|
case "yieldbasis-lt":
|
|
62223
62442
|
return readerYieldBasisLt(entry);
|
|
62443
|
+
case "wren-nav":
|
|
62444
|
+
return readerWrenNav(entry);
|
|
62224
62445
|
case "erc4626-cooldown":
|
|
62225
62446
|
return readerErc4626Cooldown(entry);
|
|
62226
62447
|
case "erc4626-idle":
|
|
@@ -62237,7 +62458,7 @@ var buildReader2 = (entry) => {
|
|
|
62237
62458
|
var resolveYieldApr2 = async (entries) => (await resolveEntryApr(entries)).apr;
|
|
62238
62459
|
|
|
62239
62460
|
// src/vaults/savings/fetchPublic.ts
|
|
62240
|
-
var
|
|
62461
|
+
var ONE_E1814 = 10n ** 18n;
|
|
62241
62462
|
var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList = {}) => {
|
|
62242
62463
|
const entries = getSavingsRegistry(chainId);
|
|
62243
62464
|
if (entries.length === 0) return {};
|
|
@@ -62286,8 +62507,8 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
62286
62507
|
1,
|
|
62287
62508
|
Number(liquidityAmount * 1000000n / state.totalAssets) / 1e6
|
|
62288
62509
|
) : 1;
|
|
62289
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
62290
|
-
const convertToShares = state.exchangeRate > 0n ?
|
|
62510
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1814;
|
|
62511
|
+
const convertToShares = state.exchangeRate > 0n ? ONE_E1814 * shareUnit / state.exchangeRate : 0n;
|
|
62291
62512
|
const depositCapacity = state.depositCapacity?.toString();
|
|
62292
62513
|
const depositCapacityFormatted = state.depositCapacity !== void 0 ? Number(state.depositCapacity) / 10 ** underlyingDec : void 0;
|
|
62293
62514
|
const depositCapacityUsd = depositCapacityFormatted !== void 0 && priceUsd !== void 0 ? depositCapacityFormatted * priceUsd : void 0;
|
|
@@ -63438,6 +63659,11 @@ var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
|
63438
63659
|
"ZCHF",
|
|
63439
63660
|
"JPYC",
|
|
63440
63661
|
"GBPT",
|
|
63662
|
+
// BCP Technologies' Tokenised GBP — cash + short-dated gilts, 1:1
|
|
63663
|
+
// redeemable. Drives `denomination` for Wren's wstGBP row, whose underlying
|
|
63664
|
+
// this is. NB `TGBP` is also TrueGBP's ticker; both are GBP stablecoins, so
|
|
63665
|
+
// the classification is right either way.
|
|
63666
|
+
"TGBP",
|
|
63441
63667
|
"XSGD",
|
|
63442
63668
|
"TRYB",
|
|
63443
63669
|
// Brix iTRY — lira-pegged, backed by a regulated basket of Turkish
|