@1delta/margin-fetcher 5.0.159 → 5.0.160
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 +670 -5
- package/dist/index.js +840 -502
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -21380,7 +21380,7 @@ function parseVault(vault, chainId, prices, additionalYields, tokenList, liquidi
|
|
|
21380
21380
|
const meta = tokenList[leg.token];
|
|
21381
21381
|
const priceKey = priceKeyFor(leg.token);
|
|
21382
21382
|
const liquidity = liquidityByToken[leg.token];
|
|
21383
|
-
const
|
|
21383
|
+
const row2 = {
|
|
21384
21384
|
marketUid,
|
|
21385
21385
|
name: "",
|
|
21386
21386
|
poolId: leg.token,
|
|
@@ -21490,41 +21490,41 @@ function parseVault(vault, chainId, prices, additionalYields, tokenList, liquidi
|
|
|
21490
21490
|
// Price cached for the second pass; stripped before returning.
|
|
21491
21491
|
__price: prices[priceKey] ?? 0
|
|
21492
21492
|
};
|
|
21493
|
-
data[marketUid] =
|
|
21494
|
-
return
|
|
21493
|
+
data[marketUid] = row2;
|
|
21494
|
+
return row2;
|
|
21495
21495
|
};
|
|
21496
21496
|
for (const leg of colLegs) {
|
|
21497
|
-
const
|
|
21498
|
-
const price2 =
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21511
|
-
|
|
21497
|
+
const row2 = ensureRow(leg);
|
|
21498
|
+
const price2 = row2.__price;
|
|
21499
|
+
row2.totalDeposits += leg.amount;
|
|
21500
|
+
row2.totalLiquidity += leg.amount;
|
|
21501
|
+
row2.totalDepositsUSD += leg.amount * price2;
|
|
21502
|
+
row2.totalLiquidityUSD += leg.amount * price2;
|
|
21503
|
+
row2.depositRate = leg.rate;
|
|
21504
|
+
row2.collateralActive = true;
|
|
21505
|
+
row2.depositsEnabled = true;
|
|
21506
|
+
row2.liquidationBonus = liquidationPenalty;
|
|
21507
|
+
row2.config["0"].borrowCollateralFactor = ltv;
|
|
21508
|
+
row2.config["0"].collateralFactor = liquidationThreshold;
|
|
21509
|
+
row2.config["0"].liquidationPenalty = liquidationPenalty;
|
|
21510
|
+
row2.config["0"].collateralDisabled = false;
|
|
21511
|
+
row2.name = "Collateral " + (row2.asset?.symbol ?? "");
|
|
21512
21512
|
}
|
|
21513
21513
|
for (const leg of debtLegs) {
|
|
21514
|
-
const
|
|
21515
|
-
const price2 =
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
if (!
|
|
21526
|
-
}
|
|
21527
|
-
for (const
|
|
21514
|
+
const row2 = ensureRow(leg);
|
|
21515
|
+
const price2 = row2.__price;
|
|
21516
|
+
row2.totalDebt += leg.amount;
|
|
21517
|
+
row2.totalLiquidity += leg.available;
|
|
21518
|
+
row2.borrowLiquidity += leg.available;
|
|
21519
|
+
row2.totalDebtUSD += leg.amount * price2;
|
|
21520
|
+
row2.totalLiquidityUSD += leg.available * price2;
|
|
21521
|
+
row2.borrowLiquidityUSD += leg.available * price2;
|
|
21522
|
+
row2.variableBorrowRate = leg.rate;
|
|
21523
|
+
row2.borrowingEnabled = true;
|
|
21524
|
+
row2.config["0"].debtDisabled = false;
|
|
21525
|
+
if (!row2.collateralActive) row2.name = "Loan " + (row2.asset?.symbol ?? "");
|
|
21526
|
+
}
|
|
21527
|
+
for (const row2 of Object.values(data)) delete row2.__price;
|
|
21528
21528
|
const llSupply = vault.liquidityUserSupplyData;
|
|
21529
21529
|
const liquidityUserSupply = llSupply ? {
|
|
21530
21530
|
withdrawable: colLegs[0]?.available ?? 0,
|
|
@@ -27100,9 +27100,9 @@ async function fetchLlamaLendMarkets(lender, chainId) {
|
|
|
27100
27100
|
const base = llamaLendApiBaseUrl(lender, chainId);
|
|
27101
27101
|
const api = await fetchJson2(`${base}/v1/getLendingVaults/all`);
|
|
27102
27102
|
const byController = {};
|
|
27103
|
-
for (const
|
|
27104
|
-
const c =
|
|
27105
|
-
if (c) byController[String(c).toLowerCase()] =
|
|
27103
|
+
for (const row2 of api?.data?.lendingVaultData ?? []) {
|
|
27104
|
+
const c = row2?.controllerAddress;
|
|
27105
|
+
if (c) byController[String(c).toLowerCase()] = row2;
|
|
27106
27106
|
}
|
|
27107
27107
|
if (Object.keys(byController).length > 0) {
|
|
27108
27108
|
const extras = await extrasPromise;
|
|
@@ -27475,7 +27475,7 @@ async function fetchResupplyMarkets(lender, chainId, multicallRetry = multicallR
|
|
|
27475
27475
|
const accounting = results[base + 5];
|
|
27476
27476
|
const rateInfo = results[base + 6];
|
|
27477
27477
|
const exchangeInfo = results[base + 7];
|
|
27478
|
-
const
|
|
27478
|
+
const tuple2 = (v, idx) => Array.isArray(v) ? big3(v[idx]) : null;
|
|
27479
27479
|
return {
|
|
27480
27480
|
identity,
|
|
27481
27481
|
maxLTV: big3(results[base]),
|
|
@@ -27483,11 +27483,11 @@ async function fetchResupplyMarkets(lender, chainId, multicallRetry = multicallR
|
|
|
27483
27483
|
liquidationFee: big3(results[base + 2]),
|
|
27484
27484
|
mintFee: big3(results[base + 3]),
|
|
27485
27485
|
minimumBorrowAmount: big3(results[base + 4]),
|
|
27486
|
-
totalBorrowAmount:
|
|
27487
|
-
totalBorrowShares:
|
|
27488
|
-
totalCollateral:
|
|
27489
|
-
ratePerSec:
|
|
27490
|
-
exchangeRate:
|
|
27486
|
+
totalBorrowAmount: tuple2(accounting, 1),
|
|
27487
|
+
totalBorrowShares: tuple2(accounting, 2),
|
|
27488
|
+
totalCollateral: tuple2(accounting, 3),
|
|
27489
|
+
ratePerSec: tuple2(rateInfo, 1),
|
|
27490
|
+
exchangeRate: tuple2(exchangeInfo, 2),
|
|
27491
27491
|
collateralPrice: big3(results[base + 8]),
|
|
27492
27492
|
// Indices follow the PUSH ORDER above exactly: the two reward reads sit
|
|
27493
27493
|
// at +9/+10, BEFORE the lens block, so the lens reads are +11/+12.
|
|
@@ -27944,7 +27944,7 @@ async function fetchViaMulticall(lender, chainId, config, multicallRetry) {
|
|
|
27944
27944
|
);
|
|
27945
27945
|
return;
|
|
27946
27946
|
}
|
|
27947
|
-
const
|
|
27947
|
+
const tuple2 = (v, idx) => Array.isArray(v) ? big4(v[idx]) : 0n;
|
|
27948
27948
|
const held = big4(results[base + 10]);
|
|
27949
27949
|
const debt = big4(results[base + 9]);
|
|
27950
27950
|
const token = {
|
|
@@ -27956,12 +27956,12 @@ async function fetchViaMulticall(lender, chainId, config, multicallRetry) {
|
|
|
27956
27956
|
assetSymbol: str(assetMeta[i * 3], "?"),
|
|
27957
27957
|
assetDecimals: num3(assetMeta[i * 3 + 1], 18),
|
|
27958
27958
|
assetName: str(assetMeta[i * 3 + 2], "?"),
|
|
27959
|
-
collRatio:
|
|
27960
|
-
collReqSoft:
|
|
27961
|
-
collReqHard:
|
|
27962
|
-
liqIncBase:
|
|
27963
|
-
liqIncCurve:
|
|
27964
|
-
closeFactorBase:
|
|
27959
|
+
collRatio: tuple2(coll, 0),
|
|
27960
|
+
collReqSoft: tuple2(coll, 1),
|
|
27961
|
+
collReqHard: tuple2(coll, 2),
|
|
27962
|
+
liqIncBase: tuple2(liq, 0),
|
|
27963
|
+
liqIncCurve: tuple2(liq, 1),
|
|
27964
|
+
closeFactorBase: tuple2(liq, 4),
|
|
27965
27965
|
maxLeverage: 0n,
|
|
27966
27966
|
collateralCap: big4(results[base + 2]),
|
|
27967
27967
|
debtCap: big4(results[base + 3]),
|
|
@@ -31325,34 +31325,34 @@ function currencyFor17(address, decimals, symbol, tokens) {
|
|
|
31325
31325
|
function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYields = { intrinsicYields: {}, lenderRewards: {}, loaded: true }, tokens = {}) {
|
|
31326
31326
|
const out = {};
|
|
31327
31327
|
if (!raw?.config) return out;
|
|
31328
|
-
for (const
|
|
31329
|
-
const m =
|
|
31330
|
-
if (
|
|
31328
|
+
for (const row2 of raw.markets ?? []) {
|
|
31329
|
+
const m = row2.market;
|
|
31330
|
+
if (row2.externalLiqLtv === void 0 || row2.maxTwyneLiqLtv === void 0) continue;
|
|
31331
31331
|
const lenderKey = twyneLenderKey(raw.lender, chainId, m.intermediateVault, m.targetAsset);
|
|
31332
31332
|
const entry2 = { data: {} };
|
|
31333
|
-
const buffer =
|
|
31334
|
-
const floorLtv = Number(
|
|
31335
|
-
const maxLtv = Number(
|
|
31336
|
-
const extLtv = Number(
|
|
31333
|
+
const buffer = row2.externalLiqBuffer ?? BigInt(BPS5);
|
|
31334
|
+
const floorLtv = Number(row2.externalLiqLtv * buffer) / (BPS5 * BPS5);
|
|
31335
|
+
const maxLtv = Number(row2.maxTwyneLiqLtv) / BPS5;
|
|
31336
|
+
const extLtv = Number(row2.externalLiqLtv) / BPS5;
|
|
31337
31337
|
const collAddr = m.underlyingAsset.toLowerCase();
|
|
31338
31338
|
const debtAddr = m.targetAsset.toLowerCase();
|
|
31339
31339
|
const collToken = tokens[collAddr];
|
|
31340
31340
|
const debtToken = tokens[debtAddr];
|
|
31341
31341
|
const collPrice = prices[toOracleKey(collToken?.assetGroup) || toGenericPriceKey(collAddr, chainId)] || 0;
|
|
31342
31342
|
const debtPrice = prices[toOracleKey(debtToken?.assetGroup) || toGenericPriceKey(debtAddr, chainId)] || 0;
|
|
31343
|
-
const creditTotal = toFloat2(
|
|
31344
|
-
const creditAvailable = toFloat2(
|
|
31345
|
-
const creditUtilization =
|
|
31346
|
-
const creditApr = spyToApr(
|
|
31347
|
-
const externalBorrowLiquidity = toFloat2(
|
|
31348
|
-
const openHalted =
|
|
31343
|
+
const creditTotal = toFloat2(row2.creditTotalAssets, row2.creditDecimals);
|
|
31344
|
+
const creditAvailable = toFloat2(row2.creditCash, row2.creditDecimals);
|
|
31345
|
+
const creditUtilization = row2.creditTotalAssets > 0n ? Number(row2.creditTotalBorrows) / Number(row2.creditTotalAssets) : 0;
|
|
31346
|
+
const creditApr = spyToApr(row2.creditRateSpy);
|
|
31347
|
+
const externalBorrowLiquidity = toFloat2(row2.externalBorrowLiquidity, row2.targetDecimals);
|
|
31348
|
+
const openHalted = row2.paused || row2.collateralMatured || creditAvailable <= 0;
|
|
31349
31349
|
const collUid = createMarketUid(chainId, lenderKey, collAddr);
|
|
31350
31350
|
entry2.data[collUid] = {
|
|
31351
31351
|
marketUid: collUid,
|
|
31352
31352
|
name: m.symbol ?? collToken?.symbol ?? "collateral",
|
|
31353
31353
|
poolId: m.intermediateVault.toLowerCase(),
|
|
31354
31354
|
underlying: collAddr,
|
|
31355
|
-
asset: currencyFor17(collAddr,
|
|
31355
|
+
asset: currencyFor17(collAddr, row2.collateralDecimals, m.symbol ?? "", tokens),
|
|
31356
31356
|
totalDeposits: creditTotal,
|
|
31357
31357
|
totalDebtStable: 0,
|
|
31358
31358
|
totalDebt: 0,
|
|
@@ -31375,13 +31375,13 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31375
31375
|
// staking rate — and the stack joins it in as `intrinsicYield`. Do not
|
|
31376
31376
|
// "fix" this by substituting the intrinsic rate here; that would
|
|
31377
31377
|
// double-count it.
|
|
31378
|
-
depositRate: (
|
|
31378
|
+
depositRate: (row2.externalSupplyRate ?? 0) * 100,
|
|
31379
31379
|
variableBorrowRate: 0,
|
|
31380
31380
|
stableBorrowRate: 0,
|
|
31381
31381
|
rateModel: "twyne-curve",
|
|
31382
31382
|
intrinsicYield: 0,
|
|
31383
31383
|
rewards: void 0,
|
|
31384
|
-
decimals:
|
|
31384
|
+
decimals: row2.collateralDecimals,
|
|
31385
31385
|
config: {
|
|
31386
31386
|
0: {
|
|
31387
31387
|
category: 0,
|
|
@@ -31427,8 +31427,8 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31427
31427
|
depositsEnabled: !openHalted,
|
|
31428
31428
|
hasStable: false,
|
|
31429
31429
|
variableBorrowDisabled: true,
|
|
31430
|
-
isActive: !
|
|
31431
|
-
isFrozen:
|
|
31430
|
+
isActive: !row2.paused,
|
|
31431
|
+
isFrozen: row2.paused
|
|
31432
31432
|
};
|
|
31433
31433
|
const debtUid = createMarketUid(chainId, lenderKey, debtAddr);
|
|
31434
31434
|
entry2.data[debtUid] = {
|
|
@@ -31436,7 +31436,7 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31436
31436
|
name: debtToken?.symbol ?? "debt",
|
|
31437
31437
|
poolId: m.intermediateVault.toLowerCase(),
|
|
31438
31438
|
underlying: debtAddr,
|
|
31439
|
-
asset: currencyFor17(debtAddr,
|
|
31439
|
+
asset: currencyFor17(debtAddr, row2.targetDecimals, debtToken?.symbol ?? "", tokens),
|
|
31440
31440
|
// Borrower aggregates are NOT readable without an event replay — see the
|
|
31441
31441
|
// header. Zero here means "not measured", and the descriptor says so.
|
|
31442
31442
|
totalDeposits: 0,
|
|
@@ -31454,12 +31454,12 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31454
31454
|
// THE market's borrow rate: the external protocol's. The Twyne credit leg
|
|
31455
31455
|
// is charged on reserved credit in the COLLATERAL asset, so it cannot be
|
|
31456
31456
|
// added to this number — its effective contribution is per-position.
|
|
31457
|
-
variableBorrowRate: (
|
|
31457
|
+
variableBorrowRate: (row2.externalBorrowRate ?? 0) * 100,
|
|
31458
31458
|
stableBorrowRate: 0,
|
|
31459
31459
|
rateModel: "twyne-curve",
|
|
31460
31460
|
intrinsicYield: 0,
|
|
31461
31461
|
rewards: void 0,
|
|
31462
|
-
decimals:
|
|
31462
|
+
decimals: row2.targetDecimals,
|
|
31463
31463
|
config: {
|
|
31464
31464
|
0: {
|
|
31465
31465
|
category: 0,
|
|
@@ -31478,8 +31478,8 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31478
31478
|
depositsEnabled: false,
|
|
31479
31479
|
hasStable: false,
|
|
31480
31480
|
variableBorrowDisabled: openHalted,
|
|
31481
|
-
isActive: !
|
|
31482
|
-
isFrozen:
|
|
31481
|
+
isActive: !row2.paused,
|
|
31482
|
+
isFrozen: row2.paused
|
|
31483
31483
|
};
|
|
31484
31484
|
entry2.params = {
|
|
31485
31485
|
market: {
|
|
@@ -31491,14 +31491,14 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31491
31491
|
// fallback exists for a roster row published before the label did, and
|
|
31492
31492
|
// must not silently degrade to the ambiguous form.
|
|
31493
31493
|
name: m.name ?? `${m.symbol ?? "?"} / ${debtToken?.symbol ?? "?"} \xB7 ${m.vaultType === "AAVE_V3" ? "Aave V3" : "Euler V2"}`,
|
|
31494
|
-
loanDecimals:
|
|
31495
|
-
collateralDecimals:
|
|
31494
|
+
loanDecimals: row2.targetDecimals,
|
|
31495
|
+
collateralDecimals: row2.collateralDecimals,
|
|
31496
31496
|
id: m.intermediateVault.toLowerCase(),
|
|
31497
31497
|
// The FLOOR, in the protocol's own 1e4 scale. Never the ceiling: a
|
|
31498
31498
|
// consumer rendering one number must render the conservative one.
|
|
31499
31499
|
lltv: String(Math.round(floorLtv * BPS5)),
|
|
31500
31500
|
oracle: raw.config.oracleRouter ?? zeroAddress,
|
|
31501
|
-
irm:
|
|
31501
|
+
irm: row2.creditIrm ?? zeroAddress,
|
|
31502
31502
|
collateralAddress: collAddr,
|
|
31503
31503
|
loanAddress: debtAddr,
|
|
31504
31504
|
twyne: {
|
|
@@ -31529,22 +31529,22 @@ function convertTwyneMarketsToResponse(raw, chainId, prices = {}, _additionalYie
|
|
|
31529
31529
|
* per position. Never add it to `variableBorrowRate`.
|
|
31530
31530
|
*/
|
|
31531
31531
|
creditApr,
|
|
31532
|
-
creditRateSpy:
|
|
31532
|
+
creditRateSpy: row2.creditRateSpy.toString(),
|
|
31533
31533
|
creditUtilization,
|
|
31534
31534
|
/** Credit still reservable. Zero ⇒ no new position can raise its LTV
|
|
31535
31535
|
* above the floor, however healthy the market otherwise looks. */
|
|
31536
31536
|
creditAvailable,
|
|
31537
31537
|
creditTotal,
|
|
31538
|
-
creditIrm:
|
|
31538
|
+
creditIrm: row2.creditIrm,
|
|
31539
31539
|
/** Cap headroom for Credit-LPs, in collateral-asset units. */
|
|
31540
|
-
creditDepositCapacity:
|
|
31540
|
+
creditDepositCapacity: row2.creditDepositCapacity === void 0 ? void 0 : row2.creditDepositCapacity.toString(),
|
|
31541
31541
|
/** Unix seconds; absent when the collateral has no maturity. */
|
|
31542
31542
|
collateralMaturity: m.collateralMaturity,
|
|
31543
31543
|
/** Computed at READ time. Two of the three live PT markets are past
|
|
31544
31544
|
* it — a stored flag would be stale. */
|
|
31545
|
-
collateralMatured:
|
|
31545
|
+
collateralMatured: row2.collateralMatured,
|
|
31546
31546
|
/** Factory-wide pause; blocks deposits, borrows and LTV changes. */
|
|
31547
|
-
paused:
|
|
31547
|
+
paused: row2.paused,
|
|
31548
31548
|
/**
|
|
31549
31549
|
* Borrower-side aggregates are absent, not zero. Positions are
|
|
31550
31550
|
* per-borrower CONTRACTS and the factory only enumerates them per
|
|
@@ -33469,17 +33469,17 @@ async function enrichMorphoCollateralTotals(chainId, result, prices, multicallRe
|
|
|
33469
33469
|
if (balance === void 0) return;
|
|
33470
33470
|
const total = balance - (idleByToken.get(token) ?? 0);
|
|
33471
33471
|
if (!Number.isFinite(total) || total < 0) return;
|
|
33472
|
-
const
|
|
33473
|
-
if (!
|
|
33474
|
-
const priceKey = toOracleKey(
|
|
33472
|
+
const row2 = result[m.bucket]?.data?.[m.collateralUid];
|
|
33473
|
+
if (!row2) return;
|
|
33474
|
+
const priceKey = toOracleKey(row2.asset?.assetGroup ?? null) || toGenericPriceKey(token, chainId);
|
|
33475
33475
|
const price2 = prices[priceKey] ?? 0;
|
|
33476
33476
|
const usd = total * price2;
|
|
33477
|
-
|
|
33478
|
-
|
|
33479
|
-
|
|
33480
|
-
|
|
33481
|
-
|
|
33482
|
-
|
|
33477
|
+
row2.totalDeposits = total;
|
|
33478
|
+
row2.totalLiquidity = total;
|
|
33479
|
+
row2.borrowLiquidity = total;
|
|
33480
|
+
row2.totalDepositsUSD = usd;
|
|
33481
|
+
row2.totalLiquidityUSD = usd;
|
|
33482
|
+
row2.borrowLiquidityUSD = usd;
|
|
33483
33483
|
});
|
|
33484
33484
|
return result;
|
|
33485
33485
|
}
|
|
@@ -40742,7 +40742,7 @@ var getRipeUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
40742
40742
|
let any = false;
|
|
40743
40743
|
let deposits24h = 0;
|
|
40744
40744
|
let debt24h = 0;
|
|
40745
|
-
const
|
|
40745
|
+
const row2 = (uid, asset, m) => ({
|
|
40746
40746
|
marketUid: uid,
|
|
40747
40747
|
underlying: asset,
|
|
40748
40748
|
deposits: "0",
|
|
@@ -40771,7 +40771,7 @@ var getRipeUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
40771
40771
|
deposits24h += amtNum * (m?.price?.priceUsd24h ?? display);
|
|
40772
40772
|
any = true;
|
|
40773
40773
|
rows[uid] = {
|
|
40774
|
-
...
|
|
40774
|
+
...row2(uid, asset, m),
|
|
40775
40775
|
deposits: amtStr,
|
|
40776
40776
|
depositsUSD: amtNum * display,
|
|
40777
40777
|
depositsUSDOracle: amtNum * oracle,
|
|
@@ -40790,7 +40790,7 @@ var getRipeUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
40790
40790
|
debt24h += amtNum * (m?.price?.priceUsd24h ?? display);
|
|
40791
40791
|
any = true;
|
|
40792
40792
|
rows[uid] = {
|
|
40793
|
-
...
|
|
40793
|
+
...row2(uid, green, m),
|
|
40794
40794
|
debt: amtStr,
|
|
40795
40795
|
debtUSD: amtNum * display,
|
|
40796
40796
|
debtUSDOracle: amtNum * oracle,
|
|
@@ -41981,11 +41981,11 @@ var getTwyneUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
41981
41981
|
const lendingPositions = {};
|
|
41982
41982
|
const modes = {};
|
|
41983
41983
|
const hist = {};
|
|
41984
|
-
for (const
|
|
41985
|
-
const id =
|
|
41986
|
-
const collStr = parseRawAmount(
|
|
41984
|
+
for (const row2 of market.rows) {
|
|
41985
|
+
const id = row2.info.collateralVault;
|
|
41986
|
+
const collStr = parseRawAmount(row2.coll.toString(), collDecimals);
|
|
41987
41987
|
const collNum = Number(collStr);
|
|
41988
|
-
const debtStr = parseRawAmount(
|
|
41988
|
+
const debtStr = parseRawAmount(row2.debt.toString(), debtDecimals);
|
|
41989
41989
|
const debtNum = Number(debtStr);
|
|
41990
41990
|
lendingPositions[id] = {
|
|
41991
41991
|
[collUid]: {
|
|
@@ -42003,7 +42003,7 @@ var getTwyneUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
42003
42003
|
stableBorrowRate: "0",
|
|
42004
42004
|
collateralEnabled: true,
|
|
42005
42005
|
claimableRewards: 0,
|
|
42006
|
-
twyneInfo:
|
|
42006
|
+
twyneInfo: row2.info
|
|
42007
42007
|
},
|
|
42008
42008
|
[debtUid]: {
|
|
42009
42009
|
marketUid: debtUid,
|
|
@@ -42020,10 +42020,10 @@ var getTwyneUserDataConverter = (lender, chainId, account, meta, opts) => {
|
|
|
42020
42020
|
stableBorrowRate: "0",
|
|
42021
42021
|
collateralEnabled: false,
|
|
42022
42022
|
claimableRewards: 0,
|
|
42023
|
-
twyneInfo:
|
|
42023
|
+
twyneInfo: row2.info
|
|
42024
42024
|
}
|
|
42025
42025
|
};
|
|
42026
|
-
modes[id] = Number(
|
|
42026
|
+
modes[id] = Number(row2.info.twyneLiqLtv) / 1e4;
|
|
42027
42027
|
hist[id] = {
|
|
42028
42028
|
totalDeposits24h: collNum * collHist,
|
|
42029
42029
|
totalDebt24h: debtNum * debtHist
|
|
@@ -42240,11 +42240,11 @@ var getFrankencoinUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
42240
42240
|
const lendingPositions = {};
|
|
42241
42241
|
const modes = {};
|
|
42242
42242
|
const hist = {};
|
|
42243
|
-
for (const
|
|
42244
|
-
const id =
|
|
42245
|
-
const collStr = parseRawAmount(
|
|
42243
|
+
for (const row2 of rows) {
|
|
42244
|
+
const id = row2.info.position;
|
|
42245
|
+
const collStr = parseRawAmount(row2.coll.toString(), collDecimals);
|
|
42246
42246
|
const collNum = Number(collStr);
|
|
42247
|
-
const debtStr = parseRawAmount(
|
|
42247
|
+
const debtStr = parseRawAmount(row2.debt.toString(), debtDecimals);
|
|
42248
42248
|
const debtNum = Number(debtStr);
|
|
42249
42249
|
lendingPositions[id] = {
|
|
42250
42250
|
[collUid]: {
|
|
@@ -42278,7 +42278,7 @@ var getFrankencoinUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
42278
42278
|
stableBorrowRate: "0",
|
|
42279
42279
|
collateralEnabled: false,
|
|
42280
42280
|
claimableRewards: 0,
|
|
42281
|
-
frankencoinInfo:
|
|
42281
|
+
frankencoinInfo: row2.info
|
|
42282
42282
|
}
|
|
42283
42283
|
};
|
|
42284
42284
|
modes[id] = 0;
|
|
@@ -53435,6 +53435,7 @@ var USD3_GROUP_KEY = "3Jane USD3::USD3";
|
|
|
53435
53435
|
var SUSD3_GROUP_KEY = "3Jane Staked USD3::sUSD3";
|
|
53436
53436
|
var USD3_LEGACY_GROUP_KEY = "USD3::USD3";
|
|
53437
53437
|
var SUSD3_LEGACY_GROUP_KEY = "sUSD3::sUSD3";
|
|
53438
|
+
var USD3L_GROUP_KEY = "USD3 Notification Vault::USD3l";
|
|
53438
53439
|
var USD3_POOL = "f8cd444e-d99f-4132-b234-fd3482bf8806";
|
|
53439
53440
|
var SUSD3_POOL = "a99bb965-ebaa-4d98-9ed2-fa18de52c605";
|
|
53440
53441
|
var threeJaneFetcher = {
|
|
@@ -53450,6 +53451,7 @@ var threeJaneFetcher = {
|
|
|
53450
53451
|
out[USD3_KEY] = apr;
|
|
53451
53452
|
out[USD3_GROUP_KEY] = apr;
|
|
53452
53453
|
out[USD3_LEGACY_GROUP_KEY] = apr;
|
|
53454
|
+
out[USD3L_GROUP_KEY] = apr;
|
|
53453
53455
|
}
|
|
53454
53456
|
if (susd3.status === "fulfilled") {
|
|
53455
53457
|
const apr = apyToAprPercent(susd3.value);
|
|
@@ -53925,10 +53927,10 @@ var fetchApyusdApyFromApi = async () => {
|
|
|
53925
53927
|
});
|
|
53926
53928
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
53927
53929
|
const items = (await res.json())?.data?.items ?? [];
|
|
53928
|
-
const
|
|
53930
|
+
const row2 = items.find(
|
|
53929
53931
|
(it) => it?.protocol === "Apyx" && it?.network === "ethereum" && Array.isArray(it?.assetSymbols) && it.assetSymbols.includes("apyUSD") && it?.apy != null
|
|
53930
53932
|
);
|
|
53931
|
-
const apy = Number(
|
|
53933
|
+
const apy = Number(row2?.apy);
|
|
53932
53934
|
if (Number.isFinite(apy) && apy > 0) return apy;
|
|
53933
53935
|
throw new Error("apyUSD apy missing");
|
|
53934
53936
|
};
|
|
@@ -54415,14 +54417,14 @@ var FEED_ABI = [
|
|
|
54415
54417
|
];
|
|
54416
54418
|
var parseRound = (raw) => {
|
|
54417
54419
|
if (!raw) return void 0;
|
|
54418
|
-
const
|
|
54420
|
+
const tuple2 = Array.isArray(raw) ? raw : [
|
|
54419
54421
|
raw.roundId,
|
|
54420
54422
|
raw.answer,
|
|
54421
54423
|
raw.startedAt,
|
|
54422
54424
|
raw.updatedAt
|
|
54423
54425
|
];
|
|
54424
|
-
const answer =
|
|
54425
|
-
const updatedAt =
|
|
54426
|
+
const answer = tuple2[1];
|
|
54427
|
+
const updatedAt = tuple2[3];
|
|
54426
54428
|
if (typeof answer !== "bigint" || typeof updatedAt !== "bigint")
|
|
54427
54429
|
return void 0;
|
|
54428
54430
|
if (answer <= 0n || updatedAt <= 0n) return void 0;
|
|
@@ -54849,9 +54851,9 @@ var fetchFromApyRoute = async () => {
|
|
|
54849
54851
|
}
|
|
54850
54852
|
const out = {};
|
|
54851
54853
|
for (const { idx } of YB_MARKETS) {
|
|
54852
|
-
const
|
|
54853
|
-
if (!
|
|
54854
|
-
const v = toPercent(
|
|
54854
|
+
const row2 = latest.get(idx);
|
|
54855
|
+
if (!row2) continue;
|
|
54856
|
+
const v = toPercent(row2.tradingApy) ?? toPercent(row2.tradingApyAllTime);
|
|
54855
54857
|
if (v !== void 0) out[idx] = v;
|
|
54856
54858
|
}
|
|
54857
54859
|
if (Object.keys(out).length === 0) {
|
|
@@ -56107,8 +56109,8 @@ var readVaults = async () => {
|
|
|
56107
56109
|
BFUSD_VAULTS.forEach(({ address }, vi) => {
|
|
56108
56110
|
const rows = /* @__PURE__ */ new Map();
|
|
56109
56111
|
epochs.forEach((e, i) => {
|
|
56110
|
-
const
|
|
56111
|
-
if (
|
|
56112
|
+
const row2 = asEpochRow(results[vi * epochs.length + i]);
|
|
56113
|
+
if (row2 && row2.startTime > 0n && row2.startRatio > 0n) rows.set(e, row2);
|
|
56112
56114
|
});
|
|
56113
56115
|
const latest = Math.max(...[...rows.keys()], -1);
|
|
56114
56116
|
if (latest < 0) return;
|
|
@@ -56243,21 +56245,21 @@ var BFBTC = [
|
|
|
56243
56245
|
exitNote: "The only exit is to Bitcoin (flat 0.00002 bfBTC) \u2014 the EVM route is switched off by a 100 % fee"
|
|
56244
56246
|
}
|
|
56245
56247
|
];
|
|
56246
|
-
var bfbtcDescription = (
|
|
56248
|
+
var bfbtcDescription = (row2) => `bfBTC accrues against BTC through a daily settled exchange ratio. The yield is not staking: it is delta-neutral derivatives trading (perpetual funding and basis) run by third-party quant teams on assets in Ceffu custody, so the backing is off-chain with no on-chain solvency invariant. ` + (row2.depositToken ? `Deposits take ${row2.depositToken}. ` : `No on-chain deposit here \u2014 BTC is sent on the Bitcoin network. `) + `Exits need approval from a 2-of-3 BitFi Safe, above which a single EOA can replace the Safe, upgrade the contract and blacklist. ${row2.exitNote}.`;
|
|
56247
56249
|
var BITFI_ENTRIES = {
|
|
56248
56250
|
...Object.fromEntries(
|
|
56249
|
-
BFBTC.map((
|
|
56250
|
-
|
|
56251
|
+
BFBTC.map((row2) => [
|
|
56252
|
+
row2.chain,
|
|
56251
56253
|
[
|
|
56252
56254
|
{
|
|
56253
56255
|
reader: "bitfi-bfbtc",
|
|
56254
|
-
address:
|
|
56255
|
-
underlying:
|
|
56256
|
+
address: row2.address,
|
|
56257
|
+
underlying: row2.underlying,
|
|
56256
56258
|
symbol: "bfBTC",
|
|
56257
56259
|
brand: "BitFi",
|
|
56258
|
-
description: bfbtcDescription(
|
|
56260
|
+
description: bfbtcDescription(row2),
|
|
56259
56261
|
decimals: 8,
|
|
56260
|
-
underlyingDecimals:
|
|
56262
|
+
underlyingDecimals: row2.underlyingDecimals,
|
|
56261
56263
|
isRebasing: false,
|
|
56262
56264
|
// Every deployment that still accepts an entry accepts it
|
|
56263
56265
|
// permissionlessly; the ones that do not are closed by an
|
|
@@ -56269,7 +56271,7 @@ var BITFI_ENTRIES = {
|
|
|
56269
56271
|
// multisig may approve, and an epoch is ~89,580 s — not a day.
|
|
56270
56272
|
withdrawalCooldownSeconds: 89580,
|
|
56271
56273
|
yieldFetcher: bitfiFetcher,
|
|
56272
|
-
yieldKey: bitfiYieldKey(
|
|
56274
|
+
yieldKey: bitfiYieldKey(row2.chain, row2.address)
|
|
56273
56275
|
}
|
|
56274
56276
|
]
|
|
56275
56277
|
])
|
|
@@ -59129,10 +59131,10 @@ var fetchAptUsdApyFromApi = async () => {
|
|
|
59129
59131
|
});
|
|
59130
59132
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
59131
59133
|
const items = (await res.json())?.data?.items ?? [];
|
|
59132
|
-
const
|
|
59134
|
+
const row2 = items.find(
|
|
59133
59135
|
(it) => it?.protocol === "Apyx" && it?.network === "ethereum" && Array.isArray(it?.assetSymbols) && it.assetSymbols.length === 1 && it.assetSymbols[0] === "aptUSD"
|
|
59134
59136
|
);
|
|
59135
|
-
const apy = Number(
|
|
59137
|
+
const apy = Number(row2?.apy);
|
|
59136
59138
|
if (Number.isFinite(apy) && apy > 0) return apy;
|
|
59137
59139
|
throw new Error("aptUSD apy missing");
|
|
59138
59140
|
};
|
|
@@ -59738,6 +59740,66 @@ var ALCHEMIX_TRANSMUTER_ENTRIES = ROWS.reduce((out, r) => {
|
|
|
59738
59740
|
(out[r.chainId] ??= []).push(toEntry4(r));
|
|
59739
59741
|
return out;
|
|
59740
59742
|
}, {});
|
|
59743
|
+
|
|
59744
|
+
// src/vaults/savings/registryThreeJaneLcc.ts
|
|
59745
|
+
var USDC = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48";
|
|
59746
|
+
var USDT = "0xdac17f958d2ee523a2206206994597c13d831ec7";
|
|
59747
|
+
var AAVE_V3_POOL = "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2";
|
|
59748
|
+
var DEPOSIT_HELPER = "0x061654840ae779b902d3a4d615de1ceda4da01ce";
|
|
59749
|
+
var PROMISE_FEE_PCT = 1.25;
|
|
59750
|
+
var description = (margin) => `A PROMISE, not a deposit. You post ${margin} as margin and promise 13.33x its value in USDC; 3Jane pays 1.25 % a year on the promise (\u2248 16.7 % on the margin, weekly in USDC, off-chain) plus the margin's Aave yield. 3Jane can CALL it: you owe your share in USDC within 9 days, returned as USD3 after a 35-day cooldown. Missing a call slashes your margin into an auction. Staking is allowlisted per address and revocable; the position cannot be transferred; an unstake is irrevocable, takes at least 42 days and stays callable until it exits.`;
|
|
59751
|
+
var row = (facility, underlying, symbol, cfg) => ({
|
|
59752
|
+
reader: "threejane-lcc",
|
|
59753
|
+
address: facility,
|
|
59754
|
+
underlying,
|
|
59755
|
+
// The position is not a token: its honest symbol is what you pay in, and
|
|
59756
|
+
// the product gets a label (the Frankencoin rule).
|
|
59757
|
+
symbol,
|
|
59758
|
+
label: `3Jane LCC (${symbol} promise margin)`,
|
|
59759
|
+
brand: "3Jane",
|
|
59760
|
+
description: description(
|
|
59761
|
+
symbol === "USDC" ? "waEthUSDC (Aave USDC)" : "waEthUSDT (Aave USDT)"
|
|
59762
|
+
),
|
|
59763
|
+
decimals: 6,
|
|
59764
|
+
underlyingDecimals: 6,
|
|
59765
|
+
isRebasing: false,
|
|
59766
|
+
isMintable: false,
|
|
59767
|
+
mintContract: DEPOSIT_HELPER,
|
|
59768
|
+
withdrawalMode: "request-based",
|
|
59769
|
+
balanceKind: "lcc-account",
|
|
59770
|
+
// Margin backs a promise, not a loan: a missed call is slashed. The
|
|
59771
|
+
// Boros class — `principal.risks` reads `slashing` off it.
|
|
59772
|
+
solvency: "margined",
|
|
59773
|
+
// `requestExit` takes the whole position, irrevocably.
|
|
59774
|
+
exitWholeOnly: true,
|
|
59775
|
+
// No fee on margin in or out; a slash is a penalty, not a fee, and
|
|
59776
|
+
// `slashFeeBps` (the auction fee, charged out of a slashed staker's
|
|
59777
|
+
// surplus) read 0 on both facilities.
|
|
59778
|
+
feeScheduleCheckedAt: "2026-11-20",
|
|
59779
|
+
threeJaneLcc: cfg
|
|
59780
|
+
});
|
|
59781
|
+
var THREE_JANE_LCC_ENTRIES = {
|
|
59782
|
+
"1": [
|
|
59783
|
+
row("0x8350ba7c69aeadd74b891efc53f52a0f592ad796", USDC, "USDC", {
|
|
59784
|
+
marginAsset: "0xd4fa2d31b7968e448877f69a96de69f5de8cd23e",
|
|
59785
|
+
marginDecimals: 6,
|
|
59786
|
+
aavePool: AAVE_V3_POOL,
|
|
59787
|
+
aaveReserve: USDC,
|
|
59788
|
+
promiseFeePct: PROMISE_FEE_PCT,
|
|
59789
|
+
depositHelper: DEPOSIT_HELPER,
|
|
59790
|
+
feeToken: USDC
|
|
59791
|
+
}),
|
|
59792
|
+
row("0xf4ae98cd6ef156ad87c1f004bbf0cdab6442042f", USDT, "USDT", {
|
|
59793
|
+
marginAsset: "0x7bc3485026ac48b6cf9baf0a377477fff5703af8",
|
|
59794
|
+
marginDecimals: 6,
|
|
59795
|
+
aavePool: AAVE_V3_POOL,
|
|
59796
|
+
aaveReserve: USDT,
|
|
59797
|
+
promiseFeePct: PROMISE_FEE_PCT,
|
|
59798
|
+
depositHelper: DEPOSIT_HELPER,
|
|
59799
|
+
feeToken: USDC
|
|
59800
|
+
})
|
|
59801
|
+
]
|
|
59802
|
+
};
|
|
59741
59803
|
var DAY5 = 24 * 60 * 60;
|
|
59742
59804
|
var FEED_WINDOW_SECONDS = 30 * DAY5;
|
|
59743
59805
|
var ROUND_ABI = [
|
|
@@ -59906,13 +59968,13 @@ var moriniFetcher = {
|
|
|
59906
59968
|
// src/vaults/savings/registryMorini.ts
|
|
59907
59969
|
var carry = MIDAS_VAULTS.find((v) => v.symbol === "CarryTradeUSDTRYLeverage");
|
|
59908
59970
|
var stock2 = MIDAS_VAULTS.find((v) => v.symbol === "StockMarketTRBasisTrade");
|
|
59909
|
-
var midasEntry = (v,
|
|
59971
|
+
var midasEntry = (v, description2, yieldKey) => ({
|
|
59910
59972
|
reader: "nav-oracle",
|
|
59911
59973
|
address: v.mToken,
|
|
59912
59974
|
underlying: v.paymentToken,
|
|
59913
59975
|
symbol: v.symbol,
|
|
59914
59976
|
brand: "Morini Capital",
|
|
59915
|
-
description,
|
|
59977
|
+
description: description2,
|
|
59916
59978
|
decimals: 18,
|
|
59917
59979
|
underlyingDecimals: v.paymentTokenDecimals,
|
|
59918
59980
|
isRebasing: false,
|
|
@@ -60161,8 +60223,8 @@ var COOLDOWN_SECONDS = {
|
|
|
60161
60223
|
var yieldKeyFor = (symbol) => EMBER_RATE_SPECS.find((s) => s.tag === symbol)?.keys[0];
|
|
60162
60224
|
var EMBER_ENTRIES = EMBER_VAULTS.reduce(
|
|
60163
60225
|
(out, v) => {
|
|
60164
|
-
const
|
|
60165
|
-
if (!
|
|
60226
|
+
const description2 = DESCRIPTIONS[v.symbol];
|
|
60227
|
+
if (!description2) return out;
|
|
60166
60228
|
const yieldKey = yieldKeyFor(v.symbol);
|
|
60167
60229
|
(out[v.chainId] ??= []).push({
|
|
60168
60230
|
reader: "ember-vault",
|
|
@@ -60170,7 +60232,7 @@ var EMBER_ENTRIES = EMBER_VAULTS.reduce(
|
|
|
60170
60232
|
underlying: v.underlying,
|
|
60171
60233
|
symbol: v.symbol,
|
|
60172
60234
|
brand: v.curator,
|
|
60173
|
-
description,
|
|
60235
|
+
description: description2,
|
|
60174
60236
|
decimals: v.decimals,
|
|
60175
60237
|
underlyingDecimals: v.decimals,
|
|
60176
60238
|
isRebasing: false,
|
|
@@ -60629,8 +60691,8 @@ var TOKEMAK_SPECS = [
|
|
|
60629
60691
|
var tokemakBaseApy = (body, pool) => {
|
|
60630
60692
|
const pools = body?.autopools;
|
|
60631
60693
|
if (!Array.isArray(pools)) return void 0;
|
|
60632
|
-
const
|
|
60633
|
-
const apy = Number(
|
|
60694
|
+
const row2 = pools.find((p) => p?.id?.toLowerCase() === pool.toLowerCase());
|
|
60695
|
+
const apy = Number(row2?.baseApy);
|
|
60634
60696
|
return Number.isFinite(apy) ? apy : void 0;
|
|
60635
60697
|
};
|
|
60636
60698
|
var tokemakAutopoolsFetcher = {
|
|
@@ -60714,10 +60776,10 @@ var JUSD_CREDIT_LOAN = "0x4c376df2f5182f5373502ccab12700c479d8a128";
|
|
|
60714
60776
|
var jusdLoanApy = (body) => {
|
|
60715
60777
|
const items = body?.items;
|
|
60716
60778
|
if (!Array.isArray(items)) return void 0;
|
|
60717
|
-
const
|
|
60779
|
+
const row2 = items.find(
|
|
60718
60780
|
(l) => l?.loan_address?.toLowerCase() === JUSD_CREDIT_LOAN
|
|
60719
60781
|
);
|
|
60720
|
-
const raw =
|
|
60782
|
+
const raw = row2?.apy_30d ?? row2?.apy_7d ?? row2?.net_apy;
|
|
60721
60783
|
const n = Number(raw);
|
|
60722
60784
|
return raw === null || raw === void 0 || !Number.isFinite(n) ? void 0 : n;
|
|
60723
60785
|
};
|
|
@@ -61176,7 +61238,7 @@ function liquidOp(p) {
|
|
|
61176
61238
|
yieldKey: p.yieldKey
|
|
61177
61239
|
};
|
|
61178
61240
|
}
|
|
61179
|
-
function liminalEntry(address, symbol,
|
|
61241
|
+
function liminalEntry(address, symbol, description2, depositPipe, redemptionPipe, liquidityProvider, navOracle, yieldKey) {
|
|
61180
61242
|
return {
|
|
61181
61243
|
reader: "liminal-pipe",
|
|
61182
61244
|
address,
|
|
@@ -61184,7 +61246,7 @@ function liminalEntry(address, symbol, description, depositPipe, redemptionPipe,
|
|
|
61184
61246
|
// USDC (HyperEVM)
|
|
61185
61247
|
symbol,
|
|
61186
61248
|
brand: "Liminal",
|
|
61187
|
-
description,
|
|
61249
|
+
description: description2,
|
|
61188
61250
|
decimals: 18,
|
|
61189
61251
|
underlyingDecimals: 6,
|
|
61190
61252
|
isRebasing: false,
|
|
@@ -61533,15 +61595,15 @@ var YIELD_KEYS = {
|
|
|
61533
61595
|
};
|
|
61534
61596
|
var MELLOW_ENTRIES = MELLOW_VAULTS.reduce(
|
|
61535
61597
|
(out, v) => {
|
|
61536
|
-
const
|
|
61537
|
-
if (!
|
|
61598
|
+
const description2 = DESCRIPTIONS2[v.symbol];
|
|
61599
|
+
if (!description2) return out;
|
|
61538
61600
|
(out[v.chainId] ??= []).push({
|
|
61539
61601
|
reader: "mellow-core",
|
|
61540
61602
|
address: v.share,
|
|
61541
61603
|
underlying: v.underlying,
|
|
61542
61604
|
symbol: v.symbol,
|
|
61543
61605
|
brand: "Lido",
|
|
61544
|
-
description,
|
|
61606
|
+
description: description2,
|
|
61545
61607
|
decimals: 18,
|
|
61546
61608
|
underlyingDecimals: v.underlyingDecimals,
|
|
61547
61609
|
isRebasing: false,
|
|
@@ -63214,8 +63276,9 @@ var SINGLE_CHAIN_ENTRIES = {
|
|
|
63214
63276
|
// USDC, price accrues on-chain (`pricePerShare`). Exit is instant
|
|
63215
63277
|
// but capped by real multi-source liquidity — idle USDC + what the
|
|
63216
63278
|
// MorphoCredit market can redeem out of waEthUSDC — read via
|
|
63217
|
-
// `availableWithdrawLimit` (~4.7 % of the $75M TVL at 2026-08-04
|
|
63218
|
-
// integration
|
|
63279
|
+
// `availableWithdrawLimit` (~4.7 % of the $75M TVL at the 2026-08-04
|
|
63280
|
+
// integration, ~10.7 % of $130M on 2026-11-19), hence the
|
|
63281
|
+
// `erc4626-withdraw-limit` reader. No
|
|
63219
63282
|
// on-chain solvency invariant on the credit sleeves (Maple /
|
|
63220
63283
|
// Spark-V2 trust class); unrealized losses zero the limit until
|
|
63221
63284
|
// marked down. `isMintable: true` is structural — the whitelist is
|
|
@@ -64070,6 +64133,10 @@ var SAVINGS_REGISTRY = (() => {
|
|
|
64070
64133
|
if (!out[chainId]) out[chainId] = [];
|
|
64071
64134
|
out[chainId].push(...entries);
|
|
64072
64135
|
}
|
|
64136
|
+
for (const [chainId, entries] of Object.entries(THREE_JANE_LCC_ENTRIES)) {
|
|
64137
|
+
if (!out[chainId]) out[chainId] = [];
|
|
64138
|
+
out[chainId].push(...entries);
|
|
64139
|
+
}
|
|
64073
64140
|
for (const [chainId, entries] of Object.entries(JARVIS_ENTRIES)) {
|
|
64074
64141
|
if (!out[chainId]) out[chainId] = [];
|
|
64075
64142
|
out[chainId].push(...entries);
|
|
@@ -64141,11 +64208,11 @@ function enumerateEmitters(chainId) {
|
|
|
64141
64208
|
const seen = /* @__PURE__ */ new Set();
|
|
64142
64209
|
const push2 = (r) => {
|
|
64143
64210
|
if (!isAddr5(r.address)) return;
|
|
64144
|
-
const
|
|
64145
|
-
const k = `${
|
|
64211
|
+
const row2 = { ...r, address: r.address.toLowerCase() };
|
|
64212
|
+
const k = `${row2.address}:${row2.lenderKey}:${row2.role}`;
|
|
64146
64213
|
if (seen.has(k)) return;
|
|
64147
64214
|
seen.add(k);
|
|
64148
|
-
out.push(
|
|
64215
|
+
out.push(row2);
|
|
64149
64216
|
};
|
|
64150
64217
|
const uid = (lender, ref) => createMarketUid(chainId, lender, ref);
|
|
64151
64218
|
for (const [lender, chains] of Object.entries(aavePools() ?? {})) {
|
|
@@ -68304,8 +68371,8 @@ function resolveEulerOpp(opp) {
|
|
|
68304
68371
|
function aaveReserveOwner(chainId, reserveToken) {
|
|
68305
68372
|
const t = reserveToken.toLowerCase();
|
|
68306
68373
|
for (const [lender, chains] of Object.entries(aaveTokens() ?? {})) {
|
|
68307
|
-
for (const [underlying,
|
|
68308
|
-
if (
|
|
68374
|
+
for (const [underlying, row2] of Object.entries(chains?.[chainId] ?? {})) {
|
|
68375
|
+
if (row2?.aToken?.toLowerCase() === t || row2?.vToken?.toLowerCase() === t)
|
|
68309
68376
|
return { lender, underlying: underlying.toLowerCase() };
|
|
68310
68377
|
}
|
|
68311
68378
|
}
|
|
@@ -72732,7 +72799,7 @@ function parseTermMaxResults(data, meta, context) {
|
|
|
72732
72799
|
[meta.debtToken, data?.[0], "TermMax oracle (debt asset)"],
|
|
72733
72800
|
[meta.collateral, data?.[1], "TermMax oracle (collateral)"]
|
|
72734
72801
|
];
|
|
72735
|
-
for (const [asset, res,
|
|
72802
|
+
for (const [asset, res, description2] of legs) {
|
|
72736
72803
|
const usd = readUsdPrice(res);
|
|
72737
72804
|
if (usd === void 0) continue;
|
|
72738
72805
|
entries.push({
|
|
@@ -72741,7 +72808,7 @@ function parseTermMaxResults(data, meta, context) {
|
|
|
72741
72808
|
priceUSD: usd,
|
|
72742
72809
|
marketUid: createMarketUid(chainId, lenderKey, asset),
|
|
72743
72810
|
targetLender: lenderKey,
|
|
72744
|
-
description
|
|
72811
|
+
description: description2
|
|
72745
72812
|
});
|
|
72746
72813
|
}
|
|
72747
72814
|
return entries;
|
|
@@ -74761,6 +74828,8 @@ var SAVINGS_SHARE_RATE_PRICE_SPECS = [
|
|
|
74761
74828
|
),
|
|
74762
74829
|
erc46263("sUSD3", "0xf689555121e529ff0463e191f9bd9d1e496164a7", 6, USD3_1, 6),
|
|
74763
74830
|
erc46263("USD3", USD3_1, 6, USDC_1, 6),
|
|
74831
|
+
// LCC funding-cooldown wrapper over USD3, 1:1 (Morpho USD3l/USDC collateral)
|
|
74832
|
+
erc46263("USD3l", "0xdf697c55f0d696ca9e3e624cd52d8186c6745904", 6, USD3_1, 6),
|
|
74764
74833
|
// wstUSR priced as if USR were $1: lenders kept 1.1330 while USR fell to 0.04
|
|
74765
74834
|
// (read 2026-11-06; DefiLlama 0.0453). The rate × USR's market price is the
|
|
74766
74835
|
// value of the share, on every chain's mirror.
|
|
@@ -74912,9 +74981,9 @@ var toBig9 = (v) => {
|
|
|
74912
74981
|
function decodeShareRate(spec, raw) {
|
|
74913
74982
|
let rate;
|
|
74914
74983
|
if (spec.read.kind === "mellow-report") {
|
|
74915
|
-
const
|
|
74916
|
-
const price2 = toBig9(Array.isArray(
|
|
74917
|
-
const suspicious = Array.isArray(
|
|
74984
|
+
const tuple2 = raw;
|
|
74985
|
+
const price2 = toBig9(Array.isArray(tuple2) ? tuple2[0] : tuple2?.priceD18);
|
|
74986
|
+
const suspicious = Array.isArray(tuple2) ? tuple2[2] : tuple2?.isSuspicious;
|
|
74918
74987
|
if (!price2 || price2 <= 0n || suspicious === true) return void 0;
|
|
74919
74988
|
rate = 1e18 / Number(price2) * 10 ** (spec.shareDecimals - spec.underlyingDecimals);
|
|
74920
74989
|
} else {
|
|
@@ -76617,14 +76686,14 @@ async function probeAaveFeedTimestamps(chainId, options = {}) {
|
|
|
76617
76686
|
const infoOfSource = /* @__PURE__ */ new Map();
|
|
76618
76687
|
uniqueSources.forEach((source, i) => {
|
|
76619
76688
|
const round = roundResults[i * 2];
|
|
76620
|
-
const
|
|
76689
|
+
const description2 = roundResults[i * 2 + 1];
|
|
76621
76690
|
if (isFailed2(round) || !Array.isArray(round)) return;
|
|
76622
76691
|
const updatedAt = Number(round[3]);
|
|
76623
76692
|
if (!(updatedAt > 0)) return;
|
|
76624
76693
|
infoOfSource.set(source, {
|
|
76625
76694
|
source,
|
|
76626
76695
|
updatedAt,
|
|
76627
|
-
description: isFailed2(
|
|
76696
|
+
description: isFailed2(description2) ? void 0 : String(description2)
|
|
76628
76697
|
});
|
|
76629
76698
|
});
|
|
76630
76699
|
for (const [i, source] of sourceOf2) {
|
|
@@ -79207,7 +79276,7 @@ async function fetchFluidExposures(chainId, multicallRetry, prices, tokenList) {
|
|
|
79207
79276
|
const assets = Number(loanEntry.totalDebt ?? 0);
|
|
79208
79277
|
if (!(assets > 0)) continue;
|
|
79209
79278
|
const assetsUsd = Number(loanEntry.totalDebtUSD ?? 0) || 0;
|
|
79210
|
-
const
|
|
79279
|
+
const row2 = {
|
|
79211
79280
|
marketId: (vault.vaultAddress ?? "").toLowerCase(),
|
|
79212
79281
|
collateralAddress,
|
|
79213
79282
|
collateral: collateralAddress ? tokenList[collateralAddress] : void 0,
|
|
@@ -79216,8 +79285,8 @@ async function fetchFluidExposures(chainId, multicallRetry, prices, tokenList) {
|
|
|
79216
79285
|
supplyApr: Number(loanEntry.variableBorrowRate ?? 0) || 0
|
|
79217
79286
|
};
|
|
79218
79287
|
const list = rowsByLoan.get(loanAddress);
|
|
79219
|
-
if (list) list.push(
|
|
79220
|
-
else rowsByLoan.set(loanAddress, [
|
|
79288
|
+
if (list) list.push(row2);
|
|
79289
|
+
else rowsByLoan.set(loanAddress, [row2]);
|
|
79221
79290
|
}
|
|
79222
79291
|
for (const [loanAddress, rows] of rowsByLoan) {
|
|
79223
79292
|
const totalUsd = rows.reduce((s, r) => s + r.assetsUsd, 0);
|
|
@@ -80927,12 +80996,12 @@ function buildExposures(vaultId, totalAssetsFormatted, pricePerUnit, positionsBy
|
|
|
80927
80996
|
if (totalAssetsFormatted <= 0) return void 0;
|
|
80928
80997
|
const rows = positionsByVault.get(vaultId) ?? [];
|
|
80929
80998
|
const exposures = [];
|
|
80930
|
-
for (const
|
|
80931
|
-
const marketId = (
|
|
80999
|
+
for (const row2 of rows) {
|
|
81000
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80932
81001
|
if (!marketId) continue;
|
|
80933
81002
|
const meta = marketMeta.get(marketId);
|
|
80934
81003
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80935
|
-
const shares = Number(
|
|
81004
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80936
81005
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80937
81006
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80938
81007
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -80960,12 +81029,12 @@ function computeSiloLiquidityFormatted(vaultId, totalAssetsFormatted, positionsB
|
|
|
80960
81029
|
let allocated = 0;
|
|
80961
81030
|
let withdrawable = 0;
|
|
80962
81031
|
let resolved2 = 0;
|
|
80963
|
-
for (const
|
|
80964
|
-
const marketId = (
|
|
81032
|
+
for (const row2 of rows) {
|
|
81033
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80965
81034
|
if (!marketId) continue;
|
|
80966
81035
|
const meta = marketMeta.get(marketId);
|
|
80967
81036
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80968
|
-
const shares = Number(
|
|
81037
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80969
81038
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80970
81039
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80971
81040
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -80984,12 +81053,12 @@ function computeSiloUtilization(vaultId, totalAssetsFormatted, positionsByVault,
|
|
|
80984
81053
|
const rows = positionsByVault.get(vaultId) ?? [];
|
|
80985
81054
|
let borrowed = 0;
|
|
80986
81055
|
let resolved2 = 0;
|
|
80987
|
-
for (const
|
|
80988
|
-
const marketId = (
|
|
81056
|
+
for (const row2 of rows) {
|
|
81057
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80989
81058
|
if (!marketId) continue;
|
|
80990
81059
|
const meta = marketMeta.get(marketId);
|
|
80991
81060
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80992
|
-
const shares = Number(
|
|
81061
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80993
81062
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80994
81063
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80995
81064
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -81164,12 +81233,12 @@ var fetchSiloVaults = async (chainId, prices = {}, tokenList = {}, options) => {
|
|
|
81164
81233
|
const items = payload?.data?.vaults?.items ?? [];
|
|
81165
81234
|
const positions = payload?.data?.positions?.items ?? [];
|
|
81166
81235
|
const positionsByVault = /* @__PURE__ */ new Map();
|
|
81167
|
-
for (const
|
|
81168
|
-
const accountId = (
|
|
81236
|
+
for (const row2 of positions) {
|
|
81237
|
+
const accountId = (row2.accountId ?? "").toLowerCase();
|
|
81169
81238
|
if (!accountId) continue;
|
|
81170
81239
|
const list = positionsByVault.get(accountId);
|
|
81171
|
-
if (list) list.push(
|
|
81172
|
-
else positionsByVault.set(accountId, [
|
|
81240
|
+
if (list) list.push(row2);
|
|
81241
|
+
else positionsByVault.set(accountId, [row2]);
|
|
81173
81242
|
}
|
|
81174
81243
|
const markets = payload?.data?.markets?.items ?? [];
|
|
81175
81244
|
const marketMeta = /* @__PURE__ */ new Map();
|
|
@@ -81751,18 +81820,18 @@ async function fetchEulerEarnVaultsFromApi(chainId, prices = {}, tokenList = {},
|
|
|
81751
81820
|
const rows = list.data ?? [];
|
|
81752
81821
|
if (rows.length === 0) return {};
|
|
81753
81822
|
const statusByAddress = /* @__PURE__ */ new Map();
|
|
81754
|
-
for (const
|
|
81755
|
-
const status =
|
|
81756
|
-
if (
|
|
81757
|
-
statusByAddress.set(
|
|
81823
|
+
for (const row2 of rows) {
|
|
81824
|
+
const status = row2.visibility?.status;
|
|
81825
|
+
if (row2.address && typeof status === "string") {
|
|
81826
|
+
statusByAddress.set(row2.address.toLowerCase(), status);
|
|
81758
81827
|
}
|
|
81759
81828
|
}
|
|
81760
81829
|
const [details, entityNames] = await Promise.all([
|
|
81761
81830
|
mapWithConcurrency(
|
|
81762
81831
|
rows,
|
|
81763
81832
|
DETAIL_CONCURRENCY,
|
|
81764
|
-
(
|
|
81765
|
-
`${EULER_DATA_API_BASE2}/earn/vaults/${chainId}/${
|
|
81833
|
+
(row2) => getJson8(
|
|
81834
|
+
`${EULER_DATA_API_BASE2}/earn/vaults/${chainId}/${row2.address}?include=strategies`
|
|
81766
81835
|
).then((d) => d?.data)
|
|
81767
81836
|
),
|
|
81768
81837
|
fetchEulerEntityNames(chainId)
|
|
@@ -90294,6 +90363,133 @@ var Multicall3BlockNumberAbi = [
|
|
|
90294
90363
|
}
|
|
90295
90364
|
];
|
|
90296
90365
|
|
|
90366
|
+
// src/vaults/savings/abis/threeJaneLcc.ts
|
|
90367
|
+
var view4 = (name, inputs = [], outputs = [
|
|
90368
|
+
{ name: "", type: "uint256" }
|
|
90369
|
+
]) => ({
|
|
90370
|
+
name,
|
|
90371
|
+
type: "function",
|
|
90372
|
+
stateMutability: "view",
|
|
90373
|
+
inputs,
|
|
90374
|
+
outputs
|
|
90375
|
+
});
|
|
90376
|
+
var tuple = (components) => [
|
|
90377
|
+
{ name: "", type: "tuple", components }
|
|
90378
|
+
];
|
|
90379
|
+
var LccTotalsAbi = [
|
|
90380
|
+
view4(
|
|
90381
|
+
"totals",
|
|
90382
|
+
[],
|
|
90383
|
+
tuple([
|
|
90384
|
+
{ name: "activeMargin", type: "uint128" },
|
|
90385
|
+
{ name: "activeCommitment", type: "uint128" },
|
|
90386
|
+
{ name: "pendingMargin", type: "uint128" },
|
|
90387
|
+
{ name: "pendingCommitment", type: "uint128" }
|
|
90388
|
+
])
|
|
90389
|
+
)
|
|
90390
|
+
];
|
|
90391
|
+
var LccRiskConfigAbi = [
|
|
90392
|
+
view4(
|
|
90393
|
+
"riskConfig",
|
|
90394
|
+
[],
|
|
90395
|
+
tuple([
|
|
90396
|
+
{ name: "protocolCommitmentCap", type: "uint256" },
|
|
90397
|
+
{ name: "userCommitmentCap", type: "uint256" },
|
|
90398
|
+
{ name: "exitCapBps", type: "uint256" },
|
|
90399
|
+
{ name: "minDepositAssets", type: "uint256" },
|
|
90400
|
+
{ name: "maxAuctionAwardBps", type: "uint256" },
|
|
90401
|
+
{ name: "slashFeeBps", type: "uint256" }
|
|
90402
|
+
])
|
|
90403
|
+
)
|
|
90404
|
+
];
|
|
90405
|
+
var LccEpochConfigAbi = [
|
|
90406
|
+
view4(
|
|
90407
|
+
"epochConfig",
|
|
90408
|
+
[],
|
|
90409
|
+
tuple([
|
|
90410
|
+
{ name: "startTimestamp", type: "uint256" },
|
|
90411
|
+
{ name: "maxEpochs", type: "uint256" },
|
|
90412
|
+
{ name: "epochLength", type: "uint256" },
|
|
90413
|
+
{ name: "normalDuration", type: "uint256" },
|
|
90414
|
+
{ name: "preCallDuration", type: "uint256" },
|
|
90415
|
+
{ name: "fundingDuration", type: "uint256" },
|
|
90416
|
+
{ name: "marginRatioBps", type: "uint256" },
|
|
90417
|
+
{ name: "exitDelayEpochs", type: "uint256" },
|
|
90418
|
+
{ name: "minCommitmentEpochs", type: "uint256" }
|
|
90419
|
+
])
|
|
90420
|
+
)
|
|
90421
|
+
];
|
|
90422
|
+
var LccPauseStateAbi = [
|
|
90423
|
+
view4(
|
|
90424
|
+
"pauseState",
|
|
90425
|
+
[],
|
|
90426
|
+
[
|
|
90427
|
+
{ name: "paused", type: "bool" },
|
|
90428
|
+
{ name: "since", type: "uint64" },
|
|
90429
|
+
{ name: "until", type: "uint64" }
|
|
90430
|
+
]
|
|
90431
|
+
)
|
|
90432
|
+
];
|
|
90433
|
+
var LccShutdownStateAbi = [
|
|
90434
|
+
view4(
|
|
90435
|
+
"shutdownState",
|
|
90436
|
+
[],
|
|
90437
|
+
tuple([
|
|
90438
|
+
{ name: "active", type: "bool" },
|
|
90439
|
+
{ name: "timestamp", type: "uint64" },
|
|
90440
|
+
{ name: "epoch", type: "uint64" }
|
|
90441
|
+
])
|
|
90442
|
+
)
|
|
90443
|
+
];
|
|
90444
|
+
var LccGetAccountAbi = [
|
|
90445
|
+
view4(
|
|
90446
|
+
"getAccount",
|
|
90447
|
+
[{ name: "user", type: "address" }],
|
|
90448
|
+
tuple([
|
|
90449
|
+
{ name: "activeMargin", type: "uint256" },
|
|
90450
|
+
{ name: "activeCommitment", type: "uint256" },
|
|
90451
|
+
{ name: "pendingMargin", type: "uint256" },
|
|
90452
|
+
{ name: "pendingCommitment", type: "uint256" },
|
|
90453
|
+
{ name: "pendingActivationEpoch", type: "uint256" },
|
|
90454
|
+
{ name: "calledEpochCursor", type: "uint256" },
|
|
90455
|
+
{ name: "claimableExitMargin", type: "uint256" },
|
|
90456
|
+
{ name: "exitBucketMargin", type: "uint256" },
|
|
90457
|
+
{ name: "exitBucketCommitment", type: "uint256" },
|
|
90458
|
+
{ name: "exitRequested", type: "bool" },
|
|
90459
|
+
{ name: "exitMaturityEpoch", type: "uint256" },
|
|
90460
|
+
{ name: "exitClaimed", type: "bool" },
|
|
90461
|
+
{ name: "exitMatured", type: "bool" },
|
|
90462
|
+
{ name: "commitmentStartEpoch", type: "uint256" }
|
|
90463
|
+
])
|
|
90464
|
+
)
|
|
90465
|
+
];
|
|
90466
|
+
var LccMarginConvertToAssetsAbi = [
|
|
90467
|
+
view4("convertToAssets", [{ name: "shares", type: "uint256" }])
|
|
90468
|
+
];
|
|
90469
|
+
var AaveReserveDataLegacyAbi = [
|
|
90470
|
+
view4(
|
|
90471
|
+
"getReserveData",
|
|
90472
|
+
[{ name: "asset", type: "address" }],
|
|
90473
|
+
tuple([
|
|
90474
|
+
{ name: "configuration", type: "uint256" },
|
|
90475
|
+
{ name: "liquidityIndex", type: "uint128" },
|
|
90476
|
+
{ name: "currentLiquidityRate", type: "uint128" },
|
|
90477
|
+
{ name: "variableBorrowIndex", type: "uint128" },
|
|
90478
|
+
{ name: "currentVariableBorrowRate", type: "uint128" },
|
|
90479
|
+
{ name: "currentStableBorrowRate", type: "uint128" },
|
|
90480
|
+
{ name: "lastUpdateTimestamp", type: "uint40" },
|
|
90481
|
+
{ name: "id", type: "uint16" },
|
|
90482
|
+
{ name: "aTokenAddress", type: "address" },
|
|
90483
|
+
{ name: "stableDebtTokenAddress", type: "address" },
|
|
90484
|
+
{ name: "variableDebtTokenAddress", type: "address" },
|
|
90485
|
+
{ name: "interestRateStrategyAddress", type: "address" },
|
|
90486
|
+
{ name: "accruedToTreasury", type: "uint128" },
|
|
90487
|
+
{ name: "unbacked", type: "uint128" },
|
|
90488
|
+
{ name: "isolationModeTotalDebt", type: "uint128" }
|
|
90489
|
+
])
|
|
90490
|
+
)
|
|
90491
|
+
];
|
|
90492
|
+
|
|
90297
90493
|
// src/vaults/savings/readers/shared.ts
|
|
90298
90494
|
var ONE_E1823 = 10n ** 18n;
|
|
90299
90495
|
var toBigInt16 = (v) => {
|
|
@@ -93304,6 +93500,123 @@ var readerAlchemixTransmuter = (entry2) => {
|
|
|
93304
93500
|
};
|
|
93305
93501
|
};
|
|
93306
93502
|
|
|
93503
|
+
// src/vaults/savings/readers/threeJaneLcc.ts
|
|
93504
|
+
var RAY11 = 10n ** 27n;
|
|
93505
|
+
var readerThreeJaneLcc = (entry2) => {
|
|
93506
|
+
const cfg = entry2.threeJaneLcc;
|
|
93507
|
+
if (!cfg)
|
|
93508
|
+
throw new Error(
|
|
93509
|
+
`threejane-lcc entry ${entry2.address} has no threeJaneLcc pins`
|
|
93510
|
+
);
|
|
93511
|
+
const marginUnit = 10n ** BigInt(cfg.marginDecimals);
|
|
93512
|
+
return {
|
|
93513
|
+
calls: [
|
|
93514
|
+
{ address: entry2.address, name: "totals", params: [] },
|
|
93515
|
+
{ address: entry2.address, name: "riskConfig", params: [] },
|
|
93516
|
+
{ address: entry2.address, name: "epochConfig", params: [] },
|
|
93517
|
+
{ address: entry2.address, name: "pauseState", params: [] },
|
|
93518
|
+
{ address: entry2.address, name: "shutdownState", params: [] },
|
|
93519
|
+
{
|
|
93520
|
+
address: cfg.marginAsset,
|
|
93521
|
+
name: "convertToAssets",
|
|
93522
|
+
params: [marginUnit]
|
|
93523
|
+
},
|
|
93524
|
+
{
|
|
93525
|
+
address: cfg.aavePool,
|
|
93526
|
+
name: "getReserveData",
|
|
93527
|
+
params: [cfg.aaveReserve]
|
|
93528
|
+
}
|
|
93529
|
+
],
|
|
93530
|
+
abis: [
|
|
93531
|
+
LccTotalsAbi,
|
|
93532
|
+
LccRiskConfigAbi,
|
|
93533
|
+
LccEpochConfigAbi,
|
|
93534
|
+
LccPauseStateAbi,
|
|
93535
|
+
LccShutdownStateAbi,
|
|
93536
|
+
LccMarginConvertToAssetsAbi,
|
|
93537
|
+
AaveReserveDataLegacyAbi
|
|
93538
|
+
],
|
|
93539
|
+
parse: ([
|
|
93540
|
+
totalsRaw,
|
|
93541
|
+
riskRaw,
|
|
93542
|
+
epochRaw,
|
|
93543
|
+
pauseRaw,
|
|
93544
|
+
shutdownRaw,
|
|
93545
|
+
ctaRaw,
|
|
93546
|
+
reserveRaw
|
|
93547
|
+
]) => {
|
|
93548
|
+
const totals = totalsRaw;
|
|
93549
|
+
const epoch = epochRaw;
|
|
93550
|
+
const assetsPerShare = toBigInt16(ctaRaw);
|
|
93551
|
+
if (!totals || typeof totals.activeMargin !== "bigint" || !epoch || typeof epoch.marginRatioBps !== "bigint" || epoch.marginRatioBps === 0n || assetsPerShare === void 0 || assetsPerShare === 0n)
|
|
93552
|
+
return void 0;
|
|
93553
|
+
const margin = totals.activeMargin + totals.pendingMargin;
|
|
93554
|
+
const commitment = totals.activeCommitment + totals.pendingCommitment;
|
|
93555
|
+
const exchangeRate = assetsPerShare * ONE_E1823 / marginUnit;
|
|
93556
|
+
const risk = riskRaw;
|
|
93557
|
+
const depositCapacity = risk && typeof risk.protocolCommitmentCap === "bigint" ? risk.protocolCommitmentCap > commitment ? (risk.protocolCommitmentCap - commitment) * epoch.marginRatioBps / 10000n : 0n : void 0;
|
|
93558
|
+
const paused = Array.isArray(pauseRaw) ? pauseRaw[0] === true : void 0;
|
|
93559
|
+
const shutdown = shutdownRaw?.active === true;
|
|
93560
|
+
const liquidityRate = reserveRaw?.currentLiquidityRate;
|
|
93561
|
+
const supplyRate = typeof liquidityRate === "bigint" ? Number(liquidityRate * 1000000n / RAY11) / 1e4 : void 0;
|
|
93562
|
+
const promiseApr = cfg.promiseFeePct * 1e4 / Number(epoch.marginRatioBps);
|
|
93563
|
+
const rewardStreams = [
|
|
93564
|
+
{
|
|
93565
|
+
side: "deposit",
|
|
93566
|
+
apr: promiseApr,
|
|
93567
|
+
kind: "token",
|
|
93568
|
+
token: {
|
|
93569
|
+
address: cfg.feeToken.toLowerCase(),
|
|
93570
|
+
symbol: "USDC",
|
|
93571
|
+
decimals: 6
|
|
93572
|
+
},
|
|
93573
|
+
source: {
|
|
93574
|
+
id: "3jane:lcc-promise-fee",
|
|
93575
|
+
label: "3Jane \xB7 LCC promise fee",
|
|
93576
|
+
link: "https://docs.3jane.xyz/levered-callable-capital-lcc/mechanism/stakers.md",
|
|
93577
|
+
platform: "protocol",
|
|
93578
|
+
refs: {
|
|
93579
|
+
facility: entry2.address.toLowerCase(),
|
|
93580
|
+
promiseFeePct: cfg.promiseFeePct,
|
|
93581
|
+
marginRatioBps: Number(epoch.marginRatioBps),
|
|
93582
|
+
distribution: "off-chain-weekly-usdc"
|
|
93583
|
+
}
|
|
93584
|
+
},
|
|
93585
|
+
// Pushed to the staker's address by 3Jane; nothing to claim.
|
|
93586
|
+
claim: "accrual"
|
|
93587
|
+
}
|
|
93588
|
+
];
|
|
93589
|
+
const epochSeconds = Number(epoch.epochLength);
|
|
93590
|
+
const delayEpochs = Number(epoch.exitDelayEpochs);
|
|
93591
|
+
const exitCapPct = risk && typeof risk.exitCapBps === "bigint" ? Number(risk.exitCapBps) / 100 : void 0;
|
|
93592
|
+
const exitRoutes = [
|
|
93593
|
+
{
|
|
93594
|
+
id: "queued",
|
|
93595
|
+
kind: "queued",
|
|
93596
|
+
label: `Unstake (\u2265 ${Math.round(delayEpochs * epochSeconds / 86400)} days)`,
|
|
93597
|
+
settlement: "async",
|
|
93598
|
+
feeBps: 0,
|
|
93599
|
+
waitSeconds: delayEpochs * epochSeconds,
|
|
93600
|
+
selfOnly: true,
|
|
93601
|
+
description: `An unstake is full-position and irrevocable. It waits ${delayEpochs} epochs of ${Math.round(epochSeconds / 86400)} days, then exits through a per-epoch capacity of ${exitCapPct ?? "?"} % of the facility, queueing into later epochs when that is full. Until it exits the position stays callable and slashable. Margin is claimed to any receiver; the request itself is the staker's own.`
|
|
93602
|
+
}
|
|
93603
|
+
];
|
|
93604
|
+
return {
|
|
93605
|
+
// Underlying the posted margin is worth; the shares are the margin.
|
|
93606
|
+
totalAssets: margin * assetsPerShare / marginUnit,
|
|
93607
|
+
totalSupply: margin,
|
|
93608
|
+
exchangeRate,
|
|
93609
|
+
supplyRate,
|
|
93610
|
+
rewardStreams,
|
|
93611
|
+
depositCapacity: shutdown ? 0n : depositCapacity,
|
|
93612
|
+
paused: paused || shutdown,
|
|
93613
|
+
exitRoutes,
|
|
93614
|
+
withdrawalCooldownSeconds: delayEpochs * epochSeconds
|
|
93615
|
+
};
|
|
93616
|
+
}
|
|
93617
|
+
};
|
|
93618
|
+
};
|
|
93619
|
+
|
|
93307
93620
|
// src/vaults/savings/readers/gapSweep.ts
|
|
93308
93621
|
var NEUTRAL_PROBE8 = "0x000000000000000000000000000000000000dead";
|
|
93309
93622
|
var MAX_UINT256 = 2n ** 256n - 1n;
|
|
@@ -93504,6 +93817,8 @@ var buildReader2 = (entry2) => {
|
|
|
93504
93817
|
return readerInverseSinv(entry2);
|
|
93505
93818
|
case "alchemix-transmuter":
|
|
93506
93819
|
return readerAlchemixTransmuter(entry2);
|
|
93820
|
+
case "threejane-lcc":
|
|
93821
|
+
return readerThreeJaneLcc(entry2);
|
|
93507
93822
|
case "erc4626-cooldown":
|
|
93508
93823
|
return readerErc4626Cooldown(entry2);
|
|
93509
93824
|
case "erc4626-idle":
|
|
@@ -93672,9 +93987,13 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
93672
93987
|
}) : void 0;
|
|
93673
93988
|
const supplyRate = state.supplyRate ?? (rewards ? 0 : fetcherApr ?? 0);
|
|
93674
93989
|
const incentives = incentivesByAddress.get(addressLc);
|
|
93675
|
-
const rewardsRate = (rewards?.apr ?? 0) + incentiveApr(incentives);
|
|
93990
|
+
const rewardsRate = (rewards?.apr ?? 0) + incentiveApr(incentives) + incentiveApr(state.rewardStreams);
|
|
93676
93991
|
const depositRate = supplyRate + rewardsRate;
|
|
93677
|
-
const rewardStreams = rewards?.streams || incentives
|
|
93992
|
+
const rewardStreams = rewards?.streams || incentives || state.rewardStreams ? [
|
|
93993
|
+
...rewards?.streams ?? [],
|
|
93994
|
+
...incentives ?? [],
|
|
93995
|
+
...state.rewardStreams ?? []
|
|
93996
|
+
] : void 0;
|
|
93678
93997
|
const shareDec = entry2.decimals;
|
|
93679
93998
|
const underlyingDec = entry2.underlyingDecimals ?? entry2.decimals;
|
|
93680
93999
|
const shareUnit = 10n ** BigInt(shareDec);
|
|
@@ -93817,6 +94136,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
93817
94136
|
// "compounds per second" and "needs an approval" for every vault.
|
|
93818
94137
|
yieldWarmupSeconds: entry2.yieldWarmupSeconds,
|
|
93819
94138
|
accrual: entry2.accrual,
|
|
94139
|
+
...entry2.exitWholeOnly ? { exitWholeOnly: true } : {},
|
|
93820
94140
|
needsDepositApproval: entry2.needsDepositApproval,
|
|
93821
94141
|
// Drives the USER-balance read. Absent ⇒ `balanceOf` on the share
|
|
93822
94142
|
// token; `savings-account` is the one address that is not a token.
|
|
@@ -93950,14 +94270,14 @@ async function readTransmuterLots(multicallRetry, chainId, account, counted) {
|
|
|
93950
94270
|
}
|
|
93951
94271
|
ids.forEach(({ address, id }, i) => {
|
|
93952
94272
|
const raw = posRes[i];
|
|
93953
|
-
const
|
|
94273
|
+
const tuple2 = Array.isArray(raw) ? raw : raw && typeof raw === "object" ? [
|
|
93954
94274
|
raw.amount,
|
|
93955
94275
|
raw.startBlock,
|
|
93956
94276
|
raw.maturationBlock
|
|
93957
94277
|
] : void 0;
|
|
93958
|
-
const amount5 =
|
|
93959
|
-
const start =
|
|
93960
|
-
const end =
|
|
94278
|
+
const amount5 = tuple2 ? toBigInt16(tuple2[0]) : void 0;
|
|
94279
|
+
const start = tuple2 ? toBigInt16(tuple2[1]) : void 0;
|
|
94280
|
+
const end = tuple2 ? toBigInt16(tuple2[2]) : void 0;
|
|
93961
94281
|
if (amount5 === void 0 || start === void 0 || end === void 0) return;
|
|
93962
94282
|
if (end <= start) return;
|
|
93963
94283
|
const term = end - start;
|
|
@@ -93981,6 +94301,18 @@ async function readTransmuterLots(multicallRetry, chainId, account, counted) {
|
|
|
93981
94301
|
return out;
|
|
93982
94302
|
}
|
|
93983
94303
|
|
|
94304
|
+
// src/vaults/savings/lccAccount.ts
|
|
94305
|
+
var lccAccountCall = (facility, account) => ({
|
|
94306
|
+
call: { address: facility, name: "getAccount", params: [account] },
|
|
94307
|
+
abi: LccGetAccountAbi
|
|
94308
|
+
});
|
|
94309
|
+
var lccAccountMargin = (decoded) => {
|
|
94310
|
+
const a = decoded;
|
|
94311
|
+
if (!a || typeof a.activeMargin !== "bigint" || typeof a.pendingMargin !== "bigint" || typeof a.claimableExitMargin !== "bigint")
|
|
94312
|
+
return void 0;
|
|
94313
|
+
return a.activeMargin + a.pendingMargin + a.claimableExitMargin;
|
|
94314
|
+
};
|
|
94315
|
+
|
|
93984
94316
|
// src/vaults/savings/usualRewards.ts
|
|
93985
94317
|
var USUAL_DISTRIBUTION_MODULE = "0x75cc0c0ddd2ccafe6ec415be686267588011e36a";
|
|
93986
94318
|
var USUAL_REWARDS_API = "https://app.usual.money/api/rewards";
|
|
@@ -94067,9 +94399,9 @@ var fetchUsualRewardsClaimData = async (account, multicallRetry, opts = {}) => {
|
|
|
94067
94399
|
};
|
|
94068
94400
|
}
|
|
94069
94401
|
const [data, claimedRaw, onlySelf, redirect, paused, cap] = res;
|
|
94070
|
-
const
|
|
94071
|
-
const root =
|
|
94072
|
-
const rootTs =
|
|
94402
|
+
const tuple2 = Array.isArray(data) ? data : void 0;
|
|
94403
|
+
const root = tuple2?.[1];
|
|
94404
|
+
const rootTs = tuple2?.[0];
|
|
94073
94405
|
if (!isHex32(root) || typeof rootTs !== "bigint" || typeof claimedRaw !== "bigint" || typeof onlySelf !== "boolean" || typeof paused !== "boolean")
|
|
94074
94406
|
return {
|
|
94075
94407
|
status: "unknown",
|
|
@@ -99484,9 +99816,10 @@ function buildExit(input, t, fees2) {
|
|
|
99484
99816
|
assetsUsd: input.liquidityUsd,
|
|
99485
99817
|
ratio
|
|
99486
99818
|
} : void 0,
|
|
99487
|
-
//
|
|
99488
|
-
// constraint is
|
|
99489
|
-
|
|
99819
|
+
// Nearly every vault lets a holder exit part of a position; the
|
|
99820
|
+
// constraint is size or timing, not granularity. 3Jane LCC's unstake is
|
|
99821
|
+
// the exception: the whole position, irrevocably.
|
|
99822
|
+
partialAllowed: input.exitWholeOnly !== true,
|
|
99490
99823
|
priceRisk,
|
|
99491
99824
|
// Only the request/queue models have something to cancel, and only where
|
|
99492
99825
|
// the protocol exposes it — left undefined rather than guessed.
|
|
@@ -99582,6 +99915,7 @@ function buildPrincipal(input, t) {
|
|
|
99582
99915
|
risks.push("nav-drawdown");
|
|
99583
99916
|
if (input.solvency === "tranched-junior") risks.push("first-loss");
|
|
99584
99917
|
if (input.solvency === "undercollateralized") risks.push("bad-debt");
|
|
99918
|
+
if (input.solvency === "margined") risks.push("slashing");
|
|
99585
99919
|
if (input.solvency === "nav-attested" || input.navOracle != null)
|
|
99586
99920
|
risks.push("nav-drawdown");
|
|
99587
99921
|
return {
|
|
@@ -99823,7 +100157,7 @@ var CI = new Map(
|
|
|
99823
100157
|
var REFLECT_CI = new Map(
|
|
99824
100158
|
Object.entries(REFLECT_TRANCHE_SIDES).map(([m, x]) => [m.toLowerCase(), x])
|
|
99825
100159
|
);
|
|
99826
|
-
var svmSavingsCuration = (mint,
|
|
100160
|
+
var svmSavingsCuration = (mint, row2) => {
|
|
99827
100161
|
const pinned = SVM_SAVINGS_CURATION[mint] ?? CI.get(mint.toLowerCase());
|
|
99828
100162
|
if (pinned) return pinned;
|
|
99829
100163
|
const reflect = REFLECT_TRANCHE_SIDES[mint] ?? REFLECT_CI.get(mint.toLowerCase());
|
|
@@ -99832,8 +100166,8 @@ var svmSavingsCuration = (mint, row) => {
|
|
|
99832
100166
|
description: reflectTrancheDescription(reflect[0], reflect[1]),
|
|
99833
100167
|
solvency: reflect[0] === "senior" ? "tranched-senior" : "tranched-junior"
|
|
99834
100168
|
};
|
|
99835
|
-
if (
|
|
99836
|
-
const t = EXPONENT_TRANCHE_NAME.exec(
|
|
100169
|
+
if (row2?.brand !== "Exponent") return void 0;
|
|
100170
|
+
const t = EXPONENT_TRANCHE_NAME.exec(row2.name ?? "");
|
|
99837
100171
|
if (!t) return void 0;
|
|
99838
100172
|
return {
|
|
99839
100173
|
description: exponentTrancheDescription(
|
|
@@ -100171,12 +100505,12 @@ function withMaturityLabel(name, maturity) {
|
|
|
100171
100505
|
if (name.includes(year)) return name;
|
|
100172
100506
|
return `${name} \xB7 ${shortDate(secs)}`;
|
|
100173
100507
|
}
|
|
100174
|
-
function earnRowSubtitle(
|
|
100175
|
-
const curator =
|
|
100176
|
-
const stack = curator ?
|
|
100508
|
+
function earnRowSubtitle(row2) {
|
|
100509
|
+
const curator = row2.curator?.name?.trim();
|
|
100510
|
+
const stack = curator ? row2.protocol?.name ?? row2.brand : row2.brand ?? row2.protocol?.name;
|
|
100177
100511
|
const out = [];
|
|
100178
100512
|
const seen = /* @__PURE__ */ new Set();
|
|
100179
|
-
for (const part of [curator, stack, earnLabel("venueKind",
|
|
100513
|
+
for (const part of [curator, stack, earnLabel("venueKind", row2.venueKind)]) {
|
|
100180
100514
|
const value = part?.trim();
|
|
100181
100515
|
if (!value) continue;
|
|
100182
100516
|
const key5 = value.toLowerCase();
|
|
@@ -100187,7 +100521,7 @@ function earnRowSubtitle(row) {
|
|
|
100187
100521
|
return out.join(" \xB7 ");
|
|
100188
100522
|
}
|
|
100189
100523
|
function stampEarnSubtitles(rows) {
|
|
100190
|
-
for (const
|
|
100524
|
+
for (const row2 of rows) row2.subtitle = earnRowSubtitle(row2);
|
|
100191
100525
|
}
|
|
100192
100526
|
function renderedIdentity(m) {
|
|
100193
100527
|
return [m.chainId, m.brand ?? m.venue, m.name ?? "", m.asset.symbol].join("|");
|
|
@@ -100432,20 +100766,20 @@ function resolveVaultBasket(provider, meta, chainId) {
|
|
|
100432
100766
|
}
|
|
100433
100767
|
var RATE_UNAVAILABLE_SOURCES = /* @__PURE__ */ new Set(["unavailable", "exchange-rate-only"]);
|
|
100434
100768
|
var isRateSourceUnavailable = (rateSource) => !!rateSource && RATE_UNAVAILABLE_SOURCES.has(rateSource);
|
|
100435
|
-
function earnMarketFromVault(
|
|
100436
|
-
const provider = str6(
|
|
100437
|
-
const address = addr5(
|
|
100438
|
-
const underlying = addr5(
|
|
100769
|
+
function earnMarketFromVault(row2, chainId, opts = {}) {
|
|
100770
|
+
const provider = str6(row2.provider);
|
|
100771
|
+
const address = addr5(row2.vaultAddress, chainId);
|
|
100772
|
+
const underlying = addr5(row2.underlying, chainId);
|
|
100439
100773
|
if (!provider || !address || !underlying) return void 0;
|
|
100440
|
-
const meta =
|
|
100774
|
+
const meta = row2.providerMeta ?? {};
|
|
100441
100775
|
const basket = resolveVaultBasket(provider, meta, chainId);
|
|
100442
100776
|
const shareAddress = (provider === "kamino-kvault" ? addr5(meta.shareMint, chainId) : void 0) ?? address;
|
|
100443
|
-
const info =
|
|
100444
|
-
const rates =
|
|
100445
|
-
const tvl =
|
|
100446
|
-
const liq =
|
|
100447
|
-
const shareDecimals = num16(
|
|
100448
|
-
const assetDecimals = num16(
|
|
100777
|
+
const info = row2.vaultInfo ?? {};
|
|
100778
|
+
const rates = row2.rates ?? {};
|
|
100779
|
+
const tvl = row2.tvl ?? {};
|
|
100780
|
+
const liq = row2.liquidity ?? {};
|
|
100781
|
+
const shareDecimals = num16(row2.decimals) ?? 18;
|
|
100782
|
+
const assetDecimals = num16(row2.assetDecimals) ?? num16(row2.underlyingInfo?.asset?.decimals) ?? shareDecimals;
|
|
100449
100783
|
const rateUnavailable = isRateSourceUnavailable(str6(meta.rateSource));
|
|
100450
100784
|
const toPercent2 = (v) => rateUnavailable ? void 0 : ratePercent(v, provider, opts.fractionRateProviders);
|
|
100451
100785
|
const rewards = toPercent2(rates.rewardsRate);
|
|
@@ -100481,15 +100815,15 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100481
100815
|
venue: vaultVenue(provider),
|
|
100482
100816
|
venueKind: "vault",
|
|
100483
100817
|
// Curator first (it names the actual operator), then the provider brand.
|
|
100484
|
-
brand: str6(
|
|
100818
|
+
brand: str6(row2.curatorName) ?? venueBrand(vaultVenue(provider)),
|
|
100485
100819
|
// What the vault is BUILT ON, kept apart from who runs it — see
|
|
100486
100820
|
// `resolveEarnIdentity` for why this is not simply provider-vs-brand.
|
|
100487
100821
|
...withCuratorEntity(
|
|
100488
100822
|
resolveEarnIdentity(
|
|
100489
100823
|
vaultVenue(provider),
|
|
100490
|
-
str6(
|
|
100824
|
+
str6(row2.curatorName)
|
|
100491
100825
|
),
|
|
100492
|
-
str6(
|
|
100826
|
+
str6(row2.curatorEntity)
|
|
100493
100827
|
),
|
|
100494
100828
|
// The maturity is part of a fixed-term row's IDENTITY. Pendle ships names
|
|
100495
100829
|
// with no date, so several PTs on one underlying render identically —
|
|
@@ -100517,8 +100851,8 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100517
100851
|
name: withTrancheLabel(
|
|
100518
100852
|
withMaturityLabel(
|
|
100519
100853
|
stripLeadingBrand(
|
|
100520
|
-
vaultDisplayName(
|
|
100521
|
-
str6(
|
|
100854
|
+
vaultDisplayName(row2, info) ?? "",
|
|
100855
|
+
str6(row2.curatorName) ?? venueBrand(vaultVenue(provider))
|
|
100522
100856
|
) || void 0,
|
|
100523
100857
|
maturity
|
|
100524
100858
|
),
|
|
@@ -100529,19 +100863,19 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100529
100863
|
// its share mint lives in `providerMeta.shareMint`. Solana builders key on
|
|
100530
100864
|
// this ref (`svmEarnBuilderKey`), so it stays base58-verbatim.
|
|
100531
100865
|
ref: shareAddress,
|
|
100532
|
-
logoURI: str6(info.logoURI) ?? str6(
|
|
100866
|
+
logoURI: str6(info.logoURI) ?? str6(row2.underlyingInfo?.asset?.logoURI),
|
|
100533
100867
|
asset: {
|
|
100534
100868
|
address: underlying,
|
|
100535
|
-
symbol: str6(
|
|
100869
|
+
symbol: str6(row2.underlyingInfo?.asset?.symbol) ?? "",
|
|
100536
100870
|
decimals: assetDecimals,
|
|
100537
100871
|
assetGroup: str6(info.assetGroup),
|
|
100538
|
-
priceUsd: num16(
|
|
100872
|
+
priceUsd: num16(row2.underlyingInfo?.prices?.priceUsd)
|
|
100539
100873
|
},
|
|
100540
100874
|
// The vault IS a share token by construction; carry it so a withdraw in
|
|
100541
100875
|
// share units can be built without a second lookup.
|
|
100542
100876
|
shareToken: {
|
|
100543
100877
|
address: shareAddress,
|
|
100544
|
-
symbol: str6(info.symbol) ?? str6(
|
|
100878
|
+
symbol: str6(info.symbol) ?? str6(row2.symbol) ?? "",
|
|
100545
100879
|
decimals: shareDecimals
|
|
100546
100880
|
},
|
|
100547
100881
|
rate,
|
|
@@ -100579,8 +100913,8 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100579
100913
|
// since the surface was written and never populated — a tranche's
|
|
100580
100914
|
// first-loss position is the term most worth surfacing on a rate list.
|
|
100581
100915
|
counterparty: str6(meta.solvency),
|
|
100582
|
-
score: num16(
|
|
100583
|
-
label: str6(
|
|
100916
|
+
score: num16(row2.rating?.score),
|
|
100917
|
+
label: str6(row2.rating?.level),
|
|
100584
100918
|
illiquid: isIlliquid({
|
|
100585
100919
|
exitMode,
|
|
100586
100920
|
tvlUsd: num16(tvl.totalAssetsUsd),
|
|
@@ -100591,7 +100925,7 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100591
100925
|
// that forgets to stamp them is a compile error, not an empty CTA.
|
|
100592
100926
|
capabilities: [],
|
|
100593
100927
|
...basket ? { basket } : {},
|
|
100594
|
-
providerMeta:
|
|
100928
|
+
providerMeta: row2.providerMeta
|
|
100595
100929
|
};
|
|
100596
100930
|
return market;
|
|
100597
100931
|
}
|
|
@@ -100653,9 +100987,9 @@ function resolveAvailability(meta, maturity) {
|
|
|
100653
100987
|
reason
|
|
100654
100988
|
};
|
|
100655
100989
|
}
|
|
100656
|
-
function vaultDisplayName(
|
|
100657
|
-
const share =
|
|
100658
|
-
return str6(
|
|
100990
|
+
function vaultDisplayName(row2, info) {
|
|
100991
|
+
const share = row2.shareAsset;
|
|
100992
|
+
return str6(row2.name) ?? str6(info.name) ?? str6(row2.displayName) ?? str6(share?.name) ?? str6(share?.symbol) ?? str6(info.symbol) ?? str6(row2.symbol);
|
|
100659
100993
|
}
|
|
100660
100994
|
function resolveMaturity(meta) {
|
|
100661
100995
|
const expiry = num16(meta.expiry) ?? num16(meta.maturity);
|
|
@@ -100784,12 +101118,12 @@ var fromRaw = (raw, decimals) => {
|
|
|
100784
101118
|
const n = Number(s) / 10 ** decimals;
|
|
100785
101119
|
return Number.isFinite(n) ? n : void 0;
|
|
100786
101120
|
};
|
|
100787
|
-
function sdkRates(
|
|
101121
|
+
function sdkRates(row2, provider) {
|
|
100788
101122
|
if (!SDK_FRACTION_RATE_PROVIDERS.has(provider)) {
|
|
100789
101123
|
return {
|
|
100790
|
-
supplyRate: num17(
|
|
100791
|
-
rewardsRate: num17(
|
|
100792
|
-
totalRate: num17(
|
|
101124
|
+
supplyRate: num17(row2.supplyRate),
|
|
101125
|
+
rewardsRate: num17(row2.rewardsRate),
|
|
101126
|
+
totalRate: num17(row2.depositRate)
|
|
100793
101127
|
};
|
|
100794
101128
|
}
|
|
100795
101129
|
const pct5 = (v) => {
|
|
@@ -100798,91 +101132,92 @@ function sdkRates(row, provider) {
|
|
|
100798
101132
|
};
|
|
100799
101133
|
return {
|
|
100800
101134
|
// GMX splits fee APY from incentive APR; HyperCore reports one number.
|
|
100801
|
-
supplyRate: pct5(
|
|
100802
|
-
rewardsRate: pct5(
|
|
100803
|
-
totalRate: pct5(
|
|
101135
|
+
supplyRate: pct5(row2.baseApy ?? row2.apr),
|
|
101136
|
+
rewardsRate: pct5(row2.bonusApr),
|
|
101137
|
+
totalRate: pct5(row2.apy ?? row2.apr)
|
|
100804
101138
|
};
|
|
100805
101139
|
}
|
|
100806
101140
|
function toVaultTermInput(vault, provider, chainId) {
|
|
100807
|
-
const
|
|
100808
|
-
const address = str7(
|
|
101141
|
+
const row2 = vault;
|
|
101142
|
+
const address = str7(row2.address)?.toLowerCase();
|
|
100809
101143
|
if (!address) return void 0;
|
|
100810
|
-
const assetDecimals = num17(
|
|
100811
|
-
const asset =
|
|
101144
|
+
const assetDecimals = num17(row2.assetDecimals) ?? num17(row2.decimals);
|
|
101145
|
+
const asset = row2.asset;
|
|
100812
101146
|
return {
|
|
100813
101147
|
provider,
|
|
100814
101148
|
chainId,
|
|
100815
101149
|
address,
|
|
100816
101150
|
vaultUid: `vault.${provider}:${chainId}:${address}`,
|
|
100817
|
-
name: str7(
|
|
100818
|
-
brand: str7(
|
|
100819
|
-
curatorName: str7(
|
|
100820
|
-
description: str7(
|
|
101151
|
+
name: str7(row2.displayName) ?? str7(row2.name),
|
|
101152
|
+
brand: str7(row2.brand),
|
|
101153
|
+
curatorName: str7(row2.curatorName),
|
|
101154
|
+
description: str7(row2.description),
|
|
100821
101155
|
asset: {
|
|
100822
101156
|
chainId,
|
|
100823
|
-
address: str7(
|
|
101157
|
+
address: str7(row2.underlying)?.toLowerCase() ?? "",
|
|
100824
101158
|
symbol: str7(asset?.symbol),
|
|
100825
101159
|
name: str7(asset?.name),
|
|
100826
101160
|
decimals: assetDecimals,
|
|
100827
101161
|
assetGroup: str7(asset?.assetGroup),
|
|
100828
101162
|
logoURI: str7(asset?.logoURI)
|
|
100829
101163
|
},
|
|
100830
|
-
...sdkRates(
|
|
100831
|
-
isForwardApr: bool5(
|
|
100832
|
-
aprWindow: str7(
|
|
101164
|
+
...sdkRates(row2, provider),
|
|
101165
|
+
isForwardApr: bool5(row2.isForwardApr),
|
|
101166
|
+
aprWindow: str7(row2.aprWindow),
|
|
100833
101167
|
// GMX / HyperCore / Pendle report USD only and set the token-denominated
|
|
100834
101168
|
// fields to their USD figure — `totalAssetsFormatted` is the cross-provider
|
|
100835
101169
|
// magnitude either way, so prefer it over re-deriving from raw.
|
|
100836
|
-
totalAssets: num17(
|
|
100837
|
-
totalAssetsUsd: num17(
|
|
100838
|
-
liquidity: num17(
|
|
100839
|
-
liquidityUsd: num17(
|
|
100840
|
-
instantLiquidityRatio: num17(
|
|
100841
|
-
totalBorrowed: fromRaw(
|
|
100842
|
-
expectedLiquidity: fromRaw(
|
|
100843
|
-
withdrawalMode: str7(
|
|
100844
|
-
withdrawalCooldownSeconds: num17(
|
|
100845
|
-
withdrawFeeBps: num17(
|
|
100846
|
-
depositFeeBps: num17(
|
|
100847
|
-
feeScheduleComplete: bool5(
|
|
100848
|
-
exitRoutes: routes(
|
|
100849
|
-
fee: num17(
|
|
100850
|
-
managementFee: num17(
|
|
100851
|
-
swapFeeRate: num17(
|
|
100852
|
-
redemptionDiscountBps: num17(
|
|
100853
|
-
instantRedeemEnabled: bool5(
|
|
100854
|
-
yieldWarmupSeconds: num17(
|
|
100855
|
-
accrual: str7(
|
|
100856
|
-
|
|
100857
|
-
|
|
100858
|
-
|
|
100859
|
-
|
|
100860
|
-
|
|
100861
|
-
|
|
100862
|
-
|
|
100863
|
-
|
|
100864
|
-
|
|
100865
|
-
|
|
100866
|
-
|
|
100867
|
-
|
|
100868
|
-
|
|
100869
|
-
|
|
100870
|
-
|
|
100871
|
-
|
|
100872
|
-
|
|
100873
|
-
|
|
100874
|
-
|
|
100875
|
-
|
|
100876
|
-
|
|
100877
|
-
|
|
101170
|
+
totalAssets: num17(row2.totalAssetsFormatted) ?? fromRaw(row2.totalAssets, assetDecimals),
|
|
101171
|
+
totalAssetsUsd: num17(row2.totalAssetsUsd) ?? num17(row2.tvlUsd),
|
|
101172
|
+
liquidity: num17(row2.liquidityFormatted) ?? fromRaw(row2.liquidity, assetDecimals),
|
|
101173
|
+
liquidityUsd: num17(row2.liquidityUsd),
|
|
101174
|
+
instantLiquidityRatio: num17(row2.instantLiquidityRatio),
|
|
101175
|
+
totalBorrowed: fromRaw(row2.totalBorrowed, assetDecimals),
|
|
101176
|
+
expectedLiquidity: fromRaw(row2.expectedLiquidity, assetDecimals),
|
|
101177
|
+
withdrawalMode: str7(row2.withdrawalMode),
|
|
101178
|
+
withdrawalCooldownSeconds: num17(row2.withdrawalCooldownSeconds),
|
|
101179
|
+
withdrawFeeBps: num17(row2.withdrawFeeBps),
|
|
101180
|
+
depositFeeBps: num17(row2.depositFeeBps),
|
|
101181
|
+
feeScheduleComplete: bool5(row2.feeScheduleComplete),
|
|
101182
|
+
exitRoutes: routes(row2.exitRoutes),
|
|
101183
|
+
fee: num17(row2.fee),
|
|
101184
|
+
managementFee: num17(row2.managementFee),
|
|
101185
|
+
swapFeeRate: num17(row2.feeRate),
|
|
101186
|
+
redemptionDiscountBps: num17(row2.redemptionDiscountBps),
|
|
101187
|
+
instantRedeemEnabled: bool5(row2.instantRedeemEnabled),
|
|
101188
|
+
yieldWarmupSeconds: num17(row2.yieldWarmupSeconds),
|
|
101189
|
+
accrual: str7(row2.accrual),
|
|
101190
|
+
exitWholeOnly: bool5(row2.exitWholeOnly),
|
|
101191
|
+
needsDepositApproval: bool5(row2.needsDepositApproval),
|
|
101192
|
+
isMintable: bool5(row2.isMintable),
|
|
101193
|
+
depositCapacity: str7(row2.depositCapacity),
|
|
101194
|
+
supplyCap: str7(row2.supplyCap),
|
|
101195
|
+
paused: bool5(row2.isPaused),
|
|
101196
|
+
depositsPaused: bool5(row2.isDepositPaused),
|
|
101197
|
+
withdrawalsPaused: bool5(row2.isWithdrawalPaused),
|
|
101198
|
+
isClosed: bool5(row2.isClosed),
|
|
101199
|
+
whitelisted: bool5(row2.whitelisted),
|
|
101200
|
+
expiry: num17(row2.expiry),
|
|
101201
|
+
termSeconds: num17(row2.termSeconds),
|
|
101202
|
+
rateBasis: str7(row2.rateBasis),
|
|
101203
|
+
timelock: num17(row2.timelock),
|
|
101204
|
+
allocators: strArray(row2.allocators),
|
|
101205
|
+
owner: str7(row2.owner),
|
|
101206
|
+
curator: str7(row2.curator),
|
|
101207
|
+
guardian: str7(row2.guardian),
|
|
101208
|
+
feeRecipient: str7(row2.feeRecipient),
|
|
101209
|
+
solvency: str7(row2.solvency),
|
|
101210
|
+
navOracle: str7(row2.navOracle),
|
|
101211
|
+
yieldProfile: str7(row2.yieldProfile),
|
|
101212
|
+
exposures: Array.isArray(row2.exposures) ? row2.exposures : void 0
|
|
100878
101213
|
};
|
|
100879
101214
|
}
|
|
100880
|
-
function savingsCuration(provider, chainId, address,
|
|
101215
|
+
function savingsCuration(provider, chainId, address, row2) {
|
|
100881
101216
|
if (provider !== "savings") {
|
|
100882
101217
|
const managed = managedVaultCuration(provider, chainId, address);
|
|
100883
101218
|
return managed ? { description: managed.description, solvency: managed.solvency } : {};
|
|
100884
101219
|
}
|
|
100885
|
-
const svm = svmSavingsCuration(address,
|
|
101220
|
+
const svm = svmSavingsCuration(address, row2);
|
|
100886
101221
|
if (svm)
|
|
100887
101222
|
return {
|
|
100888
101223
|
description: svm.description || void 0,
|
|
@@ -100897,6 +101232,7 @@ function savingsCuration(provider, chainId, address, row) {
|
|
|
100897
101232
|
description: e.description || void 0,
|
|
100898
101233
|
solvency: e.solvency,
|
|
100899
101234
|
accrual: e.accrual,
|
|
101235
|
+
exitWholeOnly: e.exitWholeOnly,
|
|
100900
101236
|
yieldWarmupSeconds: e.yieldWarmupSeconds,
|
|
100901
101237
|
needsDepositApproval: e.needsDepositApproval,
|
|
100902
101238
|
// A dated bond's maturity (Usual bUSD0) — static, and the one fact that
|
|
@@ -100956,6 +101292,7 @@ function vaultTermInputFromEarnMarket(m) {
|
|
|
100956
101292
|
instantRedeemEnabled: bool5(meta.instantRedeemEnabled),
|
|
100957
101293
|
yieldWarmupSeconds: num17(meta.yieldWarmupSeconds) ?? curated.yieldWarmupSeconds,
|
|
100958
101294
|
accrual: str7(meta.accrual) ?? curated.accrual,
|
|
101295
|
+
exitWholeOnly: bool5(meta.exitWholeOnly) ?? curated.exitWholeOnly,
|
|
100959
101296
|
needsDepositApproval: bool5(meta.needsDepositApproval) ?? curated.needsDepositApproval,
|
|
100960
101297
|
// `canDeposit` already folds in the cap, the pause and the gate, so it is
|
|
100961
101298
|
// the authoritative answer — but the REASON is what a disabled CTA renders,
|
|
@@ -100992,33 +101329,33 @@ function originRates(rates) {
|
|
|
100992
101329
|
totalRate: num17(rates.totalRate) ?? deposit
|
|
100993
101330
|
};
|
|
100994
101331
|
}
|
|
100995
|
-
function vaultTermInputFromSourceRow(
|
|
100996
|
-
const provider = str7(
|
|
100997
|
-
const address = str7(
|
|
101332
|
+
function vaultTermInputFromSourceRow(row2, chainId) {
|
|
101333
|
+
const provider = str7(row2.provider);
|
|
101334
|
+
const address = str7(row2.vaultAddress)?.toLowerCase();
|
|
100998
101335
|
if (!provider || !address) return void 0;
|
|
100999
|
-
const meta =
|
|
101000
|
-
const rates =
|
|
101001
|
-
const tvl =
|
|
101002
|
-
const liq =
|
|
101003
|
-
const info =
|
|
101004
|
-
const assetInfo =
|
|
101005
|
-
const assetDecimals = num17(
|
|
101336
|
+
const meta = row2.providerMeta ?? {};
|
|
101337
|
+
const rates = row2.rates ?? {};
|
|
101338
|
+
const tvl = row2.tvl ?? {};
|
|
101339
|
+
const liq = row2.liquidity ?? {};
|
|
101340
|
+
const info = row2.vaultInfo ?? {};
|
|
101341
|
+
const assetInfo = row2.underlyingInfo?.asset;
|
|
101342
|
+
const assetDecimals = num17(row2.assetDecimals) ?? num17(assetInfo?.decimals) ?? num17(row2.decimals);
|
|
101006
101343
|
const curated = savingsCuration(provider, chainId, address, {
|
|
101007
|
-
brand: str7(
|
|
101008
|
-
name: str7(info.name) ?? str7(
|
|
101344
|
+
brand: str7(row2.curatorName) ?? str7(meta.brand),
|
|
101345
|
+
name: str7(info.name) ?? str7(row2.displayName) ?? str7(row2.name)
|
|
101009
101346
|
});
|
|
101010
101347
|
return {
|
|
101011
101348
|
provider,
|
|
101012
101349
|
chainId,
|
|
101013
101350
|
address,
|
|
101014
101351
|
vaultUid: `vault.${provider}:${chainId}:${address}`,
|
|
101015
|
-
name: str7(info.name) ?? str7(
|
|
101016
|
-
brand: str7(
|
|
101017
|
-
curatorName: str7(
|
|
101352
|
+
name: str7(info.name) ?? str7(row2.displayName) ?? str7(row2.name),
|
|
101353
|
+
brand: str7(row2.curatorName) ?? str7(meta.brand),
|
|
101354
|
+
curatorName: str7(row2.curatorName),
|
|
101018
101355
|
description: str7(meta.description) ?? curated.description,
|
|
101019
101356
|
asset: {
|
|
101020
101357
|
chainId,
|
|
101021
|
-
address: str7(
|
|
101358
|
+
address: str7(row2.underlying)?.toLowerCase() ?? "",
|
|
101022
101359
|
symbol: str7(assetInfo?.symbol),
|
|
101023
101360
|
decimals: assetDecimals,
|
|
101024
101361
|
assetGroup: str7(info.assetGroup),
|
|
@@ -101045,6 +101382,7 @@ function vaultTermInputFromSourceRow(row, chainId) {
|
|
|
101045
101382
|
instantRedeemEnabled: bool5(meta.instantRedeemEnabled),
|
|
101046
101383
|
yieldWarmupSeconds: num17(meta.yieldWarmupSeconds) ?? curated.yieldWarmupSeconds,
|
|
101047
101384
|
accrual: str7(meta.accrual) ?? curated.accrual,
|
|
101385
|
+
exitWholeOnly: bool5(meta.exitWholeOnly) ?? curated.exitWholeOnly,
|
|
101048
101386
|
needsDepositApproval: bool5(meta.needsDepositApproval) ?? curated.needsDepositApproval,
|
|
101049
101387
|
isMintable: bool5(meta.isMintable),
|
|
101050
101388
|
depositCapacity: str7(meta.depositCapacity) ?? str7(meta.maxDeposit),
|
|
@@ -101066,7 +101404,7 @@ function vaultTermInputFromSourceRow(row, chainId) {
|
|
|
101066
101404
|
solvency: str7(meta.solvency) ?? curated.solvency,
|
|
101067
101405
|
navOracle: str7(meta.navOracle),
|
|
101068
101406
|
yieldProfile: str7(info.yieldProfile),
|
|
101069
|
-
exposures: Array.isArray(
|
|
101407
|
+
exposures: Array.isArray(row2.exposures) ? row2.exposures : Array.isArray(meta.exposures) ? meta.exposures : void 0
|
|
101070
101408
|
};
|
|
101071
101409
|
}
|
|
101072
101410
|
|
|
@@ -101130,7 +101468,7 @@ var SVM_VAULT_PROVIDERS = [
|
|
|
101130
101468
|
"exponent"
|
|
101131
101469
|
];
|
|
101132
101470
|
var HYPERCORE_PROVIDER_CHAIN = "999";
|
|
101133
|
-
var keep = (rows, ok4) => Object.fromEntries(Object.entries(rows).filter(([,
|
|
101471
|
+
var keep = (rows, ok4) => Object.fromEntries(Object.entries(rows).filter(([, row2]) => ok4(row2)));
|
|
101134
101472
|
var dropUnservableRates = (out) => {
|
|
101135
101473
|
const nowSecs = Math.floor(Date.now() / 1e3);
|
|
101136
101474
|
if (out.morpho) out.morpho = dropUnrealizableRates(out.morpho);
|
|
@@ -101935,11 +102273,11 @@ function pick2(src, ...keys) {
|
|
|
101935
102273
|
}
|
|
101936
102274
|
return void 0;
|
|
101937
102275
|
}
|
|
101938
|
-
function toTermSheetInput(
|
|
101939
|
-
const marketUid = ctx.marketUid ?? pick2(
|
|
101940
|
-
const lender = ctx.lender ?? pick2(
|
|
101941
|
-
const chainId = ctx.chainId ?? pick2(
|
|
101942
|
-
const rawConfig = pick2(
|
|
102276
|
+
function toTermSheetInput(row2, ctx = {}) {
|
|
102277
|
+
const marketUid = ctx.marketUid ?? pick2(row2, "marketUid", "poolId") ?? "";
|
|
102278
|
+
const lender = ctx.lender ?? pick2(row2, "lender", "lenderKey", "lenderInfo.key") ?? marketUid.split(":")[0] ?? "";
|
|
102279
|
+
const chainId = ctx.chainId ?? pick2(row2, "chainId") ?? marketUid.split(":")[1] ?? "";
|
|
102280
|
+
const rawConfig = pick2(row2, "config") ?? void 0;
|
|
101943
102281
|
const config = rawConfig ? Object.fromEntries(
|
|
101944
102282
|
Object.entries(rawConfig).map(([k, v]) => [
|
|
101945
102283
|
k,
|
|
@@ -101965,7 +102303,7 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
101965
102303
|
}
|
|
101966
102304
|
])
|
|
101967
102305
|
) : void 0;
|
|
101968
|
-
const rewards = pick2(
|
|
102306
|
+
const rewards = pick2(row2, "rewards")?.map((r) => ({
|
|
101969
102307
|
asset: r?.asset,
|
|
101970
102308
|
depositRate: num18(r?.depositRate),
|
|
101971
102309
|
variableBorrowRate: num18(r?.variableBorrowRate),
|
|
@@ -101981,59 +102319,59 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
101981
102319
|
// In-package rows carry `asset` as a bare ADDRESS and the metadata under
|
|
101982
102320
|
// `underlyingInfo.asset`; the origin's rows carry the object under both.
|
|
101983
102321
|
// Take the first OBJECT, so a string never shadows the metadata beside it.
|
|
101984
|
-
asset: [pick2(
|
|
102322
|
+
asset: [pick2(row2, "asset"), pick2(row2, "underlyingInfo.asset")].find(
|
|
101985
102323
|
(v) => !!v && typeof v === "object"
|
|
101986
102324
|
),
|
|
101987
|
-
underlying: pick2(
|
|
101988
|
-
decimals: num18(pick2(
|
|
101989
|
-
depositRate: num18(pick2(
|
|
101990
|
-
variableBorrowRate: num18(pick2(
|
|
101991
|
-
stableBorrowRate: num18(pick2(
|
|
101992
|
-
intrinsicYield: num18(pick2(
|
|
102325
|
+
underlying: pick2(row2, "underlying"),
|
|
102326
|
+
decimals: num18(pick2(row2, "decimals")),
|
|
102327
|
+
depositRate: num18(pick2(row2, "depositRate")),
|
|
102328
|
+
variableBorrowRate: num18(pick2(row2, "variableBorrowRate")),
|
|
102329
|
+
stableBorrowRate: num18(pick2(row2, "stableBorrowRate")),
|
|
102330
|
+
intrinsicYield: num18(pick2(row2, "intrinsicYield")),
|
|
101993
102331
|
rewards,
|
|
101994
|
-
rateModel: pick2(
|
|
101995
|
-
originationFee: num18(pick2(
|
|
101996
|
-
totalDeposits: num18(pick2(
|
|
101997
|
-
totalDebt: num18(pick2(
|
|
101998
|
-
totalDebtStable: num18(pick2(
|
|
101999
|
-
totalLiquidity: num18(pick2(
|
|
102000
|
-
borrowLiquidity: num18(pick2(
|
|
102001
|
-
totalDepositsUsd: num18(pick2(
|
|
102002
|
-
totalDebtUsd: num18(pick2(
|
|
102003
|
-
totalLiquidityUsd: num18(pick2(
|
|
102004
|
-
utilization: num18(pick2(
|
|
102005
|
-
irmTotalDeposits: num18(pick2(
|
|
102006
|
-
irmTotalDebt: num18(pick2(
|
|
102007
|
-
lockupRatio: num18(pick2(
|
|
102008
|
-
minBorrow: pick2(
|
|
102009
|
-
supplyCap: num18(pick2(
|
|
102010
|
-
borrowCap: num18(pick2(
|
|
102011
|
-
debtCeiling: pick2(
|
|
102012
|
-
isActive: pick2(
|
|
102013
|
-
isFrozen: pick2(
|
|
102332
|
+
rateModel: pick2(row2, "rateModel"),
|
|
102333
|
+
originationFee: num18(pick2(row2, "originationFee")),
|
|
102334
|
+
totalDeposits: num18(pick2(row2, "totalDeposits")),
|
|
102335
|
+
totalDebt: num18(pick2(row2, "totalDebt")),
|
|
102336
|
+
totalDebtStable: num18(pick2(row2, "totalDebtStable")),
|
|
102337
|
+
totalLiquidity: num18(pick2(row2, "totalLiquidity")),
|
|
102338
|
+
borrowLiquidity: num18(pick2(row2, "borrowLiquidity")),
|
|
102339
|
+
totalDepositsUsd: num18(pick2(row2, "totalDepositsUSD", "totalDepositsUsd")),
|
|
102340
|
+
totalDebtUsd: num18(pick2(row2, "totalDebtUSD", "totalDebtUsd")),
|
|
102341
|
+
totalLiquidityUsd: num18(pick2(row2, "totalLiquidityUSD", "totalLiquidityUsd")),
|
|
102342
|
+
utilization: num18(pick2(row2, "utilization")),
|
|
102343
|
+
irmTotalDeposits: num18(pick2(row2, "irmTotalDeposits")),
|
|
102344
|
+
irmTotalDebt: num18(pick2(row2, "irmTotalDebt")),
|
|
102345
|
+
lockupRatio: num18(pick2(row2, "lockupRatio")),
|
|
102346
|
+
minBorrow: pick2(row2, "minBorrow", "caps.minBorrow") ?? void 0,
|
|
102347
|
+
supplyCap: num18(pick2(row2, "supplyCap", "caps.supplyCap")),
|
|
102348
|
+
borrowCap: num18(pick2(row2, "borrowCap", "caps.borrowCap")),
|
|
102349
|
+
debtCeiling: pick2(row2, "debtCeiling", "caps.debtCeiling"),
|
|
102350
|
+
isActive: pick2(row2, "isActive", "flags.isActive"),
|
|
102351
|
+
isFrozen: pick2(row2, "isFrozen", "flags.isFrozen"),
|
|
102014
102352
|
borrowingEnabled: pick2(
|
|
102015
|
-
|
|
102353
|
+
row2,
|
|
102016
102354
|
"borrowingEnabled",
|
|
102017
102355
|
"flags.borrowingEnabled"
|
|
102018
102356
|
),
|
|
102019
102357
|
depositsEnabled: pick2(
|
|
102020
|
-
|
|
102358
|
+
row2,
|
|
102021
102359
|
"depositsEnabled",
|
|
102022
102360
|
"flags.depositsEnabled"
|
|
102023
102361
|
),
|
|
102024
102362
|
collateralActive: pick2(
|
|
102025
|
-
|
|
102363
|
+
row2,
|
|
102026
102364
|
"collateralActive",
|
|
102027
102365
|
"flags.collateralActive"
|
|
102028
102366
|
),
|
|
102029
|
-
hasStable: pick2(
|
|
102367
|
+
hasStable: pick2(row2, "hasStable", "flags.hasStable"),
|
|
102030
102368
|
variableBorrowDisabled: pick2(
|
|
102031
|
-
|
|
102369
|
+
row2,
|
|
102032
102370
|
"variableBorrowDisabled",
|
|
102033
102371
|
"flags.variableBorrowDisabled"
|
|
102034
102372
|
),
|
|
102035
|
-
...pick2(
|
|
102036
|
-
siloedBorrowing: pick2(
|
|
102373
|
+
...pick2(row2, "siloedBorrowing", "flags.siloedBorrowing") != null ? {
|
|
102374
|
+
siloedBorrowing: pick2(row2, "siloedBorrowing", "flags.siloedBorrowing") === true
|
|
102037
102375
|
} : {},
|
|
102038
102376
|
config,
|
|
102039
102377
|
// `caps.` is NOT optional here. `/pools/latest` serializes both of these as
|
|
@@ -102044,13 +102382,13 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
102044
102382
|
// builder's `?? 1`, so Aave and Compound V2 published "the whole debt can
|
|
102045
102383
|
// be repaid in one liquidation" against a real close factor of 0.5, and
|
|
102046
102384
|
// Aave V4's `targetHealthFactor` vanished entirely.
|
|
102047
|
-
closeFactor: num18(pick2(
|
|
102385
|
+
closeFactor: num18(pick2(row2, "closeFactor", "caps.closeFactor")),
|
|
102048
102386
|
targetHealthFactor: num18(
|
|
102049
|
-
pick2(
|
|
102387
|
+
pick2(row2, "targetHealthFactor", "caps.targetHealthFactor")
|
|
102050
102388
|
),
|
|
102051
|
-
fixedTerm: pick2(
|
|
102052
|
-
terms: pick2(
|
|
102053
|
-
market: resolveMarketDescriptors(
|
|
102389
|
+
fixedTerm: pick2(row2, "fixedTerm") ?? ctx.fixedTerm,
|
|
102390
|
+
terms: pick2(row2, "terms"),
|
|
102391
|
+
market: resolveMarketDescriptors(row2, ctx.market)
|
|
102054
102392
|
};
|
|
102055
102393
|
}
|
|
102056
102394
|
var ROW_DESCRIPTOR_KEYS = [
|
|
@@ -102101,12 +102439,12 @@ var ROW_DESCRIPTOR_KEYS = [
|
|
|
102101
102439
|
// here the flat path reports a confident 0 % on every Blue market.
|
|
102102
102440
|
"fee"
|
|
102103
102441
|
];
|
|
102104
|
-
function resolveMarketDescriptors(
|
|
102105
|
-
const fromParams = pick2(
|
|
102442
|
+
function resolveMarketDescriptors(row2, ctxMarket) {
|
|
102443
|
+
const fromParams = pick2(row2, "params.market");
|
|
102106
102444
|
const rowLevel = {};
|
|
102107
102445
|
for (const k of ROW_DESCRIPTOR_KEYS) {
|
|
102108
|
-
const underParams =
|
|
102109
|
-
if (
|
|
102446
|
+
const underParams = row2.params?.[k];
|
|
102447
|
+
if (row2[k] != null) rowLevel[k] = row2[k];
|
|
102110
102448
|
else if (underParams != null && k !== "fee") rowLevel[k] = underParams;
|
|
102111
102449
|
}
|
|
102112
102450
|
const merged = { ...ctxMarket ?? {}, ...fromParams ?? {}, ...rowLevel };
|
|
@@ -105401,10 +105739,10 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105401
105739
|
const oracleByMarketUid = /* @__PURE__ */ new Map();
|
|
105402
105740
|
const governanceByMarketUid = /* @__PURE__ */ new Map();
|
|
105403
105741
|
const assetRisk = {};
|
|
105404
|
-
for (const
|
|
105405
|
-
const uid = String(
|
|
105742
|
+
for (const row2 of rows) {
|
|
105743
|
+
const uid = String(row2?.marketUid ?? "");
|
|
105406
105744
|
if (!uid) continue;
|
|
105407
|
-
const feeds = Array.isArray(
|
|
105745
|
+
const feeds = Array.isArray(row2?.oracleInfo?.feeds) ? row2.oracleInfo.feeds : [];
|
|
105408
105746
|
if (feeds.length > 0) {
|
|
105409
105747
|
const primary = feeds.reduce(
|
|
105410
105748
|
(worst, f) => BAND_ORDER.indexOf(String(f?.band)) > BAND_ORDER.indexOf(String(worst?.band)) ? f : worst
|
|
@@ -105418,13 +105756,13 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105418
105756
|
correctOracle: primary?.correctOracle ?? void 0,
|
|
105419
105757
|
denominatorMatch: primary?.denominatorMatch ?? void 0,
|
|
105420
105758
|
fixedRate: primary?.fixedRate ?? void 0,
|
|
105421
|
-
score: primary?.score ??
|
|
105422
|
-
band: primary?.band ??
|
|
105759
|
+
score: primary?.score ?? row2?.oracleInfo?.worstScore,
|
|
105760
|
+
band: primary?.band ?? row2?.oracleInfo?.worstBand,
|
|
105423
105761
|
flags: Array.isArray(primary?.flags) ? primary.flags : void 0,
|
|
105424
105762
|
components: feeds.length > 1 ? feeds.map((f) => String(f?.oracle ?? "")).filter(Boolean) : void 0
|
|
105425
105763
|
});
|
|
105426
105764
|
}
|
|
105427
|
-
const breakdown = Array.isArray(
|
|
105765
|
+
const breakdown = Array.isArray(row2?.risk?.breakdown) ? row2.risk.breakdown : [];
|
|
105428
105766
|
const gov = breakdown.find((b) => b?.category === "governance");
|
|
105429
105767
|
if (gov) {
|
|
105430
105768
|
governanceByMarketUid.set(uid, {
|
|
@@ -105442,10 +105780,10 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105442
105780
|
});
|
|
105443
105781
|
}
|
|
105444
105782
|
const token = breakdown.find((b) => b?.category === "token");
|
|
105445
|
-
const chainId = String(
|
|
105783
|
+
const chainId = String(row2?.chainId ?? uid.split(":")[1] ?? "");
|
|
105446
105784
|
const address = termAddressKey(
|
|
105447
105785
|
chainId,
|
|
105448
|
-
String(
|
|
105786
|
+
String(row2?.asset?.address ?? row2?.underlying ?? uid.split(":")[2] ?? "")
|
|
105449
105787
|
);
|
|
105450
105788
|
if (token?.score != null && chainId && address) {
|
|
105451
105789
|
assetRisk[chainId] ??= {};
|
|
@@ -106022,13 +106360,13 @@ var FIXED_TERM_PREFIXES = [
|
|
|
106022
106360
|
];
|
|
106023
106361
|
function collateralSymbolsByVenue(rows, fallbackChainId) {
|
|
106024
106362
|
const byVenue = /* @__PURE__ */ new Map();
|
|
106025
|
-
for (const
|
|
106026
|
-
const venue = str6(
|
|
106027
|
-
const chainId = str6(
|
|
106363
|
+
for (const row2 of rows) {
|
|
106364
|
+
const venue = str6(row2.lender) ?? str6(row2.lenderKey);
|
|
106365
|
+
const chainId = str6(row2.chainId) ?? fallbackChainId;
|
|
106028
106366
|
if (!venue || !chainId) continue;
|
|
106029
|
-
const collateralActive =
|
|
106367
|
+
const collateralActive = row2.flags?.collateralActive ?? row2.collateralActive;
|
|
106030
106368
|
if (collateralActive !== true) continue;
|
|
106031
|
-
const symbol = str6(
|
|
106369
|
+
const symbol = str6(row2.underlyingInfo?.asset?.symbol) ?? str6(row2.asset?.symbol);
|
|
106032
106370
|
if (!symbol) continue;
|
|
106033
106371
|
const key5 = venueGroupKey(chainId, venue);
|
|
106034
106372
|
let set = byVenue.get(key5);
|
|
@@ -106040,13 +106378,13 @@ function collateralSymbolsByVenue(rows, fallbackChainId) {
|
|
|
106040
106378
|
function venueGroupKey(chainId, venue) {
|
|
106041
106379
|
return `${chainId}::${venue}`;
|
|
106042
106380
|
}
|
|
106043
|
-
function resolveBasket(
|
|
106381
|
+
function resolveBasket(row2, chainId = row2.chainId) {
|
|
106044
106382
|
const provider = listaCollateralProvider(
|
|
106045
|
-
|
|
106046
|
-
str6(
|
|
106383
|
+
row2.chainId ?? "",
|
|
106384
|
+
str6(row2.params?.market?.collateralProvider)
|
|
106047
106385
|
);
|
|
106048
106386
|
if (provider?.kind === "smart-lp" && provider.coins) {
|
|
106049
|
-
const rowAsset = addr5(
|
|
106387
|
+
const rowAsset = addr5(row2.underlying) ?? addr5(row2.asset?.address);
|
|
106050
106388
|
if (rowAsset && rowAsset === provider.collateralToken.toLowerCase()) {
|
|
106051
106389
|
return {
|
|
106052
106390
|
// The row's asset IS the receipt — one row for the whole position,
|
|
@@ -106071,12 +106409,12 @@ function resolveBasket(row, chainId = row.chainId) {
|
|
|
106071
106409
|
};
|
|
106072
106410
|
}
|
|
106073
106411
|
}
|
|
106074
|
-
if (
|
|
106075
|
-
const f =
|
|
106412
|
+
if (row2.autoBalanced !== true) return void 0;
|
|
106413
|
+
const f = row2.fluid;
|
|
106076
106414
|
if (f && f.isSmartCol !== true) return void 0;
|
|
106077
106415
|
const legs = (f?.collateralPair ?? []).map((a) => addr5(a, chainId)).filter((a) => !!a).map((address) => ({ address }));
|
|
106078
106416
|
if (legs.length > 0) {
|
|
106079
|
-
const rowAsset = addr5(
|
|
106417
|
+
const rowAsset = addr5(row2.underlying, chainId) ?? addr5(row2.asset?.address, chainId);
|
|
106080
106418
|
if (!rowAsset || !legs.some((l) => l.address === rowAsset)) return void 0;
|
|
106081
106419
|
}
|
|
106082
106420
|
return {
|
|
@@ -106089,8 +106427,8 @@ function resolveBasket(row, chainId = row.chainId) {
|
|
|
106089
106427
|
...f?.supplyDexTradingRate != null || f?.collateralPair ? { pool: "fluid-dex" } : {}
|
|
106090
106428
|
};
|
|
106091
106429
|
}
|
|
106092
|
-
function earnMarketFromPool(
|
|
106093
|
-
const marketUid = str6(
|
|
106430
|
+
function earnMarketFromPool(row2, fallbackChainId, venueCollaterals) {
|
|
106431
|
+
const marketUid = str6(row2.marketUid);
|
|
106094
106432
|
if (!marketUid) return void 0;
|
|
106095
106433
|
let earnUid;
|
|
106096
106434
|
try {
|
|
@@ -106098,24 +106436,24 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106098
106436
|
} catch {
|
|
106099
106437
|
return void 0;
|
|
106100
106438
|
}
|
|
106101
|
-
const chainId = str6(
|
|
106102
|
-
const venue = str6(
|
|
106439
|
+
const chainId = str6(row2.chainId) ?? fallbackChainId;
|
|
106440
|
+
const venue = str6(row2.lender) ?? str6(row2.lenderKey);
|
|
106103
106441
|
if (!chainId || !venue) return void 0;
|
|
106104
|
-
const flags =
|
|
106105
|
-
const assetInfo =
|
|
106106
|
-
const underlying = addr5(assetInfo.address, chainId) ?? addr5(
|
|
106442
|
+
const flags = row2.flags ?? {};
|
|
106443
|
+
const assetInfo = row2.underlyingInfo?.asset ?? row2.asset ?? {};
|
|
106444
|
+
const underlying = addr5(assetInfo.address, chainId) ?? addr5(row2.underlying, chainId) ?? addr5(row2.poolId, chainId);
|
|
106107
106445
|
if (!underlying) return void 0;
|
|
106108
|
-
const decimals = num16(assetInfo.decimals) ?? num16(
|
|
106109
|
-
const priceUsd = num16(
|
|
106110
|
-
const base = num16(
|
|
106111
|
-
const intrinsic = num16(
|
|
106112
|
-
const rewards = sumRewardAprs(
|
|
106446
|
+
const decimals = num16(assetInfo.decimals) ?? num16(row2.decimals) ?? 18;
|
|
106447
|
+
const priceUsd = num16(row2.underlyingInfo?.prices?.priceUsd) ?? num16(row2.price);
|
|
106448
|
+
const base = num16(row2.depositRate);
|
|
106449
|
+
const intrinsic = num16(row2.intrinsicYield);
|
|
106450
|
+
const rewards = sumRewardAprs(row2.rewards);
|
|
106113
106451
|
const marketOwn = sum2(base, rewards);
|
|
106114
106452
|
const rate = {
|
|
106115
106453
|
// Prefer our own sum over the origin's `apr`, because `apr` is documented
|
|
106116
106454
|
// as `depositRate + intrinsicYield` and therefore EXCLUDES incentives —
|
|
106117
106455
|
// using it as the headline would under-report every incentivized market.
|
|
106118
|
-
total: sum2(base, intrinsic, rewards) ?? num16(
|
|
106456
|
+
total: sum2(base, intrinsic, rewards) ?? num16(row2.apr) ?? 0,
|
|
106119
106457
|
base,
|
|
106120
106458
|
rewards,
|
|
106121
106459
|
intrinsic,
|
|
@@ -106124,8 +106462,8 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106124
106462
|
kind: resolveRateKind2(venue),
|
|
106125
106463
|
source: "chain"
|
|
106126
106464
|
};
|
|
106127
|
-
const availability2 = resolveAvailability2(
|
|
106128
|
-
const basket = resolveBasket(
|
|
106465
|
+
const availability2 = resolveAvailability2(row2, flags, rate.total ?? 0);
|
|
106466
|
+
const basket = resolveBasket(row2, chainId);
|
|
106129
106467
|
return {
|
|
106130
106468
|
earnUid,
|
|
106131
106469
|
chainId,
|
|
@@ -106137,7 +106475,7 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106137
106475
|
// Same resolver as the vault half, so `protocol.key` means one thing
|
|
106138
106476
|
// across the listing: the STABLE family key, never the per-market venue.
|
|
106139
106477
|
// No lender publishes a curator today, hence the undefined.
|
|
106140
|
-
...resolveEarnIdentity(venue, void 0, str6(
|
|
106478
|
+
...resolveEarnIdentity(venue, void 0, str6(row2.lenderInfo?.protocol)),
|
|
106141
106479
|
// Pair-aware: "USDT · vs wstETH" for an isolated market, plain "USDC" for
|
|
106142
106480
|
// a shared pool. The fetcher's own name is only the fallback — it is the
|
|
106143
106481
|
// leg-local "Loan USDC", which a chain repeats across 300 markets and
|
|
@@ -106145,15 +106483,15 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106145
106483
|
// origin's SQL route builds, so both paths agree.
|
|
106146
106484
|
name: earnMarketLabel({
|
|
106147
106485
|
assetSymbol: str6(assetInfo.symbol),
|
|
106148
|
-
lenderMarketName: str6(
|
|
106149
|
-
fetcherName: str6(
|
|
106486
|
+
lenderMarketName: str6(row2.lenderInfo?.name),
|
|
106487
|
+
fetcherName: str6(row2.name),
|
|
106150
106488
|
venue,
|
|
106151
106489
|
// The venue's collaterals, UNFILTERED — the label removes this row's own
|
|
106152
106490
|
// leg itself. Filtering here made the collateral row of a 1-collateral
|
|
106153
106491
|
// market look like a 0-collateral one, so the two legs of one market
|
|
106154
106492
|
// disagreed about whether it was isolated.
|
|
106155
106493
|
collateralSymbols: venueCollaterals?.get(venueGroupKey(chainId, venue)),
|
|
106156
|
-
fallbackName: str6(
|
|
106494
|
+
fallbackName: str6(row2.name)
|
|
106157
106495
|
}),
|
|
106158
106496
|
// Never re-derived — the uid's third segment as the origin minted it.
|
|
106159
106497
|
ref: marketUid.split(":")[2],
|
|
@@ -106162,7 +106500,7 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106162
106500
|
address: underlying,
|
|
106163
106501
|
symbol: str6(assetInfo.symbol) ?? "",
|
|
106164
106502
|
decimals,
|
|
106165
|
-
assetGroup: str6(
|
|
106503
|
+
assetGroup: str6(row2.underlyingInfo?.assetGroup) ?? str6(row2.asset?.assetGroup),
|
|
106166
106504
|
priceUsd
|
|
106167
106505
|
},
|
|
106168
106506
|
// A lending supply position is an aToken/cToken/eToken balance, but the
|
|
@@ -106175,15 +106513,15 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106175
106513
|
// back-fill `raw` by re-scaling — the round-trip loses precision and would
|
|
106176
106514
|
// fabricate base units the origin never sent.
|
|
106177
106515
|
tvl: amount4(
|
|
106178
|
-
|
|
106179
|
-
|
|
106516
|
+
row2.totalDeposits,
|
|
106517
|
+
row2.totalDepositsUSD ?? row2.totalDepositsUsd
|
|
106180
106518
|
),
|
|
106181
106519
|
liquidity: amount4(
|
|
106182
|
-
|
|
106183
|
-
|
|
106520
|
+
row2.totalLiquidity,
|
|
106521
|
+
row2.totalLiquidityUSD ?? row2.totalLiquidityUsd
|
|
106184
106522
|
),
|
|
106185
106523
|
depositCapacity: void 0,
|
|
106186
|
-
utilization: num16(
|
|
106524
|
+
utilization: num16(row2.utilization),
|
|
106187
106525
|
// Lending withdrawals are same-block, bounded by available liquidity —
|
|
106188
106526
|
// which is exactly `instant-capped`, not `instant`. A pool at 100 %
|
|
106189
106527
|
// utilization cannot be exited, and calling that `instant` is the kind of
|
|
@@ -106191,12 +106529,12 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106191
106529
|
exit: { mode: "instant-capped", settlement: "sync" },
|
|
106192
106530
|
availability: availability2,
|
|
106193
106531
|
risk: {
|
|
106194
|
-
score: num16(
|
|
106195
|
-
label: str6(
|
|
106532
|
+
score: num16(row2.risk?.score),
|
|
106533
|
+
label: str6(row2.risk?.label),
|
|
106196
106534
|
illiquid: isIlliquid({
|
|
106197
106535
|
exitMode: "instant-capped",
|
|
106198
|
-
tvlUsd: num16(
|
|
106199
|
-
liquidityUsd: num16(
|
|
106536
|
+
tvlUsd: num16(row2.totalDepositsUSD ?? row2.totalDepositsUsd),
|
|
106537
|
+
liquidityUsd: num16(row2.totalLiquidityUSD ?? row2.totalLiquidityUsd)
|
|
106200
106538
|
})
|
|
106201
106539
|
},
|
|
106202
106540
|
...basket ? { basket } : {},
|
|
@@ -106208,13 +106546,13 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106208
106546
|
// nothing else, and one may price its collateral off a feed that ignores
|
|
106209
106547
|
// a depeg in it.
|
|
106210
106548
|
oracle: addr5(
|
|
106211
|
-
|
|
106549
|
+
row2.oracleInfo?.feeds?.find((f) => f?.oracle)?.oracle,
|
|
106212
106550
|
chainId
|
|
106213
106551
|
),
|
|
106214
106552
|
oracleDescription: str6(
|
|
106215
|
-
|
|
106553
|
+
row2.oracleInfo?.feeds?.find((f) => f?.priceDescription)?.priceDescription
|
|
106216
106554
|
),
|
|
106217
|
-
borrowable: (flags.borrowingEnabled ??
|
|
106555
|
+
borrowable: (flags.borrowingEnabled ?? row2.borrowingEnabled) === true
|
|
106218
106556
|
}
|
|
106219
106557
|
};
|
|
106220
106558
|
}
|
|
@@ -106228,10 +106566,10 @@ function resolveRateKind2(venue) {
|
|
|
106228
106566
|
if (FIXED_TERM_PREFIXES.some((p) => key5.startsWith(p))) return "fixed-term";
|
|
106229
106567
|
return "variable-curve";
|
|
106230
106568
|
}
|
|
106231
|
-
function resolveAvailability2(
|
|
106232
|
-
const isActive = flags.isActive ??
|
|
106233
|
-
const isFrozen = flags.isFrozen ??
|
|
106234
|
-
const depositsEnabled = flags.depositsEnabled ??
|
|
106569
|
+
function resolveAvailability2(row2, flags, totalRate) {
|
|
106570
|
+
const isActive = flags.isActive ?? row2.isActive;
|
|
106571
|
+
const isFrozen = flags.isFrozen ?? row2.isFrozen;
|
|
106572
|
+
const depositsEnabled = flags.depositsEnabled ?? row2.depositsEnabled;
|
|
106235
106573
|
let gating;
|
|
106236
106574
|
let reason;
|
|
106237
106575
|
if (isActive === false) {
|
|
@@ -106243,7 +106581,7 @@ function resolveAvailability2(row, flags, totalRate) {
|
|
|
106243
106581
|
} else if (depositsEnabled === false) {
|
|
106244
106582
|
gating = "paused";
|
|
106245
106583
|
reason = "Deposits are disabled for this market";
|
|
106246
|
-
} else if (isSupplyCapFull(
|
|
106584
|
+
} else if (isSupplyCapFull(row2)) {
|
|
106247
106585
|
gating = "cap-full";
|
|
106248
106586
|
reason = "Supply cap is full";
|
|
106249
106587
|
}
|
|
@@ -106261,10 +106599,10 @@ function resolveAvailability2(row, flags, totalRate) {
|
|
|
106261
106599
|
reason
|
|
106262
106600
|
};
|
|
106263
106601
|
}
|
|
106264
|
-
function isSupplyCapFull(
|
|
106265
|
-
const cap = num16(
|
|
106602
|
+
function isSupplyCapFull(row2) {
|
|
106603
|
+
const cap = num16(row2.caps?.supplyCap) ?? num16(row2.supplyCap);
|
|
106266
106604
|
if (cap === void 0 || cap <= 0) return false;
|
|
106267
|
-
const deposits = num16(
|
|
106605
|
+
const deposits = num16(row2.totalDeposits);
|
|
106268
106606
|
if (deposits === void 0) return false;
|
|
106269
106607
|
return deposits >= cap;
|
|
106270
106608
|
}
|
|
@@ -106326,7 +106664,7 @@ var LENDING = {
|
|
|
106326
106664
|
nativeWithdraw: true
|
|
106327
106665
|
};
|
|
106328
106666
|
var WSOL = "So11111111111111111111111111111111111111112";
|
|
106329
|
-
var
|
|
106667
|
+
var USDC2 = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
106330
106668
|
var USDG = "2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH";
|
|
106331
106669
|
var SHARES = ["isShares"];
|
|
106332
106670
|
function isSyntheticQuoteUnit(mint) {
|
|
@@ -106414,7 +106752,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106414
106752
|
"savings:OnRe": {
|
|
106415
106753
|
verbs: ["deposit", "withdraw", "request-withdraw", "cancel"],
|
|
106416
106754
|
depositInputs: [
|
|
106417
|
-
{ asset:
|
|
106755
|
+
{ asset: USDC2, symbol: "USDC", mode: "direct" },
|
|
106418
106756
|
{ asset: USDG, symbol: "USDG", mode: "direct" }
|
|
106419
106757
|
],
|
|
106420
106758
|
requires: {
|
|
@@ -106429,7 +106767,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106429
106767
|
verbs: ["deposit", "withdraw"],
|
|
106430
106768
|
payAsset: true,
|
|
106431
106769
|
depositInputs: [
|
|
106432
|
-
{ asset:
|
|
106770
|
+
{ asset: USDC2, symbol: "USDC", mode: "direct" },
|
|
106433
106771
|
{ asset: "native", symbol: "SOL", mode: "direct" },
|
|
106434
106772
|
{ asset: WSOL, symbol: "wSOL", mode: "direct" },
|
|
106435
106773
|
{
|
|
@@ -106469,7 +106807,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106469
106807
|
symbol: "wYLDS",
|
|
106470
106808
|
mode: "direct"
|
|
106471
106809
|
},
|
|
106472
|
-
{ asset:
|
|
106810
|
+
{ asset: USDC2, symbol: "USDC", mode: "mint-then-deposit" }
|
|
106473
106811
|
],
|
|
106474
106812
|
requires: { withdraw: SHARES }
|
|
106475
106813
|
},
|
|
@@ -106745,38 +107083,38 @@ var ASYNC_PROVIDERS = /* @__PURE__ */ new Set([
|
|
|
106745
107083
|
"gmx"
|
|
106746
107084
|
// keeper-executed tickets
|
|
106747
107085
|
]);
|
|
106748
|
-
function stampCapabilities(
|
|
106749
|
-
|
|
106750
|
-
return
|
|
107086
|
+
function stampCapabilities(row2) {
|
|
107087
|
+
row2.capabilities = isSvmChainId(String(row2.chainId)) ? svmCapabilities(row2) : row2.venueKind === "lending" ? lendingCapabilities(row2) : vaultCapabilities(row2);
|
|
107088
|
+
return row2;
|
|
106751
107089
|
}
|
|
106752
107090
|
var WSOL2 = "So11111111111111111111111111111111111111112";
|
|
106753
|
-
function svmCapabilities(
|
|
106754
|
-
const b = svmEarnBuildability(
|
|
107091
|
+
function svmCapabilities(row2) {
|
|
107092
|
+
const b = svmEarnBuildability(row2.venue, row2.brand, row2.ref);
|
|
106755
107093
|
if (!b.ok) {
|
|
106756
|
-
if (
|
|
106757
|
-
|
|
106758
|
-
|
|
106759
|
-
|
|
107094
|
+
if (row2.availability.canDeposit) {
|
|
107095
|
+
row2.availability.canDeposit = false;
|
|
107096
|
+
row2.availability.gating = "unsupported";
|
|
107097
|
+
row2.availability.reason = b.reason;
|
|
106760
107098
|
}
|
|
106761
107099
|
return [];
|
|
106762
107100
|
}
|
|
106763
107101
|
const { builder } = b;
|
|
106764
|
-
const maturity =
|
|
107102
|
+
const maturity = row2.maturity?.maturity;
|
|
106765
107103
|
if (builder.via === "swap" && maturity && maturity <= Date.now() / 1e3) {
|
|
106766
|
-
if (
|
|
106767
|
-
|
|
106768
|
-
|
|
107104
|
+
if (row2.availability.canDeposit) {
|
|
107105
|
+
row2.availability.canDeposit = false;
|
|
107106
|
+
row2.availability.gating = "matured";
|
|
106769
107107
|
}
|
|
106770
|
-
|
|
107108
|
+
row2.availability.reason ??= EXPONENT_MATURED_REASON;
|
|
106771
107109
|
return [];
|
|
106772
107110
|
}
|
|
106773
|
-
const wsol =
|
|
107111
|
+
const wsol = row2.asset?.address === WSOL2;
|
|
106774
107112
|
const caps = [];
|
|
106775
|
-
const verbs = builder.requestVerbs &&
|
|
107113
|
+
const verbs = builder.requestVerbs && row2.exit?.mode === "request-based" ? builder.requestVerbs : builder.verbs;
|
|
106776
107114
|
for (const action of verbs) {
|
|
106777
|
-
const open = action === "deposit" ?
|
|
107115
|
+
const open = action === "deposit" ? row2.availability.canDeposit : row2.availability.canWithdraw;
|
|
106778
107116
|
if (!open) continue;
|
|
106779
|
-
if (action === "withdraw" && builder.withdrawNeedsInstantRoute &&
|
|
107117
|
+
if (action === "withdraw" && builder.withdrawNeedsInstantRoute && row2.exit?.routes?.length && !row2.exit.routes.some((r) => r.id === "instant"))
|
|
106780
107118
|
continue;
|
|
106781
107119
|
const cap = { action };
|
|
106782
107120
|
if (builder.via) cap.via = builder.via;
|
|
@@ -106785,8 +107123,8 @@ function svmCapabilities(row) {
|
|
|
106785
107123
|
cap.acceptsNative = wsol && !!builder.nativeDeposit;
|
|
106786
107124
|
if (builder.depositInputs?.length)
|
|
106787
107125
|
cap.inputs = builder.depositInputs.map((i) => ({ ...i }));
|
|
106788
|
-
const yieldAsset = (
|
|
106789
|
-
if (builder.unitQuoteInput && isSyntheticQuoteUnit(
|
|
107126
|
+
const yieldAsset = (row2.providerMeta ?? {}).yieldAsset;
|
|
107127
|
+
if (builder.unitQuoteInput && isSyntheticQuoteUnit(row2.asset?.address) && typeof yieldAsset === "string" && yieldAsset)
|
|
106790
107128
|
cap.inputs = [{ asset: yieldAsset, mode: "direct" }];
|
|
106791
107129
|
} else if (action === "withdraw") {
|
|
106792
107130
|
cap.acceptsReceiveAsset = !!builder.receiveAsset;
|
|
@@ -106797,30 +107135,30 @@ function svmCapabilities(row) {
|
|
|
106797
107135
|
if (requires?.length) cap.requires = [...requires];
|
|
106798
107136
|
caps.push(cap);
|
|
106799
107137
|
}
|
|
106800
|
-
if (!builder.verbs.includes("deposit") &&
|
|
106801
|
-
|
|
106802
|
-
|
|
106803
|
-
|
|
107138
|
+
if (!builder.verbs.includes("deposit") && row2.availability.canDeposit) {
|
|
107139
|
+
row2.availability.canDeposit = false;
|
|
107140
|
+
row2.availability.gating = "unsupported";
|
|
107141
|
+
row2.availability.reason = "Deposits are not built in this API yet";
|
|
106804
107142
|
}
|
|
106805
107143
|
return caps;
|
|
106806
107144
|
}
|
|
106807
|
-
function nativeStandsIn(
|
|
106808
|
-
const wrapped = getWrappedNativeAddressSafe(
|
|
106809
|
-
return !!wrapped && wrapped.toLowerCase() === String(
|
|
107145
|
+
function nativeStandsIn(row2) {
|
|
107146
|
+
const wrapped = getWrappedNativeAddressSafe(row2.chainId);
|
|
107147
|
+
return !!wrapped && wrapped.toLowerCase() === String(row2.asset?.address ?? "").toLowerCase() && isNativeWrapOneToOne(row2.chainId);
|
|
106810
107148
|
}
|
|
106811
107149
|
var NO_NATIVE_PROVIDERS = /* @__PURE__ */ new Set(["gmx", "hypercore"]);
|
|
106812
|
-
function lendingCapabilities(
|
|
107150
|
+
function lendingCapabilities(row2) {
|
|
106813
107151
|
const caps = [];
|
|
106814
|
-
const native = nativeStandsIn(
|
|
106815
|
-
const fixedLendExit = isTermMax(
|
|
106816
|
-
if (
|
|
107152
|
+
const native = nativeStandsIn(row2) && !isLiquityFamily(row2.venue) && !isFluid(row2.venue);
|
|
107153
|
+
const fixedLendExit = isTermMax(row2.venue) || isTerm(row2.venue);
|
|
107154
|
+
if (row2.availability.canDeposit) {
|
|
106817
107155
|
caps.push({
|
|
106818
107156
|
action: "deposit",
|
|
106819
107157
|
acceptsPayAsset: true,
|
|
106820
107158
|
acceptsNative: native
|
|
106821
107159
|
});
|
|
106822
107160
|
}
|
|
106823
|
-
if (
|
|
107161
|
+
if (row2.availability.canWithdraw) {
|
|
106824
107162
|
caps.push({
|
|
106825
107163
|
action: "withdraw",
|
|
106826
107164
|
acceptsReceiveAsset: true,
|
|
@@ -106862,66 +107200,66 @@ var NON_4626_DEPOSIT_KINDS = /* @__PURE__ */ new Set([
|
|
|
106862
107200
|
// Aera V3 — the deposit is a solver-filled REQUEST on the provisioner.
|
|
106863
107201
|
"aera"
|
|
106864
107202
|
]);
|
|
106865
|
-
function acceptsVaultZap(
|
|
107203
|
+
function acceptsVaultZap(row2, provider) {
|
|
106866
107204
|
if (ZAP_EXCLUDED_PROVIDERS.has(provider)) return false;
|
|
106867
|
-
const share =
|
|
107205
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
106868
107206
|
if (!share) return false;
|
|
106869
|
-
if (provider === "upshift" && isSplitUpshiftRow(
|
|
107207
|
+
if (provider === "upshift" && isSplitUpshiftRow(row2, share)) return false;
|
|
106870
107208
|
try {
|
|
106871
|
-
const entry2 = findSavingsWithdrawEntry(
|
|
107209
|
+
const entry2 = findSavingsWithdrawEntry(row2.chainId, share);
|
|
106872
107210
|
if (entry2 && NON_4626_DEPOSIT_KINDS.has(entry2.kind)) return false;
|
|
106873
107211
|
} catch {
|
|
106874
107212
|
return false;
|
|
106875
107213
|
}
|
|
106876
107214
|
return true;
|
|
106877
107215
|
}
|
|
106878
|
-
function isSplitUpshiftRow(
|
|
106879
|
-
const deposit = (
|
|
107216
|
+
function isSplitUpshiftRow(row2, share) {
|
|
107217
|
+
const deposit = (row2.providerMeta ?? {}).depositContract;
|
|
106880
107218
|
return typeof deposit === "string" && deposit.toLowerCase() !== String(share).toLowerCase();
|
|
106881
107219
|
}
|
|
106882
|
-
function isSecondaryMarketRow(
|
|
106883
|
-
const meta =
|
|
107220
|
+
function isSecondaryMarketRow(row2) {
|
|
107221
|
+
const meta = row2.providerMeta ?? {};
|
|
106884
107222
|
if (meta.secondaryMarketOnly === true) return true;
|
|
106885
|
-
const share =
|
|
106886
|
-
if (!share || !
|
|
107223
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107224
|
+
if (!share || !row2.chainId) return false;
|
|
106887
107225
|
try {
|
|
106888
|
-
return isSecondaryMarketOnly(String(
|
|
107226
|
+
return isSecondaryMarketOnly(String(row2.chainId), share);
|
|
106889
107227
|
} catch {
|
|
106890
107228
|
return false;
|
|
106891
107229
|
}
|
|
106892
107230
|
}
|
|
106893
|
-
function swapRoutedCapabilities(
|
|
107231
|
+
function swapRoutedCapabilities(row2, opts) {
|
|
106894
107232
|
const caps = [];
|
|
106895
|
-
const entryOpen =
|
|
107233
|
+
const entryOpen = row2.availability.canDeposit || opts?.ignoreMintPermission === true && row2.availability.gating === "allowlist-contract" && (row2.providerMeta ?? {}).paused !== true;
|
|
106896
107234
|
if (entryOpen) {
|
|
106897
107235
|
caps.push({
|
|
106898
107236
|
action: "deposit",
|
|
106899
107237
|
via: "swap",
|
|
106900
107238
|
requires: ["slippage"],
|
|
106901
107239
|
acceptsPayAsset: true,
|
|
106902
|
-
acceptsNative: nativeStandsIn(
|
|
107240
|
+
acceptsNative: nativeStandsIn(row2)
|
|
106903
107241
|
});
|
|
106904
107242
|
}
|
|
106905
|
-
if (
|
|
107243
|
+
if (row2.availability.canWithdraw) {
|
|
106906
107244
|
caps.push({
|
|
106907
107245
|
action: "withdraw",
|
|
106908
107246
|
via: "swap",
|
|
106909
107247
|
requires: ["slippage"],
|
|
106910
107248
|
acceptsReceiveAsset: true,
|
|
106911
|
-
acceptsNative: nativeStandsIn(
|
|
107249
|
+
acceptsNative: nativeStandsIn(row2)
|
|
106912
107250
|
});
|
|
106913
107251
|
}
|
|
106914
107252
|
return caps;
|
|
106915
107253
|
}
|
|
106916
|
-
function vaultCapabilities(
|
|
106917
|
-
const provider =
|
|
106918
|
-
const meta =
|
|
107254
|
+
function vaultCapabilities(row2) {
|
|
107255
|
+
const provider = row2.venue.replace(/^vault\./, "");
|
|
107256
|
+
const meta = row2.providerMeta ?? {};
|
|
106919
107257
|
const caps = [];
|
|
106920
|
-
if (SWAP_ROUTED_PROVIDERS.has(provider)) return swapRoutedCapabilities(
|
|
106921
|
-
if (isSecondaryMarketRow(
|
|
106922
|
-
return swapRoutedCapabilities(
|
|
106923
|
-
if (
|
|
106924
|
-
const inputs = depositInputs(
|
|
107258
|
+
if (SWAP_ROUTED_PROVIDERS.has(provider)) return swapRoutedCapabilities(row2);
|
|
107259
|
+
if (isSecondaryMarketRow(row2))
|
|
107260
|
+
return swapRoutedCapabilities(row2, { ignoreMintPermission: true });
|
|
107261
|
+
if (row2.availability.canDeposit) {
|
|
107262
|
+
const inputs = depositInputs(row2, provider);
|
|
106925
107263
|
caps.push({
|
|
106926
107264
|
action: "deposit",
|
|
106927
107265
|
inputs,
|
|
@@ -106931,15 +107269,15 @@ function vaultCapabilities(row) {
|
|
|
106931
107269
|
// deposit — but ONLY for rows whose deposit is a plain synchronous
|
|
106932
107270
|
// ERC-4626 call. Advertising it anywhere else builds a zap input that
|
|
106933
107271
|
// 400s at submit, which is exactly what this flag existed to prevent.
|
|
106934
|
-
acceptsPayAsset: acceptsVaultZap(
|
|
107272
|
+
acceptsPayAsset: acceptsVaultZap(row2, provider),
|
|
106935
107273
|
// native for a wrapped-native deposit token is NOT a zap: the 4626 rows
|
|
106936
107274
|
// take it through the composer, every single-token builder (Lagoon,
|
|
106937
107275
|
// the non-4626 savings kinds, ERC-20-only LST mints) as a leading wrap
|
|
106938
|
-
acceptsNative: !NO_NATIVE_PROVIDERS.has(provider) && nativeStandsIn(
|
|
107276
|
+
acceptsNative: !NO_NATIVE_PROVIDERS.has(provider) && nativeStandsIn(row2)
|
|
106939
107277
|
});
|
|
106940
107278
|
}
|
|
106941
|
-
if (!
|
|
106942
|
-
const mode =
|
|
107279
|
+
if (!row2.availability.canWithdraw) return caps;
|
|
107280
|
+
const mode = row2.exit.mode;
|
|
106943
107281
|
const isAsync = provider !== "hypercore" && (ASYNC_PROVIDERS.has(provider) || ASYNC_EXIT_MODES.has(mode));
|
|
106944
107282
|
if (!isAsync) {
|
|
106945
107283
|
caps.push({
|
|
@@ -106947,7 +107285,7 @@ function vaultCapabilities(row) {
|
|
|
106947
107285
|
requires: withdrawRequires(provider),
|
|
106948
107286
|
// the unwrap rides the composer's 4626 withdraw — the same rows the
|
|
106949
107287
|
// deposit zap serves; the single-token exits have no unwrap leg yet
|
|
106950
|
-
acceptsNative: acceptsVaultZap(
|
|
107288
|
+
acceptsNative: acceptsVaultZap(row2, provider) && nativeStandsIn(row2)
|
|
106951
107289
|
});
|
|
106952
107290
|
return caps;
|
|
106953
107291
|
}
|
|
@@ -106955,7 +107293,7 @@ function vaultCapabilities(row) {
|
|
|
106955
107293
|
caps.push({
|
|
106956
107294
|
action: "withdraw",
|
|
106957
107295
|
requires: withdrawRequires(provider),
|
|
106958
|
-
feeBps: num16(meta.withdrawFeeBps) ??
|
|
107296
|
+
feeBps: num16(meta.withdrawFeeBps) ?? row2.exit.feeBps,
|
|
106959
107297
|
// a fee-paying single-token exit: pays the vault's token only
|
|
106960
107298
|
acceptsNative: false
|
|
106961
107299
|
});
|
|
@@ -106969,13 +107307,13 @@ function vaultCapabilities(row) {
|
|
|
106969
107307
|
caps.push({
|
|
106970
107308
|
action: "claim",
|
|
106971
107309
|
async: false,
|
|
106972
|
-
requires: claimRequires(
|
|
107310
|
+
requires: claimRequires(row2, provider)
|
|
106973
107311
|
});
|
|
106974
107312
|
}
|
|
106975
|
-
if (supportsCancel(
|
|
107313
|
+
if (supportsCancel(row2, provider)) {
|
|
106976
107314
|
caps.push({
|
|
106977
107315
|
action: "cancel",
|
|
106978
|
-
requires: savingsVerbRequiresFor(
|
|
107316
|
+
requires: savingsVerbRequiresFor(row2, provider, "cancel")
|
|
106979
107317
|
});
|
|
106980
107318
|
}
|
|
106981
107319
|
return caps;
|
|
@@ -106987,17 +107325,17 @@ function isBookPriced(provider) {
|
|
|
106987
107325
|
function swapRoutedProvidersArePriceConsistent() {
|
|
106988
107326
|
return [...SWAP_ROUTED_PROVIDERS].filter((p) => !isBookPriced(p));
|
|
106989
107327
|
}
|
|
106990
|
-
function depositInputs(
|
|
107328
|
+
function depositInputs(row2, provider) {
|
|
106991
107329
|
if (provider === "upshift") {
|
|
106992
|
-
const assets = (
|
|
107330
|
+
const assets = (row2.providerMeta ?? {}).depositAssets;
|
|
106993
107331
|
if (!Array.isArray(assets) || assets.length < 2) return void 0;
|
|
106994
107332
|
return assets.filter((a) => typeof a === "string").map((asset) => ({ asset, mode: "direct" }));
|
|
106995
107333
|
}
|
|
106996
107334
|
if (provider !== "lst") return void 0;
|
|
106997
|
-
const share =
|
|
107335
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
106998
107336
|
if (!share) return void 0;
|
|
106999
107337
|
try {
|
|
107000
|
-
const accepted = getLstAcceptedInputs(
|
|
107338
|
+
const accepted = getLstAcceptedInputs(row2.chainId, share);
|
|
107001
107339
|
if (!accepted?.length) return void 0;
|
|
107002
107340
|
return accepted.map((a) => ({
|
|
107003
107341
|
asset: String(a.asset),
|
|
@@ -107039,19 +107377,19 @@ function requestRequires(provider) {
|
|
|
107039
107377
|
if (isBookPriced(provider)) requires.push("slippage");
|
|
107040
107378
|
return requires.length ? requires : void 0;
|
|
107041
107379
|
}
|
|
107042
|
-
function claimRequires(
|
|
107043
|
-
const share =
|
|
107044
|
-
if (provider === "upshift" && share && isSplitUpshiftRow(
|
|
107380
|
+
function claimRequires(row2, provider) {
|
|
107381
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107382
|
+
if (provider === "upshift" && share && isSplitUpshiftRow(row2, share))
|
|
107045
107383
|
return ["claimableEpoch"];
|
|
107046
107384
|
return void 0;
|
|
107047
107385
|
}
|
|
107048
|
-
function savingsVerbRequiresFor(
|
|
107386
|
+
function savingsVerbRequiresFor(row2, provider, verb) {
|
|
107049
107387
|
if (provider === "gmx" || provider === "lst") return void 0;
|
|
107050
|
-
const share =
|
|
107051
|
-
if (!share || !
|
|
107388
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107389
|
+
if (!share || !row2.chainId) return void 0;
|
|
107052
107390
|
try {
|
|
107053
107391
|
return savingsVerbRequires(
|
|
107054
|
-
String(
|
|
107392
|
+
String(row2.chainId),
|
|
107055
107393
|
share,
|
|
107056
107394
|
verb
|
|
107057
107395
|
);
|
|
@@ -107059,13 +107397,13 @@ function savingsVerbRequiresFor(row, provider, verb) {
|
|
|
107059
107397
|
return void 0;
|
|
107060
107398
|
}
|
|
107061
107399
|
}
|
|
107062
|
-
function supportsCancel(
|
|
107400
|
+
function supportsCancel(row2, provider) {
|
|
107063
107401
|
if (provider === "gmx") return true;
|
|
107064
|
-
const share =
|
|
107065
|
-
if (!share || !
|
|
107402
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107403
|
+
if (!share || !row2.chainId) return false;
|
|
107066
107404
|
try {
|
|
107067
107405
|
return savingsSupportsVerb(
|
|
107068
|
-
String(
|
|
107406
|
+
String(row2.chainId),
|
|
107069
107407
|
share,
|
|
107070
107408
|
"cancel"
|
|
107071
107409
|
);
|
|
@@ -107731,7 +108069,7 @@ var pct4 = (v) => {
|
|
|
107731
108069
|
function convertBorosCandle(c) {
|
|
107732
108070
|
const ts = Number(c?.ts);
|
|
107733
108071
|
if (!Number.isFinite(ts)) return null;
|
|
107734
|
-
const
|
|
108072
|
+
const row2 = {
|
|
107735
108073
|
ts,
|
|
107736
108074
|
impliedOpen: pct4(c.o),
|
|
107737
108075
|
impliedHigh: pct4(c.h),
|
|
@@ -107745,7 +108083,7 @@ function convertBorosCandle(c) {
|
|
|
107745
108083
|
futurePremium: pct4(c.fp),
|
|
107746
108084
|
volume: Number.isFinite(Number(c.v)) ? Number(c.v) : 0
|
|
107747
108085
|
};
|
|
107748
|
-
return Number.isFinite(
|
|
108086
|
+
return Number.isFinite(row2.impliedClose) ? row2 : null;
|
|
107749
108087
|
}
|
|
107750
108088
|
async function fetchBorosRateHistory(marketId, opts = {}) {
|
|
107751
108089
|
const interval = opts.interval ?? "1h";
|
|
@@ -108022,14 +108360,14 @@ function quoteBorosHedgeLeg(p) {
|
|
|
108022
108360
|
// src/boros/hedgeTerms.ts
|
|
108023
108361
|
var FUNDING_HEDGE_REFERENCE_USD = 1e4;
|
|
108024
108362
|
var BOROS_CHAIN = "42161";
|
|
108025
|
-
function earnRowFundingProfile(
|
|
108026
|
-
if (
|
|
108027
|
-
if (
|
|
108363
|
+
function earnRowFundingProfile(row2) {
|
|
108364
|
+
if (row2.venueKind !== "lending" && row2.venueKind !== "vault") return void 0;
|
|
108365
|
+
if (row2.maturity != null) return void 0;
|
|
108028
108366
|
const symbols = [
|
|
108029
|
-
|
|
108030
|
-
|
|
108367
|
+
row2.venueKind === "vault" ? row2.shareToken?.symbol : void 0,
|
|
108368
|
+
row2.asset?.symbol
|
|
108031
108369
|
].filter((s) => !!s);
|
|
108032
|
-
if (symbols.some(isPrincipalTokenSymbol) || isPrincipalTokenSymbol(
|
|
108370
|
+
if (symbols.some(isPrincipalTokenSymbol) || isPrincipalTokenSymbol(row2.name))
|
|
108033
108371
|
return void 0;
|
|
108034
108372
|
for (const s of symbols) {
|
|
108035
108373
|
const p = fundingExposureOf(s);
|
|
@@ -108186,6 +108524,6 @@ function hedgeImplications(h, p) {
|
|
|
108186
108524
|
return out;
|
|
108187
108525
|
}
|
|
108188
108526
|
|
|
108189
|
-
export { ALCHEMIX_BLOCK_SECONDS, ApiBookSource, BOROS_API_BASE, BOROS_GOVERNANCE, BOROS_MIN_CASH_USD, BOROS_PROFILE_ID, BorosApiError, DEFAULT_CONSENSUS_DEMOTION, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, DOLOMITE_ISO_ID_PREFIX, EARN_DESCRIPTIONS, EARN_LABELS, EARN_RATE_SOURCE_BY_PROVIDER, EMPTY_BALANCE, EXACTLY_LENDER_KEY, EXPONENT_MATURED_REASON, FIXED_YIELD_EARN_VENUE_PREFIXES, FLYING_TULIP_LENDER_KEY, FRACTION_RATE_PROVIDERS, FUNDING_EXPOSURE_PROFILES, FUNDING_HEDGE_REFERENCE_USD, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, NON_EVM_VAULT_PROVIDERS, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL2 as PENDLE_MARKETS_URL, PREFIX_LENDERS, RATE_QUEUE_MAX_LEVELS, RATE_QUEUE_STEP, REFLECT_TRANCHE_SIDES, RIPE_LENDER_KEY, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, SVM_EARN_MINT_BUILDERS, SVM_EARN_VAULT_BUILDERS, SVM_SAVINGS_CURATION, SVM_VAULT_PROVIDERS, TELLER_CALLS_PER_BID, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, USER_REWARD_SOURCES, USER_SET_RATE_PICKS, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VENUS_CORE_POOL_ID, VOLATILE_VAULT_OVERRIDES, VenusEModeAbi, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, alchemixLenderKey, alchemixMytRate, alchemixRedemptionPace, appendSnapshot, applyEarnSanity, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, bandsForStance, blockNumberFromTag, borosApi, borosInitialMargin, borosMaintenanceMargin, borosRateMoveToLiquidation, borosSideTerms, borosTakerFee, borrowDescription, borrowFindings, borrowHeadline, buildBorosTermSheet, buildExposures2 as buildExposures, buildFluidFTokensCall, buildFundingHedgeTerms, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildPositionChoices, buildQueriesFromMeta, buildRateQueue, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertAlchemixMarketsToResponse, convertBorosCandle, convertBorosMarket, convertCoolerMarketsToResponse, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFlexMarketsToResponse, convertFlyingTulipMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRipeMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMultiAccountTypeUserState, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, debtAheadOf, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, deriveSwapTags, detectInterfaceKinds, dexResolverFor, digestChoices, disambiguateEarnNames, disambiguateOrderBookNames, discoverFlexTroves, dolomiteVaultAddress, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRateAtMaturity, earnRowFundingProfile, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, emitterCoverage, encodeBalanceFetcherCalldata, encodeChoiceValue, enrichTermSheet, enrichmentIndexFromRows, enumerateEmitters, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, exponentTrancheDescription, feePhrase, feedKeyOf, feedStatKey, fetchAaveIncentivesUserRewards, fetchAlchemixMarkets, fetchBorosAccount, fetchBorosCollaterals, fetchBorosMarket, fetchBorosMarketById, fetchBorosMarkets, fetchBorosOrderBook, fetchBorosRateHistory, fetchCoolerMarkets, fetchDolomiteAccountNumbers, fetchDolomiteSubAccounts, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFlexMarkets, fetchFluidDexState, fetchFluidFTokens, fetchFlyingTulipMarkets, fetchFlyingTulipUserRewards, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLenderRewards, fetchLenderRewardsByMarketUid, fetchLiquityMarkets, fetchListaMarketEmissions, fetchListaUserRewards, fetchListaVaultEmissions, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMerklUserRewards, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRipeMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchUserRewards, fetchUsualRewardsClaimData, fetchYearnApiVaults, fetchYearnVaults, fillCapacityAt, fillableRemaining, filterActiveLenders, filterLenderMeta, filterLendersByProtocol, finalizeInfo, findingsFor, flexAverageRate, flexLenderApr, flexLenderKey, flexMarketIndex, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fundingExposureOf, fundingSymbolBase, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMidnightChainBooks, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getResolvedDolomiteSubAccounts, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, getVenusEModeSetup, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, injectLenderInfoIntoEntries, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isFixedYieldEarnRow, isIlliquid, isLenderVenueKey, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isMaturedTerm, isOrderBookCollateralLeg, isOrderBookLendRow, isPrincipalTokenSymbol, isRollingBookLendRow, isSecondaryMarketOnly, isStablecoinSymbol, isSyntheticQuoteUnit, isUnearnableEarnRate, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, lenderLiquidityPressure, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, listaEmissionRewardFetcher, listaLoginMessage, llamaLendKeyParts, llamaLendLenderKey, marketKeysOf, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, parameterLadder, parseBalanceFetcherResult, parseDolomiteSubAccountId, parseEarnUid, parseLenderKey, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, pegPressure, assetKey as pendleAssetKey, pickRates, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, protocolConsensus, protocolOf, pruneFeedStats, quoteBorosHedgeLeg, rankBorosHedgeMarkets, rankFindings, ratePercent, readLstPauseState, readTransmuterLots, readUserPositions, readVaultSharePrices, reflectTrancheDescription, rejectOutliers as rejectPriceOutliers, repairImpossibleTvl, resolveAdapter, resolveChoices, resolveDerivation, resolveDolomiteRowIdentity, resolveEarnIdentity, resolveMerklOpportunityMarkets, resolveModeConfig, resolveRatePicks, resolveStCeloDepositGroup, resolveStance, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, secondaryMarketVault, selectAssetGroupPrices, selectUsualRewardEntry, setMysticApiKey, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampOrderBookLendRow, stampRollingBookLendRow, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, subAccountsOf, supplyDescription, supplyFindings, supplyHeadline, svmEarnBuildability, svmEarnBuilderKey, svmSavingsCuration, swapRoutedProvidersArePriceConsistent, swapSideDescription, swapSideHeadline, swapSideImplications, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termApiBaseUrl, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toDolomiteSubAccountId, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, walkBorosBook, withMaturityLabel, withTrancheLabel };
|
|
108527
|
+
export { ALCHEMIX_BLOCK_SECONDS, ApiBookSource, BOROS_API_BASE, BOROS_GOVERNANCE, BOROS_MIN_CASH_USD, BOROS_PROFILE_ID, BorosApiError, DEFAULT_CONSENSUS_DEMOTION, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, DEFAULT_TERM_ORDER_STORE, DOLOMITE_ISO_ID_PREFIX, EARN_DESCRIPTIONS, EARN_LABELS, EARN_RATE_SOURCE_BY_PROVIDER, EMPTY_BALANCE, EXACTLY_LENDER_KEY, EXPONENT_MATURED_REASON, FIXED_YIELD_EARN_VENUE_PREFIXES, FLYING_TULIP_LENDER_KEY, FRACTION_RATE_PROVIDERS, FUNDING_EXPOSURE_PROFILES, FUNDING_HEDGE_REFERENCE_USD, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, NON_EVM_VAULT_PROVIDERS, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL2 as PENDLE_MARKETS_URL, PREFIX_LENDERS, RATE_QUEUE_MAX_LEVELS, RATE_QUEUE_STEP, REFLECT_TRANCHE_SIDES, RIPE_LENDER_KEY, SDK_FRACTION_RATE_PROVIDERS, SPECTRA_NETWORKS, SPECTRA_RATE_MAX_PERCENT, SPECTRA_RATE_MIN_PERCENT, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, SVM_EARN_MINT_BUILDERS, SVM_EARN_VAULT_BUILDERS, SVM_SAVINGS_CURATION, SVM_VAULT_PROVIDERS, TELLER_CALLS_PER_BID, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_MARKETS_PER_CALL, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, USER_REWARD_SOURCES, USER_SET_RATE_PICKS, VAULT_PROVIDERS, VAULT_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VENUS_CORE_POOL_ID, VOLATILE_VAULT_OVERRIDES, VenusEModeAbi, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, alchemixLenderKey, alchemixMytRate, alchemixRedemptionPace, appendSnapshot, applyEarnSanity, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, bandsForStance, blockNumberFromTag, borosApi, borosInitialMargin, borosMaintenanceMargin, borosRateMoveToLiquidation, borosSideTerms, borosTakerFee, borrowDescription, borrowFindings, borrowHeadline, buildBorosTermSheet, buildExposures2 as buildExposures, buildFluidFTokensCall, buildFundingHedgeTerms, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildPositionChoices, buildQueriesFromMeta, buildRateQueue, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, clearSpectraMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertAlchemixMarketsToResponse, convertBorosCandle, convertBorosMarket, convertCoolerMarketsToResponse, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFlexMarketsToResponse, convertFlyingTulipMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRipeMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMultiAccountTypeUserState, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, debtAheadOf, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, deriveSwapTags, detectInterfaceKinds, dexResolverFor, digestChoices, disambiguateEarnNames, disambiguateOrderBookNames, discoverFlexTroves, dolomiteVaultAddress, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnRateAtMaturity, earnRowFundingProfile, earnRowSubtitle, earnUidFromMarketUid, earnVaultTerms, earnVenueKind, emitterCoverage, encodeBalanceFetcherCalldata, encodeChoiceValue, enrichTermSheet, enrichmentIndexFromRows, enumerateEmitters, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, exponentTrancheDescription, feePhrase, feedKeyOf, feedStatKey, fetchAaveIncentivesUserRewards, fetchAlchemixMarkets, fetchBorosAccount, fetchBorosCollaterals, fetchBorosMarket, fetchBorosMarketById, fetchBorosMarkets, fetchBorosOrderBook, fetchBorosRateHistory, fetchCoolerMarkets, fetchDolomiteAccountNumbers, fetchDolomiteSubAccounts, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFlexMarkets, fetchFluidDexState, fetchFluidFTokens, fetchFlyingTulipMarkets, fetchFlyingTulipUserRewards, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLenderRewards, fetchLenderRewardsByMarketUid, fetchLiquityMarkets, fetchListaMarketEmissions, fetchListaUserRewards, fetchListaVaultEmissions, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMerklUserRewards, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRipeMarkets, fetchRiverMarkets, fetchSiloVaults, fetchSpectraApiMarkets, fetchSpectraPtMarkets, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTermStoreOrders, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchUserRewards, fetchUsualRewardsClaimData, fetchYearnApiVaults, fetchYearnVaults, fillCapacityAt, fillableRemaining, filterActiveLenders, filterLenderMeta, filterLendersByProtocol, finalizeInfo, findingsFor, flexAverageRate, flexLenderApr, flexLenderKey, flexMarketIndex, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, fundingExposureOf, fundingSymbolBase, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedFluidDexState, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMidnightChainBooks, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getResolvedDolomiteSubAccounts, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, getVenusEModeSetup, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasPendleMarkets, hasSpectraMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, injectLenderInfoIntoEntries, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isFixedYieldEarnRow, isIlliquid, isLenderVenueKey, isLendingPosition, isLiveMarket as isLivePendleMarket, isLiveSpectraMarket, isMaturedTerm, isOrderBookCollateralLeg, isOrderBookLendRow, isPrincipalTokenSymbol, isRollingBookLendRow, isSecondaryMarketOnly, isStablecoinSymbol, isSyntheticQuoteUnit, isUnearnableEarnRate, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lccAccountCall, lccAccountMargin, lenderApiOnly, lenderFamily, lenderLiquidityPressure, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, listaEmissionRewardFetcher, listaLoginMessage, llamaLendKeyParts, llamaLendLenderKey, marketKeysOf, meetsLiquidityFloor, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, organizeUserQueries, parameterLadder, parseBalanceFetcherResult, parseDolomiteSubAccountId, parseEarnUid, parseLenderKey, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseCurveFee as parseSpectraCurveFee, parsePtRate as parseSpectraPtRate, parseTermMaxLtv, parseTokenBalanceResult, pct, pegPressure, assetKey as pendleAssetKey, pickRates, pickPool as pickSpectraPool, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, protocolConsensus, protocolOf, pruneFeedStats, quoteBorosHedgeLeg, rankBorosHedgeMarkets, rankFindings, ratePercent, readLstPauseState, readTransmuterLots, readUserPositions, readVaultSharePrices, reflectTrancheDescription, rejectOutliers as rejectPriceOutliers, repairImpossibleTvl, resolveAdapter, resolveChoices, resolveDerivation, resolveDolomiteRowIdentity, resolveEarnIdentity, resolveMerklOpportunityMarkets, resolveModeConfig, resolveRatePicks, resolveStCeloDepositGroup, resolveStance, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, sanePercent as saneSpectraPercent, savingsAddresses, savingsBalanceKind, secondaryMarketVault, selectAssetGroupPrices, selectUsualRewardEntry, setMysticApiKey, shortDate, spectraAddress, spectraNetwork, spectraPoolsUrl, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampEarnSubtitles, stampOrderBookLendRow, stampRollingBookLendRow, stampVaultClassification, stampVaultTermSheets, stripLeadingBrand, subAccountsOf, supplyDescription, supplyFindings, supplyHeadline, svmEarnBuildability, svmEarnBuilderKey, svmSavingsCuration, swapRoutedProvidersArePriceConsistent, swapSideDescription, swapSideHeadline, swapSideImplications, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termApiBaseUrl, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, termOfferRateToAprPct, termOrderStoreBaseUrl, tickToAprNumber, tickToPrice, toDigest, toDolomiteSubAccountId, toTermFillNow, toTermSheetInput, toVaultTermInput, trancheFromCounterparty, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey, walkBorosBook, withMaturityLabel, withTrancheLabel };
|
|
108190
108528
|
//# sourceMappingURL=index.js.map
|
|
108191
108529
|
//# sourceMappingURL=index.js.map
|