@1delta/margin-fetcher 5.0.10 → 5.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +137 -6
- package/dist/index.js +485 -35
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Chain } from '@1delta/chain-registry';
|
|
|
9
9
|
import { multicallRetryUniversal, getEvmClient, getEvmChain, getEvmClientUniversal } from '@1delta/providers';
|
|
10
10
|
import { LiquityTroveManagerAbi, LiquityActivePoolAbi, LiquityStabilityPoolAbi, LiquityPriceFeedAbi, LiquitySortedTrovesAbi, RiverTroveManagerAbi, RiverStabilityPoolAbi, TellerMarketRegistryAbi, TellerV2Abi, InverseMarketAbi, InverseOracleAbi, InverseDbrAbi, Erc20Abi, LlamaLendControllerAbi, LlamaLendControllerV1Abi, LlamaLendControllerV2Abi, LlamaLendVaultAbi, LlamaLendAmmAbi, MetaMorphoAbi, ExactlyPreviewerAbi, ExactlyAuditorAbi, LenderCommitmentGroupAbi, ResupplyRegistryAbi, ResupplyPairAbi, ResupplyUtilitiesAbi, ResupplyRewardHandlerAbi, ResupplyPairEmissionsAbi, ConvexPoolUtilAbi, UsddVatAbi, UsddJugAbi, UsddSpotAbi, FrankencoinPositionAbi, FluidLendingResolverAbi, FluidVaultResolverAbi, FluidLiquidityResolverAbi, MoolahVaultAbi, MorphoLensAbi, AaveV4SpokeAbi, AaveV4OracleAbi, AaveV4HubAbi, DolomiteMarginAbi, GearboxMarketCompressorV310Abi, MorphoBlueAbi, MidnightAbi, TermRepoTokenAbi, TermRepoServicerAbi, TermRepoCollateralManagerAbi, LiquityTroveNFTAbi, LiquityCollSurplusPoolAbi, TellerCollateralManagerAbi, TermMaxViewerAbi, InverseEscrowAbi, CurvanceMarketManagerAbi, CurvanceCTokenAbi, GearboxCreditAccountCompressorV310Abi, UsddCdpManagerAbi, UsddProxyRegistryAbi, CurvanceProtocolReaderAbi, CurvanceCentralRegistryAbi, TermPriceConsumerAbi, CurvanceOracleManagerAbi, TermMaxOracleAggregatorV2Abi } from '@1delta/abis';
|
|
11
11
|
export { MorphoLensAbi } from '@1delta/abis';
|
|
12
|
-
import { prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, InitMarginAddresses, getLstAcceptedInputs } from '@1delta/calldata-sdk';
|
|
12
|
+
import { prepareDebitDataMulticall, prepareLenderDebitMulticall, parseDebitDataResult, parseLenderDebitResult, getPermit2ContractAddress, getCompoundV3CometAddress as getCompoundV3CometAddress$1, getMorphoAddress, getAaveCollateralTokenAddress, getSiloHalfForUnderlying, bandLtvCurve, InitMarginAddresses, getLstAcceptedInputs } from '@1delta/calldata-sdk';
|
|
13
13
|
import { proxyNativeFetch } from '@1delta/proxy-fetch';
|
|
14
14
|
import { BALANCER_V2_FORKS, BALANCER_V3_FORKS, UNISWAP_V4_FORKS, isFlashLoanSourceExcluded, FLASH_LOAN_IDS } from '@1delta/dex-registry';
|
|
15
15
|
|
|
@@ -23015,16 +23015,22 @@ var maxBorrowableCall = (m, oneUnit, n) => m.version === 1 ? {
|
|
|
23015
23015
|
name: "max_borrowable",
|
|
23016
23016
|
params: [oneUnit, BigInt(n), ZERO]
|
|
23017
23017
|
};
|
|
23018
|
-
var buildBandLtv = (
|
|
23019
|
-
if (!
|
|
23020
|
-
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23018
|
+
var buildBandLtv = (market) => {
|
|
23019
|
+
if (!market.ammA || !market.loanDiscount) return null;
|
|
23020
|
+
try {
|
|
23021
|
+
const curve = bandLtvCurve({
|
|
23022
|
+
ammA: BigInt(market.ammA),
|
|
23023
|
+
loanDiscount: BigInt(market.loanDiscount),
|
|
23024
|
+
// Reference size only — it feeds the DEAD_SHARES cushion, which is
|
|
23025
|
+
// negligible at any realistic position size and converges as it grows.
|
|
23026
|
+
collateral: 10n ** BigInt(market.collateralDecimals + 3),
|
|
23027
|
+
collateralDecimals: market.collateralDecimals,
|
|
23028
|
+
bandCounts: bandGrid(market)
|
|
23029
|
+
});
|
|
23030
|
+
return Object.keys(curve).length > 0 ? curve : null;
|
|
23031
|
+
} catch {
|
|
23032
|
+
return null;
|
|
23026
23033
|
}
|
|
23027
|
-
return Object.keys(out).length > 0 ? out : null;
|
|
23028
23034
|
};
|
|
23029
23035
|
async function fetchChainExtras(chainId, markets) {
|
|
23030
23036
|
const perMarketCalls = markets.map((m) => {
|
|
@@ -23067,17 +23073,9 @@ async function fetchChainExtras(chainId, markets) {
|
|
|
23067
23073
|
const nLoansRaw = toBig5(results[cursor + 2]);
|
|
23068
23074
|
const maxDepositRaw = toBig5(results[cursor + 3]);
|
|
23069
23075
|
const borrowCapRaw = toBig5(results[cursor + 4]);
|
|
23070
|
-
const perBand = grid.map((n, i) => ({
|
|
23071
|
-
n,
|
|
23072
|
-
maxBorrowable: toBig5(results[cursor + 5 + i])
|
|
23073
|
-
}));
|
|
23074
23076
|
cursor += 5 + grid.length;
|
|
23075
23077
|
const collateralPrice = priceRaw === null ? null : Number(priceRaw) / 1e18;
|
|
23076
|
-
const bandLtv = buildBandLtv(
|
|
23077
|
-
perBand,
|
|
23078
|
-
market.borrowedDecimals,
|
|
23079
|
-
collateralPrice
|
|
23080
|
-
);
|
|
23078
|
+
const bandLtv = buildBandLtv(market);
|
|
23081
23079
|
const defaultN = String(bandsFor(market));
|
|
23082
23080
|
out[market.controller.toLowerCase()] = {
|
|
23083
23081
|
collateralPrice,
|
|
@@ -23228,6 +23226,22 @@ var VAULT_PRICE_ABI = [
|
|
|
23228
23226
|
outputs: [{ type: "uint256" }]
|
|
23229
23227
|
}
|
|
23230
23228
|
];
|
|
23229
|
+
var WRAPPED_COLLATERAL_ABI = [
|
|
23230
|
+
{
|
|
23231
|
+
name: "collateral_token",
|
|
23232
|
+
type: "function",
|
|
23233
|
+
stateMutability: "view",
|
|
23234
|
+
inputs: [],
|
|
23235
|
+
outputs: [{ type: "address" }]
|
|
23236
|
+
},
|
|
23237
|
+
{
|
|
23238
|
+
name: "collateralContract",
|
|
23239
|
+
type: "function",
|
|
23240
|
+
stateMutability: "view",
|
|
23241
|
+
inputs: [],
|
|
23242
|
+
outputs: [{ type: "address" }]
|
|
23243
|
+
}
|
|
23244
|
+
];
|
|
23231
23245
|
var IDENTITY_READS = 3;
|
|
23232
23246
|
var STATE_READS = 14;
|
|
23233
23247
|
var ONE = 10n ** 18n;
|
|
@@ -23312,24 +23326,43 @@ async function fetchResupplyMarkets(lender, chainId) {
|
|
|
23312
23326
|
chain: chainId,
|
|
23313
23327
|
calls: pending.flatMap((p) => [
|
|
23314
23328
|
{ address: p.collateral, name: "decimals", params: [] },
|
|
23315
|
-
{ address: p.underlying, name: "decimals", params: [] }
|
|
23329
|
+
{ address: p.underlying, name: "decimals", params: [] },
|
|
23330
|
+
{ address: p.collateral, name: "collateral_token", params: [] },
|
|
23331
|
+
{ address: p.collateral, name: "collateralContract", params: [] }
|
|
23332
|
+
]),
|
|
23333
|
+
abi: pending.flatMap(() => [
|
|
23334
|
+
erc20Abi,
|
|
23335
|
+
erc20Abi,
|
|
23336
|
+
WRAPPED_COLLATERAL_ABI,
|
|
23337
|
+
WRAPPED_COLLATERAL_ABI
|
|
23316
23338
|
]),
|
|
23317
|
-
abi: pending.flatMap(() => [erc20Abi, erc20Abi]),
|
|
23318
23339
|
allowFailure: true
|
|
23319
23340
|
});
|
|
23320
23341
|
} catch {
|
|
23321
23342
|
dec = [];
|
|
23322
23343
|
}
|
|
23344
|
+
const addr2 = (v) => typeof v === "string" && /^0x[0-9a-fA-F]{40}$/.test(v) && !/^0x0+$/.test(v) ? v : void 0;
|
|
23345
|
+
const wrapped = pending.map((_3, i) => {
|
|
23346
|
+
const curve = addr2(dec[i * 4 + 2]);
|
|
23347
|
+
const frax = addr2(dec[i * 4 + 3]);
|
|
23348
|
+
return {
|
|
23349
|
+
token: curve ?? frax,
|
|
23350
|
+
family: curve ? "curvelend" : frax ? "fraxlend" : void 0
|
|
23351
|
+
};
|
|
23352
|
+
});
|
|
23323
23353
|
pending.forEach((p, i) => {
|
|
23324
|
-
const cd = Number(dec[i *
|
|
23325
|
-
const ud = Number(dec[i *
|
|
23354
|
+
const cd = Number(dec[i * 4]);
|
|
23355
|
+
const ud = Number(dec[i * 4 + 1]);
|
|
23356
|
+
const w = wrapped[i];
|
|
23326
23357
|
identityCache.set(identityKey(chainId, p.pair), {
|
|
23327
23358
|
pair: p.pair,
|
|
23328
23359
|
name: p.name,
|
|
23329
23360
|
collateral: p.collateral,
|
|
23330
23361
|
underlying: p.underlying,
|
|
23331
23362
|
collateralDecimals: Number.isFinite(cd) && cd > 0 ? cd : 18,
|
|
23332
|
-
underlyingDecimals: Number.isFinite(ud) && ud > 0 ? ud : 18
|
|
23363
|
+
underlyingDecimals: Number.isFinite(ud) && ud > 0 ? ud : 18,
|
|
23364
|
+
wrappedCollateralToken: w?.token,
|
|
23365
|
+
wrappedFamily: w?.family
|
|
23333
23366
|
});
|
|
23334
23367
|
});
|
|
23335
23368
|
}
|
|
@@ -24293,7 +24326,19 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
|
|
|
24293
24326
|
// this as a number gets NaN and can branch, where "0" would silently
|
|
24294
24327
|
// become a zero LTV. The real curve is in `llamalend.bandLtv`.
|
|
24295
24328
|
lltv: ltv !== null ? String(ltv) : "",
|
|
24296
|
-
|
|
24329
|
+
/**
|
|
24330
|
+
* The AMM, deliberately — LlamaLend's price feed is `price_oracle()` on
|
|
24331
|
+
* the LLAMMA itself, so that is the only address a reader can call.
|
|
24332
|
+
*
|
|
24333
|
+
* This used to read `market.priceOracle ?? market.amm`, but
|
|
24334
|
+
* `priceOracle` was never assigned anywhere in this pipeline (the name
|
|
24335
|
+
* is used elsewhere for the price VALUE, not the contract), so the
|
|
24336
|
+
* fallback was doing all the work. Naming it directly removes the trap:
|
|
24337
|
+
* a Curve `price_oracle_contract` exposes `price()` and NOT
|
|
24338
|
+
* `price_oracle()`, so populating that field would have silently
|
|
24339
|
+
* pointed every oracle reader at an interface it cannot call.
|
|
24340
|
+
*/
|
|
24341
|
+
oracle: market.amm,
|
|
24297
24342
|
irm: market.monetaryPolicy ?? zeroAddress,
|
|
24298
24343
|
collateralAddress: collAddr,
|
|
24299
24344
|
loanAddress: loanAddr,
|
|
@@ -24349,7 +24394,6 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
|
|
|
24349
24394
|
*/
|
|
24350
24395
|
amm: market.amm,
|
|
24351
24396
|
monetaryPolicy: market.monetaryPolicy,
|
|
24352
|
-
priceOracle: market.priceOracle,
|
|
24353
24397
|
/**
|
|
24354
24398
|
* Curve's deployed v1 leverage zaps and the aggregator routers
|
|
24355
24399
|
* they are hard-wired to. We route leverage through these rather
|
|
@@ -24375,8 +24419,24 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
|
|
|
24375
24419
|
}
|
|
24376
24420
|
return out;
|
|
24377
24421
|
}
|
|
24422
|
+
function resupplyMarketLabel(rawName) {
|
|
24423
|
+
const inner = rawName.match(/\(([^)]+)\)/)?.[1];
|
|
24424
|
+
if (!inner) return rawName;
|
|
24425
|
+
const suffix = rawName.match(/\)\s*-\s*(\d+)\s*$/)?.[1];
|
|
24426
|
+
return suffix && suffix !== "1" ? `${inner} - ${suffix}` : inner;
|
|
24427
|
+
}
|
|
24428
|
+
function wrappedCollateralSymbol(rawName) {
|
|
24429
|
+
const inner = rawName.match(/\(([^)]+)\)/)?.[1];
|
|
24430
|
+
const sym = inner?.split("/").pop()?.trim();
|
|
24431
|
+
return sym && sym.length > 0 ? sym : void 0;
|
|
24432
|
+
}
|
|
24378
24433
|
var llamaLendKey = (controller) => `LLAMALEND_${controller.replace(/^0x/i, "").toUpperCase()}`;
|
|
24379
|
-
function resolveWrappedMarket(chainId,
|
|
24434
|
+
function resolveWrappedMarket(chainId, identity) {
|
|
24435
|
+
const collateralVault = identity.collateral;
|
|
24436
|
+
const onChain = {
|
|
24437
|
+
collateralToken: identity.wrappedCollateralToken,
|
|
24438
|
+
collateralSymbol: wrappedCollateralSymbol(identity.name)
|
|
24439
|
+
};
|
|
24380
24440
|
const market = llamaLendMarketByVault("LLAMALEND", chainId, collateralVault);
|
|
24381
24441
|
if (market) {
|
|
24382
24442
|
return {
|
|
@@ -24386,13 +24446,19 @@ function resolveWrappedMarket(chainId, collateralVault, pairName) {
|
|
|
24386
24446
|
controller: market.controller,
|
|
24387
24447
|
amm: market.amm,
|
|
24388
24448
|
version: market.version,
|
|
24389
|
-
|
|
24449
|
+
// Roster first (curated symbols/decimals), on-chain as the backstop, so
|
|
24450
|
+
// an unpublished or lagging roster degrades a label rather than the
|
|
24451
|
+
// image address.
|
|
24452
|
+
collateralSymbol: market.collateralSymbol ?? onChain.collateralSymbol,
|
|
24453
|
+
collateralToken: market.collateralToken ?? onChain.collateralToken,
|
|
24454
|
+
collateralDecimals: market.collateralDecimals
|
|
24390
24455
|
};
|
|
24391
24456
|
}
|
|
24392
|
-
const
|
|
24457
|
+
const family = identity.wrappedFamily ?? (/fraxlend/i.test(identity.name) ? "fraxlend" : void 0);
|
|
24393
24458
|
return {
|
|
24394
|
-
provider:
|
|
24395
|
-
vault: collateralVault
|
|
24459
|
+
provider: family === "fraxlend" ? "fraxlend" : family === "curvelend" ? "llamalend" : "unknown",
|
|
24460
|
+
vault: collateralVault,
|
|
24461
|
+
...onChain
|
|
24396
24462
|
};
|
|
24397
24463
|
}
|
|
24398
24464
|
function resupplyLenderKey(lender, chainId, pair) {
|
|
@@ -24500,7 +24566,8 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
|
|
|
24500
24566
|
const borrowLimit = p.borrowLimit !== null ? Number(p.borrowLimit) / 10 ** debtDecimals : 0;
|
|
24501
24567
|
const borrowLiquidity = Math.max(borrowLimit - totalDebt, 0);
|
|
24502
24568
|
const halted = (p.borrowLimit ?? 0n) === 0n;
|
|
24503
|
-
const wrappedMarket = resolveWrappedMarket(chainId, id
|
|
24569
|
+
const wrappedMarket = resolveWrappedMarket(chainId, id);
|
|
24570
|
+
const marketLabel = resupplyMarketLabel(id.name);
|
|
24504
24571
|
const rewardEntries = buildRewardEntries(
|
|
24505
24572
|
p,
|
|
24506
24573
|
raw.rsup,
|
|
@@ -24547,6 +24614,7 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
|
|
|
24547
24614
|
config: {
|
|
24548
24615
|
0: {
|
|
24549
24616
|
category: 0,
|
|
24617
|
+
label: marketLabel,
|
|
24550
24618
|
borrowCollateralFactor: maxLtv,
|
|
24551
24619
|
collateralFactor: maxLtv,
|
|
24552
24620
|
borrowFactor: 1,
|
|
@@ -24606,6 +24674,7 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
|
|
|
24606
24674
|
config: {
|
|
24607
24675
|
0: {
|
|
24608
24676
|
category: 0,
|
|
24677
|
+
label: marketLabel,
|
|
24609
24678
|
borrowCollateralFactor: 0,
|
|
24610
24679
|
collateralFactor: 0,
|
|
24611
24680
|
borrowFactor: 1,
|
|
@@ -24627,7 +24696,7 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
|
|
|
24627
24696
|
entry.params = {
|
|
24628
24697
|
market: {
|
|
24629
24698
|
lender: lenderKey,
|
|
24630
|
-
name:
|
|
24699
|
+
name: marketLabel,
|
|
24631
24700
|
loanDecimals: debtDecimals,
|
|
24632
24701
|
collateralDecimals: collDecimals,
|
|
24633
24702
|
id: id.pair.toLowerCase(),
|
|
@@ -24642,6 +24711,9 @@ function convertResupplyMarketsToResponse(raw, chainId, prices = {}, _additional
|
|
|
24642
24711
|
// worker-api resolvers and the loop quoter) ---
|
|
24643
24712
|
resupply: {
|
|
24644
24713
|
pair: id.pair,
|
|
24714
|
+
/** The pair's raw on-chain `name()`, before the label is derived. */
|
|
24715
|
+
rawName: id.name,
|
|
24716
|
+
label: marketLabel,
|
|
24645
24717
|
/** The ERC-4626 share the pair actually books as collateral. */
|
|
24646
24718
|
collateralVault: id.collateral,
|
|
24647
24719
|
collateralVaultDecimals: id.collateralDecimals,
|
|
@@ -40638,6 +40710,40 @@ var fraxSavingsFetcher = {
|
|
|
40638
40710
|
}
|
|
40639
40711
|
};
|
|
40640
40712
|
|
|
40713
|
+
// src/yields/intrinsic/fetchers/binance.ts
|
|
40714
|
+
var HISTORY_URL2 = "https://www.binance.com/bapi/earn/v1/public/pos/cftoken/project/exchange-rate/history";
|
|
40715
|
+
var WBETH = "Wrapped Binance Beacon ETH::wBETH";
|
|
40716
|
+
var LLAMA_POOL = "80b8bf92-b953-4c20-98ea-c9653ef2bb98";
|
|
40717
|
+
var DAY_MS = 864e5;
|
|
40718
|
+
var LOOKBACK_MS = 14 * DAY_MS;
|
|
40719
|
+
var TIMEOUT_MS2 = 8e3;
|
|
40720
|
+
var wbethFetcher = {
|
|
40721
|
+
label: "WBETH",
|
|
40722
|
+
fetch: async () => {
|
|
40723
|
+
const now = Date.now();
|
|
40724
|
+
const url = `${HISTORY_URL2}?startTime=${now - LOOKBACK_MS}&endTime=${now}`;
|
|
40725
|
+
try {
|
|
40726
|
+
const res = await fetch(url, {
|
|
40727
|
+
method: "GET",
|
|
40728
|
+
headers: { Accept: "application/json" },
|
|
40729
|
+
signal: AbortSignal.timeout(TIMEOUT_MS2)
|
|
40730
|
+
}).then((r) => r.json());
|
|
40731
|
+
const points = res.data ?? [];
|
|
40732
|
+
if (points.length > 0) {
|
|
40733
|
+
const latest = points.reduce(
|
|
40734
|
+
(a, b) => Number(b.calcDate) > Number(a.calcDate) ? b : a
|
|
40735
|
+
);
|
|
40736
|
+
const apr = Number(latest.apr) * 100;
|
|
40737
|
+
if (Number.isFinite(apr) && apr > 0) return { [WBETH]: apr };
|
|
40738
|
+
}
|
|
40739
|
+
} catch (e) {
|
|
40740
|
+
console.log("WBETH history failed, falling back to DefiLlama", e);
|
|
40741
|
+
}
|
|
40742
|
+
const apy = await fetchDefiLlamaApy(LLAMA_POOL);
|
|
40743
|
+
return { [WBETH]: apyToAprPercent(apy) };
|
|
40744
|
+
}
|
|
40745
|
+
};
|
|
40746
|
+
|
|
40641
40747
|
// src/vaults/lst/registry.ts
|
|
40642
40748
|
var LST_REGISTRY = {
|
|
40643
40749
|
// Monad (143) — native-MON LSTs. shMON / aprMON are ERC-4626 over native
|
|
@@ -41040,6 +41146,46 @@ var LST_REGISTRY = {
|
|
|
41040
41146
|
yieldFetcher: cbethFetcher,
|
|
41041
41147
|
yieldKey: "CBETH"
|
|
41042
41148
|
},
|
|
41149
|
+
{
|
|
41150
|
+
// Binance wBETH — the *other* exchange LST, and unlike cbETH above
|
|
41151
|
+
// it is genuinely permissionless on-chain in both directions:
|
|
41152
|
+
// mint `deposit(address referral)` payable, no allowlist
|
|
41153
|
+
// redeem `requestWithdrawEth(uint256)` → the UnwrapTokenV1ETH
|
|
41154
|
+
// queue at 0x79973d557CD9dd87eb61E250cc2572c990e20196
|
|
41155
|
+
// (both simulated against mainnet — `deposit` succeeds from an
|
|
41156
|
+
// arbitrary EOA, `requestWithdrawEth` reverts only on balance).
|
|
41157
|
+
//
|
|
41158
|
+
// A FiatTokenProxy (Circle's USDC codebase) + Binance's
|
|
41159
|
+
// StakedTokenV3 mixin, so it inherits USDC-style `blacklist(address)`
|
|
41160
|
+
// and `pause()` on BOTH the token and the unwrap queue — Binance can
|
|
41161
|
+
// freeze any holder. Same trust class as USDC; that is the live risk
|
|
41162
|
+
// for anything treating wBETH as collateral.
|
|
41163
|
+
//
|
|
41164
|
+
// The `queued` exit has two teeth that a plain cooldown does not:
|
|
41165
|
+
// * the ETH owed is FROZEN at request time (`ethAmount` is stored,
|
|
41166
|
+
// not recomputed), so the position stops earning for the whole
|
|
41167
|
+
// `lockTime()` — currently 864000s / 10 days, admin-settable down
|
|
41168
|
+
// to MIN_LOCK_TIME = 172800s / 2 days. Read it live.
|
|
41169
|
+
// * a request is only auto-allocated while
|
|
41170
|
+
// `availableAllocateAmount` covers it (~3 ETH on Ethereum today);
|
|
41171
|
+
// anything larger waits for Binance's operator to `allocate()`,
|
|
41172
|
+
// with no SLA.
|
|
41173
|
+
address: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
41174
|
+
underlying: "0x0000000000000000000000000000000000000000",
|
|
41175
|
+
symbol: "wBETH",
|
|
41176
|
+
brand: "Binance",
|
|
41177
|
+
decimals: 18,
|
|
41178
|
+
reader: "binanceWbeth",
|
|
41179
|
+
isErc4626: false,
|
|
41180
|
+
isRebasing: false,
|
|
41181
|
+
isMintable: true,
|
|
41182
|
+
isNativeUnderlying: true,
|
|
41183
|
+
mintContract: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
41184
|
+
mintInputAsset: "native",
|
|
41185
|
+
withdrawalMode: "queued",
|
|
41186
|
+
yieldFetcher: wbethFetcher,
|
|
41187
|
+
yieldKey: "Wrapped Binance Beacon ETH::wBETH"
|
|
41188
|
+
},
|
|
41043
41189
|
{
|
|
41044
41190
|
address: "0xa43a7c62d56df036c187e1966c03e2799d8987ed",
|
|
41045
41191
|
// TruFin TruStake MATIC Vault uses the MATIC ERC-20 (not POL).
|
|
@@ -41606,6 +41752,37 @@ var LST_REGISTRY = {
|
|
|
41606
41752
|
listaStakeManager: "0x1adb950d8bb3da4be104211d5ab038628e477fe6"
|
|
41607
41753
|
}
|
|
41608
41754
|
},
|
|
41755
|
+
{
|
|
41756
|
+
// Binance wBETH on BNB — SAME token address as Ethereum, but a
|
|
41757
|
+
// different implementation behind the proxy (`WrapTokenV2BSC` vs
|
|
41758
|
+
// `WrapTokenV3ETH`), so the mint leg is NOT portable:
|
|
41759
|
+
// Ethereum `deposit(address referral)` payable, native ETH
|
|
41760
|
+
// BNB `deposit(uint256 amount, address referral)` nonpayable,
|
|
41761
|
+
// pulls the Binance-pegged ETH ERC-20 below → needs approve
|
|
41762
|
+
// The read surface and the pushed rate ARE identical (one oracle
|
|
41763
|
+
// 0x81720695… writes both chains, and `exchangeRate()` returns the
|
|
41764
|
+
// same value), hence the shared reader and the shared `yieldKey`.
|
|
41765
|
+
//
|
|
41766
|
+
// Exit is the same UnwrapTokenV1 queue at the same address, with the
|
|
41767
|
+
// same frozen-amount / 10-day-lock / operator-allocation caveats as
|
|
41768
|
+
// the Ethereum entry — see there.
|
|
41769
|
+
address: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
41770
|
+
// Binance-pegged ETH on BSC — the deposit input, not native BNB.
|
|
41771
|
+
underlying: "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
|
|
41772
|
+
symbol: "wBETH",
|
|
41773
|
+
brand: "Binance",
|
|
41774
|
+
decimals: 18,
|
|
41775
|
+
reader: "binanceWbeth",
|
|
41776
|
+
isErc4626: false,
|
|
41777
|
+
isRebasing: false,
|
|
41778
|
+
isMintable: true,
|
|
41779
|
+
isNativeUnderlying: false,
|
|
41780
|
+
mintContract: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
41781
|
+
mintInputAsset: "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
|
|
41782
|
+
withdrawalMode: "queued",
|
|
41783
|
+
yieldFetcher: wbethFetcher,
|
|
41784
|
+
yieldKey: "Wrapped Binance Beacon ETH::wBETH"
|
|
41785
|
+
},
|
|
41609
41786
|
{
|
|
41610
41787
|
// YieldNest ynBNB — ERC-4626 vault over slisBNB (Lista), restaked
|
|
41611
41788
|
// via Kernel. Redeems to slisBNB synchronously; the BNB unstake
|
|
@@ -48159,6 +48336,79 @@ var listaFetcher = {
|
|
|
48159
48336
|
parse: parseListaResults,
|
|
48160
48337
|
getAbi: getListaAbi
|
|
48161
48338
|
};
|
|
48339
|
+
function generateLlamaLendLenderKey(marketId) {
|
|
48340
|
+
return `${Lender.LLAMALEND}_${marketId.replace(/^0x/i, "").toUpperCase()}`;
|
|
48341
|
+
}
|
|
48342
|
+
function getLlamaLendMarketsForChain(chainId, marketOverrides) {
|
|
48343
|
+
return marketOverrides?.[chainId] ?? [];
|
|
48344
|
+
}
|
|
48345
|
+
function getLlamaLendCalls(chainId, context) {
|
|
48346
|
+
const markets = getLlamaLendMarketsForChain(chainId, context?.marketOverrides);
|
|
48347
|
+
if (markets.length === 0) return [];
|
|
48348
|
+
return markets.map((market) => {
|
|
48349
|
+
const call = {
|
|
48350
|
+
address: market.amm,
|
|
48351
|
+
name: "price_oracle",
|
|
48352
|
+
params: []
|
|
48353
|
+
};
|
|
48354
|
+
return {
|
|
48355
|
+
calls: [call],
|
|
48356
|
+
meta: { markets: [market] },
|
|
48357
|
+
lender: generateLlamaLendLenderKey(market.marketId)
|
|
48358
|
+
};
|
|
48359
|
+
});
|
|
48360
|
+
}
|
|
48361
|
+
function parseLlamaLendResults(data, meta, context) {
|
|
48362
|
+
const { chainId, usdPrices, tokenList } = context;
|
|
48363
|
+
const entries = [];
|
|
48364
|
+
const rawPrice = data[0];
|
|
48365
|
+
if (rawPrice === void 0 || rawPrice === null || rawPrice === "0x") {
|
|
48366
|
+
return entries;
|
|
48367
|
+
}
|
|
48368
|
+
for (const market of meta.markets) {
|
|
48369
|
+
const loanAsset = market.loanAsset.toLowerCase();
|
|
48370
|
+
const collateralAsset = market.collateralAsset.toLowerCase();
|
|
48371
|
+
let collateralInLoan;
|
|
48372
|
+
try {
|
|
48373
|
+
collateralInLoan = Number(formatUnits(BigInt(rawPrice.toString()), 18));
|
|
48374
|
+
} catch {
|
|
48375
|
+
continue;
|
|
48376
|
+
}
|
|
48377
|
+
if (!Number.isFinite(collateralInLoan) || collateralInLoan === 0) continue;
|
|
48378
|
+
const loanOracleKey = tokenList?.[loanAsset]?.assetGroup ?? `${chainId}-${loanAsset}`;
|
|
48379
|
+
const loanAssetUSD = usdPrices[loanOracleKey] ?? usdPrices[loanAsset];
|
|
48380
|
+
if (!loanAssetUSD) continue;
|
|
48381
|
+
const lenderKey = generateLlamaLendLenderKey(market.marketId);
|
|
48382
|
+
entries.push({
|
|
48383
|
+
asset: loanAsset,
|
|
48384
|
+
price: 1,
|
|
48385
|
+
priceUSD: loanAssetUSD,
|
|
48386
|
+
marketUid: createMarketUid(chainId, lenderKey, loanAsset),
|
|
48387
|
+
targetLender: lenderKey,
|
|
48388
|
+
description: "LlamaLend borrowed asset",
|
|
48389
|
+
staticBase: true,
|
|
48390
|
+
baseAsset: loanAsset
|
|
48391
|
+
});
|
|
48392
|
+
entries.push({
|
|
48393
|
+
asset: collateralAsset,
|
|
48394
|
+
price: collateralInLoan,
|
|
48395
|
+
priceUSD: collateralInLoan * loanAssetUSD,
|
|
48396
|
+
marketUid: createMarketUid(chainId, lenderKey, collateralAsset),
|
|
48397
|
+
targetLender: lenderKey,
|
|
48398
|
+
description: "LlamaLend collateral (AMM EMA oracle)",
|
|
48399
|
+
baseAsset: loanAsset
|
|
48400
|
+
});
|
|
48401
|
+
}
|
|
48402
|
+
return entries;
|
|
48403
|
+
}
|
|
48404
|
+
function getLlamaLendAbi() {
|
|
48405
|
+
return LlamaLendAmmAbi;
|
|
48406
|
+
}
|
|
48407
|
+
var llamaLendFetcher = {
|
|
48408
|
+
getCalls: getLlamaLendCalls,
|
|
48409
|
+
parse: parseLlamaLendResults,
|
|
48410
|
+
getAbi: getLlamaLendAbi
|
|
48411
|
+
};
|
|
48162
48412
|
|
|
48163
48413
|
// src/abis/euler/priceLens.ts
|
|
48164
48414
|
var priceLensAbi = [
|
|
@@ -49519,7 +49769,7 @@ async function executeGroup(group, chainId, chainBatchSize, retries, allowFailur
|
|
|
49519
49769
|
};
|
|
49520
49770
|
}
|
|
49521
49771
|
}
|
|
49522
|
-
async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3, batchSize = void 0, allowFailure = true, basePrices = {}, morphoMarketOverrides, listaMarketOverrides, stalenessThresholdSeconds = 3600, onlyFetchers, probeFeedStaleness = true) {
|
|
49772
|
+
async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3, batchSize = void 0, allowFailure = true, basePrices = {}, morphoMarketOverrides, listaMarketOverrides, stalenessThresholdSeconds = 3600, onlyFetchers, probeFeedStaleness = true, llamaLendMarketOverrides) {
|
|
49523
49773
|
const totalStart = Date.now();
|
|
49524
49774
|
const result = {};
|
|
49525
49775
|
const chainPromises = chainIds.map(async (chainId) => {
|
|
@@ -49564,6 +49814,13 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
49564
49814
|
}),
|
|
49565
49815
|
getCallsErrors
|
|
49566
49816
|
) : [];
|
|
49817
|
+
const llamaLendResults = isActive("llamalend") ? safeGetCalls(
|
|
49818
|
+
"llamaLend",
|
|
49819
|
+
() => llamaLendFetcher.getCalls(chainId, {
|
|
49820
|
+
marketOverrides: llamaLendMarketOverrides
|
|
49821
|
+
}),
|
|
49822
|
+
getCallsErrors
|
|
49823
|
+
) : [];
|
|
49567
49824
|
const eulerResults = isActive("eulerv2") ? safeGetCalls(
|
|
49568
49825
|
"eulerV2",
|
|
49569
49826
|
() => eulerV2Fetcher.getCalls(chainId),
|
|
@@ -49684,6 +49941,13 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
49684
49941
|
ProxyOracleAbi,
|
|
49685
49942
|
"direct"
|
|
49686
49943
|
);
|
|
49944
|
+
const llamaLendGroup = buildGroup(
|
|
49945
|
+
"llamaLend",
|
|
49946
|
+
llamaLendResults,
|
|
49947
|
+
llamaLendFetcher.parse,
|
|
49948
|
+
getLlamaLendAbi(),
|
|
49949
|
+
"derived"
|
|
49950
|
+
);
|
|
49687
49951
|
const eulerGroup = buildGroup(
|
|
49688
49952
|
"eulerV2",
|
|
49689
49953
|
eulerResults,
|
|
@@ -49810,6 +50074,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
49810
50074
|
compoundV2Group,
|
|
49811
50075
|
compoundV3Group,
|
|
49812
50076
|
listaGroup,
|
|
50077
|
+
llamaLendGroup,
|
|
49813
50078
|
eulerGroup,
|
|
49814
50079
|
aaveV4Group,
|
|
49815
50080
|
morphoGroup,
|
|
@@ -49857,6 +50122,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
49857
50122
|
compoundV2Data,
|
|
49858
50123
|
compoundV3Data,
|
|
49859
50124
|
listaData,
|
|
50125
|
+
llamaLendData,
|
|
49860
50126
|
eulerData,
|
|
49861
50127
|
aaveV4Data,
|
|
49862
50128
|
fluidData,
|
|
@@ -49907,6 +50173,14 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
49907
50173
|
allowFailure,
|
|
49908
50174
|
rpcOverrides
|
|
49909
50175
|
),
|
|
50176
|
+
executeGroup(
|
|
50177
|
+
llamaLendGroup,
|
|
50178
|
+
chainId,
|
|
50179
|
+
chainBatchSize,
|
|
50180
|
+
retries,
|
|
50181
|
+
allowFailure,
|
|
50182
|
+
rpcOverrides
|
|
50183
|
+
),
|
|
49910
50184
|
executeGroup(
|
|
49911
50185
|
eulerGroup,
|
|
49912
50186
|
chainId,
|
|
@@ -50064,6 +50338,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
50064
50338
|
{ group: compoundV2Group, data: compoundV2Data },
|
|
50065
50339
|
{ group: compoundV3Group, data: compoundV3Data },
|
|
50066
50340
|
{ group: listaGroup, data: listaData },
|
|
50341
|
+
{ group: llamaLendGroup, data: llamaLendData },
|
|
50067
50342
|
{ group: eulerGroup, data: eulerData },
|
|
50068
50343
|
{ group: aaveV4Group, data: aaveV4Data },
|
|
50069
50344
|
{ group: fluidGroup, data: fluidData },
|
|
@@ -50256,6 +50531,7 @@ async function fetchOraclePrices(chainIds, rpcOverrides, lists = {}, retries = 3
|
|
|
50256
50531
|
}
|
|
50257
50532
|
parseTrackers(midnightGroup, midnightData.results, false);
|
|
50258
50533
|
parseTrackers(tellerGroup, tellerData.results, false);
|
|
50534
|
+
parseTrackers(llamaLendGroup, llamaLendData.results, false);
|
|
50259
50535
|
if (stalenessThresholdSeconds > 0) {
|
|
50260
50536
|
const feedTimestamps = await feedTimestampsPromise;
|
|
50261
50537
|
for (const [lender, assetMap] of Object.entries(feedTimestamps)) {
|
|
@@ -54747,6 +55023,38 @@ var readerAnkrRatio = (entry) => ({
|
|
|
54747
55023
|
}
|
|
54748
55024
|
});
|
|
54749
55025
|
|
|
55026
|
+
// src/vaults/lst/abis/binance.ts
|
|
55027
|
+
var WbethExchangeRateAbi = [
|
|
55028
|
+
{
|
|
55029
|
+
name: "exchangeRate",
|
|
55030
|
+
type: "function",
|
|
55031
|
+
stateMutability: "view",
|
|
55032
|
+
inputs: [],
|
|
55033
|
+
outputs: [{ type: "uint256" }]
|
|
55034
|
+
}
|
|
55035
|
+
];
|
|
55036
|
+
|
|
55037
|
+
// src/vaults/lst/readers/binance.ts
|
|
55038
|
+
var readerBinanceWbeth = (entry) => ({
|
|
55039
|
+
calls: [
|
|
55040
|
+
{ address: entry.address, name: "totalSupply", params: [] },
|
|
55041
|
+
{ address: entry.address, name: "exchangeRate", params: [] }
|
|
55042
|
+
],
|
|
55043
|
+
abis: [TotalSupplyAbi, WbethExchangeRateAbi],
|
|
55044
|
+
parse: ([supply, rate]) => {
|
|
55045
|
+
const totalSupply = toBigInt13(supply);
|
|
55046
|
+
const exchangeRate = toBigInt13(rate);
|
|
55047
|
+
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
55048
|
+
return void 0;
|
|
55049
|
+
}
|
|
55050
|
+
return {
|
|
55051
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
55052
|
+
totalSupply,
|
|
55053
|
+
exchangeRate
|
|
55054
|
+
};
|
|
55055
|
+
}
|
|
55056
|
+
});
|
|
55057
|
+
|
|
54750
55058
|
// src/vaults/lst/abis/core.ts
|
|
54751
55059
|
var CoreEarnRateAbi = [
|
|
54752
55060
|
{
|
|
@@ -54869,6 +55177,8 @@ var buildReader = (entry) => {
|
|
|
54869
55177
|
return readerKelpRsEth(entry);
|
|
54870
55178
|
case "swellGetRate":
|
|
54871
55179
|
return readerSwellGetRate(entry);
|
|
55180
|
+
case "binanceWbeth":
|
|
55181
|
+
return readerBinanceWbeth(entry);
|
|
54872
55182
|
case "stakewiseOsEth":
|
|
54873
55183
|
return readerStakeWiseOsEth(entry);
|
|
54874
55184
|
case "staderEthx":
|
|
@@ -55766,6 +56076,96 @@ var readerBenqi = {
|
|
|
55766
56076
|
}
|
|
55767
56077
|
};
|
|
55768
56078
|
|
|
56079
|
+
// src/vaults/lst/withdrawals/abis/binance.ts
|
|
56080
|
+
var BinanceUnwrapQueueAbi = [
|
|
56081
|
+
{
|
|
56082
|
+
name: "getUserWithdrawRequests",
|
|
56083
|
+
type: "function",
|
|
56084
|
+
stateMutability: "view",
|
|
56085
|
+
inputs: [{ type: "address", name: "recipient" }],
|
|
56086
|
+
outputs: [
|
|
56087
|
+
{
|
|
56088
|
+
type: "tuple[]",
|
|
56089
|
+
components: [
|
|
56090
|
+
{ type: "address", name: "recipient" },
|
|
56091
|
+
{ type: "uint256", name: "wbethAmount" },
|
|
56092
|
+
{ type: "uint256", name: "ethAmount" },
|
|
56093
|
+
{ type: "uint256", name: "triggerTime" },
|
|
56094
|
+
{ type: "uint256", name: "claimTime" },
|
|
56095
|
+
{ type: "bool", name: "allocated" }
|
|
56096
|
+
]
|
|
56097
|
+
}
|
|
56098
|
+
]
|
|
56099
|
+
},
|
|
56100
|
+
{
|
|
56101
|
+
// Currently 864000 (10 days). Admin-settable down to
|
|
56102
|
+
// `MIN_LOCK_TIME` = 172800 (2 days) — always read it, never hardcode.
|
|
56103
|
+
name: "lockTime",
|
|
56104
|
+
type: "function",
|
|
56105
|
+
stateMutability: "view",
|
|
56106
|
+
inputs: [],
|
|
56107
|
+
outputs: [{ type: "uint256" }]
|
|
56108
|
+
},
|
|
56109
|
+
{
|
|
56110
|
+
name: "claimWithdraw",
|
|
56111
|
+
type: "function",
|
|
56112
|
+
stateMutability: "nonpayable",
|
|
56113
|
+
inputs: [{ type: "uint256", name: "index" }],
|
|
56114
|
+
outputs: [{ type: "uint256" }]
|
|
56115
|
+
}
|
|
56116
|
+
];
|
|
56117
|
+
|
|
56118
|
+
// src/vaults/lst/withdrawals/readers/binance.ts
|
|
56119
|
+
var readerBinanceWbeth2 = {
|
|
56120
|
+
fetch: async (user, multicallRetry, chainId, entry) => {
|
|
56121
|
+
if (!entry.withdrawalContract) return [];
|
|
56122
|
+
const res = await multicallRetry({
|
|
56123
|
+
chain: chainId,
|
|
56124
|
+
calls: [
|
|
56125
|
+
{
|
|
56126
|
+
address: entry.withdrawalContract,
|
|
56127
|
+
name: "getUserWithdrawRequests",
|
|
56128
|
+
params: [user]
|
|
56129
|
+
},
|
|
56130
|
+
{
|
|
56131
|
+
address: entry.withdrawalContract,
|
|
56132
|
+
name: "lockTime",
|
|
56133
|
+
params: []
|
|
56134
|
+
}
|
|
56135
|
+
],
|
|
56136
|
+
abi: [BinanceUnwrapQueueAbi, BinanceUnwrapQueueAbi]
|
|
56137
|
+
});
|
|
56138
|
+
const reqs = res[0];
|
|
56139
|
+
const lockTime = toNumber(res[1]);
|
|
56140
|
+
if (!Array.isArray(reqs) || lockTime === void 0) return [];
|
|
56141
|
+
const out = [];
|
|
56142
|
+
for (let i = 0; i < reqs.length; i++) {
|
|
56143
|
+
const r = reqs[i];
|
|
56144
|
+
const triggerTime = toNumber(r.triggerTime);
|
|
56145
|
+
const ethAmount = toBigInt14(r.ethAmount);
|
|
56146
|
+
const wbethAmount = toBigInt14(r.wbethAmount);
|
|
56147
|
+
if (triggerTime === void 0 || ethAmount === void 0) continue;
|
|
56148
|
+
const readyAt = triggerTime + lockTime;
|
|
56149
|
+
const claimed = (toNumber(r.claimTime) ?? 0) > 0;
|
|
56150
|
+
const allocated = r.allocated === true;
|
|
56151
|
+
out.push({
|
|
56152
|
+
lst: entry.lst,
|
|
56153
|
+
brand: entry.brand,
|
|
56154
|
+
symbol: entry.symbol,
|
|
56155
|
+
// Positional — see note 1 above.
|
|
56156
|
+
requestId: String(i),
|
|
56157
|
+
amountUnderlying: ethAmount.toString(),
|
|
56158
|
+
shares: wbethAmount?.toString(),
|
|
56159
|
+
// Claimed requests are popped from the array, so this branch is
|
|
56160
|
+
// defensive only.
|
|
56161
|
+
status: claimed ? "claimed" : allocated ? computeStatus(readyAt) : "pending",
|
|
56162
|
+
readyAt
|
|
56163
|
+
});
|
|
56164
|
+
}
|
|
56165
|
+
return out;
|
|
56166
|
+
}
|
|
56167
|
+
};
|
|
56168
|
+
|
|
55769
56169
|
// src/vaults/lst/withdrawals/abis/berapaw.ts
|
|
55770
56170
|
var BeraPawForgeWithdrawalAbi = [
|
|
55771
56171
|
{
|
|
@@ -57907,6 +58307,8 @@ var readerYieldNest = {
|
|
|
57907
58307
|
// src/vaults/lst/withdrawals/readers/index.ts
|
|
57908
58308
|
var buildWithdrawalReader = (entry) => {
|
|
57909
58309
|
switch (entry.reader) {
|
|
58310
|
+
case "binanceWbethQueue":
|
|
58311
|
+
return readerBinanceWbeth2;
|
|
57910
58312
|
case "lidoQueue":
|
|
57911
58313
|
return readerLido;
|
|
57912
58314
|
case "etherfiNft":
|
|
@@ -57972,6 +58374,20 @@ var buildWithdrawalReader = (entry) => {
|
|
|
57972
58374
|
// src/vaults/lst/withdrawals/registry.ts
|
|
57973
58375
|
var LST_WITHDRAWAL_REGISTRY = {
|
|
57974
58376
|
"1": [
|
|
58377
|
+
{
|
|
58378
|
+
// wBETH — Binance's UnwrapTokenV1 queue, the SAME contract address
|
|
58379
|
+
// on Ethereum and BNB. Entered via `wBETH.requestWithdrawEth`;
|
|
58380
|
+
// `getUserWithdrawRequests(user)` enumerates open requests, and
|
|
58381
|
+
// `claimWithdraw(index)` takes the user's ARRAY POSITION (swap-and-pop,
|
|
58382
|
+
// so ids shift on every claim — never cache them). `lockTime()` is
|
|
58383
|
+
// 10 days today but is admin-settable down to 2, and the ETH owed is
|
|
58384
|
+
// frozen at request time, so the position stops earning meanwhile.
|
|
58385
|
+
lst: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
58386
|
+
brand: "Binance",
|
|
58387
|
+
symbol: "wBETH",
|
|
58388
|
+
reader: "binanceWbethQueue",
|
|
58389
|
+
withdrawalContract: "0x79973d557cd9dd87eb61e250cc2572c990e20196"
|
|
58390
|
+
},
|
|
57975
58391
|
// Ankr ankrETH — Ankr unstake queue; reader not yet implemented.
|
|
57976
58392
|
{
|
|
57977
58393
|
lst: "0xe95a203b1a91a908f9b9ce46459d101078c2c3cb",
|
|
@@ -58344,6 +58760,20 @@ var LST_WITHDRAWAL_REGISTRY = {
|
|
|
58344
58760
|
}
|
|
58345
58761
|
],
|
|
58346
58762
|
"56": [
|
|
58763
|
+
{
|
|
58764
|
+
// wBETH — Binance's UnwrapTokenV1 queue, the SAME contract address
|
|
58765
|
+
// on Ethereum and BNB. Entered via `wBETH.requestWithdrawEth`;
|
|
58766
|
+
// `getUserWithdrawRequests(user)` enumerates open requests, and
|
|
58767
|
+
// `claimWithdraw(index)` takes the user's ARRAY POSITION (swap-and-pop,
|
|
58768
|
+
// so ids shift on every claim — never cache them). `lockTime()` is
|
|
58769
|
+
// 10 days today but is admin-settable down to 2, and the ETH owed is
|
|
58770
|
+
// frozen at request time, so the position stops earning meanwhile.
|
|
58771
|
+
lst: "0xa2e3356610840701bdf5611a53974510ae27e2e1",
|
|
58772
|
+
brand: "Binance",
|
|
58773
|
+
symbol: "wBETH",
|
|
58774
|
+
reader: "binanceWbethQueue",
|
|
58775
|
+
withdrawalContract: "0x79973d557cd9dd87eb61e250cc2572c990e20196"
|
|
58776
|
+
},
|
|
58347
58777
|
// Ankr ankrBNB — Ankr unstake queue; reader not yet implemented.
|
|
58348
58778
|
{
|
|
58349
58779
|
lst: "0x52f24a5e03aee338da5fd9df68d2b6fae1178827",
|
|
@@ -64633,6 +65063,26 @@ var llamaLendAdapter = {
|
|
|
64633
65063
|
] : void 0,
|
|
64634
65064
|
bandLtv,
|
|
64635
65065
|
defaultBands: typeof ll.defaultBands === "number" ? ll.defaultBands : void 0,
|
|
65066
|
+
/**
|
|
65067
|
+
* The band count as an editable TERM, not just a curve to read.
|
|
65068
|
+
*
|
|
65069
|
+
* `bandLtv` alone cannot drive a control: it is four sampled points,
|
|
65070
|
+
* and it is missing on any market whose curve could not be computed.
|
|
65071
|
+
* The domain is always known — `MIN_TICKS`/`MAX_TICKS` are 4..50 on
|
|
65072
|
+
* both generations — so the control works even where the curve does
|
|
65073
|
+
* not.
|
|
65074
|
+
*
|
|
65075
|
+
* `immutableAfterOpen` is what tells the UI to render this read-only
|
|
65076
|
+
* on an existing loan: `_add_collateral_borrow` reuses the tick
|
|
65077
|
+
* width, so changing N means closing and reopening.
|
|
65078
|
+
*/
|
|
65079
|
+
openParameter: {
|
|
65080
|
+
kind: "llamalend-bands",
|
|
65081
|
+
dimension: "collateralFactor",
|
|
65082
|
+
domain: { min: 4, max: 50 },
|
|
65083
|
+
default: typeof ll.defaultBands === "number" ? ll.defaultBands : 10,
|
|
65084
|
+
immutableAfterOpen: true
|
|
65085
|
+
},
|
|
64636
65086
|
badDebt: "socialized"
|
|
64637
65087
|
},
|
|
64638
65088
|
counterparty: { kind: "pool", solvency: "overcollateralized" }
|
|
@@ -65361,6 +65811,6 @@ function validateTermSheets(sheets) {
|
|
|
65361
65811
|
return sheets.flatMap((s) => validateTermSheet(s));
|
|
65362
65812
|
}
|
|
65363
65813
|
|
|
65364
|
-
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EMPTY_BALANCE, EXACTLY_LENDER_KEY, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
|
65814
|
+
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EMPTY_BALANCE, EXACTLY_LENDER_KEY, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
|
65365
65815
|
//# sourceMappingURL=index.js.map
|
|
65366
65816
|
//# sourceMappingURL=index.js.map
|