@1delta/margin-fetcher 5.0.159 → 5.0.161
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 +975 -507
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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,
|
|
@@ -62919,11 +62981,14 @@ var SINGLE_CHAIN_ENTRIES = {
|
|
|
62919
62981
|
underlying: "0xdc035d45d973e3ec169d2276ddab16f1e407384f",
|
|
62920
62982
|
symbol: "stUSDS",
|
|
62921
62983
|
brand: "Sky",
|
|
62922
|
-
description: "Sky's higher-yield staking module over USDS, with a utilisation-driven rate instead of the flat Sky Savings Rate. Withdrawals
|
|
62984
|
+
description: "Sky's higher-yield staking module over USDS, lent to SKY stakers borrowing through the LockstakeEngine, with a utilisation-driven rate instead of the flat Sky Savings Rate. Withdrawals settle instantly but only out of what those borrowers are not using \u2014 the pool targets ~90% utilisation and can sit at 100%, when nothing can be withdrawn until borrowers repay.",
|
|
62923
62985
|
decimals: 18,
|
|
62924
62986
|
isRebasing: false,
|
|
62925
62987
|
isMintable: true,
|
|
62926
|
-
|
|
62988
|
+
// The USDS stays in the vault but is reserved for the LSE ilk's debt;
|
|
62989
|
+
// `sky-stusds` reads the free part (totalAssets − ilk debt).
|
|
62990
|
+
reader: "sky-stusds",
|
|
62991
|
+
withdrawalMode: "instant-capped",
|
|
62927
62992
|
yieldFetcher: susdsFetcher,
|
|
62928
62993
|
yieldKey: "Staked USDS::stUSDS"
|
|
62929
62994
|
},
|
|
@@ -63214,8 +63279,9 @@ var SINGLE_CHAIN_ENTRIES = {
|
|
|
63214
63279
|
// USDC, price accrues on-chain (`pricePerShare`). Exit is instant
|
|
63215
63280
|
// but capped by real multi-source liquidity — idle USDC + what the
|
|
63216
63281
|
// MorphoCredit market can redeem out of waEthUSDC — read via
|
|
63217
|
-
// `availableWithdrawLimit` (~4.7 % of the $75M TVL at 2026-08-04
|
|
63218
|
-
// integration
|
|
63282
|
+
// `availableWithdrawLimit` (~4.7 % of the $75M TVL at the 2026-08-04
|
|
63283
|
+
// integration, ~10.7 % of $130M on 2026-11-19), hence the
|
|
63284
|
+
// `erc4626-withdraw-limit` reader. No
|
|
63219
63285
|
// on-chain solvency invariant on the credit sleeves (Maple /
|
|
63220
63286
|
// Spark-V2 trust class); unrealized losses zero the limit until
|
|
63221
63287
|
// marked down. `isMintable: true` is structural — the whitelist is
|
|
@@ -64070,6 +64136,10 @@ var SAVINGS_REGISTRY = (() => {
|
|
|
64070
64136
|
if (!out[chainId]) out[chainId] = [];
|
|
64071
64137
|
out[chainId].push(...entries);
|
|
64072
64138
|
}
|
|
64139
|
+
for (const [chainId, entries] of Object.entries(THREE_JANE_LCC_ENTRIES)) {
|
|
64140
|
+
if (!out[chainId]) out[chainId] = [];
|
|
64141
|
+
out[chainId].push(...entries);
|
|
64142
|
+
}
|
|
64073
64143
|
for (const [chainId, entries] of Object.entries(JARVIS_ENTRIES)) {
|
|
64074
64144
|
if (!out[chainId]) out[chainId] = [];
|
|
64075
64145
|
out[chainId].push(...entries);
|
|
@@ -64141,11 +64211,11 @@ function enumerateEmitters(chainId) {
|
|
|
64141
64211
|
const seen = /* @__PURE__ */ new Set();
|
|
64142
64212
|
const push2 = (r) => {
|
|
64143
64213
|
if (!isAddr5(r.address)) return;
|
|
64144
|
-
const
|
|
64145
|
-
const k = `${
|
|
64214
|
+
const row2 = { ...r, address: r.address.toLowerCase() };
|
|
64215
|
+
const k = `${row2.address}:${row2.lenderKey}:${row2.role}`;
|
|
64146
64216
|
if (seen.has(k)) return;
|
|
64147
64217
|
seen.add(k);
|
|
64148
|
-
out.push(
|
|
64218
|
+
out.push(row2);
|
|
64149
64219
|
};
|
|
64150
64220
|
const uid = (lender, ref) => createMarketUid(chainId, lender, ref);
|
|
64151
64221
|
for (const [lender, chains] of Object.entries(aavePools() ?? {})) {
|
|
@@ -68304,8 +68374,8 @@ function resolveEulerOpp(opp) {
|
|
|
68304
68374
|
function aaveReserveOwner(chainId, reserveToken) {
|
|
68305
68375
|
const t = reserveToken.toLowerCase();
|
|
68306
68376
|
for (const [lender, chains] of Object.entries(aaveTokens() ?? {})) {
|
|
68307
|
-
for (const [underlying,
|
|
68308
|
-
if (
|
|
68377
|
+
for (const [underlying, row2] of Object.entries(chains?.[chainId] ?? {})) {
|
|
68378
|
+
if (row2?.aToken?.toLowerCase() === t || row2?.vToken?.toLowerCase() === t)
|
|
68309
68379
|
return { lender, underlying: underlying.toLowerCase() };
|
|
68310
68380
|
}
|
|
68311
68381
|
}
|
|
@@ -72732,7 +72802,7 @@ function parseTermMaxResults(data, meta, context) {
|
|
|
72732
72802
|
[meta.debtToken, data?.[0], "TermMax oracle (debt asset)"],
|
|
72733
72803
|
[meta.collateral, data?.[1], "TermMax oracle (collateral)"]
|
|
72734
72804
|
];
|
|
72735
|
-
for (const [asset, res,
|
|
72805
|
+
for (const [asset, res, description2] of legs) {
|
|
72736
72806
|
const usd = readUsdPrice(res);
|
|
72737
72807
|
if (usd === void 0) continue;
|
|
72738
72808
|
entries.push({
|
|
@@ -72741,7 +72811,7 @@ function parseTermMaxResults(data, meta, context) {
|
|
|
72741
72811
|
priceUSD: usd,
|
|
72742
72812
|
marketUid: createMarketUid(chainId, lenderKey, asset),
|
|
72743
72813
|
targetLender: lenderKey,
|
|
72744
|
-
description
|
|
72814
|
+
description: description2
|
|
72745
72815
|
});
|
|
72746
72816
|
}
|
|
72747
72817
|
return entries;
|
|
@@ -74761,6 +74831,8 @@ var SAVINGS_SHARE_RATE_PRICE_SPECS = [
|
|
|
74761
74831
|
),
|
|
74762
74832
|
erc46263("sUSD3", "0xf689555121e529ff0463e191f9bd9d1e496164a7", 6, USD3_1, 6),
|
|
74763
74833
|
erc46263("USD3", USD3_1, 6, USDC_1, 6),
|
|
74834
|
+
// LCC funding-cooldown wrapper over USD3, 1:1 (Morpho USD3l/USDC collateral)
|
|
74835
|
+
erc46263("USD3l", "0xdf697c55f0d696ca9e3e624cd52d8186c6745904", 6, USD3_1, 6),
|
|
74764
74836
|
// wstUSR priced as if USR were $1: lenders kept 1.1330 while USR fell to 0.04
|
|
74765
74837
|
// (read 2026-11-06; DefiLlama 0.0453). The rate × USR's market price is the
|
|
74766
74838
|
// value of the share, on every chain's mirror.
|
|
@@ -74912,9 +74984,9 @@ var toBig9 = (v) => {
|
|
|
74912
74984
|
function decodeShareRate(spec, raw) {
|
|
74913
74985
|
let rate;
|
|
74914
74986
|
if (spec.read.kind === "mellow-report") {
|
|
74915
|
-
const
|
|
74916
|
-
const price2 = toBig9(Array.isArray(
|
|
74917
|
-
const suspicious = Array.isArray(
|
|
74987
|
+
const tuple2 = raw;
|
|
74988
|
+
const price2 = toBig9(Array.isArray(tuple2) ? tuple2[0] : tuple2?.priceD18);
|
|
74989
|
+
const suspicious = Array.isArray(tuple2) ? tuple2[2] : tuple2?.isSuspicious;
|
|
74918
74990
|
if (!price2 || price2 <= 0n || suspicious === true) return void 0;
|
|
74919
74991
|
rate = 1e18 / Number(price2) * 10 ** (spec.shareDecimals - spec.underlyingDecimals);
|
|
74920
74992
|
} else {
|
|
@@ -76617,14 +76689,14 @@ async function probeAaveFeedTimestamps(chainId, options = {}) {
|
|
|
76617
76689
|
const infoOfSource = /* @__PURE__ */ new Map();
|
|
76618
76690
|
uniqueSources.forEach((source, i) => {
|
|
76619
76691
|
const round = roundResults[i * 2];
|
|
76620
|
-
const
|
|
76692
|
+
const description2 = roundResults[i * 2 + 1];
|
|
76621
76693
|
if (isFailed2(round) || !Array.isArray(round)) return;
|
|
76622
76694
|
const updatedAt = Number(round[3]);
|
|
76623
76695
|
if (!(updatedAt > 0)) return;
|
|
76624
76696
|
infoOfSource.set(source, {
|
|
76625
76697
|
source,
|
|
76626
76698
|
updatedAt,
|
|
76627
|
-
description: isFailed2(
|
|
76699
|
+
description: isFailed2(description2) ? void 0 : String(description2)
|
|
76628
76700
|
});
|
|
76629
76701
|
});
|
|
76630
76702
|
for (const [i, source] of sourceOf2) {
|
|
@@ -79207,7 +79279,7 @@ async function fetchFluidExposures(chainId, multicallRetry, prices, tokenList) {
|
|
|
79207
79279
|
const assets = Number(loanEntry.totalDebt ?? 0);
|
|
79208
79280
|
if (!(assets > 0)) continue;
|
|
79209
79281
|
const assetsUsd = Number(loanEntry.totalDebtUSD ?? 0) || 0;
|
|
79210
|
-
const
|
|
79282
|
+
const row2 = {
|
|
79211
79283
|
marketId: (vault.vaultAddress ?? "").toLowerCase(),
|
|
79212
79284
|
collateralAddress,
|
|
79213
79285
|
collateral: collateralAddress ? tokenList[collateralAddress] : void 0,
|
|
@@ -79216,8 +79288,8 @@ async function fetchFluidExposures(chainId, multicallRetry, prices, tokenList) {
|
|
|
79216
79288
|
supplyApr: Number(loanEntry.variableBorrowRate ?? 0) || 0
|
|
79217
79289
|
};
|
|
79218
79290
|
const list = rowsByLoan.get(loanAddress);
|
|
79219
|
-
if (list) list.push(
|
|
79220
|
-
else rowsByLoan.set(loanAddress, [
|
|
79291
|
+
if (list) list.push(row2);
|
|
79292
|
+
else rowsByLoan.set(loanAddress, [row2]);
|
|
79221
79293
|
}
|
|
79222
79294
|
for (const [loanAddress, rows] of rowsByLoan) {
|
|
79223
79295
|
const totalUsd = rows.reduce((s, r) => s + r.assetsUsd, 0);
|
|
@@ -80927,12 +80999,12 @@ function buildExposures(vaultId, totalAssetsFormatted, pricePerUnit, positionsBy
|
|
|
80927
80999
|
if (totalAssetsFormatted <= 0) return void 0;
|
|
80928
81000
|
const rows = positionsByVault.get(vaultId) ?? [];
|
|
80929
81001
|
const exposures = [];
|
|
80930
|
-
for (const
|
|
80931
|
-
const marketId = (
|
|
81002
|
+
for (const row2 of rows) {
|
|
81003
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80932
81004
|
if (!marketId) continue;
|
|
80933
81005
|
const meta = marketMeta.get(marketId);
|
|
80934
81006
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80935
|
-
const shares = Number(
|
|
81007
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80936
81008
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80937
81009
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80938
81010
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -80960,12 +81032,12 @@ function computeSiloLiquidityFormatted(vaultId, totalAssetsFormatted, positionsB
|
|
|
80960
81032
|
let allocated = 0;
|
|
80961
81033
|
let withdrawable = 0;
|
|
80962
81034
|
let resolved2 = 0;
|
|
80963
|
-
for (const
|
|
80964
|
-
const marketId = (
|
|
81035
|
+
for (const row2 of rows) {
|
|
81036
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80965
81037
|
if (!marketId) continue;
|
|
80966
81038
|
const meta = marketMeta.get(marketId);
|
|
80967
81039
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80968
|
-
const shares = Number(
|
|
81040
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80969
81041
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80970
81042
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80971
81043
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -80984,12 +81056,12 @@ function computeSiloUtilization(vaultId, totalAssetsFormatted, positionsByVault,
|
|
|
80984
81056
|
const rows = positionsByVault.get(vaultId) ?? [];
|
|
80985
81057
|
let borrowed = 0;
|
|
80986
81058
|
let resolved2 = 0;
|
|
80987
|
-
for (const
|
|
80988
|
-
const marketId = (
|
|
81059
|
+
for (const row2 of rows) {
|
|
81060
|
+
const marketId = (row2.marketId ?? "").toLowerCase();
|
|
80989
81061
|
if (!marketId) continue;
|
|
80990
81062
|
const meta = marketMeta.get(marketId);
|
|
80991
81063
|
if (!meta || meta.collateralShares <= 0) continue;
|
|
80992
|
-
const shares = Number(
|
|
81064
|
+
const shares = Number(row2.sTokenBalance ?? 0);
|
|
80993
81065
|
if (!Number.isFinite(shares) || shares <= 0) continue;
|
|
80994
81066
|
const assets = shares * meta.collateralAssets / meta.collateralShares;
|
|
80995
81067
|
if (!(assets > 0) || assets > totalAssetsFormatted * 1.01) continue;
|
|
@@ -81164,12 +81236,12 @@ var fetchSiloVaults = async (chainId, prices = {}, tokenList = {}, options) => {
|
|
|
81164
81236
|
const items = payload?.data?.vaults?.items ?? [];
|
|
81165
81237
|
const positions = payload?.data?.positions?.items ?? [];
|
|
81166
81238
|
const positionsByVault = /* @__PURE__ */ new Map();
|
|
81167
|
-
for (const
|
|
81168
|
-
const accountId = (
|
|
81239
|
+
for (const row2 of positions) {
|
|
81240
|
+
const accountId = (row2.accountId ?? "").toLowerCase();
|
|
81169
81241
|
if (!accountId) continue;
|
|
81170
81242
|
const list = positionsByVault.get(accountId);
|
|
81171
|
-
if (list) list.push(
|
|
81172
|
-
else positionsByVault.set(accountId, [
|
|
81243
|
+
if (list) list.push(row2);
|
|
81244
|
+
else positionsByVault.set(accountId, [row2]);
|
|
81173
81245
|
}
|
|
81174
81246
|
const markets = payload?.data?.markets?.items ?? [];
|
|
81175
81247
|
const marketMeta = /* @__PURE__ */ new Map();
|
|
@@ -81751,18 +81823,18 @@ async function fetchEulerEarnVaultsFromApi(chainId, prices = {}, tokenList = {},
|
|
|
81751
81823
|
const rows = list.data ?? [];
|
|
81752
81824
|
if (rows.length === 0) return {};
|
|
81753
81825
|
const statusByAddress = /* @__PURE__ */ new Map();
|
|
81754
|
-
for (const
|
|
81755
|
-
const status =
|
|
81756
|
-
if (
|
|
81757
|
-
statusByAddress.set(
|
|
81826
|
+
for (const row2 of rows) {
|
|
81827
|
+
const status = row2.visibility?.status;
|
|
81828
|
+
if (row2.address && typeof status === "string") {
|
|
81829
|
+
statusByAddress.set(row2.address.toLowerCase(), status);
|
|
81758
81830
|
}
|
|
81759
81831
|
}
|
|
81760
81832
|
const [details, entityNames] = await Promise.all([
|
|
81761
81833
|
mapWithConcurrency(
|
|
81762
81834
|
rows,
|
|
81763
81835
|
DETAIL_CONCURRENCY,
|
|
81764
|
-
(
|
|
81765
|
-
`${EULER_DATA_API_BASE2}/earn/vaults/${chainId}/${
|
|
81836
|
+
(row2) => getJson8(
|
|
81837
|
+
`${EULER_DATA_API_BASE2}/earn/vaults/${chainId}/${row2.address}?include=strategies`
|
|
81766
81838
|
).then((d) => d?.data)
|
|
81767
81839
|
),
|
|
81768
81840
|
fetchEulerEntityNames(chainId)
|
|
@@ -89962,6 +90034,53 @@ var EmberPauseStatusAbi = [
|
|
|
89962
90034
|
}
|
|
89963
90035
|
];
|
|
89964
90036
|
|
|
90037
|
+
// src/vaults/savings/abis/sky.ts
|
|
90038
|
+
var VatIlksAbi = [
|
|
90039
|
+
{
|
|
90040
|
+
name: "ilks",
|
|
90041
|
+
type: "function",
|
|
90042
|
+
stateMutability: "view",
|
|
90043
|
+
inputs: [{ type: "bytes32", name: "ilk" }],
|
|
90044
|
+
outputs: [
|
|
90045
|
+
{ type: "uint256", name: "Art" },
|
|
90046
|
+
{ type: "uint256", name: "rate" },
|
|
90047
|
+
{ type: "uint256", name: "spot" },
|
|
90048
|
+
{ type: "uint256", name: "line" },
|
|
90049
|
+
{ type: "uint256", name: "dust" }
|
|
90050
|
+
]
|
|
90051
|
+
}
|
|
90052
|
+
];
|
|
90053
|
+
var JugIlksAbi = [
|
|
90054
|
+
{
|
|
90055
|
+
name: "ilks",
|
|
90056
|
+
type: "function",
|
|
90057
|
+
stateMutability: "view",
|
|
90058
|
+
inputs: [{ type: "bytes32", name: "ilk" }],
|
|
90059
|
+
outputs: [
|
|
90060
|
+
{ type: "uint256", name: "duty" },
|
|
90061
|
+
{ type: "uint256", name: "rho" }
|
|
90062
|
+
]
|
|
90063
|
+
}
|
|
90064
|
+
];
|
|
90065
|
+
var ClipDueAbi = [
|
|
90066
|
+
{
|
|
90067
|
+
name: "Due",
|
|
90068
|
+
type: "function",
|
|
90069
|
+
stateMutability: "view",
|
|
90070
|
+
inputs: [],
|
|
90071
|
+
outputs: [{ type: "uint256" }]
|
|
90072
|
+
}
|
|
90073
|
+
];
|
|
90074
|
+
var StUsdsMaxDepositAbi = [
|
|
90075
|
+
{
|
|
90076
|
+
name: "maxDeposit",
|
|
90077
|
+
type: "function",
|
|
90078
|
+
stateMutability: "view",
|
|
90079
|
+
inputs: [{ type: "address", name: "receiver" }],
|
|
90080
|
+
outputs: [{ type: "uint256" }]
|
|
90081
|
+
}
|
|
90082
|
+
];
|
|
90083
|
+
|
|
89965
90084
|
// src/vaults/savings/abis/inverse.ts
|
|
89966
90085
|
var uintView = (name) => [
|
|
89967
90086
|
{
|
|
@@ -90294,6 +90413,133 @@ var Multicall3BlockNumberAbi = [
|
|
|
90294
90413
|
}
|
|
90295
90414
|
];
|
|
90296
90415
|
|
|
90416
|
+
// src/vaults/savings/abis/threeJaneLcc.ts
|
|
90417
|
+
var view4 = (name, inputs = [], outputs = [
|
|
90418
|
+
{ name: "", type: "uint256" }
|
|
90419
|
+
]) => ({
|
|
90420
|
+
name,
|
|
90421
|
+
type: "function",
|
|
90422
|
+
stateMutability: "view",
|
|
90423
|
+
inputs,
|
|
90424
|
+
outputs
|
|
90425
|
+
});
|
|
90426
|
+
var tuple = (components) => [
|
|
90427
|
+
{ name: "", type: "tuple", components }
|
|
90428
|
+
];
|
|
90429
|
+
var LccTotalsAbi = [
|
|
90430
|
+
view4(
|
|
90431
|
+
"totals",
|
|
90432
|
+
[],
|
|
90433
|
+
tuple([
|
|
90434
|
+
{ name: "activeMargin", type: "uint128" },
|
|
90435
|
+
{ name: "activeCommitment", type: "uint128" },
|
|
90436
|
+
{ name: "pendingMargin", type: "uint128" },
|
|
90437
|
+
{ name: "pendingCommitment", type: "uint128" }
|
|
90438
|
+
])
|
|
90439
|
+
)
|
|
90440
|
+
];
|
|
90441
|
+
var LccRiskConfigAbi = [
|
|
90442
|
+
view4(
|
|
90443
|
+
"riskConfig",
|
|
90444
|
+
[],
|
|
90445
|
+
tuple([
|
|
90446
|
+
{ name: "protocolCommitmentCap", type: "uint256" },
|
|
90447
|
+
{ name: "userCommitmentCap", type: "uint256" },
|
|
90448
|
+
{ name: "exitCapBps", type: "uint256" },
|
|
90449
|
+
{ name: "minDepositAssets", type: "uint256" },
|
|
90450
|
+
{ name: "maxAuctionAwardBps", type: "uint256" },
|
|
90451
|
+
{ name: "slashFeeBps", type: "uint256" }
|
|
90452
|
+
])
|
|
90453
|
+
)
|
|
90454
|
+
];
|
|
90455
|
+
var LccEpochConfigAbi = [
|
|
90456
|
+
view4(
|
|
90457
|
+
"epochConfig",
|
|
90458
|
+
[],
|
|
90459
|
+
tuple([
|
|
90460
|
+
{ name: "startTimestamp", type: "uint256" },
|
|
90461
|
+
{ name: "maxEpochs", type: "uint256" },
|
|
90462
|
+
{ name: "epochLength", type: "uint256" },
|
|
90463
|
+
{ name: "normalDuration", type: "uint256" },
|
|
90464
|
+
{ name: "preCallDuration", type: "uint256" },
|
|
90465
|
+
{ name: "fundingDuration", type: "uint256" },
|
|
90466
|
+
{ name: "marginRatioBps", type: "uint256" },
|
|
90467
|
+
{ name: "exitDelayEpochs", type: "uint256" },
|
|
90468
|
+
{ name: "minCommitmentEpochs", type: "uint256" }
|
|
90469
|
+
])
|
|
90470
|
+
)
|
|
90471
|
+
];
|
|
90472
|
+
var LccPauseStateAbi = [
|
|
90473
|
+
view4(
|
|
90474
|
+
"pauseState",
|
|
90475
|
+
[],
|
|
90476
|
+
[
|
|
90477
|
+
{ name: "paused", type: "bool" },
|
|
90478
|
+
{ name: "since", type: "uint64" },
|
|
90479
|
+
{ name: "until", type: "uint64" }
|
|
90480
|
+
]
|
|
90481
|
+
)
|
|
90482
|
+
];
|
|
90483
|
+
var LccShutdownStateAbi = [
|
|
90484
|
+
view4(
|
|
90485
|
+
"shutdownState",
|
|
90486
|
+
[],
|
|
90487
|
+
tuple([
|
|
90488
|
+
{ name: "active", type: "bool" },
|
|
90489
|
+
{ name: "timestamp", type: "uint64" },
|
|
90490
|
+
{ name: "epoch", type: "uint64" }
|
|
90491
|
+
])
|
|
90492
|
+
)
|
|
90493
|
+
];
|
|
90494
|
+
var LccGetAccountAbi = [
|
|
90495
|
+
view4(
|
|
90496
|
+
"getAccount",
|
|
90497
|
+
[{ name: "user", type: "address" }],
|
|
90498
|
+
tuple([
|
|
90499
|
+
{ name: "activeMargin", type: "uint256" },
|
|
90500
|
+
{ name: "activeCommitment", type: "uint256" },
|
|
90501
|
+
{ name: "pendingMargin", type: "uint256" },
|
|
90502
|
+
{ name: "pendingCommitment", type: "uint256" },
|
|
90503
|
+
{ name: "pendingActivationEpoch", type: "uint256" },
|
|
90504
|
+
{ name: "calledEpochCursor", type: "uint256" },
|
|
90505
|
+
{ name: "claimableExitMargin", type: "uint256" },
|
|
90506
|
+
{ name: "exitBucketMargin", type: "uint256" },
|
|
90507
|
+
{ name: "exitBucketCommitment", type: "uint256" },
|
|
90508
|
+
{ name: "exitRequested", type: "bool" },
|
|
90509
|
+
{ name: "exitMaturityEpoch", type: "uint256" },
|
|
90510
|
+
{ name: "exitClaimed", type: "bool" },
|
|
90511
|
+
{ name: "exitMatured", type: "bool" },
|
|
90512
|
+
{ name: "commitmentStartEpoch", type: "uint256" }
|
|
90513
|
+
])
|
|
90514
|
+
)
|
|
90515
|
+
];
|
|
90516
|
+
var LccMarginConvertToAssetsAbi = [
|
|
90517
|
+
view4("convertToAssets", [{ name: "shares", type: "uint256" }])
|
|
90518
|
+
];
|
|
90519
|
+
var AaveReserveDataLegacyAbi = [
|
|
90520
|
+
view4(
|
|
90521
|
+
"getReserveData",
|
|
90522
|
+
[{ name: "asset", type: "address" }],
|
|
90523
|
+
tuple([
|
|
90524
|
+
{ name: "configuration", type: "uint256" },
|
|
90525
|
+
{ name: "liquidityIndex", type: "uint128" },
|
|
90526
|
+
{ name: "currentLiquidityRate", type: "uint128" },
|
|
90527
|
+
{ name: "variableBorrowIndex", type: "uint128" },
|
|
90528
|
+
{ name: "currentVariableBorrowRate", type: "uint128" },
|
|
90529
|
+
{ name: "currentStableBorrowRate", type: "uint128" },
|
|
90530
|
+
{ name: "lastUpdateTimestamp", type: "uint40" },
|
|
90531
|
+
{ name: "id", type: "uint16" },
|
|
90532
|
+
{ name: "aTokenAddress", type: "address" },
|
|
90533
|
+
{ name: "stableDebtTokenAddress", type: "address" },
|
|
90534
|
+
{ name: "variableDebtTokenAddress", type: "address" },
|
|
90535
|
+
{ name: "interestRateStrategyAddress", type: "address" },
|
|
90536
|
+
{ name: "accruedToTreasury", type: "uint128" },
|
|
90537
|
+
{ name: "unbacked", type: "uint128" },
|
|
90538
|
+
{ name: "isolationModeTotalDebt", type: "uint128" }
|
|
90539
|
+
])
|
|
90540
|
+
)
|
|
90541
|
+
];
|
|
90542
|
+
|
|
90297
90543
|
// src/vaults/savings/readers/shared.ts
|
|
90298
90544
|
var ONE_E1823 = 10n ** 18n;
|
|
90299
90545
|
var toBigInt16 = (v) => {
|
|
@@ -92951,6 +93197,82 @@ var readerSBold = (entry2) => {
|
|
|
92951
93197
|
};
|
|
92952
93198
|
};
|
|
92953
93199
|
|
|
93200
|
+
// src/vaults/savings/readers/skyStUsds.ts
|
|
93201
|
+
var RAY11 = 10n ** 27n;
|
|
93202
|
+
var VAT = "0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B";
|
|
93203
|
+
var JUG = "0x19c0976f590D67707E62397C87829d896Dc0f1F1";
|
|
93204
|
+
var CLIP = "0x836F56750517b1528B5078Cba4Ac4B94fBE4A399";
|
|
93205
|
+
var ILK = "0x4c534556322d534b592d41000000000000000000000000000000000000000000";
|
|
93206
|
+
var NEUTRAL_PROBE8 = "0x000000000000000000000000000000000000dead";
|
|
93207
|
+
var rpow = (x, n) => {
|
|
93208
|
+
let z = n % 2n ? x : RAY11;
|
|
93209
|
+
for (n /= 2n; n > 0n; n /= 2n) {
|
|
93210
|
+
x = (x * x + RAY11 / 2n) / RAY11;
|
|
93211
|
+
if (n % 2n) z = (z * x + RAY11 / 2n) / RAY11;
|
|
93212
|
+
}
|
|
93213
|
+
return z;
|
|
93214
|
+
};
|
|
93215
|
+
var readerSkyStUsds = (entry2) => {
|
|
93216
|
+
const shareUnit = 10n ** BigInt(entry2.decimals);
|
|
93217
|
+
const underlyingUnit = 10n ** BigInt(entry2.underlyingDecimals ?? entry2.decimals);
|
|
93218
|
+
return {
|
|
93219
|
+
calls: [
|
|
93220
|
+
{ address: entry2.address, name: "totalAssets", params: [] },
|
|
93221
|
+
{ address: entry2.address, name: "totalSupply", params: [] },
|
|
93222
|
+
{
|
|
93223
|
+
address: entry2.address,
|
|
93224
|
+
name: "convertToAssets",
|
|
93225
|
+
params: [shareUnit]
|
|
93226
|
+
},
|
|
93227
|
+
{ address: VAT, name: "ilks", params: [ILK] },
|
|
93228
|
+
{ address: JUG, name: "ilks", params: [ILK] },
|
|
93229
|
+
{ address: CLIP, name: "Due", params: [] },
|
|
93230
|
+
{ address: entry2.address, name: "maxDeposit", params: [NEUTRAL_PROBE8] }
|
|
93231
|
+
],
|
|
93232
|
+
abis: [
|
|
93233
|
+
Erc4626ReadAbi2,
|
|
93234
|
+
TotalSupplyAbi2,
|
|
93235
|
+
Erc4626ReadAbi2,
|
|
93236
|
+
VatIlksAbi,
|
|
93237
|
+
JugIlksAbi,
|
|
93238
|
+
ClipDueAbi,
|
|
93239
|
+
StUsdsMaxDepositAbi
|
|
93240
|
+
],
|
|
93241
|
+
parse: ([assets, supply, rate, vatIlk, jugIlk, due, maxDep]) => {
|
|
93242
|
+
const totalAssets = toBigInt16(assets);
|
|
93243
|
+
const totalSupply = toBigInt16(supply);
|
|
93244
|
+
const convertToAssetsRaw = toBigInt16(rate);
|
|
93245
|
+
if (totalAssets === void 0 || totalSupply === void 0 || convertToAssetsRaw === void 0) {
|
|
93246
|
+
return void 0;
|
|
93247
|
+
}
|
|
93248
|
+
const art = Array.isArray(vatIlk) ? toBigInt16(vatIlk[0]) : void 0;
|
|
93249
|
+
const ilkRate = Array.isArray(vatIlk) ? toBigInt16(vatIlk[1]) : void 0;
|
|
93250
|
+
const duty = Array.isArray(jugIlk) ? toBigInt16(jugIlk[0]) : void 0;
|
|
93251
|
+
const rho = Array.isArray(jugIlk) ? toBigInt16(jugIlk[1]) : void 0;
|
|
93252
|
+
const clipDue = toBigInt16(due);
|
|
93253
|
+
let capacity;
|
|
93254
|
+
if (art !== void 0 && ilkRate !== void 0 && duty !== void 0 && rho !== void 0 && clipDue !== void 0) {
|
|
93255
|
+
const now = BigInt(Math.floor(Date.now() / 1e3));
|
|
93256
|
+
const accrued = now > rho ? rpow(duty, now - rho) * ilkRate / RAY11 : ilkRate;
|
|
93257
|
+
const used = (art * accrued + clipDue) / RAY11;
|
|
93258
|
+
capacity = totalAssets > used ? totalAssets - used : 0n;
|
|
93259
|
+
}
|
|
93260
|
+
const depositCapacity = toBigInt16(maxDep);
|
|
93261
|
+
return {
|
|
93262
|
+
totalAssets,
|
|
93263
|
+
totalSupply,
|
|
93264
|
+
exchangeRate: convertToAssetsRaw * ONE_E1823 / underlyingUnit,
|
|
93265
|
+
...capacity !== void 0 ? {
|
|
93266
|
+
instantRedeemCapacity: capacity,
|
|
93267
|
+
instantRedeemEnabled: true,
|
|
93268
|
+
withdrawFeeBps: 0
|
|
93269
|
+
} : {},
|
|
93270
|
+
...depositCapacity !== void 0 ? { depositCapacity } : {}
|
|
93271
|
+
};
|
|
93272
|
+
}
|
|
93273
|
+
};
|
|
93274
|
+
};
|
|
93275
|
+
|
|
92954
93276
|
// src/vaults/savings/readers/morphoVaultV2.ts
|
|
92955
93277
|
var MorphoVaultV2ReadAbi = [
|
|
92956
93278
|
{
|
|
@@ -93304,8 +93626,125 @@ var readerAlchemixTransmuter = (entry2) => {
|
|
|
93304
93626
|
};
|
|
93305
93627
|
};
|
|
93306
93628
|
|
|
93629
|
+
// src/vaults/savings/readers/threeJaneLcc.ts
|
|
93630
|
+
var RAY12 = 10n ** 27n;
|
|
93631
|
+
var readerThreeJaneLcc = (entry2) => {
|
|
93632
|
+
const cfg = entry2.threeJaneLcc;
|
|
93633
|
+
if (!cfg)
|
|
93634
|
+
throw new Error(
|
|
93635
|
+
`threejane-lcc entry ${entry2.address} has no threeJaneLcc pins`
|
|
93636
|
+
);
|
|
93637
|
+
const marginUnit = 10n ** BigInt(cfg.marginDecimals);
|
|
93638
|
+
return {
|
|
93639
|
+
calls: [
|
|
93640
|
+
{ address: entry2.address, name: "totals", params: [] },
|
|
93641
|
+
{ address: entry2.address, name: "riskConfig", params: [] },
|
|
93642
|
+
{ address: entry2.address, name: "epochConfig", params: [] },
|
|
93643
|
+
{ address: entry2.address, name: "pauseState", params: [] },
|
|
93644
|
+
{ address: entry2.address, name: "shutdownState", params: [] },
|
|
93645
|
+
{
|
|
93646
|
+
address: cfg.marginAsset,
|
|
93647
|
+
name: "convertToAssets",
|
|
93648
|
+
params: [marginUnit]
|
|
93649
|
+
},
|
|
93650
|
+
{
|
|
93651
|
+
address: cfg.aavePool,
|
|
93652
|
+
name: "getReserveData",
|
|
93653
|
+
params: [cfg.aaveReserve]
|
|
93654
|
+
}
|
|
93655
|
+
],
|
|
93656
|
+
abis: [
|
|
93657
|
+
LccTotalsAbi,
|
|
93658
|
+
LccRiskConfigAbi,
|
|
93659
|
+
LccEpochConfigAbi,
|
|
93660
|
+
LccPauseStateAbi,
|
|
93661
|
+
LccShutdownStateAbi,
|
|
93662
|
+
LccMarginConvertToAssetsAbi,
|
|
93663
|
+
AaveReserveDataLegacyAbi
|
|
93664
|
+
],
|
|
93665
|
+
parse: ([
|
|
93666
|
+
totalsRaw,
|
|
93667
|
+
riskRaw,
|
|
93668
|
+
epochRaw,
|
|
93669
|
+
pauseRaw,
|
|
93670
|
+
shutdownRaw,
|
|
93671
|
+
ctaRaw,
|
|
93672
|
+
reserveRaw
|
|
93673
|
+
]) => {
|
|
93674
|
+
const totals = totalsRaw;
|
|
93675
|
+
const epoch = epochRaw;
|
|
93676
|
+
const assetsPerShare = toBigInt16(ctaRaw);
|
|
93677
|
+
if (!totals || typeof totals.activeMargin !== "bigint" || !epoch || typeof epoch.marginRatioBps !== "bigint" || epoch.marginRatioBps === 0n || assetsPerShare === void 0 || assetsPerShare === 0n)
|
|
93678
|
+
return void 0;
|
|
93679
|
+
const margin = totals.activeMargin + totals.pendingMargin;
|
|
93680
|
+
const commitment = totals.activeCommitment + totals.pendingCommitment;
|
|
93681
|
+
const exchangeRate = assetsPerShare * ONE_E1823 / marginUnit;
|
|
93682
|
+
const risk = riskRaw;
|
|
93683
|
+
const depositCapacity = risk && typeof risk.protocolCommitmentCap === "bigint" ? risk.protocolCommitmentCap > commitment ? (risk.protocolCommitmentCap - commitment) * epoch.marginRatioBps / 10000n : 0n : void 0;
|
|
93684
|
+
const paused = Array.isArray(pauseRaw) ? pauseRaw[0] === true : void 0;
|
|
93685
|
+
const shutdown = shutdownRaw?.active === true;
|
|
93686
|
+
const liquidityRate = reserveRaw?.currentLiquidityRate;
|
|
93687
|
+
const supplyRate = typeof liquidityRate === "bigint" ? Number(liquidityRate * 1000000n / RAY12) / 1e4 : void 0;
|
|
93688
|
+
const promiseApr = cfg.promiseFeePct * 1e4 / Number(epoch.marginRatioBps);
|
|
93689
|
+
const rewardStreams = [
|
|
93690
|
+
{
|
|
93691
|
+
side: "deposit",
|
|
93692
|
+
apr: promiseApr,
|
|
93693
|
+
kind: "token",
|
|
93694
|
+
token: {
|
|
93695
|
+
address: cfg.feeToken.toLowerCase(),
|
|
93696
|
+
symbol: "USDC",
|
|
93697
|
+
decimals: 6
|
|
93698
|
+
},
|
|
93699
|
+
source: {
|
|
93700
|
+
id: "3jane:lcc-promise-fee",
|
|
93701
|
+
label: "3Jane \xB7 LCC promise fee",
|
|
93702
|
+
link: "https://docs.3jane.xyz/levered-callable-capital-lcc/mechanism/stakers.md",
|
|
93703
|
+
platform: "protocol",
|
|
93704
|
+
refs: {
|
|
93705
|
+
facility: entry2.address.toLowerCase(),
|
|
93706
|
+
promiseFeePct: cfg.promiseFeePct,
|
|
93707
|
+
marginRatioBps: Number(epoch.marginRatioBps),
|
|
93708
|
+
distribution: "off-chain-weekly-usdc"
|
|
93709
|
+
}
|
|
93710
|
+
},
|
|
93711
|
+
// Pushed to the staker's address by 3Jane; nothing to claim.
|
|
93712
|
+
claim: "accrual"
|
|
93713
|
+
}
|
|
93714
|
+
];
|
|
93715
|
+
const epochSeconds = Number(epoch.epochLength);
|
|
93716
|
+
const delayEpochs = Number(epoch.exitDelayEpochs);
|
|
93717
|
+
const exitCapPct = risk && typeof risk.exitCapBps === "bigint" ? Number(risk.exitCapBps) / 100 : void 0;
|
|
93718
|
+
const exitRoutes = [
|
|
93719
|
+
{
|
|
93720
|
+
id: "queued",
|
|
93721
|
+
kind: "queued",
|
|
93722
|
+
label: `Unstake (\u2265 ${Math.round(delayEpochs * epochSeconds / 86400)} days)`,
|
|
93723
|
+
settlement: "async",
|
|
93724
|
+
feeBps: 0,
|
|
93725
|
+
waitSeconds: delayEpochs * epochSeconds,
|
|
93726
|
+
selfOnly: true,
|
|
93727
|
+
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.`
|
|
93728
|
+
}
|
|
93729
|
+
];
|
|
93730
|
+
return {
|
|
93731
|
+
// Underlying the posted margin is worth; the shares are the margin.
|
|
93732
|
+
totalAssets: margin * assetsPerShare / marginUnit,
|
|
93733
|
+
totalSupply: margin,
|
|
93734
|
+
exchangeRate,
|
|
93735
|
+
supplyRate,
|
|
93736
|
+
rewardStreams,
|
|
93737
|
+
depositCapacity: shutdown ? 0n : depositCapacity,
|
|
93738
|
+
paused: paused || shutdown,
|
|
93739
|
+
exitRoutes,
|
|
93740
|
+
withdrawalCooldownSeconds: delayEpochs * epochSeconds
|
|
93741
|
+
};
|
|
93742
|
+
}
|
|
93743
|
+
};
|
|
93744
|
+
};
|
|
93745
|
+
|
|
93307
93746
|
// src/vaults/savings/readers/gapSweep.ts
|
|
93308
|
-
var
|
|
93747
|
+
var NEUTRAL_PROBE9 = "0x000000000000000000000000000000000000dead";
|
|
93309
93748
|
var MAX_UINT256 = 2n ** 256n - 1n;
|
|
93310
93749
|
var readerUsdaiStaked = (entry2) => {
|
|
93311
93750
|
const a = entry2.address;
|
|
@@ -93355,7 +93794,7 @@ var readerYuzuIlp = (entry2) => {
|
|
|
93355
93794
|
{ address: entry2.address, name: "totalAssets", params: [] },
|
|
93356
93795
|
{ address: entry2.address, name: "totalSupply", params: [] },
|
|
93357
93796
|
{ address: entry2.address, name: "convertToAssets", params: [shareUnit] },
|
|
93358
|
-
{ address: entry2.address, name: "maxDeposit", params: [
|
|
93797
|
+
{ address: entry2.address, name: "maxDeposit", params: [NEUTRAL_PROBE9] },
|
|
93359
93798
|
{ address: entry2.address, name: "paused", params: [] }
|
|
93360
93799
|
],
|
|
93361
93800
|
abis: [
|
|
@@ -93488,6 +93927,8 @@ var buildReader2 = (entry2) => {
|
|
|
93488
93927
|
return readerUnitasXgld(entry2);
|
|
93489
93928
|
case "sbold":
|
|
93490
93929
|
return readerSBold(entry2);
|
|
93930
|
+
case "sky-stusds":
|
|
93931
|
+
return readerSkyStUsds(entry2);
|
|
93491
93932
|
case "accountable-vault":
|
|
93492
93933
|
return readerAccountableVault(entry2);
|
|
93493
93934
|
case "morpho-vault-v2":
|
|
@@ -93504,6 +93945,8 @@ var buildReader2 = (entry2) => {
|
|
|
93504
93945
|
return readerInverseSinv(entry2);
|
|
93505
93946
|
case "alchemix-transmuter":
|
|
93506
93947
|
return readerAlchemixTransmuter(entry2);
|
|
93948
|
+
case "threejane-lcc":
|
|
93949
|
+
return readerThreeJaneLcc(entry2);
|
|
93507
93950
|
case "erc4626-cooldown":
|
|
93508
93951
|
return readerErc4626Cooldown(entry2);
|
|
93509
93952
|
case "erc4626-idle":
|
|
@@ -93672,9 +94115,13 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
93672
94115
|
}) : void 0;
|
|
93673
94116
|
const supplyRate = state.supplyRate ?? (rewards ? 0 : fetcherApr ?? 0);
|
|
93674
94117
|
const incentives = incentivesByAddress.get(addressLc);
|
|
93675
|
-
const rewardsRate = (rewards?.apr ?? 0) + incentiveApr(incentives);
|
|
94118
|
+
const rewardsRate = (rewards?.apr ?? 0) + incentiveApr(incentives) + incentiveApr(state.rewardStreams);
|
|
93676
94119
|
const depositRate = supplyRate + rewardsRate;
|
|
93677
|
-
const rewardStreams = rewards?.streams || incentives
|
|
94120
|
+
const rewardStreams = rewards?.streams || incentives || state.rewardStreams ? [
|
|
94121
|
+
...rewards?.streams ?? [],
|
|
94122
|
+
...incentives ?? [],
|
|
94123
|
+
...state.rewardStreams ?? []
|
|
94124
|
+
] : void 0;
|
|
93678
94125
|
const shareDec = entry2.decimals;
|
|
93679
94126
|
const underlyingDec = entry2.underlyingDecimals ?? entry2.decimals;
|
|
93680
94127
|
const shareUnit = 10n ** BigInt(shareDec);
|
|
@@ -93760,7 +94207,9 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
93760
94207
|
// (`deposit(assets, receiver)`, `redeem(shares, receiver, owner)`);
|
|
93761
94208
|
// the bespoke reader exists for the FRV lock, the rate blend and the
|
|
93762
94209
|
// emission read, not because the standard surface is missing.
|
|
93763
|
-
entry2.reader === "venus-hub" || //
|
|
94210
|
+
entry2.reader === "venus-hub" || // Sky stUSDS: plain 4626 legs; the reader adds the LSE-ilk debt that
|
|
94211
|
+
// caps the exit.
|
|
94212
|
+
entry2.reader === "sky-stusds" || // hbfUSD / pbfUSD ARE conforming 4626 — the bespoke reader exists for
|
|
93764
94213
|
// the epoch ledger and the share-denominated supply cap, not because
|
|
93765
94214
|
// the standard surface is missing. bfBTC (`bitfi-bfbtc`) is the
|
|
93766
94215
|
// opposite and correctly falls through to `false`.
|
|
@@ -93817,6 +94266,7 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
93817
94266
|
// "compounds per second" and "needs an approval" for every vault.
|
|
93818
94267
|
yieldWarmupSeconds: entry2.yieldWarmupSeconds,
|
|
93819
94268
|
accrual: entry2.accrual,
|
|
94269
|
+
...entry2.exitWholeOnly ? { exitWholeOnly: true } : {},
|
|
93820
94270
|
needsDepositApproval: entry2.needsDepositApproval,
|
|
93821
94271
|
// Drives the USER-balance read. Absent ⇒ `balanceOf` on the share
|
|
93822
94272
|
// token; `savings-account` is the one address that is not a token.
|
|
@@ -93950,14 +94400,14 @@ async function readTransmuterLots(multicallRetry, chainId, account, counted) {
|
|
|
93950
94400
|
}
|
|
93951
94401
|
ids.forEach(({ address, id }, i) => {
|
|
93952
94402
|
const raw = posRes[i];
|
|
93953
|
-
const
|
|
94403
|
+
const tuple2 = Array.isArray(raw) ? raw : raw && typeof raw === "object" ? [
|
|
93954
94404
|
raw.amount,
|
|
93955
94405
|
raw.startBlock,
|
|
93956
94406
|
raw.maturationBlock
|
|
93957
94407
|
] : void 0;
|
|
93958
|
-
const amount5 =
|
|
93959
|
-
const start =
|
|
93960
|
-
const end =
|
|
94408
|
+
const amount5 = tuple2 ? toBigInt16(tuple2[0]) : void 0;
|
|
94409
|
+
const start = tuple2 ? toBigInt16(tuple2[1]) : void 0;
|
|
94410
|
+
const end = tuple2 ? toBigInt16(tuple2[2]) : void 0;
|
|
93961
94411
|
if (amount5 === void 0 || start === void 0 || end === void 0) return;
|
|
93962
94412
|
if (end <= start) return;
|
|
93963
94413
|
const term = end - start;
|
|
@@ -93981,6 +94431,18 @@ async function readTransmuterLots(multicallRetry, chainId, account, counted) {
|
|
|
93981
94431
|
return out;
|
|
93982
94432
|
}
|
|
93983
94433
|
|
|
94434
|
+
// src/vaults/savings/lccAccount.ts
|
|
94435
|
+
var lccAccountCall = (facility, account) => ({
|
|
94436
|
+
call: { address: facility, name: "getAccount", params: [account] },
|
|
94437
|
+
abi: LccGetAccountAbi
|
|
94438
|
+
});
|
|
94439
|
+
var lccAccountMargin = (decoded) => {
|
|
94440
|
+
const a = decoded;
|
|
94441
|
+
if (!a || typeof a.activeMargin !== "bigint" || typeof a.pendingMargin !== "bigint" || typeof a.claimableExitMargin !== "bigint")
|
|
94442
|
+
return void 0;
|
|
94443
|
+
return a.activeMargin + a.pendingMargin + a.claimableExitMargin;
|
|
94444
|
+
};
|
|
94445
|
+
|
|
93984
94446
|
// src/vaults/savings/usualRewards.ts
|
|
93985
94447
|
var USUAL_DISTRIBUTION_MODULE = "0x75cc0c0ddd2ccafe6ec415be686267588011e36a";
|
|
93986
94448
|
var USUAL_REWARDS_API = "https://app.usual.money/api/rewards";
|
|
@@ -94067,9 +94529,9 @@ var fetchUsualRewardsClaimData = async (account, multicallRetry, opts = {}) => {
|
|
|
94067
94529
|
};
|
|
94068
94530
|
}
|
|
94069
94531
|
const [data, claimedRaw, onlySelf, redirect, paused, cap] = res;
|
|
94070
|
-
const
|
|
94071
|
-
const root =
|
|
94072
|
-
const rootTs =
|
|
94532
|
+
const tuple2 = Array.isArray(data) ? data : void 0;
|
|
94533
|
+
const root = tuple2?.[1];
|
|
94534
|
+
const rootTs = tuple2?.[0];
|
|
94073
94535
|
if (!isHex32(root) || typeof rootTs !== "bigint" || typeof claimedRaw !== "bigint" || typeof onlySelf !== "boolean" || typeof paused !== "boolean")
|
|
94074
94536
|
return {
|
|
94075
94537
|
status: "unknown",
|
|
@@ -99484,9 +99946,10 @@ function buildExit(input, t, fees2) {
|
|
|
99484
99946
|
assetsUsd: input.liquidityUsd,
|
|
99485
99947
|
ratio
|
|
99486
99948
|
} : void 0,
|
|
99487
|
-
//
|
|
99488
|
-
// constraint is
|
|
99489
|
-
|
|
99949
|
+
// Nearly every vault lets a holder exit part of a position; the
|
|
99950
|
+
// constraint is size or timing, not granularity. 3Jane LCC's unstake is
|
|
99951
|
+
// the exception: the whole position, irrevocably.
|
|
99952
|
+
partialAllowed: input.exitWholeOnly !== true,
|
|
99490
99953
|
priceRisk,
|
|
99491
99954
|
// Only the request/queue models have something to cancel, and only where
|
|
99492
99955
|
// the protocol exposes it — left undefined rather than guessed.
|
|
@@ -99582,6 +100045,7 @@ function buildPrincipal(input, t) {
|
|
|
99582
100045
|
risks.push("nav-drawdown");
|
|
99583
100046
|
if (input.solvency === "tranched-junior") risks.push("first-loss");
|
|
99584
100047
|
if (input.solvency === "undercollateralized") risks.push("bad-debt");
|
|
100048
|
+
if (input.solvency === "margined") risks.push("slashing");
|
|
99585
100049
|
if (input.solvency === "nav-attested" || input.navOracle != null)
|
|
99586
100050
|
risks.push("nav-drawdown");
|
|
99587
100051
|
return {
|
|
@@ -99823,7 +100287,7 @@ var CI = new Map(
|
|
|
99823
100287
|
var REFLECT_CI = new Map(
|
|
99824
100288
|
Object.entries(REFLECT_TRANCHE_SIDES).map(([m, x]) => [m.toLowerCase(), x])
|
|
99825
100289
|
);
|
|
99826
|
-
var svmSavingsCuration = (mint,
|
|
100290
|
+
var svmSavingsCuration = (mint, row2) => {
|
|
99827
100291
|
const pinned = SVM_SAVINGS_CURATION[mint] ?? CI.get(mint.toLowerCase());
|
|
99828
100292
|
if (pinned) return pinned;
|
|
99829
100293
|
const reflect = REFLECT_TRANCHE_SIDES[mint] ?? REFLECT_CI.get(mint.toLowerCase());
|
|
@@ -99832,8 +100296,8 @@ var svmSavingsCuration = (mint, row) => {
|
|
|
99832
100296
|
description: reflectTrancheDescription(reflect[0], reflect[1]),
|
|
99833
100297
|
solvency: reflect[0] === "senior" ? "tranched-senior" : "tranched-junior"
|
|
99834
100298
|
};
|
|
99835
|
-
if (
|
|
99836
|
-
const t = EXPONENT_TRANCHE_NAME.exec(
|
|
100299
|
+
if (row2?.brand !== "Exponent") return void 0;
|
|
100300
|
+
const t = EXPONENT_TRANCHE_NAME.exec(row2.name ?? "");
|
|
99837
100301
|
if (!t) return void 0;
|
|
99838
100302
|
return {
|
|
99839
100303
|
description: exponentTrancheDescription(
|
|
@@ -100171,12 +100635,12 @@ function withMaturityLabel(name, maturity) {
|
|
|
100171
100635
|
if (name.includes(year)) return name;
|
|
100172
100636
|
return `${name} \xB7 ${shortDate(secs)}`;
|
|
100173
100637
|
}
|
|
100174
|
-
function earnRowSubtitle(
|
|
100175
|
-
const curator =
|
|
100176
|
-
const stack = curator ?
|
|
100638
|
+
function earnRowSubtitle(row2) {
|
|
100639
|
+
const curator = row2.curator?.name?.trim();
|
|
100640
|
+
const stack = curator ? row2.protocol?.name ?? row2.brand : row2.brand ?? row2.protocol?.name;
|
|
100177
100641
|
const out = [];
|
|
100178
100642
|
const seen = /* @__PURE__ */ new Set();
|
|
100179
|
-
for (const part of [curator, stack, earnLabel("venueKind",
|
|
100643
|
+
for (const part of [curator, stack, earnLabel("venueKind", row2.venueKind)]) {
|
|
100180
100644
|
const value = part?.trim();
|
|
100181
100645
|
if (!value) continue;
|
|
100182
100646
|
const key5 = value.toLowerCase();
|
|
@@ -100187,7 +100651,7 @@ function earnRowSubtitle(row) {
|
|
|
100187
100651
|
return out.join(" \xB7 ");
|
|
100188
100652
|
}
|
|
100189
100653
|
function stampEarnSubtitles(rows) {
|
|
100190
|
-
for (const
|
|
100654
|
+
for (const row2 of rows) row2.subtitle = earnRowSubtitle(row2);
|
|
100191
100655
|
}
|
|
100192
100656
|
function renderedIdentity(m) {
|
|
100193
100657
|
return [m.chainId, m.brand ?? m.venue, m.name ?? "", m.asset.symbol].join("|");
|
|
@@ -100432,20 +100896,20 @@ function resolveVaultBasket(provider, meta, chainId) {
|
|
|
100432
100896
|
}
|
|
100433
100897
|
var RATE_UNAVAILABLE_SOURCES = /* @__PURE__ */ new Set(["unavailable", "exchange-rate-only"]);
|
|
100434
100898
|
var isRateSourceUnavailable = (rateSource) => !!rateSource && RATE_UNAVAILABLE_SOURCES.has(rateSource);
|
|
100435
|
-
function earnMarketFromVault(
|
|
100436
|
-
const provider = str6(
|
|
100437
|
-
const address = addr5(
|
|
100438
|
-
const underlying = addr5(
|
|
100899
|
+
function earnMarketFromVault(row2, chainId, opts = {}) {
|
|
100900
|
+
const provider = str6(row2.provider);
|
|
100901
|
+
const address = addr5(row2.vaultAddress, chainId);
|
|
100902
|
+
const underlying = addr5(row2.underlying, chainId);
|
|
100439
100903
|
if (!provider || !address || !underlying) return void 0;
|
|
100440
|
-
const meta =
|
|
100904
|
+
const meta = row2.providerMeta ?? {};
|
|
100441
100905
|
const basket = resolveVaultBasket(provider, meta, chainId);
|
|
100442
100906
|
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(
|
|
100907
|
+
const info = row2.vaultInfo ?? {};
|
|
100908
|
+
const rates = row2.rates ?? {};
|
|
100909
|
+
const tvl = row2.tvl ?? {};
|
|
100910
|
+
const liq = row2.liquidity ?? {};
|
|
100911
|
+
const shareDecimals = num16(row2.decimals) ?? 18;
|
|
100912
|
+
const assetDecimals = num16(row2.assetDecimals) ?? num16(row2.underlyingInfo?.asset?.decimals) ?? shareDecimals;
|
|
100449
100913
|
const rateUnavailable = isRateSourceUnavailable(str6(meta.rateSource));
|
|
100450
100914
|
const toPercent2 = (v) => rateUnavailable ? void 0 : ratePercent(v, provider, opts.fractionRateProviders);
|
|
100451
100915
|
const rewards = toPercent2(rates.rewardsRate);
|
|
@@ -100481,15 +100945,15 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100481
100945
|
venue: vaultVenue(provider),
|
|
100482
100946
|
venueKind: "vault",
|
|
100483
100947
|
// Curator first (it names the actual operator), then the provider brand.
|
|
100484
|
-
brand: str6(
|
|
100948
|
+
brand: str6(row2.curatorName) ?? venueBrand(vaultVenue(provider)),
|
|
100485
100949
|
// What the vault is BUILT ON, kept apart from who runs it — see
|
|
100486
100950
|
// `resolveEarnIdentity` for why this is not simply provider-vs-brand.
|
|
100487
100951
|
...withCuratorEntity(
|
|
100488
100952
|
resolveEarnIdentity(
|
|
100489
100953
|
vaultVenue(provider),
|
|
100490
|
-
str6(
|
|
100954
|
+
str6(row2.curatorName)
|
|
100491
100955
|
),
|
|
100492
|
-
str6(
|
|
100956
|
+
str6(row2.curatorEntity)
|
|
100493
100957
|
),
|
|
100494
100958
|
// The maturity is part of a fixed-term row's IDENTITY. Pendle ships names
|
|
100495
100959
|
// with no date, so several PTs on one underlying render identically —
|
|
@@ -100517,8 +100981,8 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100517
100981
|
name: withTrancheLabel(
|
|
100518
100982
|
withMaturityLabel(
|
|
100519
100983
|
stripLeadingBrand(
|
|
100520
|
-
vaultDisplayName(
|
|
100521
|
-
str6(
|
|
100984
|
+
vaultDisplayName(row2, info) ?? "",
|
|
100985
|
+
str6(row2.curatorName) ?? venueBrand(vaultVenue(provider))
|
|
100522
100986
|
) || void 0,
|
|
100523
100987
|
maturity
|
|
100524
100988
|
),
|
|
@@ -100529,19 +100993,19 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100529
100993
|
// its share mint lives in `providerMeta.shareMint`. Solana builders key on
|
|
100530
100994
|
// this ref (`svmEarnBuilderKey`), so it stays base58-verbatim.
|
|
100531
100995
|
ref: shareAddress,
|
|
100532
|
-
logoURI: str6(info.logoURI) ?? str6(
|
|
100996
|
+
logoURI: str6(info.logoURI) ?? str6(row2.underlyingInfo?.asset?.logoURI),
|
|
100533
100997
|
asset: {
|
|
100534
100998
|
address: underlying,
|
|
100535
|
-
symbol: str6(
|
|
100999
|
+
symbol: str6(row2.underlyingInfo?.asset?.symbol) ?? "",
|
|
100536
101000
|
decimals: assetDecimals,
|
|
100537
101001
|
assetGroup: str6(info.assetGroup),
|
|
100538
|
-
priceUsd: num16(
|
|
101002
|
+
priceUsd: num16(row2.underlyingInfo?.prices?.priceUsd)
|
|
100539
101003
|
},
|
|
100540
101004
|
// The vault IS a share token by construction; carry it so a withdraw in
|
|
100541
101005
|
// share units can be built without a second lookup.
|
|
100542
101006
|
shareToken: {
|
|
100543
101007
|
address: shareAddress,
|
|
100544
|
-
symbol: str6(info.symbol) ?? str6(
|
|
101008
|
+
symbol: str6(info.symbol) ?? str6(row2.symbol) ?? "",
|
|
100545
101009
|
decimals: shareDecimals
|
|
100546
101010
|
},
|
|
100547
101011
|
rate,
|
|
@@ -100579,8 +101043,8 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100579
101043
|
// since the surface was written and never populated — a tranche's
|
|
100580
101044
|
// first-loss position is the term most worth surfacing on a rate list.
|
|
100581
101045
|
counterparty: str6(meta.solvency),
|
|
100582
|
-
score: num16(
|
|
100583
|
-
label: str6(
|
|
101046
|
+
score: num16(row2.rating?.score),
|
|
101047
|
+
label: str6(row2.rating?.level),
|
|
100584
101048
|
illiquid: isIlliquid({
|
|
100585
101049
|
exitMode,
|
|
100586
101050
|
tvlUsd: num16(tvl.totalAssetsUsd),
|
|
@@ -100591,7 +101055,7 @@ function earnMarketFromVault(row, chainId, opts = {}) {
|
|
|
100591
101055
|
// that forgets to stamp them is a compile error, not an empty CTA.
|
|
100592
101056
|
capabilities: [],
|
|
100593
101057
|
...basket ? { basket } : {},
|
|
100594
|
-
providerMeta:
|
|
101058
|
+
providerMeta: row2.providerMeta
|
|
100595
101059
|
};
|
|
100596
101060
|
return market;
|
|
100597
101061
|
}
|
|
@@ -100653,9 +101117,9 @@ function resolveAvailability(meta, maturity) {
|
|
|
100653
101117
|
reason
|
|
100654
101118
|
};
|
|
100655
101119
|
}
|
|
100656
|
-
function vaultDisplayName(
|
|
100657
|
-
const share =
|
|
100658
|
-
return str6(
|
|
101120
|
+
function vaultDisplayName(row2, info) {
|
|
101121
|
+
const share = row2.shareAsset;
|
|
101122
|
+
return str6(row2.name) ?? str6(info.name) ?? str6(row2.displayName) ?? str6(share?.name) ?? str6(share?.symbol) ?? str6(info.symbol) ?? str6(row2.symbol);
|
|
100659
101123
|
}
|
|
100660
101124
|
function resolveMaturity(meta) {
|
|
100661
101125
|
const expiry = num16(meta.expiry) ?? num16(meta.maturity);
|
|
@@ -100784,12 +101248,12 @@ var fromRaw = (raw, decimals) => {
|
|
|
100784
101248
|
const n = Number(s) / 10 ** decimals;
|
|
100785
101249
|
return Number.isFinite(n) ? n : void 0;
|
|
100786
101250
|
};
|
|
100787
|
-
function sdkRates(
|
|
101251
|
+
function sdkRates(row2, provider) {
|
|
100788
101252
|
if (!SDK_FRACTION_RATE_PROVIDERS.has(provider)) {
|
|
100789
101253
|
return {
|
|
100790
|
-
supplyRate: num17(
|
|
100791
|
-
rewardsRate: num17(
|
|
100792
|
-
totalRate: num17(
|
|
101254
|
+
supplyRate: num17(row2.supplyRate),
|
|
101255
|
+
rewardsRate: num17(row2.rewardsRate),
|
|
101256
|
+
totalRate: num17(row2.depositRate)
|
|
100793
101257
|
};
|
|
100794
101258
|
}
|
|
100795
101259
|
const pct5 = (v) => {
|
|
@@ -100798,91 +101262,92 @@ function sdkRates(row, provider) {
|
|
|
100798
101262
|
};
|
|
100799
101263
|
return {
|
|
100800
101264
|
// GMX splits fee APY from incentive APR; HyperCore reports one number.
|
|
100801
|
-
supplyRate: pct5(
|
|
100802
|
-
rewardsRate: pct5(
|
|
100803
|
-
totalRate: pct5(
|
|
101265
|
+
supplyRate: pct5(row2.baseApy ?? row2.apr),
|
|
101266
|
+
rewardsRate: pct5(row2.bonusApr),
|
|
101267
|
+
totalRate: pct5(row2.apy ?? row2.apr)
|
|
100804
101268
|
};
|
|
100805
101269
|
}
|
|
100806
101270
|
function toVaultTermInput(vault, provider, chainId) {
|
|
100807
|
-
const
|
|
100808
|
-
const address = str7(
|
|
101271
|
+
const row2 = vault;
|
|
101272
|
+
const address = str7(row2.address)?.toLowerCase();
|
|
100809
101273
|
if (!address) return void 0;
|
|
100810
|
-
const assetDecimals = num17(
|
|
100811
|
-
const asset =
|
|
101274
|
+
const assetDecimals = num17(row2.assetDecimals) ?? num17(row2.decimals);
|
|
101275
|
+
const asset = row2.asset;
|
|
100812
101276
|
return {
|
|
100813
101277
|
provider,
|
|
100814
101278
|
chainId,
|
|
100815
101279
|
address,
|
|
100816
101280
|
vaultUid: `vault.${provider}:${chainId}:${address}`,
|
|
100817
|
-
name: str7(
|
|
100818
|
-
brand: str7(
|
|
100819
|
-
curatorName: str7(
|
|
100820
|
-
description: str7(
|
|
101281
|
+
name: str7(row2.displayName) ?? str7(row2.name),
|
|
101282
|
+
brand: str7(row2.brand),
|
|
101283
|
+
curatorName: str7(row2.curatorName),
|
|
101284
|
+
description: str7(row2.description),
|
|
100821
101285
|
asset: {
|
|
100822
101286
|
chainId,
|
|
100823
|
-
address: str7(
|
|
101287
|
+
address: str7(row2.underlying)?.toLowerCase() ?? "",
|
|
100824
101288
|
symbol: str7(asset?.symbol),
|
|
100825
101289
|
name: str7(asset?.name),
|
|
100826
101290
|
decimals: assetDecimals,
|
|
100827
101291
|
assetGroup: str7(asset?.assetGroup),
|
|
100828
101292
|
logoURI: str7(asset?.logoURI)
|
|
100829
101293
|
},
|
|
100830
|
-
...sdkRates(
|
|
100831
|
-
isForwardApr: bool5(
|
|
100832
|
-
aprWindow: str7(
|
|
101294
|
+
...sdkRates(row2, provider),
|
|
101295
|
+
isForwardApr: bool5(row2.isForwardApr),
|
|
101296
|
+
aprWindow: str7(row2.aprWindow),
|
|
100833
101297
|
// GMX / HyperCore / Pendle report USD only and set the token-denominated
|
|
100834
101298
|
// fields to their USD figure — `totalAssetsFormatted` is the cross-provider
|
|
100835
101299
|
// 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
|
-
|
|
101300
|
+
totalAssets: num17(row2.totalAssetsFormatted) ?? fromRaw(row2.totalAssets, assetDecimals),
|
|
101301
|
+
totalAssetsUsd: num17(row2.totalAssetsUsd) ?? num17(row2.tvlUsd),
|
|
101302
|
+
liquidity: num17(row2.liquidityFormatted) ?? fromRaw(row2.liquidity, assetDecimals),
|
|
101303
|
+
liquidityUsd: num17(row2.liquidityUsd),
|
|
101304
|
+
instantLiquidityRatio: num17(row2.instantLiquidityRatio),
|
|
101305
|
+
totalBorrowed: fromRaw(row2.totalBorrowed, assetDecimals),
|
|
101306
|
+
expectedLiquidity: fromRaw(row2.expectedLiquidity, assetDecimals),
|
|
101307
|
+
withdrawalMode: str7(row2.withdrawalMode),
|
|
101308
|
+
withdrawalCooldownSeconds: num17(row2.withdrawalCooldownSeconds),
|
|
101309
|
+
withdrawFeeBps: num17(row2.withdrawFeeBps),
|
|
101310
|
+
depositFeeBps: num17(row2.depositFeeBps),
|
|
101311
|
+
feeScheduleComplete: bool5(row2.feeScheduleComplete),
|
|
101312
|
+
exitRoutes: routes(row2.exitRoutes),
|
|
101313
|
+
fee: num17(row2.fee),
|
|
101314
|
+
managementFee: num17(row2.managementFee),
|
|
101315
|
+
swapFeeRate: num17(row2.feeRate),
|
|
101316
|
+
redemptionDiscountBps: num17(row2.redemptionDiscountBps),
|
|
101317
|
+
instantRedeemEnabled: bool5(row2.instantRedeemEnabled),
|
|
101318
|
+
yieldWarmupSeconds: num17(row2.yieldWarmupSeconds),
|
|
101319
|
+
accrual: str7(row2.accrual),
|
|
101320
|
+
exitWholeOnly: bool5(row2.exitWholeOnly),
|
|
101321
|
+
needsDepositApproval: bool5(row2.needsDepositApproval),
|
|
101322
|
+
isMintable: bool5(row2.isMintable),
|
|
101323
|
+
depositCapacity: str7(row2.depositCapacity),
|
|
101324
|
+
supplyCap: str7(row2.supplyCap),
|
|
101325
|
+
paused: bool5(row2.isPaused),
|
|
101326
|
+
depositsPaused: bool5(row2.isDepositPaused),
|
|
101327
|
+
withdrawalsPaused: bool5(row2.isWithdrawalPaused),
|
|
101328
|
+
isClosed: bool5(row2.isClosed),
|
|
101329
|
+
whitelisted: bool5(row2.whitelisted),
|
|
101330
|
+
expiry: num17(row2.expiry),
|
|
101331
|
+
termSeconds: num17(row2.termSeconds),
|
|
101332
|
+
rateBasis: str7(row2.rateBasis),
|
|
101333
|
+
timelock: num17(row2.timelock),
|
|
101334
|
+
allocators: strArray(row2.allocators),
|
|
101335
|
+
owner: str7(row2.owner),
|
|
101336
|
+
curator: str7(row2.curator),
|
|
101337
|
+
guardian: str7(row2.guardian),
|
|
101338
|
+
feeRecipient: str7(row2.feeRecipient),
|
|
101339
|
+
solvency: str7(row2.solvency),
|
|
101340
|
+
navOracle: str7(row2.navOracle),
|
|
101341
|
+
yieldProfile: str7(row2.yieldProfile),
|
|
101342
|
+
exposures: Array.isArray(row2.exposures) ? row2.exposures : void 0
|
|
100878
101343
|
};
|
|
100879
101344
|
}
|
|
100880
|
-
function savingsCuration(provider, chainId, address,
|
|
101345
|
+
function savingsCuration(provider, chainId, address, row2) {
|
|
100881
101346
|
if (provider !== "savings") {
|
|
100882
101347
|
const managed = managedVaultCuration(provider, chainId, address);
|
|
100883
101348
|
return managed ? { description: managed.description, solvency: managed.solvency } : {};
|
|
100884
101349
|
}
|
|
100885
|
-
const svm = svmSavingsCuration(address,
|
|
101350
|
+
const svm = svmSavingsCuration(address, row2);
|
|
100886
101351
|
if (svm)
|
|
100887
101352
|
return {
|
|
100888
101353
|
description: svm.description || void 0,
|
|
@@ -100897,6 +101362,7 @@ function savingsCuration(provider, chainId, address, row) {
|
|
|
100897
101362
|
description: e.description || void 0,
|
|
100898
101363
|
solvency: e.solvency,
|
|
100899
101364
|
accrual: e.accrual,
|
|
101365
|
+
exitWholeOnly: e.exitWholeOnly,
|
|
100900
101366
|
yieldWarmupSeconds: e.yieldWarmupSeconds,
|
|
100901
101367
|
needsDepositApproval: e.needsDepositApproval,
|
|
100902
101368
|
// A dated bond's maturity (Usual bUSD0) — static, and the one fact that
|
|
@@ -100956,6 +101422,7 @@ function vaultTermInputFromEarnMarket(m) {
|
|
|
100956
101422
|
instantRedeemEnabled: bool5(meta.instantRedeemEnabled),
|
|
100957
101423
|
yieldWarmupSeconds: num17(meta.yieldWarmupSeconds) ?? curated.yieldWarmupSeconds,
|
|
100958
101424
|
accrual: str7(meta.accrual) ?? curated.accrual,
|
|
101425
|
+
exitWholeOnly: bool5(meta.exitWholeOnly) ?? curated.exitWholeOnly,
|
|
100959
101426
|
needsDepositApproval: bool5(meta.needsDepositApproval) ?? curated.needsDepositApproval,
|
|
100960
101427
|
// `canDeposit` already folds in the cap, the pause and the gate, so it is
|
|
100961
101428
|
// the authoritative answer — but the REASON is what a disabled CTA renders,
|
|
@@ -100992,33 +101459,33 @@ function originRates(rates) {
|
|
|
100992
101459
|
totalRate: num17(rates.totalRate) ?? deposit
|
|
100993
101460
|
};
|
|
100994
101461
|
}
|
|
100995
|
-
function vaultTermInputFromSourceRow(
|
|
100996
|
-
const provider = str7(
|
|
100997
|
-
const address = str7(
|
|
101462
|
+
function vaultTermInputFromSourceRow(row2, chainId) {
|
|
101463
|
+
const provider = str7(row2.provider);
|
|
101464
|
+
const address = str7(row2.vaultAddress)?.toLowerCase();
|
|
100998
101465
|
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(
|
|
101466
|
+
const meta = row2.providerMeta ?? {};
|
|
101467
|
+
const rates = row2.rates ?? {};
|
|
101468
|
+
const tvl = row2.tvl ?? {};
|
|
101469
|
+
const liq = row2.liquidity ?? {};
|
|
101470
|
+
const info = row2.vaultInfo ?? {};
|
|
101471
|
+
const assetInfo = row2.underlyingInfo?.asset;
|
|
101472
|
+
const assetDecimals = num17(row2.assetDecimals) ?? num17(assetInfo?.decimals) ?? num17(row2.decimals);
|
|
101006
101473
|
const curated = savingsCuration(provider, chainId, address, {
|
|
101007
|
-
brand: str7(
|
|
101008
|
-
name: str7(info.name) ?? str7(
|
|
101474
|
+
brand: str7(row2.curatorName) ?? str7(meta.brand),
|
|
101475
|
+
name: str7(info.name) ?? str7(row2.displayName) ?? str7(row2.name)
|
|
101009
101476
|
});
|
|
101010
101477
|
return {
|
|
101011
101478
|
provider,
|
|
101012
101479
|
chainId,
|
|
101013
101480
|
address,
|
|
101014
101481
|
vaultUid: `vault.${provider}:${chainId}:${address}`,
|
|
101015
|
-
name: str7(info.name) ?? str7(
|
|
101016
|
-
brand: str7(
|
|
101017
|
-
curatorName: str7(
|
|
101482
|
+
name: str7(info.name) ?? str7(row2.displayName) ?? str7(row2.name),
|
|
101483
|
+
brand: str7(row2.curatorName) ?? str7(meta.brand),
|
|
101484
|
+
curatorName: str7(row2.curatorName),
|
|
101018
101485
|
description: str7(meta.description) ?? curated.description,
|
|
101019
101486
|
asset: {
|
|
101020
101487
|
chainId,
|
|
101021
|
-
address: str7(
|
|
101488
|
+
address: str7(row2.underlying)?.toLowerCase() ?? "",
|
|
101022
101489
|
symbol: str7(assetInfo?.symbol),
|
|
101023
101490
|
decimals: assetDecimals,
|
|
101024
101491
|
assetGroup: str7(info.assetGroup),
|
|
@@ -101045,6 +101512,7 @@ function vaultTermInputFromSourceRow(row, chainId) {
|
|
|
101045
101512
|
instantRedeemEnabled: bool5(meta.instantRedeemEnabled),
|
|
101046
101513
|
yieldWarmupSeconds: num17(meta.yieldWarmupSeconds) ?? curated.yieldWarmupSeconds,
|
|
101047
101514
|
accrual: str7(meta.accrual) ?? curated.accrual,
|
|
101515
|
+
exitWholeOnly: bool5(meta.exitWholeOnly) ?? curated.exitWholeOnly,
|
|
101048
101516
|
needsDepositApproval: bool5(meta.needsDepositApproval) ?? curated.needsDepositApproval,
|
|
101049
101517
|
isMintable: bool5(meta.isMintable),
|
|
101050
101518
|
depositCapacity: str7(meta.depositCapacity) ?? str7(meta.maxDeposit),
|
|
@@ -101066,7 +101534,7 @@ function vaultTermInputFromSourceRow(row, chainId) {
|
|
|
101066
101534
|
solvency: str7(meta.solvency) ?? curated.solvency,
|
|
101067
101535
|
navOracle: str7(meta.navOracle),
|
|
101068
101536
|
yieldProfile: str7(info.yieldProfile),
|
|
101069
|
-
exposures: Array.isArray(
|
|
101537
|
+
exposures: Array.isArray(row2.exposures) ? row2.exposures : Array.isArray(meta.exposures) ? meta.exposures : void 0
|
|
101070
101538
|
};
|
|
101071
101539
|
}
|
|
101072
101540
|
|
|
@@ -101130,7 +101598,7 @@ var SVM_VAULT_PROVIDERS = [
|
|
|
101130
101598
|
"exponent"
|
|
101131
101599
|
];
|
|
101132
101600
|
var HYPERCORE_PROVIDER_CHAIN = "999";
|
|
101133
|
-
var keep = (rows, ok4) => Object.fromEntries(Object.entries(rows).filter(([,
|
|
101601
|
+
var keep = (rows, ok4) => Object.fromEntries(Object.entries(rows).filter(([, row2]) => ok4(row2)));
|
|
101134
101602
|
var dropUnservableRates = (out) => {
|
|
101135
101603
|
const nowSecs = Math.floor(Date.now() / 1e3);
|
|
101136
101604
|
if (out.morpho) out.morpho = dropUnrealizableRates(out.morpho);
|
|
@@ -101935,11 +102403,11 @@ function pick2(src, ...keys) {
|
|
|
101935
102403
|
}
|
|
101936
102404
|
return void 0;
|
|
101937
102405
|
}
|
|
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(
|
|
102406
|
+
function toTermSheetInput(row2, ctx = {}) {
|
|
102407
|
+
const marketUid = ctx.marketUid ?? pick2(row2, "marketUid", "poolId") ?? "";
|
|
102408
|
+
const lender = ctx.lender ?? pick2(row2, "lender", "lenderKey", "lenderInfo.key") ?? marketUid.split(":")[0] ?? "";
|
|
102409
|
+
const chainId = ctx.chainId ?? pick2(row2, "chainId") ?? marketUid.split(":")[1] ?? "";
|
|
102410
|
+
const rawConfig = pick2(row2, "config") ?? void 0;
|
|
101943
102411
|
const config = rawConfig ? Object.fromEntries(
|
|
101944
102412
|
Object.entries(rawConfig).map(([k, v]) => [
|
|
101945
102413
|
k,
|
|
@@ -101965,7 +102433,7 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
101965
102433
|
}
|
|
101966
102434
|
])
|
|
101967
102435
|
) : void 0;
|
|
101968
|
-
const rewards = pick2(
|
|
102436
|
+
const rewards = pick2(row2, "rewards")?.map((r) => ({
|
|
101969
102437
|
asset: r?.asset,
|
|
101970
102438
|
depositRate: num18(r?.depositRate),
|
|
101971
102439
|
variableBorrowRate: num18(r?.variableBorrowRate),
|
|
@@ -101981,59 +102449,59 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
101981
102449
|
// In-package rows carry `asset` as a bare ADDRESS and the metadata under
|
|
101982
102450
|
// `underlyingInfo.asset`; the origin's rows carry the object under both.
|
|
101983
102451
|
// Take the first OBJECT, so a string never shadows the metadata beside it.
|
|
101984
|
-
asset: [pick2(
|
|
102452
|
+
asset: [pick2(row2, "asset"), pick2(row2, "underlyingInfo.asset")].find(
|
|
101985
102453
|
(v) => !!v && typeof v === "object"
|
|
101986
102454
|
),
|
|
101987
|
-
underlying: pick2(
|
|
101988
|
-
decimals: num18(pick2(
|
|
101989
|
-
depositRate: num18(pick2(
|
|
101990
|
-
variableBorrowRate: num18(pick2(
|
|
101991
|
-
stableBorrowRate: num18(pick2(
|
|
101992
|
-
intrinsicYield: num18(pick2(
|
|
102455
|
+
underlying: pick2(row2, "underlying"),
|
|
102456
|
+
decimals: num18(pick2(row2, "decimals")),
|
|
102457
|
+
depositRate: num18(pick2(row2, "depositRate")),
|
|
102458
|
+
variableBorrowRate: num18(pick2(row2, "variableBorrowRate")),
|
|
102459
|
+
stableBorrowRate: num18(pick2(row2, "stableBorrowRate")),
|
|
102460
|
+
intrinsicYield: num18(pick2(row2, "intrinsicYield")),
|
|
101993
102461
|
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(
|
|
102462
|
+
rateModel: pick2(row2, "rateModel"),
|
|
102463
|
+
originationFee: num18(pick2(row2, "originationFee")),
|
|
102464
|
+
totalDeposits: num18(pick2(row2, "totalDeposits")),
|
|
102465
|
+
totalDebt: num18(pick2(row2, "totalDebt")),
|
|
102466
|
+
totalDebtStable: num18(pick2(row2, "totalDebtStable")),
|
|
102467
|
+
totalLiquidity: num18(pick2(row2, "totalLiquidity")),
|
|
102468
|
+
borrowLiquidity: num18(pick2(row2, "borrowLiquidity")),
|
|
102469
|
+
totalDepositsUsd: num18(pick2(row2, "totalDepositsUSD", "totalDepositsUsd")),
|
|
102470
|
+
totalDebtUsd: num18(pick2(row2, "totalDebtUSD", "totalDebtUsd")),
|
|
102471
|
+
totalLiquidityUsd: num18(pick2(row2, "totalLiquidityUSD", "totalLiquidityUsd")),
|
|
102472
|
+
utilization: num18(pick2(row2, "utilization")),
|
|
102473
|
+
irmTotalDeposits: num18(pick2(row2, "irmTotalDeposits")),
|
|
102474
|
+
irmTotalDebt: num18(pick2(row2, "irmTotalDebt")),
|
|
102475
|
+
lockupRatio: num18(pick2(row2, "lockupRatio")),
|
|
102476
|
+
minBorrow: pick2(row2, "minBorrow", "caps.minBorrow") ?? void 0,
|
|
102477
|
+
supplyCap: num18(pick2(row2, "supplyCap", "caps.supplyCap")),
|
|
102478
|
+
borrowCap: num18(pick2(row2, "borrowCap", "caps.borrowCap")),
|
|
102479
|
+
debtCeiling: pick2(row2, "debtCeiling", "caps.debtCeiling"),
|
|
102480
|
+
isActive: pick2(row2, "isActive", "flags.isActive"),
|
|
102481
|
+
isFrozen: pick2(row2, "isFrozen", "flags.isFrozen"),
|
|
102014
102482
|
borrowingEnabled: pick2(
|
|
102015
|
-
|
|
102483
|
+
row2,
|
|
102016
102484
|
"borrowingEnabled",
|
|
102017
102485
|
"flags.borrowingEnabled"
|
|
102018
102486
|
),
|
|
102019
102487
|
depositsEnabled: pick2(
|
|
102020
|
-
|
|
102488
|
+
row2,
|
|
102021
102489
|
"depositsEnabled",
|
|
102022
102490
|
"flags.depositsEnabled"
|
|
102023
102491
|
),
|
|
102024
102492
|
collateralActive: pick2(
|
|
102025
|
-
|
|
102493
|
+
row2,
|
|
102026
102494
|
"collateralActive",
|
|
102027
102495
|
"flags.collateralActive"
|
|
102028
102496
|
),
|
|
102029
|
-
hasStable: pick2(
|
|
102497
|
+
hasStable: pick2(row2, "hasStable", "flags.hasStable"),
|
|
102030
102498
|
variableBorrowDisabled: pick2(
|
|
102031
|
-
|
|
102499
|
+
row2,
|
|
102032
102500
|
"variableBorrowDisabled",
|
|
102033
102501
|
"flags.variableBorrowDisabled"
|
|
102034
102502
|
),
|
|
102035
|
-
...pick2(
|
|
102036
|
-
siloedBorrowing: pick2(
|
|
102503
|
+
...pick2(row2, "siloedBorrowing", "flags.siloedBorrowing") != null ? {
|
|
102504
|
+
siloedBorrowing: pick2(row2, "siloedBorrowing", "flags.siloedBorrowing") === true
|
|
102037
102505
|
} : {},
|
|
102038
102506
|
config,
|
|
102039
102507
|
// `caps.` is NOT optional here. `/pools/latest` serializes both of these as
|
|
@@ -102044,13 +102512,13 @@ function toTermSheetInput(row, ctx = {}) {
|
|
|
102044
102512
|
// builder's `?? 1`, so Aave and Compound V2 published "the whole debt can
|
|
102045
102513
|
// be repaid in one liquidation" against a real close factor of 0.5, and
|
|
102046
102514
|
// Aave V4's `targetHealthFactor` vanished entirely.
|
|
102047
|
-
closeFactor: num18(pick2(
|
|
102515
|
+
closeFactor: num18(pick2(row2, "closeFactor", "caps.closeFactor")),
|
|
102048
102516
|
targetHealthFactor: num18(
|
|
102049
|
-
pick2(
|
|
102517
|
+
pick2(row2, "targetHealthFactor", "caps.targetHealthFactor")
|
|
102050
102518
|
),
|
|
102051
|
-
fixedTerm: pick2(
|
|
102052
|
-
terms: pick2(
|
|
102053
|
-
market: resolveMarketDescriptors(
|
|
102519
|
+
fixedTerm: pick2(row2, "fixedTerm") ?? ctx.fixedTerm,
|
|
102520
|
+
terms: pick2(row2, "terms"),
|
|
102521
|
+
market: resolveMarketDescriptors(row2, ctx.market)
|
|
102054
102522
|
};
|
|
102055
102523
|
}
|
|
102056
102524
|
var ROW_DESCRIPTOR_KEYS = [
|
|
@@ -102101,12 +102569,12 @@ var ROW_DESCRIPTOR_KEYS = [
|
|
|
102101
102569
|
// here the flat path reports a confident 0 % on every Blue market.
|
|
102102
102570
|
"fee"
|
|
102103
102571
|
];
|
|
102104
|
-
function resolveMarketDescriptors(
|
|
102105
|
-
const fromParams = pick2(
|
|
102572
|
+
function resolveMarketDescriptors(row2, ctxMarket) {
|
|
102573
|
+
const fromParams = pick2(row2, "params.market");
|
|
102106
102574
|
const rowLevel = {};
|
|
102107
102575
|
for (const k of ROW_DESCRIPTOR_KEYS) {
|
|
102108
|
-
const underParams =
|
|
102109
|
-
if (
|
|
102576
|
+
const underParams = row2.params?.[k];
|
|
102577
|
+
if (row2[k] != null) rowLevel[k] = row2[k];
|
|
102110
102578
|
else if (underParams != null && k !== "fee") rowLevel[k] = underParams;
|
|
102111
102579
|
}
|
|
102112
102580
|
const merged = { ...ctxMarket ?? {}, ...fromParams ?? {}, ...rowLevel };
|
|
@@ -105401,10 +105869,10 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105401
105869
|
const oracleByMarketUid = /* @__PURE__ */ new Map();
|
|
105402
105870
|
const governanceByMarketUid = /* @__PURE__ */ new Map();
|
|
105403
105871
|
const assetRisk = {};
|
|
105404
|
-
for (const
|
|
105405
|
-
const uid = String(
|
|
105872
|
+
for (const row2 of rows) {
|
|
105873
|
+
const uid = String(row2?.marketUid ?? "");
|
|
105406
105874
|
if (!uid) continue;
|
|
105407
|
-
const feeds = Array.isArray(
|
|
105875
|
+
const feeds = Array.isArray(row2?.oracleInfo?.feeds) ? row2.oracleInfo.feeds : [];
|
|
105408
105876
|
if (feeds.length > 0) {
|
|
105409
105877
|
const primary = feeds.reduce(
|
|
105410
105878
|
(worst, f) => BAND_ORDER.indexOf(String(f?.band)) > BAND_ORDER.indexOf(String(worst?.band)) ? f : worst
|
|
@@ -105418,13 +105886,13 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105418
105886
|
correctOracle: primary?.correctOracle ?? void 0,
|
|
105419
105887
|
denominatorMatch: primary?.denominatorMatch ?? void 0,
|
|
105420
105888
|
fixedRate: primary?.fixedRate ?? void 0,
|
|
105421
|
-
score: primary?.score ??
|
|
105422
|
-
band: primary?.band ??
|
|
105889
|
+
score: primary?.score ?? row2?.oracleInfo?.worstScore,
|
|
105890
|
+
band: primary?.band ?? row2?.oracleInfo?.worstBand,
|
|
105423
105891
|
flags: Array.isArray(primary?.flags) ? primary.flags : void 0,
|
|
105424
105892
|
components: feeds.length > 1 ? feeds.map((f) => String(f?.oracle ?? "")).filter(Boolean) : void 0
|
|
105425
105893
|
});
|
|
105426
105894
|
}
|
|
105427
|
-
const breakdown = Array.isArray(
|
|
105895
|
+
const breakdown = Array.isArray(row2?.risk?.breakdown) ? row2.risk.breakdown : [];
|
|
105428
105896
|
const gov = breakdown.find((b) => b?.category === "governance");
|
|
105429
105897
|
if (gov) {
|
|
105430
105898
|
governanceByMarketUid.set(uid, {
|
|
@@ -105442,10 +105910,10 @@ function enrichmentIndexFromRows(rows) {
|
|
|
105442
105910
|
});
|
|
105443
105911
|
}
|
|
105444
105912
|
const token = breakdown.find((b) => b?.category === "token");
|
|
105445
|
-
const chainId = String(
|
|
105913
|
+
const chainId = String(row2?.chainId ?? uid.split(":")[1] ?? "");
|
|
105446
105914
|
const address = termAddressKey(
|
|
105447
105915
|
chainId,
|
|
105448
|
-
String(
|
|
105916
|
+
String(row2?.asset?.address ?? row2?.underlying ?? uid.split(":")[2] ?? "")
|
|
105449
105917
|
);
|
|
105450
105918
|
if (token?.score != null && chainId && address) {
|
|
105451
105919
|
assetRisk[chainId] ??= {};
|
|
@@ -106022,13 +106490,13 @@ var FIXED_TERM_PREFIXES = [
|
|
|
106022
106490
|
];
|
|
106023
106491
|
function collateralSymbolsByVenue(rows, fallbackChainId) {
|
|
106024
106492
|
const byVenue = /* @__PURE__ */ new Map();
|
|
106025
|
-
for (const
|
|
106026
|
-
const venue = str6(
|
|
106027
|
-
const chainId = str6(
|
|
106493
|
+
for (const row2 of rows) {
|
|
106494
|
+
const venue = str6(row2.lender) ?? str6(row2.lenderKey);
|
|
106495
|
+
const chainId = str6(row2.chainId) ?? fallbackChainId;
|
|
106028
106496
|
if (!venue || !chainId) continue;
|
|
106029
|
-
const collateralActive =
|
|
106497
|
+
const collateralActive = row2.flags?.collateralActive ?? row2.collateralActive;
|
|
106030
106498
|
if (collateralActive !== true) continue;
|
|
106031
|
-
const symbol = str6(
|
|
106499
|
+
const symbol = str6(row2.underlyingInfo?.asset?.symbol) ?? str6(row2.asset?.symbol);
|
|
106032
106500
|
if (!symbol) continue;
|
|
106033
106501
|
const key5 = venueGroupKey(chainId, venue);
|
|
106034
106502
|
let set = byVenue.get(key5);
|
|
@@ -106040,13 +106508,13 @@ function collateralSymbolsByVenue(rows, fallbackChainId) {
|
|
|
106040
106508
|
function venueGroupKey(chainId, venue) {
|
|
106041
106509
|
return `${chainId}::${venue}`;
|
|
106042
106510
|
}
|
|
106043
|
-
function resolveBasket(
|
|
106511
|
+
function resolveBasket(row2, chainId = row2.chainId) {
|
|
106044
106512
|
const provider = listaCollateralProvider(
|
|
106045
|
-
|
|
106046
|
-
str6(
|
|
106513
|
+
row2.chainId ?? "",
|
|
106514
|
+
str6(row2.params?.market?.collateralProvider)
|
|
106047
106515
|
);
|
|
106048
106516
|
if (provider?.kind === "smart-lp" && provider.coins) {
|
|
106049
|
-
const rowAsset = addr5(
|
|
106517
|
+
const rowAsset = addr5(row2.underlying) ?? addr5(row2.asset?.address);
|
|
106050
106518
|
if (rowAsset && rowAsset === provider.collateralToken.toLowerCase()) {
|
|
106051
106519
|
return {
|
|
106052
106520
|
// The row's asset IS the receipt — one row for the whole position,
|
|
@@ -106071,12 +106539,12 @@ function resolveBasket(row, chainId = row.chainId) {
|
|
|
106071
106539
|
};
|
|
106072
106540
|
}
|
|
106073
106541
|
}
|
|
106074
|
-
if (
|
|
106075
|
-
const f =
|
|
106542
|
+
if (row2.autoBalanced !== true) return void 0;
|
|
106543
|
+
const f = row2.fluid;
|
|
106076
106544
|
if (f && f.isSmartCol !== true) return void 0;
|
|
106077
106545
|
const legs = (f?.collateralPair ?? []).map((a) => addr5(a, chainId)).filter((a) => !!a).map((address) => ({ address }));
|
|
106078
106546
|
if (legs.length > 0) {
|
|
106079
|
-
const rowAsset = addr5(
|
|
106547
|
+
const rowAsset = addr5(row2.underlying, chainId) ?? addr5(row2.asset?.address, chainId);
|
|
106080
106548
|
if (!rowAsset || !legs.some((l) => l.address === rowAsset)) return void 0;
|
|
106081
106549
|
}
|
|
106082
106550
|
return {
|
|
@@ -106089,8 +106557,8 @@ function resolveBasket(row, chainId = row.chainId) {
|
|
|
106089
106557
|
...f?.supplyDexTradingRate != null || f?.collateralPair ? { pool: "fluid-dex" } : {}
|
|
106090
106558
|
};
|
|
106091
106559
|
}
|
|
106092
|
-
function earnMarketFromPool(
|
|
106093
|
-
const marketUid = str6(
|
|
106560
|
+
function earnMarketFromPool(row2, fallbackChainId, venueCollaterals) {
|
|
106561
|
+
const marketUid = str6(row2.marketUid);
|
|
106094
106562
|
if (!marketUid) return void 0;
|
|
106095
106563
|
let earnUid;
|
|
106096
106564
|
try {
|
|
@@ -106098,24 +106566,24 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106098
106566
|
} catch {
|
|
106099
106567
|
return void 0;
|
|
106100
106568
|
}
|
|
106101
|
-
const chainId = str6(
|
|
106102
|
-
const venue = str6(
|
|
106569
|
+
const chainId = str6(row2.chainId) ?? fallbackChainId;
|
|
106570
|
+
const venue = str6(row2.lender) ?? str6(row2.lenderKey);
|
|
106103
106571
|
if (!chainId || !venue) return void 0;
|
|
106104
|
-
const flags =
|
|
106105
|
-
const assetInfo =
|
|
106106
|
-
const underlying = addr5(assetInfo.address, chainId) ?? addr5(
|
|
106572
|
+
const flags = row2.flags ?? {};
|
|
106573
|
+
const assetInfo = row2.underlyingInfo?.asset ?? row2.asset ?? {};
|
|
106574
|
+
const underlying = addr5(assetInfo.address, chainId) ?? addr5(row2.underlying, chainId) ?? addr5(row2.poolId, chainId);
|
|
106107
106575
|
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(
|
|
106576
|
+
const decimals = num16(assetInfo.decimals) ?? num16(row2.decimals) ?? 18;
|
|
106577
|
+
const priceUsd = num16(row2.underlyingInfo?.prices?.priceUsd) ?? num16(row2.price);
|
|
106578
|
+
const base = num16(row2.depositRate);
|
|
106579
|
+
const intrinsic = num16(row2.intrinsicYield);
|
|
106580
|
+
const rewards = sumRewardAprs(row2.rewards);
|
|
106113
106581
|
const marketOwn = sum2(base, rewards);
|
|
106114
106582
|
const rate = {
|
|
106115
106583
|
// Prefer our own sum over the origin's `apr`, because `apr` is documented
|
|
106116
106584
|
// as `depositRate + intrinsicYield` and therefore EXCLUDES incentives —
|
|
106117
106585
|
// using it as the headline would under-report every incentivized market.
|
|
106118
|
-
total: sum2(base, intrinsic, rewards) ?? num16(
|
|
106586
|
+
total: sum2(base, intrinsic, rewards) ?? num16(row2.apr) ?? 0,
|
|
106119
106587
|
base,
|
|
106120
106588
|
rewards,
|
|
106121
106589
|
intrinsic,
|
|
@@ -106124,8 +106592,8 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106124
106592
|
kind: resolveRateKind2(venue),
|
|
106125
106593
|
source: "chain"
|
|
106126
106594
|
};
|
|
106127
|
-
const availability2 = resolveAvailability2(
|
|
106128
|
-
const basket = resolveBasket(
|
|
106595
|
+
const availability2 = resolveAvailability2(row2, flags, rate.total ?? 0);
|
|
106596
|
+
const basket = resolveBasket(row2, chainId);
|
|
106129
106597
|
return {
|
|
106130
106598
|
earnUid,
|
|
106131
106599
|
chainId,
|
|
@@ -106137,7 +106605,7 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106137
106605
|
// Same resolver as the vault half, so `protocol.key` means one thing
|
|
106138
106606
|
// across the listing: the STABLE family key, never the per-market venue.
|
|
106139
106607
|
// No lender publishes a curator today, hence the undefined.
|
|
106140
|
-
...resolveEarnIdentity(venue, void 0, str6(
|
|
106608
|
+
...resolveEarnIdentity(venue, void 0, str6(row2.lenderInfo?.protocol)),
|
|
106141
106609
|
// Pair-aware: "USDT · vs wstETH" for an isolated market, plain "USDC" for
|
|
106142
106610
|
// a shared pool. The fetcher's own name is only the fallback — it is the
|
|
106143
106611
|
// leg-local "Loan USDC", which a chain repeats across 300 markets and
|
|
@@ -106145,15 +106613,15 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106145
106613
|
// origin's SQL route builds, so both paths agree.
|
|
106146
106614
|
name: earnMarketLabel({
|
|
106147
106615
|
assetSymbol: str6(assetInfo.symbol),
|
|
106148
|
-
lenderMarketName: str6(
|
|
106149
|
-
fetcherName: str6(
|
|
106616
|
+
lenderMarketName: str6(row2.lenderInfo?.name),
|
|
106617
|
+
fetcherName: str6(row2.name),
|
|
106150
106618
|
venue,
|
|
106151
106619
|
// The venue's collaterals, UNFILTERED — the label removes this row's own
|
|
106152
106620
|
// leg itself. Filtering here made the collateral row of a 1-collateral
|
|
106153
106621
|
// market look like a 0-collateral one, so the two legs of one market
|
|
106154
106622
|
// disagreed about whether it was isolated.
|
|
106155
106623
|
collateralSymbols: venueCollaterals?.get(venueGroupKey(chainId, venue)),
|
|
106156
|
-
fallbackName: str6(
|
|
106624
|
+
fallbackName: str6(row2.name)
|
|
106157
106625
|
}),
|
|
106158
106626
|
// Never re-derived — the uid's third segment as the origin minted it.
|
|
106159
106627
|
ref: marketUid.split(":")[2],
|
|
@@ -106162,7 +106630,7 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106162
106630
|
address: underlying,
|
|
106163
106631
|
symbol: str6(assetInfo.symbol) ?? "",
|
|
106164
106632
|
decimals,
|
|
106165
|
-
assetGroup: str6(
|
|
106633
|
+
assetGroup: str6(row2.underlyingInfo?.assetGroup) ?? str6(row2.asset?.assetGroup),
|
|
106166
106634
|
priceUsd
|
|
106167
106635
|
},
|
|
106168
106636
|
// A lending supply position is an aToken/cToken/eToken balance, but the
|
|
@@ -106175,15 +106643,15 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106175
106643
|
// back-fill `raw` by re-scaling — the round-trip loses precision and would
|
|
106176
106644
|
// fabricate base units the origin never sent.
|
|
106177
106645
|
tvl: amount4(
|
|
106178
|
-
|
|
106179
|
-
|
|
106646
|
+
row2.totalDeposits,
|
|
106647
|
+
row2.totalDepositsUSD ?? row2.totalDepositsUsd
|
|
106180
106648
|
),
|
|
106181
106649
|
liquidity: amount4(
|
|
106182
|
-
|
|
106183
|
-
|
|
106650
|
+
row2.totalLiquidity,
|
|
106651
|
+
row2.totalLiquidityUSD ?? row2.totalLiquidityUsd
|
|
106184
106652
|
),
|
|
106185
106653
|
depositCapacity: void 0,
|
|
106186
|
-
utilization: num16(
|
|
106654
|
+
utilization: num16(row2.utilization),
|
|
106187
106655
|
// Lending withdrawals are same-block, bounded by available liquidity —
|
|
106188
106656
|
// which is exactly `instant-capped`, not `instant`. A pool at 100 %
|
|
106189
106657
|
// utilization cannot be exited, and calling that `instant` is the kind of
|
|
@@ -106191,12 +106659,12 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106191
106659
|
exit: { mode: "instant-capped", settlement: "sync" },
|
|
106192
106660
|
availability: availability2,
|
|
106193
106661
|
risk: {
|
|
106194
|
-
score: num16(
|
|
106195
|
-
label: str6(
|
|
106662
|
+
score: num16(row2.risk?.score),
|
|
106663
|
+
label: str6(row2.risk?.label),
|
|
106196
106664
|
illiquid: isIlliquid({
|
|
106197
106665
|
exitMode: "instant-capped",
|
|
106198
|
-
tvlUsd: num16(
|
|
106199
|
-
liquidityUsd: num16(
|
|
106666
|
+
tvlUsd: num16(row2.totalDepositsUSD ?? row2.totalDepositsUsd),
|
|
106667
|
+
liquidityUsd: num16(row2.totalLiquidityUSD ?? row2.totalLiquidityUsd)
|
|
106200
106668
|
})
|
|
106201
106669
|
},
|
|
106202
106670
|
...basket ? { basket } : {},
|
|
@@ -106208,13 +106676,13 @@ function earnMarketFromPool(row, fallbackChainId, venueCollaterals) {
|
|
|
106208
106676
|
// nothing else, and one may price its collateral off a feed that ignores
|
|
106209
106677
|
// a depeg in it.
|
|
106210
106678
|
oracle: addr5(
|
|
106211
|
-
|
|
106679
|
+
row2.oracleInfo?.feeds?.find((f) => f?.oracle)?.oracle,
|
|
106212
106680
|
chainId
|
|
106213
106681
|
),
|
|
106214
106682
|
oracleDescription: str6(
|
|
106215
|
-
|
|
106683
|
+
row2.oracleInfo?.feeds?.find((f) => f?.priceDescription)?.priceDescription
|
|
106216
106684
|
),
|
|
106217
|
-
borrowable: (flags.borrowingEnabled ??
|
|
106685
|
+
borrowable: (flags.borrowingEnabled ?? row2.borrowingEnabled) === true
|
|
106218
106686
|
}
|
|
106219
106687
|
};
|
|
106220
106688
|
}
|
|
@@ -106228,10 +106696,10 @@ function resolveRateKind2(venue) {
|
|
|
106228
106696
|
if (FIXED_TERM_PREFIXES.some((p) => key5.startsWith(p))) return "fixed-term";
|
|
106229
106697
|
return "variable-curve";
|
|
106230
106698
|
}
|
|
106231
|
-
function resolveAvailability2(
|
|
106232
|
-
const isActive = flags.isActive ??
|
|
106233
|
-
const isFrozen = flags.isFrozen ??
|
|
106234
|
-
const depositsEnabled = flags.depositsEnabled ??
|
|
106699
|
+
function resolveAvailability2(row2, flags, totalRate) {
|
|
106700
|
+
const isActive = flags.isActive ?? row2.isActive;
|
|
106701
|
+
const isFrozen = flags.isFrozen ?? row2.isFrozen;
|
|
106702
|
+
const depositsEnabled = flags.depositsEnabled ?? row2.depositsEnabled;
|
|
106235
106703
|
let gating;
|
|
106236
106704
|
let reason;
|
|
106237
106705
|
if (isActive === false) {
|
|
@@ -106243,7 +106711,7 @@ function resolveAvailability2(row, flags, totalRate) {
|
|
|
106243
106711
|
} else if (depositsEnabled === false) {
|
|
106244
106712
|
gating = "paused";
|
|
106245
106713
|
reason = "Deposits are disabled for this market";
|
|
106246
|
-
} else if (isSupplyCapFull(
|
|
106714
|
+
} else if (isSupplyCapFull(row2)) {
|
|
106247
106715
|
gating = "cap-full";
|
|
106248
106716
|
reason = "Supply cap is full";
|
|
106249
106717
|
}
|
|
@@ -106261,10 +106729,10 @@ function resolveAvailability2(row, flags, totalRate) {
|
|
|
106261
106729
|
reason
|
|
106262
106730
|
};
|
|
106263
106731
|
}
|
|
106264
|
-
function isSupplyCapFull(
|
|
106265
|
-
const cap = num16(
|
|
106732
|
+
function isSupplyCapFull(row2) {
|
|
106733
|
+
const cap = num16(row2.caps?.supplyCap) ?? num16(row2.supplyCap);
|
|
106266
106734
|
if (cap === void 0 || cap <= 0) return false;
|
|
106267
|
-
const deposits = num16(
|
|
106735
|
+
const deposits = num16(row2.totalDeposits);
|
|
106268
106736
|
if (deposits === void 0) return false;
|
|
106269
106737
|
return deposits >= cap;
|
|
106270
106738
|
}
|
|
@@ -106326,7 +106794,7 @@ var LENDING = {
|
|
|
106326
106794
|
nativeWithdraw: true
|
|
106327
106795
|
};
|
|
106328
106796
|
var WSOL = "So11111111111111111111111111111111111111112";
|
|
106329
|
-
var
|
|
106797
|
+
var USDC2 = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
106330
106798
|
var USDG = "2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH";
|
|
106331
106799
|
var SHARES = ["isShares"];
|
|
106332
106800
|
function isSyntheticQuoteUnit(mint) {
|
|
@@ -106414,7 +106882,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106414
106882
|
"savings:OnRe": {
|
|
106415
106883
|
verbs: ["deposit", "withdraw", "request-withdraw", "cancel"],
|
|
106416
106884
|
depositInputs: [
|
|
106417
|
-
{ asset:
|
|
106885
|
+
{ asset: USDC2, symbol: "USDC", mode: "direct" },
|
|
106418
106886
|
{ asset: USDG, symbol: "USDG", mode: "direct" }
|
|
106419
106887
|
],
|
|
106420
106888
|
requires: {
|
|
@@ -106429,7 +106897,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106429
106897
|
verbs: ["deposit", "withdraw"],
|
|
106430
106898
|
payAsset: true,
|
|
106431
106899
|
depositInputs: [
|
|
106432
|
-
{ asset:
|
|
106900
|
+
{ asset: USDC2, symbol: "USDC", mode: "direct" },
|
|
106433
106901
|
{ asset: "native", symbol: "SOL", mode: "direct" },
|
|
106434
106902
|
{ asset: WSOL, symbol: "wSOL", mode: "direct" },
|
|
106435
106903
|
{
|
|
@@ -106469,7 +106937,7 @@ var SVM_EARN_VAULT_BUILDERS = {
|
|
|
106469
106937
|
symbol: "wYLDS",
|
|
106470
106938
|
mode: "direct"
|
|
106471
106939
|
},
|
|
106472
|
-
{ asset:
|
|
106940
|
+
{ asset: USDC2, symbol: "USDC", mode: "mint-then-deposit" }
|
|
106473
106941
|
],
|
|
106474
106942
|
requires: { withdraw: SHARES }
|
|
106475
106943
|
},
|
|
@@ -106745,38 +107213,38 @@ var ASYNC_PROVIDERS = /* @__PURE__ */ new Set([
|
|
|
106745
107213
|
"gmx"
|
|
106746
107214
|
// keeper-executed tickets
|
|
106747
107215
|
]);
|
|
106748
|
-
function stampCapabilities(
|
|
106749
|
-
|
|
106750
|
-
return
|
|
107216
|
+
function stampCapabilities(row2) {
|
|
107217
|
+
row2.capabilities = isSvmChainId(String(row2.chainId)) ? svmCapabilities(row2) : row2.venueKind === "lending" ? lendingCapabilities(row2) : vaultCapabilities(row2);
|
|
107218
|
+
return row2;
|
|
106751
107219
|
}
|
|
106752
107220
|
var WSOL2 = "So11111111111111111111111111111111111111112";
|
|
106753
|
-
function svmCapabilities(
|
|
106754
|
-
const b = svmEarnBuildability(
|
|
107221
|
+
function svmCapabilities(row2) {
|
|
107222
|
+
const b = svmEarnBuildability(row2.venue, row2.brand, row2.ref);
|
|
106755
107223
|
if (!b.ok) {
|
|
106756
|
-
if (
|
|
106757
|
-
|
|
106758
|
-
|
|
106759
|
-
|
|
107224
|
+
if (row2.availability.canDeposit) {
|
|
107225
|
+
row2.availability.canDeposit = false;
|
|
107226
|
+
row2.availability.gating = "unsupported";
|
|
107227
|
+
row2.availability.reason = b.reason;
|
|
106760
107228
|
}
|
|
106761
107229
|
return [];
|
|
106762
107230
|
}
|
|
106763
107231
|
const { builder } = b;
|
|
106764
|
-
const maturity =
|
|
107232
|
+
const maturity = row2.maturity?.maturity;
|
|
106765
107233
|
if (builder.via === "swap" && maturity && maturity <= Date.now() / 1e3) {
|
|
106766
|
-
if (
|
|
106767
|
-
|
|
106768
|
-
|
|
107234
|
+
if (row2.availability.canDeposit) {
|
|
107235
|
+
row2.availability.canDeposit = false;
|
|
107236
|
+
row2.availability.gating = "matured";
|
|
106769
107237
|
}
|
|
106770
|
-
|
|
107238
|
+
row2.availability.reason ??= EXPONENT_MATURED_REASON;
|
|
106771
107239
|
return [];
|
|
106772
107240
|
}
|
|
106773
|
-
const wsol =
|
|
107241
|
+
const wsol = row2.asset?.address === WSOL2;
|
|
106774
107242
|
const caps = [];
|
|
106775
|
-
const verbs = builder.requestVerbs &&
|
|
107243
|
+
const verbs = builder.requestVerbs && row2.exit?.mode === "request-based" ? builder.requestVerbs : builder.verbs;
|
|
106776
107244
|
for (const action of verbs) {
|
|
106777
|
-
const open = action === "deposit" ?
|
|
107245
|
+
const open = action === "deposit" ? row2.availability.canDeposit : row2.availability.canWithdraw;
|
|
106778
107246
|
if (!open) continue;
|
|
106779
|
-
if (action === "withdraw" && builder.withdrawNeedsInstantRoute &&
|
|
107247
|
+
if (action === "withdraw" && builder.withdrawNeedsInstantRoute && row2.exit?.routes?.length && !row2.exit.routes.some((r) => r.id === "instant"))
|
|
106780
107248
|
continue;
|
|
106781
107249
|
const cap = { action };
|
|
106782
107250
|
if (builder.via) cap.via = builder.via;
|
|
@@ -106785,8 +107253,8 @@ function svmCapabilities(row) {
|
|
|
106785
107253
|
cap.acceptsNative = wsol && !!builder.nativeDeposit;
|
|
106786
107254
|
if (builder.depositInputs?.length)
|
|
106787
107255
|
cap.inputs = builder.depositInputs.map((i) => ({ ...i }));
|
|
106788
|
-
const yieldAsset = (
|
|
106789
|
-
if (builder.unitQuoteInput && isSyntheticQuoteUnit(
|
|
107256
|
+
const yieldAsset = (row2.providerMeta ?? {}).yieldAsset;
|
|
107257
|
+
if (builder.unitQuoteInput && isSyntheticQuoteUnit(row2.asset?.address) && typeof yieldAsset === "string" && yieldAsset)
|
|
106790
107258
|
cap.inputs = [{ asset: yieldAsset, mode: "direct" }];
|
|
106791
107259
|
} else if (action === "withdraw") {
|
|
106792
107260
|
cap.acceptsReceiveAsset = !!builder.receiveAsset;
|
|
@@ -106797,30 +107265,30 @@ function svmCapabilities(row) {
|
|
|
106797
107265
|
if (requires?.length) cap.requires = [...requires];
|
|
106798
107266
|
caps.push(cap);
|
|
106799
107267
|
}
|
|
106800
|
-
if (!builder.verbs.includes("deposit") &&
|
|
106801
|
-
|
|
106802
|
-
|
|
106803
|
-
|
|
107268
|
+
if (!builder.verbs.includes("deposit") && row2.availability.canDeposit) {
|
|
107269
|
+
row2.availability.canDeposit = false;
|
|
107270
|
+
row2.availability.gating = "unsupported";
|
|
107271
|
+
row2.availability.reason = "Deposits are not built in this API yet";
|
|
106804
107272
|
}
|
|
106805
107273
|
return caps;
|
|
106806
107274
|
}
|
|
106807
|
-
function nativeStandsIn(
|
|
106808
|
-
const wrapped = getWrappedNativeAddressSafe(
|
|
106809
|
-
return !!wrapped && wrapped.toLowerCase() === String(
|
|
107275
|
+
function nativeStandsIn(row2) {
|
|
107276
|
+
const wrapped = getWrappedNativeAddressSafe(row2.chainId);
|
|
107277
|
+
return !!wrapped && wrapped.toLowerCase() === String(row2.asset?.address ?? "").toLowerCase() && isNativeWrapOneToOne(row2.chainId);
|
|
106810
107278
|
}
|
|
106811
107279
|
var NO_NATIVE_PROVIDERS = /* @__PURE__ */ new Set(["gmx", "hypercore"]);
|
|
106812
|
-
function lendingCapabilities(
|
|
107280
|
+
function lendingCapabilities(row2) {
|
|
106813
107281
|
const caps = [];
|
|
106814
|
-
const native = nativeStandsIn(
|
|
106815
|
-
const fixedLendExit = isTermMax(
|
|
106816
|
-
if (
|
|
107282
|
+
const native = nativeStandsIn(row2) && !isLiquityFamily(row2.venue) && !isFluid(row2.venue);
|
|
107283
|
+
const fixedLendExit = isTermMax(row2.venue) || isTerm(row2.venue);
|
|
107284
|
+
if (row2.availability.canDeposit) {
|
|
106817
107285
|
caps.push({
|
|
106818
107286
|
action: "deposit",
|
|
106819
107287
|
acceptsPayAsset: true,
|
|
106820
107288
|
acceptsNative: native
|
|
106821
107289
|
});
|
|
106822
107290
|
}
|
|
106823
|
-
if (
|
|
107291
|
+
if (row2.availability.canWithdraw) {
|
|
106824
107292
|
caps.push({
|
|
106825
107293
|
action: "withdraw",
|
|
106826
107294
|
acceptsReceiveAsset: true,
|
|
@@ -106862,66 +107330,66 @@ var NON_4626_DEPOSIT_KINDS = /* @__PURE__ */ new Set([
|
|
|
106862
107330
|
// Aera V3 — the deposit is a solver-filled REQUEST on the provisioner.
|
|
106863
107331
|
"aera"
|
|
106864
107332
|
]);
|
|
106865
|
-
function acceptsVaultZap(
|
|
107333
|
+
function acceptsVaultZap(row2, provider) {
|
|
106866
107334
|
if (ZAP_EXCLUDED_PROVIDERS.has(provider)) return false;
|
|
106867
|
-
const share =
|
|
107335
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
106868
107336
|
if (!share) return false;
|
|
106869
|
-
if (provider === "upshift" && isSplitUpshiftRow(
|
|
107337
|
+
if (provider === "upshift" && isSplitUpshiftRow(row2, share)) return false;
|
|
106870
107338
|
try {
|
|
106871
|
-
const entry2 = findSavingsWithdrawEntry(
|
|
107339
|
+
const entry2 = findSavingsWithdrawEntry(row2.chainId, share);
|
|
106872
107340
|
if (entry2 && NON_4626_DEPOSIT_KINDS.has(entry2.kind)) return false;
|
|
106873
107341
|
} catch {
|
|
106874
107342
|
return false;
|
|
106875
107343
|
}
|
|
106876
107344
|
return true;
|
|
106877
107345
|
}
|
|
106878
|
-
function isSplitUpshiftRow(
|
|
106879
|
-
const deposit = (
|
|
107346
|
+
function isSplitUpshiftRow(row2, share) {
|
|
107347
|
+
const deposit = (row2.providerMeta ?? {}).depositContract;
|
|
106880
107348
|
return typeof deposit === "string" && deposit.toLowerCase() !== String(share).toLowerCase();
|
|
106881
107349
|
}
|
|
106882
|
-
function isSecondaryMarketRow(
|
|
106883
|
-
const meta =
|
|
107350
|
+
function isSecondaryMarketRow(row2) {
|
|
107351
|
+
const meta = row2.providerMeta ?? {};
|
|
106884
107352
|
if (meta.secondaryMarketOnly === true) return true;
|
|
106885
|
-
const share =
|
|
106886
|
-
if (!share || !
|
|
107353
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107354
|
+
if (!share || !row2.chainId) return false;
|
|
106887
107355
|
try {
|
|
106888
|
-
return isSecondaryMarketOnly(String(
|
|
107356
|
+
return isSecondaryMarketOnly(String(row2.chainId), share);
|
|
106889
107357
|
} catch {
|
|
106890
107358
|
return false;
|
|
106891
107359
|
}
|
|
106892
107360
|
}
|
|
106893
|
-
function swapRoutedCapabilities(
|
|
107361
|
+
function swapRoutedCapabilities(row2, opts) {
|
|
106894
107362
|
const caps = [];
|
|
106895
|
-
const entryOpen =
|
|
107363
|
+
const entryOpen = row2.availability.canDeposit || opts?.ignoreMintPermission === true && row2.availability.gating === "allowlist-contract" && (row2.providerMeta ?? {}).paused !== true;
|
|
106896
107364
|
if (entryOpen) {
|
|
106897
107365
|
caps.push({
|
|
106898
107366
|
action: "deposit",
|
|
106899
107367
|
via: "swap",
|
|
106900
107368
|
requires: ["slippage"],
|
|
106901
107369
|
acceptsPayAsset: true,
|
|
106902
|
-
acceptsNative: nativeStandsIn(
|
|
107370
|
+
acceptsNative: nativeStandsIn(row2)
|
|
106903
107371
|
});
|
|
106904
107372
|
}
|
|
106905
|
-
if (
|
|
107373
|
+
if (row2.availability.canWithdraw) {
|
|
106906
107374
|
caps.push({
|
|
106907
107375
|
action: "withdraw",
|
|
106908
107376
|
via: "swap",
|
|
106909
107377
|
requires: ["slippage"],
|
|
106910
107378
|
acceptsReceiveAsset: true,
|
|
106911
|
-
acceptsNative: nativeStandsIn(
|
|
107379
|
+
acceptsNative: nativeStandsIn(row2)
|
|
106912
107380
|
});
|
|
106913
107381
|
}
|
|
106914
107382
|
return caps;
|
|
106915
107383
|
}
|
|
106916
|
-
function vaultCapabilities(
|
|
106917
|
-
const provider =
|
|
106918
|
-
const meta =
|
|
107384
|
+
function vaultCapabilities(row2) {
|
|
107385
|
+
const provider = row2.venue.replace(/^vault\./, "");
|
|
107386
|
+
const meta = row2.providerMeta ?? {};
|
|
106919
107387
|
const caps = [];
|
|
106920
|
-
if (SWAP_ROUTED_PROVIDERS.has(provider)) return swapRoutedCapabilities(
|
|
106921
|
-
if (isSecondaryMarketRow(
|
|
106922
|
-
return swapRoutedCapabilities(
|
|
106923
|
-
if (
|
|
106924
|
-
const inputs = depositInputs(
|
|
107388
|
+
if (SWAP_ROUTED_PROVIDERS.has(provider)) return swapRoutedCapabilities(row2);
|
|
107389
|
+
if (isSecondaryMarketRow(row2))
|
|
107390
|
+
return swapRoutedCapabilities(row2, { ignoreMintPermission: true });
|
|
107391
|
+
if (row2.availability.canDeposit) {
|
|
107392
|
+
const inputs = depositInputs(row2, provider);
|
|
106925
107393
|
caps.push({
|
|
106926
107394
|
action: "deposit",
|
|
106927
107395
|
inputs,
|
|
@@ -106931,15 +107399,15 @@ function vaultCapabilities(row) {
|
|
|
106931
107399
|
// deposit — but ONLY for rows whose deposit is a plain synchronous
|
|
106932
107400
|
// ERC-4626 call. Advertising it anywhere else builds a zap input that
|
|
106933
107401
|
// 400s at submit, which is exactly what this flag existed to prevent.
|
|
106934
|
-
acceptsPayAsset: acceptsVaultZap(
|
|
107402
|
+
acceptsPayAsset: acceptsVaultZap(row2, provider),
|
|
106935
107403
|
// native for a wrapped-native deposit token is NOT a zap: the 4626 rows
|
|
106936
107404
|
// take it through the composer, every single-token builder (Lagoon,
|
|
106937
107405
|
// the non-4626 savings kinds, ERC-20-only LST mints) as a leading wrap
|
|
106938
|
-
acceptsNative: !NO_NATIVE_PROVIDERS.has(provider) && nativeStandsIn(
|
|
107406
|
+
acceptsNative: !NO_NATIVE_PROVIDERS.has(provider) && nativeStandsIn(row2)
|
|
106939
107407
|
});
|
|
106940
107408
|
}
|
|
106941
|
-
if (!
|
|
106942
|
-
const mode =
|
|
107409
|
+
if (!row2.availability.canWithdraw) return caps;
|
|
107410
|
+
const mode = row2.exit.mode;
|
|
106943
107411
|
const isAsync = provider !== "hypercore" && (ASYNC_PROVIDERS.has(provider) || ASYNC_EXIT_MODES.has(mode));
|
|
106944
107412
|
if (!isAsync) {
|
|
106945
107413
|
caps.push({
|
|
@@ -106947,7 +107415,7 @@ function vaultCapabilities(row) {
|
|
|
106947
107415
|
requires: withdrawRequires(provider),
|
|
106948
107416
|
// the unwrap rides the composer's 4626 withdraw — the same rows the
|
|
106949
107417
|
// deposit zap serves; the single-token exits have no unwrap leg yet
|
|
106950
|
-
acceptsNative: acceptsVaultZap(
|
|
107418
|
+
acceptsNative: acceptsVaultZap(row2, provider) && nativeStandsIn(row2)
|
|
106951
107419
|
});
|
|
106952
107420
|
return caps;
|
|
106953
107421
|
}
|
|
@@ -106955,7 +107423,7 @@ function vaultCapabilities(row) {
|
|
|
106955
107423
|
caps.push({
|
|
106956
107424
|
action: "withdraw",
|
|
106957
107425
|
requires: withdrawRequires(provider),
|
|
106958
|
-
feeBps: num16(meta.withdrawFeeBps) ??
|
|
107426
|
+
feeBps: num16(meta.withdrawFeeBps) ?? row2.exit.feeBps,
|
|
106959
107427
|
// a fee-paying single-token exit: pays the vault's token only
|
|
106960
107428
|
acceptsNative: false
|
|
106961
107429
|
});
|
|
@@ -106969,13 +107437,13 @@ function vaultCapabilities(row) {
|
|
|
106969
107437
|
caps.push({
|
|
106970
107438
|
action: "claim",
|
|
106971
107439
|
async: false,
|
|
106972
|
-
requires: claimRequires(
|
|
107440
|
+
requires: claimRequires(row2, provider)
|
|
106973
107441
|
});
|
|
106974
107442
|
}
|
|
106975
|
-
if (supportsCancel(
|
|
107443
|
+
if (supportsCancel(row2, provider)) {
|
|
106976
107444
|
caps.push({
|
|
106977
107445
|
action: "cancel",
|
|
106978
|
-
requires: savingsVerbRequiresFor(
|
|
107446
|
+
requires: savingsVerbRequiresFor(row2, provider, "cancel")
|
|
106979
107447
|
});
|
|
106980
107448
|
}
|
|
106981
107449
|
return caps;
|
|
@@ -106987,17 +107455,17 @@ function isBookPriced(provider) {
|
|
|
106987
107455
|
function swapRoutedProvidersArePriceConsistent() {
|
|
106988
107456
|
return [...SWAP_ROUTED_PROVIDERS].filter((p) => !isBookPriced(p));
|
|
106989
107457
|
}
|
|
106990
|
-
function depositInputs(
|
|
107458
|
+
function depositInputs(row2, provider) {
|
|
106991
107459
|
if (provider === "upshift") {
|
|
106992
|
-
const assets = (
|
|
107460
|
+
const assets = (row2.providerMeta ?? {}).depositAssets;
|
|
106993
107461
|
if (!Array.isArray(assets) || assets.length < 2) return void 0;
|
|
106994
107462
|
return assets.filter((a) => typeof a === "string").map((asset) => ({ asset, mode: "direct" }));
|
|
106995
107463
|
}
|
|
106996
107464
|
if (provider !== "lst") return void 0;
|
|
106997
|
-
const share =
|
|
107465
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
106998
107466
|
if (!share) return void 0;
|
|
106999
107467
|
try {
|
|
107000
|
-
const accepted = getLstAcceptedInputs(
|
|
107468
|
+
const accepted = getLstAcceptedInputs(row2.chainId, share);
|
|
107001
107469
|
if (!accepted?.length) return void 0;
|
|
107002
107470
|
return accepted.map((a) => ({
|
|
107003
107471
|
asset: String(a.asset),
|
|
@@ -107039,19 +107507,19 @@ function requestRequires(provider) {
|
|
|
107039
107507
|
if (isBookPriced(provider)) requires.push("slippage");
|
|
107040
107508
|
return requires.length ? requires : void 0;
|
|
107041
107509
|
}
|
|
107042
|
-
function claimRequires(
|
|
107043
|
-
const share =
|
|
107044
|
-
if (provider === "upshift" && share && isSplitUpshiftRow(
|
|
107510
|
+
function claimRequires(row2, provider) {
|
|
107511
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107512
|
+
if (provider === "upshift" && share && isSplitUpshiftRow(row2, share))
|
|
107045
107513
|
return ["claimableEpoch"];
|
|
107046
107514
|
return void 0;
|
|
107047
107515
|
}
|
|
107048
|
-
function savingsVerbRequiresFor(
|
|
107516
|
+
function savingsVerbRequiresFor(row2, provider, verb) {
|
|
107049
107517
|
if (provider === "gmx" || provider === "lst") return void 0;
|
|
107050
|
-
const share =
|
|
107051
|
-
if (!share || !
|
|
107518
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107519
|
+
if (!share || !row2.chainId) return void 0;
|
|
107052
107520
|
try {
|
|
107053
107521
|
return savingsVerbRequires(
|
|
107054
|
-
String(
|
|
107522
|
+
String(row2.chainId),
|
|
107055
107523
|
share,
|
|
107056
107524
|
verb
|
|
107057
107525
|
);
|
|
@@ -107059,13 +107527,13 @@ function savingsVerbRequiresFor(row, provider, verb) {
|
|
|
107059
107527
|
return void 0;
|
|
107060
107528
|
}
|
|
107061
107529
|
}
|
|
107062
|
-
function supportsCancel(
|
|
107530
|
+
function supportsCancel(row2, provider) {
|
|
107063
107531
|
if (provider === "gmx") return true;
|
|
107064
|
-
const share =
|
|
107065
|
-
if (!share || !
|
|
107532
|
+
const share = row2.shareToken?.address ?? row2.ref;
|
|
107533
|
+
if (!share || !row2.chainId) return false;
|
|
107066
107534
|
try {
|
|
107067
107535
|
return savingsSupportsVerb(
|
|
107068
|
-
String(
|
|
107536
|
+
String(row2.chainId),
|
|
107069
107537
|
share,
|
|
107070
107538
|
"cancel"
|
|
107071
107539
|
);
|
|
@@ -107731,7 +108199,7 @@ var pct4 = (v) => {
|
|
|
107731
108199
|
function convertBorosCandle(c) {
|
|
107732
108200
|
const ts = Number(c?.ts);
|
|
107733
108201
|
if (!Number.isFinite(ts)) return null;
|
|
107734
|
-
const
|
|
108202
|
+
const row2 = {
|
|
107735
108203
|
ts,
|
|
107736
108204
|
impliedOpen: pct4(c.o),
|
|
107737
108205
|
impliedHigh: pct4(c.h),
|
|
@@ -107745,7 +108213,7 @@ function convertBorosCandle(c) {
|
|
|
107745
108213
|
futurePremium: pct4(c.fp),
|
|
107746
108214
|
volume: Number.isFinite(Number(c.v)) ? Number(c.v) : 0
|
|
107747
108215
|
};
|
|
107748
|
-
return Number.isFinite(
|
|
108216
|
+
return Number.isFinite(row2.impliedClose) ? row2 : null;
|
|
107749
108217
|
}
|
|
107750
108218
|
async function fetchBorosRateHistory(marketId, opts = {}) {
|
|
107751
108219
|
const interval = opts.interval ?? "1h";
|
|
@@ -108022,14 +108490,14 @@ function quoteBorosHedgeLeg(p) {
|
|
|
108022
108490
|
// src/boros/hedgeTerms.ts
|
|
108023
108491
|
var FUNDING_HEDGE_REFERENCE_USD = 1e4;
|
|
108024
108492
|
var BOROS_CHAIN = "42161";
|
|
108025
|
-
function earnRowFundingProfile(
|
|
108026
|
-
if (
|
|
108027
|
-
if (
|
|
108493
|
+
function earnRowFundingProfile(row2) {
|
|
108494
|
+
if (row2.venueKind !== "lending" && row2.venueKind !== "vault") return void 0;
|
|
108495
|
+
if (row2.maturity != null) return void 0;
|
|
108028
108496
|
const symbols = [
|
|
108029
|
-
|
|
108030
|
-
|
|
108497
|
+
row2.venueKind === "vault" ? row2.shareToken?.symbol : void 0,
|
|
108498
|
+
row2.asset?.symbol
|
|
108031
108499
|
].filter((s) => !!s);
|
|
108032
|
-
if (symbols.some(isPrincipalTokenSymbol) || isPrincipalTokenSymbol(
|
|
108500
|
+
if (symbols.some(isPrincipalTokenSymbol) || isPrincipalTokenSymbol(row2.name))
|
|
108033
108501
|
return void 0;
|
|
108034
108502
|
for (const s of symbols) {
|
|
108035
108503
|
const p = fundingExposureOf(s);
|
|
@@ -108186,6 +108654,6 @@ function hedgeImplications(h, p) {
|
|
|
108186
108654
|
return out;
|
|
108187
108655
|
}
|
|
108188
108656
|
|
|
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 };
|
|
108657
|
+
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
108658
|
//# sourceMappingURL=index.js.map
|
|
108191
108659
|
//# sourceMappingURL=index.js.map
|