@1delta/margin-fetcher 5.0.126 → 5.0.127
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 +8 -2
- package/dist/index.js +492 -21
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseAbi, parseAbiItem, keccak256, encodeAbiParameters, formatEther, BaseError, erc20Abi, isAddress, stringToHex, pad, encodeFunctionData, decodeFunctionResult, decodeAbiParameters, formatUnits, getAddress, toBytes, slice, concat, AbiEncodingLengthMismatchError, concatHex, parseAbiParameters, hexToString, InvalidAddressError, boolToHex, integerRegex, numberToHex, bytesRegex, BytesSizeMismatchError, arrayRegex, UnsupportedPackedAbiType } from './chunk-GZR3D6YQ.js';
|
|
2
2
|
import './chunk-BYTNVMX7.js';
|
|
3
3
|
import './chunk-PR4QN5HX.js';
|
|
4
|
-
import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isCooler, isDssType, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, isFrankencoin, isResupply, isCurvance, isFlyingTulip, isRipe, isTwyne, isFraxlend, isAaveV4Type, isKamino, isJupiterLend, isSave, isLoopscale, isProject0, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isCompoundV2Type, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite, isMorphoType, isUsdd, isSky, hasCrossMarginRisk, isEulerType, isInit, isVenusType, normalizeLenderKey, isSumerType, AAVE_V3_LENDERS, AAVE_V2_LENDERS, isMorphoBlue, kaminoMarketFromKey, jupiterLendVaultFromKey, saveMarketFromKey, loopscaleMarketFromKey, project0GroupFromKey, isAaveV2Type, isAaveV32Type, isAaveV3Type, isYLDR, isLista, hasSubAccounts, isTectonicType, isKineticType, isBenqiType } from '@1delta/lender-registry';
|
|
4
|
+
import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isCooler, isDssType, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, isFrankencoin, isResupply, isCurvance, isFlyingTulip, isRipe, isTwyne, isFraxlend, isAaveV4Type, isKamino, isJupiterLend, isSave, isLoopscale, isProject0, isZodial, isDefituna, isJupiterOfferbook, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isCompoundV2Type, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite, isMorphoType, isUsdd, isSky, hasCrossMarginRisk, isEulerType, isInit, isVenusType, normalizeLenderKey, isSumerType, AAVE_V3_LENDERS, AAVE_V2_LENDERS, isMorphoBlue, kaminoMarketFromKey, jupiterLendVaultFromKey, saveMarketFromKey, loopscaleMarketFromKey, project0GroupFromKey, zodialGroupFromKey, defiTunaPoolFromKey, jupiterOfferbookMarketFromKey, isAaveV2Type, isAaveV32Type, isAaveV3Type, isYLDR, isLista, hasSubAccounts, isTectonicType, isKineticType, isBenqiType } from '@1delta/lender-registry';
|
|
5
5
|
export { hasCrossMarginRisk, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isMultiMarket, isYLDR } from '@1delta/lender-registry';
|
|
6
6
|
import { fetchTokenLists, fetchTokenList, aavePools, compoundV3Pools, initConfig, morphoPools, compoundV2Pools, eulerVaults, siloMarkets, siloV2LenderKey, siloMarketsV3, siloV3LenderKey, aaveV4Spokes, aaveV4SpokeLenderKey, fluidResolvers, gearboxResolvers, dolomiteConfigs, midnightConfig, termConfig, termMarketsByChain, exactlyConfig, flyingTulipLendersByChain, liquityLendersByChain, riverLendersByChain, inverseLendersByChain, coolerLendersByChain, ripeLendersByChain, llamaLendLendersByChain, usddLendersByChain, skyLendersByChain, frankencoinLendersByChain, resupplyLendersByChain, curvanceLendersByChain, fraxlendLendersByChain, twyneLendersByChain, tellerConfigByChain, tellerPoolsByChain, termMaxConfigByChain, aaveReserves, compoundV3Reserves, dolomiteIsolationMarket, morphoTypeMarkets, resolveTermApiBase, flyingTulipConfigFor, flyingTulipAssetsFor, liquityConfigFor, liquityBranchesByChain, riverConfigFor, riverChainData, termMaxApiBaseUrl, termMaxLenderKey, inverseConfigFor, inverseChainData, coolerConfigFor, llamaLendConfigFor, llamaLendChainData, llamaLendApiBaseUrl, resupplyConfigFor, fraxlendConfigFor, dssConfigFor, dssChainData, dssDebtToken, dssDebtJoin, frankencoinConfigFor, frankencoinChainData, aaveTokens, compoundV3BaseData, compoundV2TokenArray, morphoTypeVaults, eulerConfigs, fluidVaultEntries, gearboxMarketConfigurators, dolomiteIsolation, liquityMarkets, riverMarkets, tellerConfig, tellerPools, termMarkets, termMaxConfig, midnightMarkets, midnightCollateralRef, llamaLendMarkets, fraxlendPairsFor, inverseMarkets, curvanceConfig, frankencoinMarkets, ripeConfigFor, twyneMarkets, twyneConfigFor, exactlyMarkets, aaveOracles, resolveMidnightApiBase, RIPE_HQ_IDS, llamaLendMarketByVault, getSiloV2MarketEntry, getSiloV3MarketEntry, dolomiteEmode, curvanceConfigFor, listaCollateralProvider, gearboxMarketCompressor, gearboxV3LenderKey, midnightMarketsByChain, twyneChainData, parseAaveV4SpokeLenderKey, gearboxAccountCompressor, compoundV2Tokens, exactlyMarketsByChain, aaveOraclesConfig, compoundV2Oracles, compoundV2OraclesConfig, compoundV3OraclesData, compoundV2Reserves, aaveV4Oracles, morphoTypeOracles } from '@1delta/data-sdk';
|
|
7
7
|
import lodash from 'lodash';
|
|
@@ -12627,10 +12627,10 @@ async function post(query3) {
|
|
|
12627
12627
|
throw new Error(json.errors.map((e) => e?.message).join("; "));
|
|
12628
12628
|
return json.data;
|
|
12629
12629
|
}
|
|
12630
|
-
async function pageAll(
|
|
12630
|
+
async function pageAll(build9, field15, pageSize) {
|
|
12631
12631
|
const out = [];
|
|
12632
12632
|
for (let page = 0; page < MAX_PAGES; page++) {
|
|
12633
|
-
const items = (await post(
|
|
12633
|
+
const items = (await post(build9(pageSize, page * pageSize)))?.[field15]?.items;
|
|
12634
12634
|
if (!Array.isArray(items)) throw new Error(`unexpected ${field15} shape`);
|
|
12635
12635
|
out.push(...items);
|
|
12636
12636
|
if (items.length < pageSize) return out;
|
|
@@ -45255,7 +45255,10 @@ var PREFIX_LENDERS = /* @__PURE__ */ new Set([
|
|
|
45255
45255
|
"JUPITER_LEND",
|
|
45256
45256
|
"SAVE",
|
|
45257
45257
|
"LOOPSCALE",
|
|
45258
|
-
"PROJECT_0"
|
|
45258
|
+
"PROJECT_0",
|
|
45259
|
+
"ZODIAL",
|
|
45260
|
+
"DEFITUNA",
|
|
45261
|
+
"JUPITER_OFFERBOOK"
|
|
45259
45262
|
]);
|
|
45260
45263
|
var parseLenderKey = (raw) => normalizeLenderKey(raw);
|
|
45261
45264
|
function filterLenderMeta(meta, filter) {
|
|
@@ -53817,7 +53820,9 @@ var yieldpointYutyFetcher = {
|
|
|
53817
53820
|
abi: CONVERT_TO_ASSETS_ABI7,
|
|
53818
53821
|
functionName: "convertToAssets",
|
|
53819
53822
|
args: [ONE_E1816],
|
|
53820
|
-
|
|
53823
|
+
// yUTY accrues in weekly-ish `donate` steps 6–9 days apart, so a 30-day
|
|
53824
|
+
// window holds four or five of them and swings ~±20 %; 90 days does not.
|
|
53825
|
+
windowDays: 90,
|
|
53821
53826
|
allowDecrease: false
|
|
53822
53827
|
}).catch(() => void 0);
|
|
53823
53828
|
return keyed(L2SD_YIELD_KEYS.yUTY, apr);
|
|
@@ -53949,7 +53954,7 @@ var L2SD_ENTRIES = {
|
|
|
53949
53954
|
underlying: WHYPE,
|
|
53950
53955
|
symbol: "haHYPE",
|
|
53951
53956
|
brand: "Harmonix",
|
|
53952
|
-
description: "Harmonix's HYPE vault: WHYPE deposited here is deployed by Harmonix across HyperEVM yield venues (it earns points from Kinetiq, Valantis, HyperLend, Felix and HypurrFi), and the share price, set from Harmonix's fund NAV, accrues what that earns in HYPE. Exit is a request: initiate a withdrawal, which fixes the payout at that moment's share price, wait for Harmonix to fund it, then redeem; a small network-cost fee can apply. Harmonix's operators can pause the vault.",
|
|
53957
|
+
description: "Harmonix's HYPE vault: WHYPE deposited here is deployed by Harmonix across HyperEVM yield venues (it earns points from Kinetiq, Valantis, HyperLend, Felix and HypurrFi), and the share price, set from Harmonix's fund NAV, accrues what that earns in HYPE. That price is a mark, not a ratchet: it has dipped, and Harmonix's own reported price has sat below the on-chain one. Exit is a request: initiate a withdrawal, which fixes the payout at that moment's share price, wait for Harmonix to fund it, then redeem; a small network-cost fee can apply. Harmonix's operators can pause the vault.",
|
|
53953
53958
|
decimals: 18,
|
|
53954
53959
|
isRebasing: false,
|
|
53955
53960
|
isMintable: true,
|
|
@@ -54104,7 +54109,7 @@ var roycoFetcher = {
|
|
|
54104
54109
|
// src/vaults/savings/registryEthStructuredC.ts
|
|
54105
54110
|
var ROYCO_PROSE = {
|
|
54106
54111
|
"ROY-ST-apyUSD": "Royco's senior tranche over Apyx apyUSD: deposited apyUSD earns a share of apyUSD's dividend-backed yield, measured on the tranche's USD NAV, while the junior tranche absorbs losses first \u2014 the senior held flat through the June\u2013July 2026 apxUSD markdown that cut the junior 34%. Exit is a request through Royco's entry point that executes 24 hours later and pays apyUSD; yield accrued during that day is forfeited. Unstaking apyUSD itself takes a further 3\u201320 days.",
|
|
54107
|
-
"ROY-JT-apyUSD": "Royco's junior tranche over Apyx apyUSD \u2014 first-loss capital that earns its own apyUSD yield plus a risk premium paid out of the senior's yield. The risk is real: a June\u2013July 2026 apxUSD markdown cut its NAV 34% (1.02 to 0.67) while the senior held, and its
|
|
54112
|
+
"ROY-JT-apyUSD": "Royco's junior tranche over Apyx apyUSD \u2014 first-loss capital that earns its own apyUSD yield plus a risk premium paid out of the senior's yield. The risk is real: a June\u2013July 2026 apxUSD markdown cut its NAV 34% (1.02 to 0.67) while the senior held, and it is still about 15% below that peak (0.87 on 2026-10-19); its current rate is mostly apyUSD's own yield. Exit is a request through Royco's entry point, executed 24 hours later in apyUSD with that day's yield forfeited, and junior redemptions are limited by the senior's coverage requirement."
|
|
54108
54113
|
};
|
|
54109
54114
|
var STRATA_NOPAL_PROSE = {
|
|
54110
54115
|
srnOPAL: "Strata's senior tranche over Nest nOPAL (BlackOpal's LiquidStone II fund: FX-hedged, short-dated Brazilian credit-card receivables), accounted in USDC: a benchmark-floored share of the nOPAL yield, junior-protected. Deposits and exits are in nOPAL itself \u2014 the strategy rejects USDC \u2014 and a redemption pays nOPAL immediately minus a 5 bps exit fee while the cooldown is 0; turning nOPAL into USDC is Nest's own fee-paying instant redemption or its queued request.",
|
|
@@ -54336,8 +54341,7 @@ var fetchRealizedApr = async (src) => {
|
|
|
54336
54341
|
client.getBlock({ blockNumber: head }),
|
|
54337
54342
|
client.getBlock({ blockNumber: past })
|
|
54338
54343
|
]);
|
|
54339
|
-
if (then <= 0n
|
|
54340
|
-
throw new Error(`${src.label}: bad archival read`);
|
|
54344
|
+
if (then <= 0n) throw new Error(`${src.label}: bad archival read`);
|
|
54341
54345
|
const elapsed = Number(headBlock.timestamp - pastBlock.timestamp);
|
|
54342
54346
|
if (elapsed <= 0) throw new Error(`${src.label}: non-positive window`);
|
|
54343
54347
|
return annualizeRateDeltaPercent(now, then, elapsed);
|
|
@@ -54432,7 +54436,7 @@ var ETH_STABLES_A_ENTRIES = {
|
|
|
54432
54436
|
// USDC
|
|
54433
54437
|
symbol: "SIERRA",
|
|
54434
54438
|
brand: "Sierra",
|
|
54435
|
-
description: "Sierra's liquid vault token: USDC reserves are placed in OpenTrade vaults (AAA CLOs, commercial paper, Morpho lending, trade finance, a SOL basis trade) and Sierra
|
|
54439
|
+
description: "Sierra's liquid vault token: USDC reserves are placed in OpenTrade vaults (AAA CLOs, commercial paper, Morpho lending, trade finance, a SOL basis trade) and Sierra restates SIERRA's USDC exchange rate several times a day from their NAVs. Because those holdings are marked, the rate can step down as well as up (it did four times between 2026-09-16 and 2026-10-06, by up to 2.4 bps). Minting and redemption are limited to KYB-approved institutions, so here you buy and sell SIERRA on its DEX pools; the market price can differ from the published rate.",
|
|
54436
54440
|
decimals: 6,
|
|
54437
54441
|
isRebasing: false,
|
|
54438
54442
|
isMintable: false,
|
|
@@ -55349,7 +55353,7 @@ var ETH_SAVINGS_B_ENTRIES = {
|
|
|
55349
55353
|
// WETH
|
|
55350
55354
|
symbol: "mixWETH",
|
|
55351
55355
|
brand: "Alchemix",
|
|
55352
|
-
description: "mixWETH is Alchemix v3's WETH Mix Yield Token, the vault behind alETH: WETH is spread across Yearn's WETH vault, Aave, wstETH, sfrxETH, ether.fi eETH and StakeDAO strategies by Alchemix's curator, and the share price
|
|
55356
|
+
description: "mixWETH is Alchemix v3's WETH Mix Yield Token, the vault behind alETH: WETH is spread across Yearn's WETH vault, Aave, wstETH, sfrxETH, ether.fi eETH and StakeDAO strategies by Alchemix's curator, and the share price follows what they realize after a 5 % performance fee. It is marked to those staked-ETH legs, so it moves down in small steps as well as up. The rate shown is realized over 30 days. Withdrawals are instant up to what the vault holds idle plus what its Yearn liquidity leg can release; the staked-ETH legs need the curator to unwind first.",
|
|
55353
55357
|
decimals: 18,
|
|
55354
55358
|
isRebasing: false,
|
|
55355
55359
|
isMintable: true,
|
|
@@ -82403,6 +82407,12 @@ var VOLATILE_VAULT_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
82403
82407
|
// 90 days to 2026-10-16 it grew ~1.1 % APR against kHYPE's own ~1.96 %.
|
|
82404
82408
|
"999-0x9ba2edc44e0a4632eb4723e81d4142353e1bb160",
|
|
82405
82409
|
// vkHYPE
|
|
82410
|
+
// Harmonix haHYPE (HyperEVM) — the share price is set from Harmonix's
|
|
82411
|
+
// delta-neutral fund NAV (an operator mark, the vkHYPE shape): it fell
|
|
82412
|
+
// 1.0468857 → 1.0468791 between 2026-10-06 and 2026-10-07, and Harmonix's
|
|
82413
|
+
// own API price sat 0.23 % below the on-chain one on 2026-10-19.
|
|
82414
|
+
"999-0xfde5b0626fc80e36885e2fa9cd5ad9d7768d725c",
|
|
82415
|
+
// haHYPE
|
|
82406
82416
|
// Royco junior tranche over apyUSD — first-loss capital whose USD NAV/share
|
|
82407
82417
|
// fell 1.019 → 0.670 (−34 %) in June–July 2026 while apxUSD/USD was marked
|
|
82408
82418
|
// ~0.88, then recovered to ~0.866 (2026-10-16). Its trailing rate is a
|
|
@@ -82414,6 +82424,35 @@ var VOLATILE_VAULT_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
82414
82424
|
// mark it DOWN in dollars. Its realized rate is a NAV delta, not a coupon.
|
|
82415
82425
|
"1-0x098697ba3fee4ea76294c5d6a466a4e3b3e95fe6",
|
|
82416
82426
|
// USP
|
|
82427
|
+
// Strata JUNIOR tranches — first-loss capital, marked against the senior's
|
|
82428
|
+
// benchmark payment and the collateral's own NAV, so the share CAN fall:
|
|
82429
|
+
// jrUSDat marked to ~0.36 through the 2026-06/07 sUSDat drawdown, and
|
|
82430
|
+
// jrNUSD above. Seniors stay yield-bearing (benchmark-floored, protected).
|
|
82431
|
+
// Classified as a family, not by observed drawdown — jrnOPAL has none yet
|
|
82432
|
+
// and is the same instrument.
|
|
82433
|
+
"1-0xc58d044404d8b14e953c115e67823784dea53d8f",
|
|
82434
|
+
// jrUSDe
|
|
82435
|
+
"1-0xeb205d26e9e605ec82d1c0d652e00037c278714b",
|
|
82436
|
+
// jrmHYPER
|
|
82437
|
+
"1-0xf7eb8dfec75c42d2d2247fe76ccaedc59f821688",
|
|
82438
|
+
// jrmM1-USD
|
|
82439
|
+
"1-0x011e55d2b28306458e37ca7e997c879bb25a455d",
|
|
82440
|
+
// jrUSDat
|
|
82441
|
+
"1-0xf4c91f24e20ee8ed5eda905e501a1136334c2f27",
|
|
82442
|
+
// jrPRIME
|
|
82443
|
+
"1-0x1b2b8cfef0b7b1fad216b55fefeeb0c3349da141",
|
|
82444
|
+
// jrnOPAL
|
|
82445
|
+
// Alchemix mixWETH — a Vault V2 marked to its staked-ETH strategy legs
|
|
82446
|
+
// (Tokemak autoETH, wstETH, sfrxETH, eETH): the share price fell on 15 of 54
|
|
82447
|
+
// samples since launch, 9 of the last 30 days (worst −0.128 %), 2026-10-19.
|
|
82448
|
+
"1-0x29bcfed246ce37319d94eba107db90c453d4c43d",
|
|
82449
|
+
// mixWETH
|
|
82450
|
+
// Sierra SIERRA — an operator-restated USDC exchange rate over OpenTrade
|
|
82451
|
+
// vaults holding marked credit (AAA CLOs, commercial paper) and a SOL basis
|
|
82452
|
+
// trade. Small, but a mark: four step-downs between 2026-09-16 and
|
|
82453
|
+
// 2026-10-06 (largest −2.42 bps), the vkHYPE precedent.
|
|
82454
|
+
"1-0xbceb5f6877d979ec621ae694da1102cb95691ad3",
|
|
82455
|
+
// SIERRA
|
|
82417
82456
|
// Morini Capital's single-strategy vaults behind USP (registryMorini.ts) —
|
|
82418
82457
|
// the same call for the same reason: USD NAVs over Turkish-market books.
|
|
82419
82458
|
// CarryTradeUSDTRYLeverage is UNHEDGED leveraged lira carry (37 % since
|
|
@@ -82540,9 +82579,50 @@ var STABLECOIN_UNDERLYING_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
82540
82579
|
// rows `volatile`.
|
|
82541
82580
|
"1-0xda67b4284609d2d48e5d10cfac411572727dc1ed",
|
|
82542
82581
|
// USN
|
|
82543
|
-
"1-0x18f52b3fb465118731d9e0d276d4eb3599d57596"
|
|
82582
|
+
"1-0x18f52b3fb465118731d9e0d276d4eb3599d57596",
|
|
82544
82583
|
// AID
|
|
82584
|
+
// Jarvis jEUR (EUR synthetic) and its Superfluid wrapper jEURx on Base —
|
|
82585
|
+
// the underlyings of sjEUR and of Spectra's PT-sjEUR market. Neither ticker
|
|
82586
|
+
// carries `USD`/`EUR` in a form the heuristic reads, and the token list
|
|
82587
|
+
// gives neither a `stablecoin` peg (2026-10-19).
|
|
82588
|
+
"8453-0x4154550f4db74dc38d1fe98e1f3f28ed6dad627d",
|
|
82589
|
+
// jEUR
|
|
82590
|
+
"8453-0xfcdecfe37463912c03a644128eb02a1147715e36",
|
|
82591
|
+
// jEURx
|
|
82592
|
+
// Piku USP — NOT a peg (a 1.15 USDC NAV that can step down; token-lists no
|
|
82593
|
+
// longer tags it `stablecoin`), but USD is its unit of account: it is
|
|
82594
|
+
// priced, minted and redeemed in USDC, so a Pendle PT over it is a dollar
|
|
82595
|
+
// product. `denomination` names the money, `yieldProfile` the volatility.
|
|
82596
|
+
"1-0x098697ba3fee4ea76294c5d6a466a4e3b3e95fe6"
|
|
82597
|
+
// USP
|
|
82545
82598
|
]);
|
|
82599
|
+
var FIAT_BASES = /* @__PURE__ */ new Set([
|
|
82600
|
+
"USD",
|
|
82601
|
+
"EUR",
|
|
82602
|
+
"CHF",
|
|
82603
|
+
"GBP",
|
|
82604
|
+
"TRY",
|
|
82605
|
+
"JPY",
|
|
82606
|
+
"SGD",
|
|
82607
|
+
"AUD",
|
|
82608
|
+
"CAD",
|
|
82609
|
+
"BRL",
|
|
82610
|
+
"MXN",
|
|
82611
|
+
"HKD",
|
|
82612
|
+
"KRW",
|
|
82613
|
+
"CNY",
|
|
82614
|
+
"IDR",
|
|
82615
|
+
"PHP",
|
|
82616
|
+
"NGN",
|
|
82617
|
+
"ZAR",
|
|
82618
|
+
"INR",
|
|
82619
|
+
"ARS"
|
|
82620
|
+
]);
|
|
82621
|
+
var isFiatPeggedByProps = (props) => {
|
|
82622
|
+
const p = props;
|
|
82623
|
+
const base = p?.stablecoin?.base ?? p?.savings?.base;
|
|
82624
|
+
return typeof base === "string" && FIAT_BASES.has(base.toUpperCase());
|
|
82625
|
+
};
|
|
82546
82626
|
var normalizeSymbol = (s) => (s ?? "").trim().toUpperCase();
|
|
82547
82627
|
var isStablecoinSymbol = (symbol) => {
|
|
82548
82628
|
const s = normalizeSymbol(symbol);
|
|
@@ -82554,7 +82634,7 @@ var classifyVault = (input) => {
|
|
|
82554
82634
|
const key4 = `${input.chainId}-${input.address.toLowerCase()}`;
|
|
82555
82635
|
const yieldProfile2 = VOLATILE_VAULT_OVERRIDES.has(key4) || VOLATILE_PROVIDERS.has(input.provider) ? "volatile" : "yield-bearing";
|
|
82556
82636
|
const underlyingKey = input.underlyingAddress !== void 0 ? `${input.chainId}-${input.underlyingAddress.toLowerCase()}` : void 0;
|
|
82557
|
-
const denomination2 = underlyingKey !== void 0 && STABLECOIN_UNDERLYING_OVERRIDES.has(underlyingKey) || isStablecoinSymbol(input.underlyingSymbol) ? "stable" : "volatile";
|
|
82637
|
+
const denomination2 = underlyingKey !== void 0 && STABLECOIN_UNDERLYING_OVERRIDES.has(underlyingKey) || isFiatPeggedByProps(input.underlyingProps) || isStablecoinSymbol(input.underlyingSymbol) ? "stable" : "volatile";
|
|
82558
82638
|
return { yieldProfile: yieldProfile2, denomination: denomination2 };
|
|
82559
82639
|
};
|
|
82560
82640
|
var stampVaultClassification = (data, chainId, tokenList = {}) => {
|
|
@@ -82576,7 +82656,8 @@ var stampVaultClassification = (data, chainId, tokenList = {}) => {
|
|
|
82576
82656
|
chainId,
|
|
82577
82657
|
address: v.address,
|
|
82578
82658
|
underlyingSymbol: v.asset?.symbol ?? v.symbol,
|
|
82579
|
-
underlyingAddress: v.underlying
|
|
82659
|
+
underlyingAddress: v.underlying,
|
|
82660
|
+
underlyingProps: (v.underlying != null ? tokenList[v.underlying.toLowerCase()]?.props : void 0) ?? v.asset?.props
|
|
82580
82661
|
});
|
|
82581
82662
|
v.yieldProfile = c.yieldProfile;
|
|
82582
82663
|
v.denomination = c.denomination;
|
|
@@ -83411,7 +83492,7 @@ var fetchGmxVaults = async (chainId, multicallRetry, options) => {
|
|
|
83411
83492
|
const symbolOf = /* @__PURE__ */ new Map();
|
|
83412
83493
|
for (const t of tokens) symbolOf.set(t.address.toLowerCase(), t.symbol);
|
|
83413
83494
|
const out = {};
|
|
83414
|
-
const
|
|
83495
|
+
const build9 = (address, name, kind, longToken, shortToken, indexToken, entry) => {
|
|
83415
83496
|
const longSymbol = symbolOf.get(longToken.toLowerCase());
|
|
83416
83497
|
const shortSymbol = symbolOf.get(shortToken.toLowerCase());
|
|
83417
83498
|
return {
|
|
@@ -83435,7 +83516,7 @@ var fetchGmxVaults = async (chainId, multicallRetry, options) => {
|
|
|
83435
83516
|
for (const m of markets) {
|
|
83436
83517
|
if (!m.isListed) continue;
|
|
83437
83518
|
const key4 = m.marketToken.toLowerCase();
|
|
83438
|
-
out[key4] =
|
|
83519
|
+
out[key4] = build9(
|
|
83439
83520
|
m.marketToken,
|
|
83440
83521
|
m.name,
|
|
83441
83522
|
"gm",
|
|
@@ -83448,7 +83529,7 @@ var fetchGmxVaults = async (chainId, multicallRetry, options) => {
|
|
|
83448
83529
|
for (const g of glvs) {
|
|
83449
83530
|
if (!g.isListed) continue;
|
|
83450
83531
|
const key4 = g.glvToken.toLowerCase();
|
|
83451
|
-
out[key4] =
|
|
83532
|
+
out[key4] = build9(
|
|
83452
83533
|
g.glvToken,
|
|
83453
83534
|
g.name,
|
|
83454
83535
|
"glv",
|
|
@@ -83807,10 +83888,10 @@ async function getJson7(url, label) {
|
|
|
83807
83888
|
}
|
|
83808
83889
|
return response.json();
|
|
83809
83890
|
}
|
|
83810
|
-
function cache5(slot,
|
|
83891
|
+
function cache5(slot, build9, store) {
|
|
83811
83892
|
const now = Date.now();
|
|
83812
83893
|
if (slot && now - slot.at < CACHE_TTL_MS7) return slot.promise;
|
|
83813
|
-
const promise =
|
|
83894
|
+
const promise = build9();
|
|
83814
83895
|
const entry = { at: now, promise };
|
|
83815
83896
|
store(entry);
|
|
83816
83897
|
promise.catch(() => store(void 0));
|
|
@@ -85497,6 +85578,69 @@ var TERM_PROFILES = [
|
|
|
85497
85578
|
]
|
|
85498
85579
|
}
|
|
85499
85580
|
}),
|
|
85581
|
+
P({
|
|
85582
|
+
id: "zodial.portfolio@v1",
|
|
85583
|
+
name: "Zodial portfolio-margin lending group",
|
|
85584
|
+
family: "zodial",
|
|
85585
|
+
docsUrl: "https://zodial.xyz/",
|
|
85586
|
+
supply: {
|
|
85587
|
+
description: "A shared pool per asset (a 'bank') inside one cross-margined group \u2014 a fork of the marginfi v2 program. Deposits earn the bank's lending rate, which moves with utilization along a multi-point curve and is settled into the deposit's share value whenever the bank is touched. Collateral includes tokenized stocks and other real-world assets alongside crypto and stablecoins.",
|
|
85588
|
+
implications: [
|
|
85589
|
+
"Your yield is not fixed \u2014 it moves with borrowing demand, and accrues as simple interest between touches of the bank.",
|
|
85590
|
+
"Withdrawals are instant up to the cash left in the bank, and can be capped by a per-bank outflow limit shared with borrows.",
|
|
85591
|
+
"Borrowers are checked against per-PAIR LTVs set by the group admins (up to 96 % between correlated assets), so a correlated pair can be lent against far more tightly than a pool with one LTV per asset.",
|
|
85592
|
+
"Bad debt in the group is socialised to depositors of the affected bank after the insurance fund; banks can be paused or set reduce-only by the group admins."
|
|
85593
|
+
]
|
|
85594
|
+
},
|
|
85595
|
+
borrow: {
|
|
85596
|
+
description: "Borrow any borrowable bank against everything the account holds. There is no single LTV per asset: every (collateral, debt) pair has its own initial and maintenance LTV and liquidation bonus, and the account is healthy when its debts can be covered by SOME allocation of its collateral at those pair LTVs \u2014 a linear program the client solves and the program verifies.",
|
|
85597
|
+
implications: [
|
|
85598
|
+
"With one debt, each collateral counts at its pair LTV with that debt; with several, the allocation that covers them best decides \u2014 never worse than every collateral at its worst pair.",
|
|
85599
|
+
"A borrow, a withdrawal or a flash loan must carry a coverage plan; when prices move, an action can fail although the account is healthy on paper.",
|
|
85600
|
+
"Past the maintenance LTVs a liquidator repays debt and takes collateral plus the PAIR\u2019s bonus (2.5 % where none is set), after proving the account cannot be healthy under any allocation.",
|
|
85601
|
+
"Tokenized stocks and RWAs price off their markets; outside market hours the protocol uses the last official close, and their pairs are the most conservative."
|
|
85602
|
+
]
|
|
85603
|
+
}
|
|
85604
|
+
}),
|
|
85605
|
+
P({
|
|
85606
|
+
id: "defituna.lending@v1",
|
|
85607
|
+
name: "DefiTuna lending vault",
|
|
85608
|
+
family: "defituna",
|
|
85609
|
+
docsUrl: "https://docs.defituna.com/dive-into-defituna/lend",
|
|
85610
|
+
supply: {
|
|
85611
|
+
description: "A single-asset lending vault behind DefiTuna's leveraged liquidity and spot trading on Orca and its own Fusion AMM. Deposits are lent ONLY to DefiTuna's own leveraged positions \u2014 concentrated-liquidity ranges and spot trades at up to 5\xD7 \u2014 never to wallets posting collateral. Interest follows a utilization curve targeting 90 % and goes entirely to lenders, accruing into the deposit's share value.",
|
|
85612
|
+
implications: [
|
|
85613
|
+
"Your yield is not fixed \u2014 it moves with how much of the vault the leveraged positions draw; above 90 % utilization the rate rises steeply (4\xD7 the target rate at 100 %).",
|
|
85614
|
+
"Withdrawals are instant up to the cash left in the vault; at 100 % utilization nothing can leave until positions repay or close.",
|
|
85615
|
+
"Positions are liquidated by DefiTuna alone, through Jupiter, and the protocol does not guarantee it happens in time; a shortfall is written off into the vault\u2019s share value, so every depositor of that vault loses pro rata. The Main USDC vault has already been written down this way.",
|
|
85616
|
+
"A vault can be closed to new deposits by its supply limit, and lending deposits and withdrawals can be suspended protocol-wide by the admin."
|
|
85617
|
+
]
|
|
85618
|
+
}
|
|
85619
|
+
}),
|
|
85620
|
+
P({
|
|
85621
|
+
id: "jupiter-offerbook.p2p@v1",
|
|
85622
|
+
name: "Jupiter Offerbook (peer-to-peer, fixed-term, no price liquidation)",
|
|
85623
|
+
family: "jupiter-offerbook",
|
|
85624
|
+
docsUrl: "https://docs.jup.ag/user-docs/earn/offerbook",
|
|
85625
|
+
supply: {
|
|
85626
|
+
description: "Lend USDC by filling a borrower's resting offer, like a market order: the rate, the term (1 to 30 days) and the collateral per USDC are the offer's, fixed when you fill it. The borrower's collateral is already escrowed behind the offer.",
|
|
85627
|
+
implications: [
|
|
85628
|
+
"Your USDC is locked until the borrower repays or the term ends \u2014 there is no early exit and no market to sell the loan into.",
|
|
85629
|
+
"There is no price liquidation: if the collateral falls, nothing happens until maturity. If the borrower does not repay, you claim the WHOLE collateral (less a 0.1 % fee) and receive the token itself, worth whatever it is worth then \u2014 a rational borrower walks away when it is worth less than the debt.",
|
|
85630
|
+
"A tenth of the interest goes to the protocol at repayment; the rate shown is already net of it.",
|
|
85631
|
+
"About one ended loan in ten has defaulted since launch; most collateral on the book is volatile."
|
|
85632
|
+
]
|
|
85633
|
+
},
|
|
85634
|
+
borrow: {
|
|
85635
|
+
description: "Borrow USDC by filling a lender's resting offer: a fixed rate and a fixed term of 1 to 30 days, against collateral that is locked in the loan until you repay. There are no oracles and no price liquidation \u2014 the only deadline is the term.",
|
|
85636
|
+
implications: [
|
|
85637
|
+
"You owe the FULL term\u2019s interest however early you repay, plus an origination fee of a quarter of that interest, paid when the loan opens; the rate shown already includes it.",
|
|
85638
|
+
"Miss the maturity and the lender can take ALL your collateral at any moment, not only what covers the debt. You can still repay until they claim it, but nothing guarantees a window.",
|
|
85639
|
+
"An offer fixes how much collateral backs each USDC, so the loan-to-value moves with the price; a fall never liquidates you before maturity.",
|
|
85640
|
+
"Some offers can be extended for another term on the same rate, if the lender allowed it, by paying the interest so far plus a new origination fee."
|
|
85641
|
+
]
|
|
85642
|
+
}
|
|
85643
|
+
}),
|
|
85500
85644
|
// ── Vaults ───────────────────────────────────────────────────────────────
|
|
85501
85645
|
P({
|
|
85502
85646
|
id: "vault.lending@v1",
|
|
@@ -91772,6 +91916,324 @@ var project0Adapter = {
|
|
|
91772
91916
|
profileId: () => PROJECT_0_PROFILE_ID,
|
|
91773
91917
|
build: build5
|
|
91774
91918
|
};
|
|
91919
|
+
var ZODIAL_PROFILE_ID = "zodial.portfolio@v1";
|
|
91920
|
+
var ZODIAL_PROGRAM_ID = "zod11Jzp72T6qBbGVJfR38y1pGY3dBK8nSuouD4mMkZ";
|
|
91921
|
+
var ZODIAL_MAX_BALANCES = 16;
|
|
91922
|
+
function pairModes(input) {
|
|
91923
|
+
const cfg = input.config;
|
|
91924
|
+
if (!cfg || Object.keys(cfg).length <= 1) return void 0;
|
|
91925
|
+
return Object.entries(cfg).map(([key4, c]) => {
|
|
91926
|
+
const isDefault = key4 === "0";
|
|
91927
|
+
return {
|
|
91928
|
+
modeId: key4,
|
|
91929
|
+
label: c.label,
|
|
91930
|
+
isDefault,
|
|
91931
|
+
// derived from what the account borrows; nobody selects it
|
|
91932
|
+
entry: isDefault ? void 0 : "automatic",
|
|
91933
|
+
liquidation: {
|
|
91934
|
+
ltv: c.borrowCollateralFactor,
|
|
91935
|
+
liquidationLtv: c.collateralFactor,
|
|
91936
|
+
penalty: c.liquidationPenalty,
|
|
91937
|
+
closeFactor: c.closeFactor ?? input.closeFactor ?? 1,
|
|
91938
|
+
targetHealthFactor: c.targetHealthFactor ?? input.targetHealthFactor
|
|
91939
|
+
},
|
|
91940
|
+
...c.debtDisabled ? { availability: { canOpen: false } } : {}
|
|
91941
|
+
};
|
|
91942
|
+
});
|
|
91943
|
+
}
|
|
91944
|
+
function build6(input) {
|
|
91945
|
+
const group = zodialGroupFromKey(input.lender);
|
|
91946
|
+
const address = input.asset?.address ?? input.underlying;
|
|
91947
|
+
const modes = pairModes(input);
|
|
91948
|
+
const pending = {
|
|
91949
|
+
"ext.zodial.operationalState": "the bank's operational state (Operational / Paused / ReduceOnly) is not served; the flags carry its effect on opening only",
|
|
91950
|
+
"borrow.fees.interest": "the group and insurance fee legs on interest are not served",
|
|
91951
|
+
"supply.exit.rateLimiter": "the bank's hourly / daily outflow limiter (shared by withdrawals and borrows) is not served",
|
|
91952
|
+
oracle: "the oracle setup (Kamino Scope with a bank-local binding, Switchboard for one bank), max age and confidence cap are not served",
|
|
91953
|
+
"borrow.liquidation.multiDebt": "with debt in several banks the LP's exact allocation is per ACCOUNT; mode '0' publishes each collateral's worst pair, a lower bound",
|
|
91954
|
+
"governance.roles": "the group admin and its delegates are not served; multisig status unverified"
|
|
91955
|
+
};
|
|
91956
|
+
return {
|
|
91957
|
+
...address ? { asset: { address: String(address) } } : {},
|
|
91958
|
+
supply: {
|
|
91959
|
+
// simple interest settled into the share value at every touch (marginfi)
|
|
91960
|
+
rate: { compounding: "on-touch" },
|
|
91961
|
+
counterparty: {
|
|
91962
|
+
kind: "pool",
|
|
91963
|
+
solvency: "overcollateralized",
|
|
91964
|
+
socializedLoss: true
|
|
91965
|
+
},
|
|
91966
|
+
principal: { protected: false, risks: ["bad-debt"] },
|
|
91967
|
+
...modes ? { modes } : {}
|
|
91968
|
+
},
|
|
91969
|
+
borrow: {
|
|
91970
|
+
rate: { compounding: "on-touch" },
|
|
91971
|
+
liquidation: {
|
|
91972
|
+
model: "repay-seize",
|
|
91973
|
+
absorber: "liquidator",
|
|
91974
|
+
reversible: false,
|
|
91975
|
+
trigger: "price",
|
|
91976
|
+
seizure: "proportional",
|
|
91977
|
+
permissioned: false,
|
|
91978
|
+
badDebt: "insurance-fund"
|
|
91979
|
+
},
|
|
91980
|
+
counterparty: {
|
|
91981
|
+
kind: "pool",
|
|
91982
|
+
solvency: "overcollateralized",
|
|
91983
|
+
socializedLoss: true
|
|
91984
|
+
},
|
|
91985
|
+
...modes ? { modes } : {},
|
|
91986
|
+
ext: {
|
|
91987
|
+
zodial: {
|
|
91988
|
+
riskModel: "Portfolio margin: one linear program over pair LTVs. An account is healthy when every debt can be covered by some allocation of its collateral at the pairs\u2019 maintenance LTVs; it may open debt when the same holds at the initial LTVs. The bank weights are not used.",
|
|
91989
|
+
witness: "A borrow, a withdrawal and the end of a flash loan carry a coverage plan (debt share per collateral, in bps) that the program verifies against live prices; liquidation carries an exact dual certificate.",
|
|
91990
|
+
modeModel: "Derived, never selected: borrowing exactly one bank prices every collateral at its pair with that bank; borrowing several is the LP's, bounded below by each collateral's worst pair.",
|
|
91991
|
+
liquidationPenalty: "The pair's liquidation bonus from the group's pairwise registry; 2.5 % where the pair sets none."
|
|
91992
|
+
}
|
|
91993
|
+
}
|
|
91994
|
+
},
|
|
91995
|
+
constraints: {
|
|
91996
|
+
crossMargin: true,
|
|
91997
|
+
positionModel: "sub-account",
|
|
91998
|
+
positionIdMeaning: `The marginfi account pubkey (a PDA ["marginfi_account", group, authority, u16 index, u16 third-party id], or a keypair); up to ${ZODIAL_MAX_BALANCES} balances each, one LP per account.`
|
|
91999
|
+
},
|
|
92000
|
+
ext: {
|
|
92001
|
+
zodial: {
|
|
92002
|
+
program: ZODIAL_PROGRAM_ID,
|
|
92003
|
+
...group ? { group } : {},
|
|
92004
|
+
marketUidRef: "bank"
|
|
92005
|
+
}
|
|
92006
|
+
},
|
|
92007
|
+
coverage: { pending }
|
|
92008
|
+
};
|
|
92009
|
+
}
|
|
92010
|
+
var zodialAdapter = {
|
|
92011
|
+
id: "zodial",
|
|
92012
|
+
matches: isZodial,
|
|
92013
|
+
profileId: () => ZODIAL_PROFILE_ID,
|
|
92014
|
+
build: build6
|
|
92015
|
+
};
|
|
92016
|
+
var DEFITUNA_PROFILE_ID = "defituna.lending@v1";
|
|
92017
|
+
var DEFITUNA_PROGRAM_ID = "tuna4uSQZncNeeiAMKbstuxA9CUkHH6HmC64wgmnogD";
|
|
92018
|
+
function build7(input) {
|
|
92019
|
+
const pool = defiTunaPoolFromKey(input.lender);
|
|
92020
|
+
const address = input.asset?.address ?? input.underlying;
|
|
92021
|
+
const pending = {
|
|
92022
|
+
"supply.principal.writeDown": "the vault's share value (deposited funds per share \u2014 below 1 means deposits were written down) is on the row's `defiTuna` slot, not on the input",
|
|
92023
|
+
"supply.exit.suspension": "the protocol-wide lending deposit / withdrawal suspension switches are on the pool meta, not on the input",
|
|
92024
|
+
backedBy: "the borrowers' LP ranges and spot positions (markets, leverage, liquidation thresholds) are not served",
|
|
92025
|
+
oracle: "Pyth (or an authority-pushed price) per market, which the liquidation bot reads, is not served",
|
|
92026
|
+
"governance.roles": "the admin, owner and liquidator authorities are on the pool meta, not on the input"
|
|
92027
|
+
};
|
|
92028
|
+
return {
|
|
92029
|
+
...address ? { asset: { address: String(address) } } : {},
|
|
92030
|
+
supply: {
|
|
92031
|
+
// e^(r·t) − 1 by a 3-term Taylor series, at every touch (≥ 60 s apart)
|
|
92032
|
+
rate: { compounding: "per-second" },
|
|
92033
|
+
counterparty: {
|
|
92034
|
+
kind: "pool",
|
|
92035
|
+
solvency: "overcollateralized",
|
|
92036
|
+
socializedLoss: true
|
|
92037
|
+
},
|
|
92038
|
+
principal: { protected: false, risks: ["bad-debt"] },
|
|
92039
|
+
ext: {
|
|
92040
|
+
defiTuna: {
|
|
92041
|
+
borrowers: "DefiTuna's own leveraged positions: concentrated-liquidity LP ranges on Orca / Fusion and leveraged spot trades, up to 5\xD7. Nobody borrows against posted collateral, and this API offers no borrowing.",
|
|
92042
|
+
liquidation: "One permissioned liquidator (the protocol) closes a position past its market threshold through Jupiter; a failed close is retried in parts (50 %, 25 %, \u2026). Liquidation is not guaranteed to be timely.",
|
|
92043
|
+
badDebt: "A shortfall is socialised into the vault's share value \u2014 every depositor of that vault takes it pro rata. The Main USDC vault has already been written down (0.512 USDC per share on 2026-10-19).",
|
|
92044
|
+
control: "The config admin, the owner and the liquidator are plain wallets with no multisig or timelock (2026-10-19), and the owner is also the program\u2019s upgrade authority.",
|
|
92045
|
+
rateModel: "Borrow APR = the vault rate at 90 % utilization \xD7 a curve (0.25\xD7 at 0 %, 4\xD7 at 100 %); suppliers get it \xD7 utilization, with no protocol fee."
|
|
92046
|
+
}
|
|
92047
|
+
}
|
|
92048
|
+
},
|
|
92049
|
+
constraints: {
|
|
92050
|
+
crossMargin: false,
|
|
92051
|
+
positionModel: "account",
|
|
92052
|
+
positionIdMeaning: 'One LendingPosition per (wallet, vault), a PDA ["lending_position", wallet, mint] \u2014 derived, nothing to pass.'
|
|
92053
|
+
},
|
|
92054
|
+
ext: {
|
|
92055
|
+
defiTuna: {
|
|
92056
|
+
program: DEFITUNA_PROGRAM_ID,
|
|
92057
|
+
...pool ? { pool } : {},
|
|
92058
|
+
marketUidRef: "vault"
|
|
92059
|
+
}
|
|
92060
|
+
},
|
|
92061
|
+
coverage: { pending }
|
|
92062
|
+
};
|
|
92063
|
+
}
|
|
92064
|
+
var defiTunaAdapter = {
|
|
92065
|
+
id: "defituna",
|
|
92066
|
+
matches: isDefituna,
|
|
92067
|
+
profileId: () => DEFITUNA_PROFILE_ID,
|
|
92068
|
+
build: build7
|
|
92069
|
+
};
|
|
92070
|
+
var JUPITER_OFFERBOOK_PROFILE_ID = "jupiter-offerbook.p2p@v1";
|
|
92071
|
+
var OFFERBOOK_PROGRAM_ID = "offerbkFMvVfpQhL8ZQ5iromnjct5rz3r52B9ewu3ie";
|
|
92072
|
+
var ORIGINATION_SHARE_OF_INTEREST = 0.25;
|
|
92073
|
+
var REPAY_SHARE_OF_INTEREST = 0.1;
|
|
92074
|
+
var CLAIM_FEE_PERCENT_OF_COLLATERAL = 0.1;
|
|
92075
|
+
var DAY6 = 86400;
|
|
92076
|
+
var isNum8 = (v) => typeof v === "number" && Number.isFinite(v);
|
|
92077
|
+
function menuOf2(input) {
|
|
92078
|
+
if (!input.terms?.length) return void 0;
|
|
92079
|
+
return input.terms.map((t) => ({
|
|
92080
|
+
...t,
|
|
92081
|
+
durationSecs: isNum8(t.durationSecs) ? t.durationSecs : Math.round(t.durationDays * DAY6)
|
|
92082
|
+
}));
|
|
92083
|
+
}
|
|
92084
|
+
function build8(input) {
|
|
92085
|
+
const pair = jupiterOfferbookMarketFromKey(input.lender);
|
|
92086
|
+
const cfg = input.config?.["0"];
|
|
92087
|
+
const address = input.asset?.address ?? input.underlying;
|
|
92088
|
+
const menu = menuOf2(input);
|
|
92089
|
+
const durations = (menu ?? []).map((t) => t.durationSecs).filter(isNum8);
|
|
92090
|
+
const tenor = durations.length ? {
|
|
92091
|
+
minDurationSecs: Math.min(...durations),
|
|
92092
|
+
maxDurationSecs: Math.max(...durations)
|
|
92093
|
+
} : { minDurationSecs: DAY6, maxDurationSecs: 30 * DAY6 };
|
|
92094
|
+
const isLoanLeg = cfg?.debtDisabled === false || input.rateModel === "fixedTerm" || !!input.terms?.length;
|
|
92095
|
+
const fixedRate = {
|
|
92096
|
+
kind: "fixed-term",
|
|
92097
|
+
source: "orderbook",
|
|
92098
|
+
isLocked: true,
|
|
92099
|
+
compounding: "none",
|
|
92100
|
+
...menu ? { menu } : {}
|
|
92101
|
+
};
|
|
92102
|
+
const claimFee = {
|
|
92103
|
+
id: "claim",
|
|
92104
|
+
label: "Collateral claim fee",
|
|
92105
|
+
when: "late",
|
|
92106
|
+
unit: "percent",
|
|
92107
|
+
basis: "collateral",
|
|
92108
|
+
value: CLAIM_FEE_PERCENT_OF_COLLATERAL,
|
|
92109
|
+
payee: "protocol",
|
|
92110
|
+
mutable: true,
|
|
92111
|
+
description: "Deducted from the collateral a lender claims after a default (none on NFT collateral)."
|
|
92112
|
+
};
|
|
92113
|
+
const originationFee = {
|
|
92114
|
+
id: "origination",
|
|
92115
|
+
label: "Origination fee (share of interest)",
|
|
92116
|
+
when: "entry",
|
|
92117
|
+
unit: "percent",
|
|
92118
|
+
basis: "yield",
|
|
92119
|
+
value: ORIGINATION_SHARE_OF_INTEREST * 100,
|
|
92120
|
+
payee: "protocol",
|
|
92121
|
+
mutable: true,
|
|
92122
|
+
description: "25 % of the FULL term's interest, paid by the borrower when the loan opens and on every extension. Already included in the row's borrow rate (offer rate \xD7 1.25)."
|
|
92123
|
+
};
|
|
92124
|
+
const repayFee = {
|
|
92125
|
+
id: "performance",
|
|
92126
|
+
label: "Repay fee (share of interest)",
|
|
92127
|
+
when: "exit",
|
|
92128
|
+
unit: "percent",
|
|
92129
|
+
basis: "yield",
|
|
92130
|
+
value: REPAY_SHARE_OF_INTEREST * 100,
|
|
92131
|
+
payee: "protocol",
|
|
92132
|
+
mutable: true,
|
|
92133
|
+
description: "10 % of the interest, taken from the lender's return at repayment. Already netted out of the row's supply rate (offer rate \xD7 0.9)."
|
|
92134
|
+
};
|
|
92135
|
+
return {
|
|
92136
|
+
...address ? { asset: { address: String(address) } } : {},
|
|
92137
|
+
// Not a coverage hole: Offerbook genuinely has no price input.
|
|
92138
|
+
oracle: { kind: "none" },
|
|
92139
|
+
utilization: null,
|
|
92140
|
+
supply: isLoanLeg ? {
|
|
92141
|
+
// Taking a borrower's resting offer: a fixed rate for its term.
|
|
92142
|
+
rate: fixedRate,
|
|
92143
|
+
maturity: {
|
|
92144
|
+
kind: "rolling-duration",
|
|
92145
|
+
...tenor,
|
|
92146
|
+
atMaturity: "default-seizure"
|
|
92147
|
+
},
|
|
92148
|
+
exit: {
|
|
92149
|
+
// locked until the borrower repays or the lender claims
|
|
92150
|
+
mode: "at-maturity",
|
|
92151
|
+
settlement: "async",
|
|
92152
|
+
partialAllowed: false,
|
|
92153
|
+
fees: [repayFee]
|
|
92154
|
+
},
|
|
92155
|
+
counterparty: { kind: "peer", solvency: "overcollateralized" },
|
|
92156
|
+
principal: {
|
|
92157
|
+
protected: false,
|
|
92158
|
+
// a default pays out in the collateral itself, worth what it is worth then
|
|
92159
|
+
risks: ["collateral-delivery", "counterparty"]
|
|
92160
|
+
},
|
|
92161
|
+
fees: [repayFee, claimFee],
|
|
92162
|
+
ext: {
|
|
92163
|
+
jupiterOfferbook: {
|
|
92164
|
+
takeSide: "The row's supply rate is the richest BORROWER offer a lender can fill now, net of the repay fee \u2014 earn by filling an offer, like a market order",
|
|
92165
|
+
exitBeforeMaturity: "none",
|
|
92166
|
+
defaultPayout: "the whole collateral, claimed by the lender after maturity (0.1 % fee); never sold for USDC"
|
|
92167
|
+
}
|
|
92168
|
+
}
|
|
92169
|
+
} : {},
|
|
92170
|
+
borrow: {
|
|
92171
|
+
rate: fixedRate,
|
|
92172
|
+
maturity: {
|
|
92173
|
+
kind: "rolling-duration",
|
|
92174
|
+
...tenor,
|
|
92175
|
+
atMaturity: "default-seizure"
|
|
92176
|
+
},
|
|
92177
|
+
debtShape: "static-face",
|
|
92178
|
+
exit: {
|
|
92179
|
+
// the full term's interest is owed however early the loan is repaid
|
|
92180
|
+
earlyRepay: "penalty",
|
|
92181
|
+
atMaturityCost: "face",
|
|
92182
|
+
lateBehaviour: "default-seizure",
|
|
92183
|
+
partialAllowed: true
|
|
92184
|
+
},
|
|
92185
|
+
liquidation: {
|
|
92186
|
+
model: "default-seizure",
|
|
92187
|
+
absorber: "lenders",
|
|
92188
|
+
reversible: false,
|
|
92189
|
+
trigger: "time",
|
|
92190
|
+
seizure: "full-collateral",
|
|
92191
|
+
// the claim is manual — the borrower can repay until the lender signs it, but nothing guarantees a window
|
|
92192
|
+
gracePeriodSecs: 0,
|
|
92193
|
+
penalty: null,
|
|
92194
|
+
badDebt: "unknown"
|
|
92195
|
+
},
|
|
92196
|
+
counterparty: { kind: "peer", solvency: "overcollateralized" },
|
|
92197
|
+
fees: [originationFee],
|
|
92198
|
+
ext: {
|
|
92199
|
+
jupiterOfferbook: {
|
|
92200
|
+
noPriceLiquidation: true,
|
|
92201
|
+
fullTermInterestOnEarlyRepay: true,
|
|
92202
|
+
ltvFloatsWithPrice: "an offer fixes collateral per USDC; the row's LTV is the best offer's at today's price",
|
|
92203
|
+
extension: "only where the lender allowed it: pay the interest so far (at least 30 % of the period) plus a new origination fee, and the term restarts"
|
|
92204
|
+
}
|
|
92205
|
+
}
|
|
92206
|
+
},
|
|
92207
|
+
constraints: {
|
|
92208
|
+
crossMargin: false,
|
|
92209
|
+
positionModel: "loan-id",
|
|
92210
|
+
positionIdMeaning: "The Loan account pubkey \u2014 one per filled offer, one collateral against USDC, its own maturity."
|
|
92211
|
+
},
|
|
92212
|
+
ext: {
|
|
92213
|
+
jupiterOfferbook: {
|
|
92214
|
+
program: OFFERBOOK_PROGRAM_ID,
|
|
92215
|
+
...pair ? { pair } : {},
|
|
92216
|
+
marketUidRef: "mint"
|
|
92217
|
+
}
|
|
92218
|
+
},
|
|
92219
|
+
coverage: {
|
|
92220
|
+
pending: {
|
|
92221
|
+
"borrow.rate.menu.ltv": "each offer's LTV, maker and escrow-capped size are on the venue slot (`params.offerbookMarket`), not on the row's `terms`",
|
|
92222
|
+
"governance.controller": "program upgrade authority GpYnS3dPdR4Abj6pf3XbtU2kC8kgN6Lz5y6CuyFt4N79; reported as a multisig with an 8 h timelock \u2014 not verified"
|
|
92223
|
+
},
|
|
92224
|
+
notApplicable: {
|
|
92225
|
+
utilization: "order book \u2014 no pool utilization",
|
|
92226
|
+
oracle: "no oracle: loans are time-based, never priced on-chain"
|
|
92227
|
+
}
|
|
92228
|
+
}
|
|
92229
|
+
};
|
|
92230
|
+
}
|
|
92231
|
+
var jupiterOfferbookAdapter = {
|
|
92232
|
+
id: "jupiter-offerbook",
|
|
92233
|
+
matches: isJupiterOfferbook,
|
|
92234
|
+
profileId: () => JUPITER_OFFERBOOK_PROFILE_ID,
|
|
92235
|
+
build: build8
|
|
92236
|
+
};
|
|
91775
92237
|
|
|
91776
92238
|
// src/terms/adapters/index.ts
|
|
91777
92239
|
var TERM_ADAPTERS = [
|
|
@@ -91805,7 +92267,10 @@ var TERM_ADAPTERS = [
|
|
|
91805
92267
|
jupiterLendAdapter,
|
|
91806
92268
|
saveAdapter,
|
|
91807
92269
|
loopscaleAdapter,
|
|
91808
|
-
project0Adapter
|
|
92270
|
+
project0Adapter,
|
|
92271
|
+
zodialAdapter,
|
|
92272
|
+
defiTunaAdapter,
|
|
92273
|
+
jupiterOfferbookAdapter
|
|
91809
92274
|
];
|
|
91810
92275
|
function resolveAdapter(lender) {
|
|
91811
92276
|
return TERM_ADAPTERS.find((a) => a.matches(lender));
|
|
@@ -92822,7 +93287,13 @@ function svmEarnBuildability(venue, brand, ref) {
|
|
|
92822
93287
|
if (!venue.startsWith("vault.")) {
|
|
92823
93288
|
if (isLoopscale(venue))
|
|
92824
93289
|
return { ok: false, reason: LOOPSCALE_LENDING_REASON };
|
|
92825
|
-
if (
|
|
93290
|
+
if (isJupiterOfferbook(venue))
|
|
93291
|
+
return {
|
|
93292
|
+
ok: false,
|
|
93293
|
+
reason: "Filling a Jupiter Offerbook offer is not built in this API yet \u2014 the live book is at /v1/data/lending/book"
|
|
93294
|
+
};
|
|
93295
|
+
if (isKamino(venue) || isJupiterLend(venue) || isSave(venue) || isProject0(venue) || isZodial(venue) || // supply-only vaults: deposit / withdraw are exactly what is built
|
|
93296
|
+
isDefituna(venue))
|
|
92826
93297
|
return { ok: true, key: "lending", builder: LENDING };
|
|
92827
93298
|
return { ok: false, reason: "No Solana builder for this lender yet" };
|
|
92828
93299
|
}
|