@1delta/margin-fetcher 5.0.15 → 5.0.17
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 +52 -7
- package/dist/index.js +119 -51
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -3735,6 +3735,16 @@ interface LlamaLendMarketRaw {
|
|
|
3735
3735
|
* converting anyone's collateral.
|
|
3736
3736
|
*/
|
|
3737
3737
|
activeBand: number | null;
|
|
3738
|
+
/**
|
|
3739
|
+
* Assets per 1e18 vault shares — the multiplier that turns a lender's share
|
|
3740
|
+
* balance into an amount of the borrowed token.
|
|
3741
|
+
*
|
|
3742
|
+
* Read once per market rather than per user. It is NOT ~1.0: `DEAD_SHARES`
|
|
3743
|
+
* puts LlamaLend vault shares roughly 1000x the asset scale, so it reads
|
|
3744
|
+
* around 1e-3. A consumer that treats a share balance as an amount overstates
|
|
3745
|
+
* a lender's position by three orders of magnitude.
|
|
3746
|
+
*/
|
|
3747
|
+
pricePerShare: number | null;
|
|
3738
3748
|
}
|
|
3739
3749
|
/** Raw public-data batch for one LlamaLend chain (both generations together). */
|
|
3740
3750
|
interface LlamaLendMarketsRaw {
|
|
@@ -3804,6 +3814,18 @@ interface LlamaLendPositionInfo {
|
|
|
3804
3814
|
* the position IS or HAS BEEN in soft liquidation.
|
|
3805
3815
|
*/
|
|
3806
3816
|
bandCollateralInBorrowed: string;
|
|
3817
|
+
/**
|
|
3818
|
+
* The user's SUPPLY position on this market, in the borrowed token — vault
|
|
3819
|
+
* shares plus gauge-staked shares, converted to assets.
|
|
3820
|
+
*
|
|
3821
|
+
* Separate from the row's `deposits`, which sums this with
|
|
3822
|
+
* `bandCollateralInBorrowed`. Only this part earns the vault's lend APR.
|
|
3823
|
+
*/
|
|
3824
|
+
lendAssets: string;
|
|
3825
|
+
/** Raw lend SHARES (vault + gauge). ~1000x the asset scale — never an amount. */
|
|
3826
|
+
lendShares: string;
|
|
3827
|
+
/** True when some or all of the lend shares are staked in the market's gauge. */
|
|
3828
|
+
lendStaked: boolean;
|
|
3807
3829
|
/** True when the LLAMMA currently holds a borrowed-token leg for this user. */
|
|
3808
3830
|
softLiquidating: boolean;
|
|
3809
3831
|
/**
|
|
@@ -3882,17 +3904,40 @@ declare const fetchUsddMarkets: typeof fetchDssMarkets;
|
|
|
3882
3904
|
declare const usddIlkBytes32: (ilk: string) => `0x${string}`;
|
|
3883
3905
|
|
|
3884
3906
|
/**
|
|
3885
|
-
* Synthesized per-ilk lender key, e.g. `
|
|
3907
|
+
* Synthesized per-ilk lender key, e.g. `SKY_1_ETH_A` / `USDD_1_WBTC_A`. The
|
|
3886
3908
|
* CHAIN ID is part of the key (Fluid/River convention) because two dss
|
|
3887
3909
|
* deployments — even of the same brand — are INDEPENDENT Maker stacks that
|
|
3888
3910
|
* could file the same ilk string.
|
|
3911
|
+
*
|
|
3912
|
+
* **`_` IS THE ONLY SEPARATOR — the ilk's own `-` is re-spelled to `_`.**
|
|
3913
|
+
* Maker ilks are the first market suffixes in the codebase that contain a
|
|
3914
|
+
* hyphen (`ETH-A`, `PSM-USDT-A`), and a key mixing both separators cannot
|
|
3915
|
+
* survive a round-trip through any case- or slug-mapping layer: a consumer
|
|
3916
|
+
* that lower-cases on `_` and restores on `-` cannot tell which dashes were
|
|
3917
|
+
* structure and which were payload. That is not hypothetical — it silently
|
|
3918
|
+
* resolved `sky-1-wbtc-a` to the wrong lender in the allocator UI. Keys are
|
|
3919
|
+
* therefore hyphen-free, and the real ilk is recovered by `dssKeyParts`.
|
|
3920
|
+
*
|
|
3921
|
+
* Safe because a Maker ilk never contains `_` (the on-chain convention is
|
|
3922
|
+
* `<GEM>-<CLASS>`), making `-` ⇄ `_` injective over the roster; the metadata
|
|
3923
|
+
* generators reject an ilk carrying `_` so that stays true.
|
|
3889
3924
|
*/
|
|
3890
3925
|
declare function dssLenderKey(lender: string, chainId: string | number, ilk: string): string;
|
|
3891
|
-
/**
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3926
|
+
/** Ilk → key segment: `WBTC-A` → `WBTC_A`. */
|
|
3927
|
+
declare const ilkToKeySegment: (ilk: string) => string;
|
|
3928
|
+
/** Key segment → ilk: `WBTC_A` → `WBTC-A`. Inverse of the above. */
|
|
3929
|
+
declare const keySegmentToIlk: (seg: string) => string;
|
|
3930
|
+
/**
|
|
3931
|
+
* Recover `{ lender, chainId, ilk }` from a per-market key (or undefined),
|
|
3932
|
+
* with the ilk in its true on-chain spelling (`WBTC_A` → `WBTC-A`).
|
|
3933
|
+
*
|
|
3934
|
+
* **Tolerant on input, canonical on output.** The canonical key is
|
|
3935
|
+
* hyphen-free (see `dssLenderKey`), but this also accepts the legacy
|
|
3936
|
+
* hyphenated form `SKY_1_WBTC-A` and any mixture, because those keys were
|
|
3937
|
+
* already emitted into caller databases and bookmarks. Both spellings map to
|
|
3938
|
+
* the same ilk, so a stale link keeps resolving instead of falling through to
|
|
3939
|
+
* "unknown lender". The leading `\d+_` disambiguates from the bare
|
|
3940
|
+
* `SKY` / `USDD` key.
|
|
3896
3941
|
*/
|
|
3897
3942
|
declare function dssKeyParts(key: string): {
|
|
3898
3943
|
lender: string;
|
|
@@ -10043,4 +10088,4 @@ interface TermAdapter {
|
|
|
10043
10088
|
declare const TERM_ADAPTERS: TermAdapter[];
|
|
10044
10089
|
declare function resolveAdapter(lender: string): TermAdapter | undefined;
|
|
10045
10090
|
|
|
10046
|
-
export { type AaveMetadata, type AaveV2Public, type AaveV2UserReserveResponse, type AaveV3Public, type AaveV3UserReserveResponse, type AdditionalYields, type AdminKind, ApiBookSource, type AprData, type AprPercent, type AssetQuality, type AssetRiskIndex, type AuctionWindow, type AvailabilityTerms, type BalanceData, type BaseLendingPosition, type BasicReserveResponse, type BorrowExitTerms, type BorrowTermSheet, type BuildTermSheetOptions, type ChainDiagnostic, type ChainLinkResponse, type ChainQuery, type ChainSummary, type CompoundV2Metadata, type CompoundV3Public, type CompoundV3UserReserveResponse, type ConfigEntry, type ConvertLenderUserDataOptions, type CoreValidators, type CounterpartyTerms, type CoverageInfo, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, type DeepPartial, type Denomination, type DepthMap, type DssMarketRaw, type DssMarketsRaw, type DssPositionInfo, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, EXACTLY_LENDER_KEY, type EndpointFailure, type EnrichmentIndex, type EulerEarnVault, type EulerEarnVaults, type EulerV2Metadata, type ExactlyFixedPool, type ExactlyFixedPosition, type ExactlyMarketAccount, type ExactlyMarketsRaw, type ExactlyUserFixedPosition, type ExposureEntry, type ExposureTerms, type ExtraValidationCall, type FeeTerm, type FeeWhen, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, type FrankencoinMarketRaw, type FrankencoinMarketsRaw, type FrankencoinPositionInfo, type FullLenderRewardsMap, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, type GenericCurrency, type GenericTokenList, type GetVaultPublicDataAllOptions, type GmxExecutionFees, type GmxPendingDeposit, type GmxPendingWithdrawal, type GmxReadContracts, type GmxUserBalance, type GmxUserPositions, type GmxUserPositionsOptions, type GmxVault, type GmxVaultKind, type GmxVaults, type GmxVaultsFetchOptions, type GovernancePower, type GovernanceRow, type GovernanceTerms, type GroupAccumulator, HYPERCORE_VAULT_REGISTRY, type HypercoreLockStatus, type HypercoreUserPositionsOptions, type HypercoreVault, type HypercoreVaultPosition, type HypercoreVaultRegistryEntry, type HypercoreVaults, type HypercoreVaultsFetchOptions, IDLE_MARKET_ID, INTERFACE_IDS, type IncompleteLenderRead, type IncompleteReason, type InitMetadata, type InitPublic, type InitUserReserveResponse, type InterfaceKind, type InvariantViolation, type InverseMarketRaw, type InverseMarketsRaw, type InversePositionInfo, LAGOON_API_URL, LAGOON_CHAIN_IDS, type LagoonApiVault, type LagoonSyncMode, type LagoonVault, type LagoonVaults, type LenderAssetReward, type LenderConfigData, type LenderConfigMap, type LenderCrossPoolMeta, type LenderData, type LenderDataEntry, type LenderInfo, type LenderInfoMap, type LenderPublicBase, type LenderRewardsMap, type LenderSummary, type LenderToLenderCrossPoolMeta, type LenderTotalAmounts, type LenderUserQuery, type LenderUserResponse, type LenderYieldComplete, type LenderYields$1 as LenderYields, LendingMode, type LiquidationPenaltyTerm, type LiquidationTerms, type LiquityBranchRaw, type LiquityDiscoveredTrove, type LiquityDiscovery, type LiquityMarketsRaw, type LiquitySpInfo, type LiquityTroveInfo, type ListaMarketOverrides, type LlamaLendMarketOverride, type LlamaLendMarketOverrides, type LlamaLendMarketRaw, type LlamaLendMarketsRaw, type LlamaLendPositionInfo, type LoopPostTradeMetrics, type LstDelegation, type LstDelegationKind, type LstValidator, type LstWithdrawalFetchOptions, type LstWithdrawalRegistryEntry, type LstWithdrawalRequest, type LstWithdrawalRequestsByLst, type LstWithdrawalStatus, MORPHO_LENS, MULTICALL_FAILURE, type MaturityTerms, MaxParamThresholds, type MergedUserData, type MidnightBook, type MidnightBookLevel, type MidnightBookSource, type ModeBase, type ModeVariant, type MorphoMarketOverrides, type MorphoSubgraphProxyConfig, type MorphoUserMarketBalance, type MorphoUserReserveResponse, type MorphoVault, type MorphoVaults, type MulticallEndpointOptions, type MulticallRpcBatch, type NumberMap, type Open, type OracleBand, type OracleDiagnostics, type OraclePriceEntry, type OraclePricesResult, type OracleRiskRow, type OracleTerms, type OutlierGuardConfig, type ParsedBalanceData, type ParsedResponse, type ParsedUserBalance, type PermissionKind, type PermissionParams, type PoolData, type PoolWithMeta, type PortfolioSummary, type PortfolioTotals, type PositionConstraints, type PostTradeMetrics, type PreparedCall, type PreparedMergedMulticallParams, type PreparedMergedRpcCalls, type PreparedTokenBalanceRpcCalls, type PreparedUserDataRpcCalls, type PriceDerivation, type PriceSelection, type ProtocolParams, type ProviderOptions, type RateKind, type RateMenuEntry, type RateTerms, type RawRpcBatch, type RawRpcCall, type RawRpcResponse, type ReadFailurePolicy, type RedemptionTerms, type ResupplyMarketsRaw, type ResupplyPairIdentity, type ResupplyPairRaw, type ResupplyPositionInfo, type ResupplyWrappedMarket, type RewardSourceRef, type RewardStream, type RewardTerm, type RewardTokenRef, type RiverMarketRaw, type RiverMarketsRaw, type RiverPositionInfo, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, type SelectPricesOptions, type Severity, type SeverityFinding, type SiloVault, type SiloVaults, type StCeloValidatorGroup, type StaleFeedEntry, type StampOptions, type StructuredOraclePrices, type SubAccountSummary, type SumerPositionInput, type SummaryAprData, type SummaryBalanceData, type SupplyExitMode, type SupplyExitTerms, type SupplyTermSheet, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, type TellerDiscoveredBid, type TellerDiscovery, type TellerMarketsRaw, type TellerPoolRaw, type TermAdapter, type TermAssetRef, type TermAuctionOrder, type TermAuctionOrders, type TermBookSource, type TermBookTop, type TermInfo, type TermListing, type TermMarketRaw, TermMaxApiSource, type TermMaxBookTop, type TermMaxCurveSegment, type TermMaxDataSource, type TermMaxDiscovery, type TermMaxFeeConfig, type TermMaxMarketConfig, type TermMaxMarketRaw, type TermMaxOrderState, type TermProfile, type TermSheet, type TermSheetDigest, type TermSheetInput, type TermSheetViolation, TermSubgraphSource, type TermTag, type TokenApprovalMeta, type TokenApprovalParams, type TokenBalanceEntry, type TokenBalanceQuery, type TokenBalanceResult, type TokenEntry, type TokenList, type TokenListInput, type TrackerDiagnostic, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, type USDPriceMap, type UpshiftApiAsset, type UpshiftApiVault, type UpshiftVault, type UpshiftVaults, type UsddMarketRaw, type UsddMarketsRaw, type DssPositionInfo as UsddPositionInfo, type UserApr, type UserConfig, type UserData, type UserDataResult, type UserLendingPosition, type UtilizationTerms, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, type ValidationResult, type VaultAprResult, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultPublicDataAll, type VaultPublicDataResult, type VaultYieldSeries, type VaultYieldSnapshot, type YDaemonVault, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, type YearnVault, type YearnVaultKind, type YearnVaults, type YieldProfile, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
|
10091
|
+
export { type AaveMetadata, type AaveV2Public, type AaveV2UserReserveResponse, type AaveV3Public, type AaveV3UserReserveResponse, type AdditionalYields, type AdminKind, ApiBookSource, type AprData, type AprPercent, type AssetQuality, type AssetRiskIndex, type AuctionWindow, type AvailabilityTerms, type BalanceData, type BaseLendingPosition, type BasicReserveResponse, type BorrowExitTerms, type BorrowTermSheet, type BuildTermSheetOptions, type ChainDiagnostic, type ChainLinkResponse, type ChainQuery, type ChainSummary, type CompoundV2Metadata, type CompoundV3Public, type CompoundV3UserReserveResponse, type ConfigEntry, type ConvertLenderUserDataOptions, type CoreValidators, type CounterpartyTerms, type CoverageInfo, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, type DeepPartial, type Denomination, type DepthMap, type DssMarketRaw, type DssMarketsRaw, type DssPositionInfo, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, EXACTLY_LENDER_KEY, type EndpointFailure, type EnrichmentIndex, type EulerEarnVault, type EulerEarnVaults, type EulerV2Metadata, type ExactlyFixedPool, type ExactlyFixedPosition, type ExactlyMarketAccount, type ExactlyMarketsRaw, type ExactlyUserFixedPosition, type ExposureEntry, type ExposureTerms, type ExtraValidationCall, type FeeTerm, type FeeWhen, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, type FrankencoinMarketRaw, type FrankencoinMarketsRaw, type FrankencoinPositionInfo, type FullLenderRewardsMap, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, type GenericCurrency, type GenericTokenList, type GetVaultPublicDataAllOptions, type GmxExecutionFees, type GmxPendingDeposit, type GmxPendingWithdrawal, type GmxReadContracts, type GmxUserBalance, type GmxUserPositions, type GmxUserPositionsOptions, type GmxVault, type GmxVaultKind, type GmxVaults, type GmxVaultsFetchOptions, type GovernancePower, type GovernanceRow, type GovernanceTerms, type GroupAccumulator, HYPERCORE_VAULT_REGISTRY, type HypercoreLockStatus, type HypercoreUserPositionsOptions, type HypercoreVault, type HypercoreVaultPosition, type HypercoreVaultRegistryEntry, type HypercoreVaults, type HypercoreVaultsFetchOptions, IDLE_MARKET_ID, INTERFACE_IDS, type IncompleteLenderRead, type IncompleteReason, type InitMetadata, type InitPublic, type InitUserReserveResponse, type InterfaceKind, type InvariantViolation, type InverseMarketRaw, type InverseMarketsRaw, type InversePositionInfo, LAGOON_API_URL, LAGOON_CHAIN_IDS, type LagoonApiVault, type LagoonSyncMode, type LagoonVault, type LagoonVaults, type LenderAssetReward, type LenderConfigData, type LenderConfigMap, type LenderCrossPoolMeta, type LenderData, type LenderDataEntry, type LenderInfo, type LenderInfoMap, type LenderPublicBase, type LenderRewardsMap, type LenderSummary, type LenderToLenderCrossPoolMeta, type LenderTotalAmounts, type LenderUserQuery, type LenderUserResponse, type LenderYieldComplete, type LenderYields$1 as LenderYields, LendingMode, type LiquidationPenaltyTerm, type LiquidationTerms, type LiquityBranchRaw, type LiquityDiscoveredTrove, type LiquityDiscovery, type LiquityMarketsRaw, type LiquitySpInfo, type LiquityTroveInfo, type ListaMarketOverrides, type LlamaLendMarketOverride, type LlamaLendMarketOverrides, type LlamaLendMarketRaw, type LlamaLendMarketsRaw, type LlamaLendPositionInfo, type LoopPostTradeMetrics, type LstDelegation, type LstDelegationKind, type LstValidator, type LstWithdrawalFetchOptions, type LstWithdrawalRegistryEntry, type LstWithdrawalRequest, type LstWithdrawalRequestsByLst, type LstWithdrawalStatus, MORPHO_LENS, MULTICALL_FAILURE, type MaturityTerms, MaxParamThresholds, type MergedUserData, type MidnightBook, type MidnightBookLevel, type MidnightBookSource, type ModeBase, type ModeVariant, type MorphoMarketOverrides, type MorphoSubgraphProxyConfig, type MorphoUserMarketBalance, type MorphoUserReserveResponse, type MorphoVault, type MorphoVaults, type MulticallEndpointOptions, type MulticallRpcBatch, type NumberMap, type Open, type OracleBand, type OracleDiagnostics, type OraclePriceEntry, type OraclePricesResult, type OracleRiskRow, type OracleTerms, type OutlierGuardConfig, type ParsedBalanceData, type ParsedResponse, type ParsedUserBalance, type PermissionKind, type PermissionParams, type PoolData, type PoolWithMeta, type PortfolioSummary, type PortfolioTotals, type PositionConstraints, type PostTradeMetrics, type PreparedCall, type PreparedMergedMulticallParams, type PreparedMergedRpcCalls, type PreparedTokenBalanceRpcCalls, type PreparedUserDataRpcCalls, type PriceDerivation, type PriceSelection, type ProtocolParams, type ProviderOptions, type RateKind, type RateMenuEntry, type RateTerms, type RawRpcBatch, type RawRpcCall, type RawRpcResponse, type ReadFailurePolicy, type RedemptionTerms, type ResupplyMarketsRaw, type ResupplyPairIdentity, type ResupplyPairRaw, type ResupplyPositionInfo, type ResupplyWrappedMarket, type RewardSourceRef, type RewardStream, type RewardTerm, type RewardTokenRef, type RiverMarketRaw, type RiverMarketsRaw, type RiverPositionInfo, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, type SelectPricesOptions, type Severity, type SeverityFinding, type SiloVault, type SiloVaults, type StCeloValidatorGroup, type StaleFeedEntry, type StampOptions, type StructuredOraclePrices, type SubAccountSummary, type SumerPositionInput, type SummaryAprData, type SummaryBalanceData, type SupplyExitMode, type SupplyExitTerms, type SupplyTermSheet, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, type TellerDiscoveredBid, type TellerDiscovery, type TellerMarketsRaw, type TellerPoolRaw, type TermAdapter, type TermAssetRef, type TermAuctionOrder, type TermAuctionOrders, type TermBookSource, type TermBookTop, type TermInfo, type TermListing, type TermMarketRaw, TermMaxApiSource, type TermMaxBookTop, type TermMaxCurveSegment, type TermMaxDataSource, type TermMaxDiscovery, type TermMaxFeeConfig, type TermMaxMarketConfig, type TermMaxMarketRaw, type TermMaxOrderState, type TermProfile, type TermSheet, type TermSheetDigest, type TermSheetInput, type TermSheetViolation, TermSubgraphSource, type TermTag, type TokenApprovalMeta, type TokenApprovalParams, type TokenBalanceEntry, type TokenBalanceQuery, type TokenBalanceResult, type TokenEntry, type TokenList, type TokenListInput, type TrackerDiagnostic, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, type USDPriceMap, type UpshiftApiAsset, type UpshiftApiVault, type UpshiftVault, type UpshiftVaults, type UsddMarketRaw, type UsddMarketsRaw, type DssPositionInfo as UsddPositionInfo, type UserApr, type UserConfig, type UserData, type UserDataResult, type UserLendingPosition, type UtilizationTerms, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, type ValidationResult, type VaultAprResult, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultPublicDataAll, type VaultPublicDataResult, type VaultYieldSeries, type VaultYieldSnapshot, type YDaemonVault, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, type YearnVault, type YearnVaultKind, type YearnVaults, type YieldProfile, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
package/dist/index.js
CHANGED
|
@@ -17642,7 +17642,16 @@ function buildEModes(borrowVaults, cluster) {
|
|
|
17642
17642
|
}
|
|
17643
17643
|
return eModes;
|
|
17644
17644
|
}
|
|
17645
|
+
var OP_DEPOSIT = 1 << 0;
|
|
17646
|
+
var OP_MINT = 1 << 1;
|
|
17647
|
+
var OP_BORROW = 1 << 6;
|
|
17648
|
+
function isOperationDisabled(info, operation) {
|
|
17649
|
+
const hookedOps = Number(info.hookedOperations ?? 0n);
|
|
17650
|
+
return (hookedOps & operation) !== 0 && info.hookTarget.toLowerCase() === zeroAddress;
|
|
17651
|
+
}
|
|
17645
17652
|
function buildMetadata(info) {
|
|
17653
|
+
const hookedOperations = Number(info.hookedOperations ?? 0n);
|
|
17654
|
+
const hookTarget = info.hookTarget.toLowerCase();
|
|
17646
17655
|
return {
|
|
17647
17656
|
vault: info.vault.toLowerCase(),
|
|
17648
17657
|
dToken: info.dToken.toLowerCase(),
|
|
@@ -17650,7 +17659,9 @@ function buildMetadata(info) {
|
|
|
17650
17659
|
interestRateModel: info.interestRateModel.toLowerCase(),
|
|
17651
17660
|
unitOfAccount: info.unitOfAccount.toLowerCase(),
|
|
17652
17661
|
evc: info.evc.toLowerCase(),
|
|
17653
|
-
governorAdmin: info.governorAdmin.toLowerCase()
|
|
17662
|
+
governorAdmin: info.governorAdmin.toLowerCase(),
|
|
17663
|
+
...hookedOperations !== 0 ? { hookedOperations } : {},
|
|
17664
|
+
...hookTarget !== zeroAddress ? { hookTarget } : {}
|
|
17654
17665
|
};
|
|
17655
17666
|
}
|
|
17656
17667
|
function buildTokenEntry(info, config, collateralActive, borrowVaults, opts) {
|
|
@@ -17707,13 +17718,32 @@ function buildTokenEntry(info, config, collateralActive, borrowVaults, opts) {
|
|
|
17707
17718
|
lastUpdateTimestamp: Number(info.timestamp),
|
|
17708
17719
|
config,
|
|
17709
17720
|
collateralActive,
|
|
17710
|
-
|
|
17711
|
-
|
|
17721
|
+
// A governor can switch either side of a vault off through the hook system
|
|
17722
|
+
// without ever touching the caps, so these flags are read from
|
|
17723
|
+
// `hookedOperations`/`hookTarget` rather than assumed. A vault that takes no
|
|
17724
|
+
// deposits is not a collateral candidate and must not rank as one, however
|
|
17725
|
+
// attractive its rate — `maxDeposit`/`maxMint` return 0 for it on-chain.
|
|
17726
|
+
borrowingEnabled: isBorrowVault && !isOperationDisabled(info, OP_BORROW),
|
|
17727
|
+
// Gated on OP_DEPOSIT alone, not on `OP_DEPOSIT || OP_MINT`: every supply
|
|
17728
|
+
// route we encode calls `deposit`, so a vault that disabled only that leg is
|
|
17729
|
+
// unusable to us even while share-minting stays open.
|
|
17730
|
+
depositsEnabled: !isOperationDisabled(info, OP_DEPOSIT),
|
|
17712
17731
|
hasStable: false,
|
|
17713
17732
|
isActive: true,
|
|
17714
|
-
|
|
17733
|
+
// Supply AND borrow both off is the closest EVK analogue of an Aave-style
|
|
17734
|
+
// freeze: the vault still prices and still lets existing positions unwind.
|
|
17735
|
+
isFrozen: isOperationDisabled(info, OP_DEPOSIT) && isOperationDisabled(info, OP_MINT) && isOperationDisabled(info, OP_BORROW),
|
|
17715
17736
|
borrowCap: toTokenAmount(info.borrowCap, info.assetDecimals),
|
|
17716
|
-
|
|
17737
|
+
// Supply switched off reports as ZERO CAPACITY, not merely as a false flag.
|
|
17738
|
+
// Consumers that rank markets (the pair book) can only compare capacity
|
|
17739
|
+
// across lenders — `depositsEnabled` means different things per provider
|
|
17740
|
+
// (Gearbox marks collateral-only tokens false because they have no lend
|
|
17741
|
+
// side, while they remain perfectly good collateral), so it cannot be a
|
|
17742
|
+
// cross-lender gate. Capacity can, and 0 is exactly what the vault's own
|
|
17743
|
+
// `maxDeposit`/`maxMint` return here. Note this is already the shape Euler
|
|
17744
|
+
// itself emits for a cap-disabled vault: `caps() = (1, …)` resolves to a
|
|
17745
|
+
// supply cap of 0.
|
|
17746
|
+
supplyCap: isOperationDisabled(info, OP_DEPOSIT) ? 0 : toTokenAmount(info.supplyCap, info.assetDecimals),
|
|
17717
17747
|
debtCeiling: 0,
|
|
17718
17748
|
eMode: selfEMode,
|
|
17719
17749
|
decimals: Number(info.assetDecimals),
|
|
@@ -22978,7 +23008,6 @@ function num(api, key2) {
|
|
|
22978
23008
|
const v = api?.[key2];
|
|
22979
23009
|
return typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
22980
23010
|
}
|
|
22981
|
-
var BANDS_ENDPOINTS = [4, 10, 20, 50];
|
|
22982
23011
|
var DEFAULT_BANDS = 10;
|
|
22983
23012
|
var LLAMALEND_READ_ABI = [
|
|
22984
23013
|
...LlamaLendControllerAbi,
|
|
@@ -22989,6 +23018,8 @@ var LLAMALEND_READ_ABI = [
|
|
|
22989
23018
|
...Erc20Abi
|
|
22990
23019
|
];
|
|
22991
23020
|
var ZERO = "0x0000000000000000000000000000000000000000";
|
|
23021
|
+
var WAD8 = 10n ** 18n;
|
|
23022
|
+
var CALLS_PER_MARKET = 6;
|
|
22992
23023
|
var fetchJson2 = async (url, timeoutMs = 8e3) => {
|
|
22993
23024
|
const res = await fetch(url, {
|
|
22994
23025
|
headers: { accept: "application/json" },
|
|
@@ -23005,25 +23036,12 @@ var toBig5 = (v) => {
|
|
|
23005
23036
|
};
|
|
23006
23037
|
var human = (v, decimals) => v === null ? null : Number(v) / 10 ** decimals;
|
|
23007
23038
|
var bandsFor = (m) => m.defaultBands && m.defaultBands >= 4 && m.defaultBands <= 50 ? m.defaultBands : DEFAULT_BANDS;
|
|
23008
|
-
var bandGrid = (m) => {
|
|
23009
|
-
const set = /* @__PURE__ */ new Set([...BANDS_ENDPOINTS, bandsFor(m)]);
|
|
23010
|
-
return [...set].sort((a, b) => a - b);
|
|
23011
|
-
};
|
|
23012
23039
|
var MIN_BANDS = 4;
|
|
23013
23040
|
var MAX_BANDS = 50;
|
|
23014
23041
|
var LTV_CURVE_BANDS = Array.from(
|
|
23015
23042
|
{ length: MAX_BANDS - MIN_BANDS + 1 },
|
|
23016
23043
|
(_3, i) => MIN_BANDS + i
|
|
23017
23044
|
);
|
|
23018
|
-
var maxBorrowableCall = (m, oneUnit, n) => m.version === 1 ? {
|
|
23019
|
-
address: m.controller,
|
|
23020
|
-
name: "max_borrowable",
|
|
23021
|
-
params: [oneUnit, BigInt(n), 0n, ZERO]
|
|
23022
|
-
} : {
|
|
23023
|
-
address: m.controller,
|
|
23024
|
-
name: "max_borrowable",
|
|
23025
|
-
params: [oneUnit, BigInt(n), ZERO]
|
|
23026
|
-
};
|
|
23027
23045
|
var buildBandLtv = (market) => {
|
|
23028
23046
|
if (!market.ammA || !market.loanDiscount) return null;
|
|
23029
23047
|
try {
|
|
@@ -23044,8 +23062,6 @@ var buildBandLtv = (market) => {
|
|
|
23044
23062
|
};
|
|
23045
23063
|
async function fetchChainExtras(chainId, markets) {
|
|
23046
23064
|
const perMarketCalls = markets.map((m) => {
|
|
23047
|
-
const grid = bandGrid(m);
|
|
23048
|
-
const oneUnit = 10n ** BigInt(m.collateralDecimals);
|
|
23049
23065
|
const calls = [
|
|
23050
23066
|
{ address: m.amm, name: "price_oracle", params: [] },
|
|
23051
23067
|
{ address: m.amm, name: "active_band", params: [] },
|
|
@@ -23054,9 +23070,17 @@ async function fetchChainExtras(chainId, markets) {
|
|
|
23054
23070
|
// v1 controllers have no `borrow_cap`; allowFailure turns that into a
|
|
23055
23071
|
// null rather than sinking the whole batch.
|
|
23056
23072
|
{ address: m.controller, name: "borrow_cap", params: [] },
|
|
23057
|
-
|
|
23073
|
+
/**
|
|
23074
|
+
* Price per share, read ONCE PER MARKET rather than per user.
|
|
23075
|
+
*
|
|
23076
|
+
* Vault shares run ~1000x the asset scale (`DEAD_SHARES`), so a share
|
|
23077
|
+
* balance is never an amount — every consumer needs this multiplier to
|
|
23078
|
+
* turn a lender's holding into assets. Reading it here keeps the
|
|
23079
|
+
* per-user call to two plain `balanceOf`s.
|
|
23080
|
+
*/
|
|
23081
|
+
{ address: m.vault, name: "convertToAssets", params: [WAD8] }
|
|
23058
23082
|
];
|
|
23059
|
-
return { market: m,
|
|
23083
|
+
return { market: m, calls };
|
|
23060
23084
|
});
|
|
23061
23085
|
const flat = perMarketCalls.flatMap((x) => x.calls);
|
|
23062
23086
|
if (flat.length === 0) return {};
|
|
@@ -23077,13 +23101,14 @@ async function fetchChainExtras(chainId, markets) {
|
|
|
23077
23101
|
}
|
|
23078
23102
|
const out = {};
|
|
23079
23103
|
let cursor = 0;
|
|
23080
|
-
for (const { market
|
|
23104
|
+
for (const { market } of perMarketCalls) {
|
|
23081
23105
|
const priceRaw = toBig5(results[cursor]);
|
|
23082
23106
|
const activeBandRaw = toBig5(results[cursor + 1]);
|
|
23083
23107
|
const nLoansRaw = toBig5(results[cursor + 2]);
|
|
23084
23108
|
const maxDepositRaw = toBig5(results[cursor + 3]);
|
|
23085
23109
|
const borrowCapRaw = toBig5(results[cursor + 4]);
|
|
23086
|
-
|
|
23110
|
+
const pricePerShareRaw = toBig5(results[cursor + 5]);
|
|
23111
|
+
cursor += CALLS_PER_MARKET;
|
|
23087
23112
|
const collateralPrice = priceRaw === null ? null : Number(priceRaw) / 1e18;
|
|
23088
23113
|
const bandLtv = buildBandLtv(market);
|
|
23089
23114
|
const defaultN = String(bandsFor(market));
|
|
@@ -23094,7 +23119,11 @@ async function fetchChainExtras(chainId, markets) {
|
|
|
23094
23119
|
borrowCap: human(borrowCapRaw, market.borrowedDecimals),
|
|
23095
23120
|
maxDeposit: human(maxDepositRaw, market.borrowedDecimals),
|
|
23096
23121
|
nLoans: nLoansRaw === null ? null : Number(nLoansRaw),
|
|
23097
|
-
activeBand: activeBandRaw === null ? null : Number(activeBandRaw)
|
|
23122
|
+
activeBand: activeBandRaw === null ? null : Number(activeBandRaw),
|
|
23123
|
+
// Assets-per-WAD-shares. Kept as a ratio (not scaled to the borrowed
|
|
23124
|
+
// token's decimals) so a consumer multiplies a raw share balance by it
|
|
23125
|
+
// and divides by 1e18 exactly once.
|
|
23126
|
+
pricePerShare: pricePerShareRaw === null ? null : Number(pricePerShareRaw) / 1e18
|
|
23098
23127
|
};
|
|
23099
23128
|
}
|
|
23100
23129
|
return out;
|
|
@@ -23159,7 +23188,8 @@ async function fetchLlamaLendMarkets(lender, chainId) {
|
|
|
23159
23188
|
),
|
|
23160
23189
|
maxDeposit: ex?.maxDeposit ?? null,
|
|
23161
23190
|
nLoans: ex?.nLoans ?? null,
|
|
23162
|
-
activeBand: ex?.activeBand ?? null
|
|
23191
|
+
activeBand: ex?.activeBand ?? null,
|
|
23192
|
+
pricePerShare: ex?.pricePerShare ?? null
|
|
23163
23193
|
};
|
|
23164
23194
|
});
|
|
23165
23195
|
return { lender, config, chainData, markets: rows, source: "api" };
|
|
@@ -23219,7 +23249,8 @@ async function fetchLlamaLendMarkets(lender, chainId) {
|
|
|
23219
23249
|
),
|
|
23220
23250
|
maxDeposit: ex?.maxDeposit ?? null,
|
|
23221
23251
|
nLoans: ex?.nLoans ?? null,
|
|
23222
|
-
activeBand: ex?.activeBand ?? null
|
|
23252
|
+
activeBand: ex?.activeBand ?? null,
|
|
23253
|
+
pricePerShare: ex?.pricePerShare ?? null
|
|
23223
23254
|
};
|
|
23224
23255
|
});
|
|
23225
23256
|
return { lender, config, chainData, markets: rows, source: "chain" };
|
|
@@ -24411,6 +24442,13 @@ function convertLlamaLendMarketsToResponse(raw, chainId, prices = {}, additional
|
|
|
24411
24442
|
collateralPrice: m.collateralPrice !== null ? String(m.collateralPrice) : void 0,
|
|
24412
24443
|
/** v2 only; `0` means borrowing is switched off. */
|
|
24413
24444
|
borrowCap: m.borrowCap !== null ? String(m.borrowCap) : void 0,
|
|
24445
|
+
/**
|
|
24446
|
+
* Assets per 1e18 vault shares — what a lender's share balance is
|
|
24447
|
+
* worth. Published because the SUPPLY side of a LlamaLend market is
|
|
24448
|
+
* an ERC-4626 vault whose shares run ~1000x the asset scale, so a
|
|
24449
|
+
* raw balance is meaningless without it.
|
|
24450
|
+
*/
|
|
24451
|
+
pricePerShare: m.pricePerShare !== null ? String(m.pricePerShare) : void 0,
|
|
24414
24452
|
addresses: {
|
|
24415
24453
|
controller: market.controller,
|
|
24416
24454
|
vault: market.vault,
|
|
@@ -25096,18 +25134,20 @@ async function fetchDssMarkets(lender, chainId) {
|
|
|
25096
25134
|
var fetchUsddMarkets = fetchDssMarkets;
|
|
25097
25135
|
var usddIlkBytes32 = dssIlkBytes32;
|
|
25098
25136
|
function dssLenderKey(lender, chainId, ilk) {
|
|
25099
|
-
return `${lender}_${chainId}_${ilk}`;
|
|
25137
|
+
return `${lender}_${chainId}_${ilkToKeySegment(ilk)}`;
|
|
25100
25138
|
}
|
|
25139
|
+
var ilkToKeySegment = (ilk) => ilk.replace(/-/g, "_");
|
|
25140
|
+
var keySegmentToIlk = (seg) => seg.replace(/_/g, "-");
|
|
25101
25141
|
var DSS_KEY_PREFIXES = ["USDD", "SKY"];
|
|
25102
25142
|
var DSS_KEY_RE = new RegExp(
|
|
25103
|
-
`^(${DSS_KEY_PREFIXES.join("|")})_(\\d+)_([A-Z0-9][A-Z0-
|
|
25143
|
+
`^(${DSS_KEY_PREFIXES.join("|")})_(\\d+)_([A-Z0-9][A-Z0-9_-]*)$`
|
|
25104
25144
|
);
|
|
25105
25145
|
function dssKeyParts(key2) {
|
|
25106
25146
|
const m = key2.match(DSS_KEY_RE);
|
|
25107
25147
|
if (!m) return void 0;
|
|
25108
|
-
return { lender: m[1], chainId: m[2], ilk: m[3] };
|
|
25148
|
+
return { lender: m[1], chainId: m[2], ilk: keySegmentToIlk(m[3]) };
|
|
25109
25149
|
}
|
|
25110
|
-
var
|
|
25150
|
+
var WAD10 = 1e18;
|
|
25111
25151
|
var RAY4 = 1e27;
|
|
25112
25152
|
var RAD = 1e45;
|
|
25113
25153
|
var YEAR_SECONDS2 = 31536e3;
|
|
@@ -25151,7 +25191,7 @@ function convertDssMarketsToResponse(raw, chainId, prices = {}, _additionalYield
|
|
|
25151
25191
|
const totalColl = m.joinBalance !== null ? toHuman4(m.joinBalance, collDecimals) : 0;
|
|
25152
25192
|
const mat = m.mat !== null ? Number(m.mat) / RAY4 : Number(market.mat) / RAY4 || 1.5;
|
|
25153
25193
|
const ltv = mat > 0 ? 1 / mat : 0;
|
|
25154
|
-
const chop = market.chop ? Number(market.chop) /
|
|
25194
|
+
const chop = market.chop ? Number(market.chop) / WAD10 : 0;
|
|
25155
25195
|
const liqPenalty = chop > 1 ? chop - 1 : 0;
|
|
25156
25196
|
const duty = m.duty !== null ? m.duty : BigInt(market.duty ?? 0);
|
|
25157
25197
|
const borrowApr = duty > BigInt(1e27) ? Number(duty - BigInt(10) ** BigInt(27)) / RAY4 * YEAR_SECONDS2 * 100 : 0;
|
|
@@ -27883,7 +27923,7 @@ var buildRiverUserCall = (chainId, lender, account) => {
|
|
|
27883
27923
|
});
|
|
27884
27924
|
return calls;
|
|
27885
27925
|
};
|
|
27886
|
-
var LLAMALEND_CALLS_PER_MARKET =
|
|
27926
|
+
var LLAMALEND_CALLS_PER_MARKET = 8;
|
|
27887
27927
|
var buildLlamaLendUserCall = (chainId, lender, account, spender) => {
|
|
27888
27928
|
const cfg = llamaLendConfigFor(lender, chainId);
|
|
27889
27929
|
const markets = llamaLendChainData(lender, chainId)?.markets ?? [];
|
|
@@ -27894,7 +27934,16 @@ var buildLlamaLendUserCall = (chainId, lender, account, spender) => {
|
|
|
27894
27934
|
{ address: m.controller, name: "health", params: [account, true] },
|
|
27895
27935
|
{ address: m.controller, name: "user_prices", params: [account] },
|
|
27896
27936
|
{ address: m.amm, name: "read_user_tick_numbers", params: [account] },
|
|
27897
|
-
{ address: m.controller, name: "approval", params: [account, delegate] }
|
|
27937
|
+
{ address: m.controller, name: "approval", params: [account, delegate] },
|
|
27938
|
+
{ address: m.vault, name: "balanceOf", params: [account] },
|
|
27939
|
+
// A market without a gauge would call address(0), which returns '0x' and
|
|
27940
|
+
// parses as zero — the layout stays fixed either way.
|
|
27941
|
+
{
|
|
27942
|
+
address: m.gauge ?? "0x0000000000000000000000000000000000000000",
|
|
27943
|
+
name: "balanceOf",
|
|
27944
|
+
params: [account]
|
|
27945
|
+
},
|
|
27946
|
+
{ address: m.vault, name: "convertToAssets", params: [10n ** 18n] }
|
|
27898
27947
|
]);
|
|
27899
27948
|
};
|
|
27900
27949
|
var INVERSE_CALLS_PER_MARKET = 4;
|
|
@@ -31071,7 +31120,7 @@ var getMidnightUserDataConverter = (_lender, chainId, account, meta) => {
|
|
|
31071
31120
|
totalCalls
|
|
31072
31121
|
];
|
|
31073
31122
|
};
|
|
31074
|
-
var
|
|
31123
|
+
var WAD11 = 1000000000000000000n;
|
|
31075
31124
|
function toBigInt11(v) {
|
|
31076
31125
|
if (v === void 0 || v === null || v === "0x") return 0n;
|
|
31077
31126
|
if (typeof v === "bigint") return v;
|
|
@@ -31113,8 +31162,8 @@ var getTermUserDataConverter = (_lender, chainId, account, meta) => {
|
|
|
31113
31162
|
const debtStr = parseRawAmount(debtUnits.toString(), market.loanDecimals);
|
|
31114
31163
|
const debtNum = Number(debtStr);
|
|
31115
31164
|
const repoBalance = toBigInt11(balanceResult);
|
|
31116
|
-
const redemptionValue = toBigInt11(redemptionResult) || toBigInt11(market.redemptionValue) ||
|
|
31117
|
-
const lentUnits = repoBalance * redemptionValue /
|
|
31165
|
+
const redemptionValue = toBigInt11(redemptionResult) || toBigInt11(market.redemptionValue) || WAD11;
|
|
31166
|
+
const lentUnits = repoBalance * redemptionValue / WAD11;
|
|
31118
31167
|
const depositsStr = parseRawAmount(lentUnits.toString(), market.loanDecimals);
|
|
31119
31168
|
const depositsNum = Number(depositsStr);
|
|
31120
31169
|
const posData = {};
|
|
@@ -31192,7 +31241,7 @@ var getTermUserDataConverter = (_lender, chainId, account, meta) => {
|
|
|
31192
31241
|
};
|
|
31193
31242
|
var nowSec6 = () => Math.floor(Date.now() / 1e3);
|
|
31194
31243
|
var DAY_SECONDS = 86400n;
|
|
31195
|
-
var
|
|
31244
|
+
var WAD12 = 10n ** 18n;
|
|
31196
31245
|
function sumPreview(positions) {
|
|
31197
31246
|
return positions.reduce((acc, p) => acc + p.previewValue, 0n);
|
|
31198
31247
|
}
|
|
@@ -31216,7 +31265,7 @@ function toDetail(positions, kind, now, penaltyRate, penaltyApr) {
|
|
|
31216
31265
|
...kind === "borrow" ? {
|
|
31217
31266
|
...overdue ? { latePenalty: excess.toString() } : { earlyRepayDiscount: gap.toString() },
|
|
31218
31267
|
// face × penaltyRate × 1 day — what another day of being late adds.
|
|
31219
|
-
latePenaltyPerDay: (face * penaltyRate * DAY_SECONDS /
|
|
31268
|
+
latePenaltyPerDay: (face * penaltyRate * DAY_SECONDS / WAD12).toString(),
|
|
31220
31269
|
latePenaltyApr: penaltyApr
|
|
31221
31270
|
} : {
|
|
31222
31271
|
...overdue ? {} : { earlyExitCost: gap.toString() },
|
|
@@ -31345,7 +31394,7 @@ var getExactlyUserDataConverter = (_lender, chainId, account, meta) => {
|
|
|
31345
31394
|
latePenalty: penalty,
|
|
31346
31395
|
/** further penalty per day overdue — linear on face */
|
|
31347
31396
|
latePenaltyPerDay: parseRawAmount(
|
|
31348
|
-
(face * m.penaltyRate * DAY_SECONDS /
|
|
31397
|
+
(face * m.penaltyRate * DAY_SECONDS / WAD12).toString(),
|
|
31349
31398
|
decimals
|
|
31350
31399
|
),
|
|
31351
31400
|
latePenaltyApr: penaltyApr,
|
|
@@ -31873,7 +31922,13 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31873
31922
|
const bandBorrowed = big7(stateRaw[1]);
|
|
31874
31923
|
const debt = big7(stateRaw[2]);
|
|
31875
31924
|
const bandCount = Number(big7(stateRaw[3]));
|
|
31876
|
-
|
|
31925
|
+
const vaultSharesRaw = data[base + 5];
|
|
31926
|
+
const gaugeSharesRaw = data[base + 6];
|
|
31927
|
+
const vaultShares = isFailedCall(vaultSharesRaw) ? 0n : big7(vaultSharesRaw);
|
|
31928
|
+
const gaugeShares = isFailedCall(gaugeSharesRaw) ? 0n : big7(gaugeSharesRaw);
|
|
31929
|
+
const lendShares = vaultShares + gaugeShares;
|
|
31930
|
+
if (collateral === 0n && debt === 0n && bandBorrowed === 0n && lendShares === 0n)
|
|
31931
|
+
return;
|
|
31877
31932
|
const healthRaw = data[base + 1];
|
|
31878
31933
|
const health = isFailedCall(healthRaw) ? 0n : big7(healthRaw);
|
|
31879
31934
|
const pricesRaw = data[base + 2];
|
|
@@ -31900,6 +31955,15 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31900
31955
|
const loanDisplay = loanMeta ? getDisplayPrice(loanMeta) : 0;
|
|
31901
31956
|
const loanOracle = loanMeta ? getOraclePrice(loanMeta) : 0;
|
|
31902
31957
|
const loanHist = loanMeta?.price?.priceUsd24h ?? loanDisplay;
|
|
31958
|
+
const shareToAssetRaw = data[base + 7];
|
|
31959
|
+
const shareToAsset = isFailedCall(shareToAssetRaw) ? 0n : big7(shareToAssetRaw);
|
|
31960
|
+
const lendAssets = shareToAsset === 0n ? 0n : lendShares * shareToAsset / 10n ** 18n;
|
|
31961
|
+
const lendStr = parseRawAmount(lendAssets.toString(), loanDecimals);
|
|
31962
|
+
const depositStr = parseRawAmount(
|
|
31963
|
+
(lendAssets + bandBorrowed).toString(),
|
|
31964
|
+
loanDecimals
|
|
31965
|
+
);
|
|
31966
|
+
const depositNum = Number(depositStr);
|
|
31903
31967
|
const llamalendInfo = {
|
|
31904
31968
|
health: health.toString(),
|
|
31905
31969
|
priceUpper: priceUpper.toString(),
|
|
@@ -31907,6 +31971,9 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31907
31971
|
bands,
|
|
31908
31972
|
bandCount,
|
|
31909
31973
|
bandCollateralInBorrowed: bandBorrowed.toString(),
|
|
31974
|
+
lendAssets: lendStr,
|
|
31975
|
+
lendShares: lendShares.toString(),
|
|
31976
|
+
lendStaked: gaugeShares > 0n,
|
|
31910
31977
|
softLiquidating: bandBorrowed > 0n,
|
|
31911
31978
|
delegated,
|
|
31912
31979
|
supportsDelegation: market.supportsDelegation === true,
|
|
@@ -31916,11 +31983,10 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31916
31983
|
const collNum = Number(collStr);
|
|
31917
31984
|
const debtStr = parseRawAmount(debt.toString(), loanDecimals);
|
|
31918
31985
|
const debtNum = Number(debtStr);
|
|
31919
|
-
|
|
31986
|
+
parseRawAmount(
|
|
31920
31987
|
bandBorrowed.toString(),
|
|
31921
31988
|
loanDecimals
|
|
31922
31989
|
);
|
|
31923
|
-
const bandBorrowedNum = Number(bandBorrowedStr);
|
|
31924
31990
|
const lendingPositions = {
|
|
31925
31991
|
"0": {
|
|
31926
31992
|
[collUid]: {
|
|
@@ -31942,16 +32008,18 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31942
32008
|
[loanUid]: {
|
|
31943
32009
|
marketUid: loanUid,
|
|
31944
32010
|
underlying: loanAddr,
|
|
31945
|
-
deposits:
|
|
32011
|
+
deposits: depositStr,
|
|
31946
32012
|
debt: debtStr,
|
|
31947
32013
|
debtStable: "0",
|
|
31948
|
-
depositsUSD:
|
|
32014
|
+
depositsUSD: depositNum * loanDisplay,
|
|
31949
32015
|
debtUSD: debtNum * loanDisplay,
|
|
31950
32016
|
debtStableUSD: 0,
|
|
31951
|
-
depositsUSDOracle:
|
|
32017
|
+
depositsUSDOracle: depositNum * loanOracle,
|
|
31952
32018
|
debtUSDOracle: debtNum * loanOracle,
|
|
31953
32019
|
debtStableUSDOracle: 0,
|
|
31954
32020
|
stableBorrowRate: "0",
|
|
32021
|
+
// The borrowed token is never collateral in a LlamaLend market —
|
|
32022
|
+
// supplying it earns the lend rate, it does not back a loan.
|
|
31955
32023
|
collateralEnabled: false,
|
|
31956
32024
|
claimableRewards: 0,
|
|
31957
32025
|
llamalendInfo
|
|
@@ -31961,7 +32029,7 @@ var getLlamaLendUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
31961
32029
|
const modes = { "0": bandCount };
|
|
31962
32030
|
const hist = {
|
|
31963
32031
|
"0": {
|
|
31964
|
-
totalDeposits24h: collNum * collHist +
|
|
32032
|
+
totalDeposits24h: collNum * collHist + depositNum * loanHist,
|
|
31965
32033
|
totalDebt24h: debtNum * loanHist
|
|
31966
32034
|
}
|
|
31967
32035
|
};
|
|
@@ -32109,7 +32177,7 @@ var getResupplyUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
32109
32177
|
expected
|
|
32110
32178
|
];
|
|
32111
32179
|
};
|
|
32112
|
-
var
|
|
32180
|
+
var WAD13 = 10n ** 18n;
|
|
32113
32181
|
var big9 = (v) => {
|
|
32114
32182
|
try {
|
|
32115
32183
|
if (typeof v === "bigint") return v;
|
|
@@ -32180,7 +32248,7 @@ var getCurvanceUserDataConverter = (lender, chainId, account, meta) => {
|
|
|
32180
32248
|
const display = getDisplayPrice(rowMeta);
|
|
32181
32249
|
const oracle = getOraclePrice(rowMeta);
|
|
32182
32250
|
const histPrice = rowMeta.price?.priceUsd24h ?? display;
|
|
32183
|
-
const toUnderlying = (s) => exchangeRate > 0n ? s * exchangeRate /
|
|
32251
|
+
const toUnderlying = (s) => exchangeRate > 0n ? s * exchangeRate / WAD13 : s;
|
|
32184
32252
|
const depositsRaw = toUnderlying(collateralShares);
|
|
32185
32253
|
const depositsStr = parseRawAmount(
|
|
32186
32254
|
depositsRaw.toString(),
|
|
@@ -66189,6 +66257,6 @@ function validateTermSheets(sheets) {
|
|
|
66189
66257
|
return sheets.flatMap((s) => validateTermSheet(s));
|
|
66190
66258
|
}
|
|
66191
66259
|
|
|
66192
|
-
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EMPTY_BALANCE, EXACTLY_LENDER_KEY, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
|
66260
|
+
export { ApiBookSource, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_PROFILE_ID, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, EMPTY_BALANCE, EXACTLY_LENDER_KEY, GMX_API_HOSTS, GMX_READ_CONTRACTS, GMX_SUPPORTED_CHAINS, HYPERCORE_VAULT_REGISTRY, IDLE_MARKET_ID, INTERFACE_IDS, LAGOON_API_URL, LAGOON_CHAIN_IDS, MORPHO_LENS, MULTICALL_FAILURE, MaxParamThresholds, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, TELLER_CALLS_PER_BID, TERMMAX_CALLS_PER_ACCOUNT, DECIMAL_BASE as TERMMAX_DECIMAL_BASE, TERMMAX_LIQUIDATION_PENALTY, TERMMAX_LIQUIDATION_WINDOW_SECS, TERMMAX_LIQUIDATOR_BONUS, TERMMAX_PARTIAL_CLOSE_FACTOR, TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD, TERM_ADAPTERS, TERM_PROFILES, TERM_SHEET_SCHEMA_VERSION, TermMaxApiSource, TermSubgraphSource, UPSHIFT_CHAIN_IDS, UPSHIFT_VAULTS_URL, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, __resetResupplyUserCaches, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachImplications, attachPricesToFlashLiquidity, borrowDescription, borrowFindings, borrowHeadline, buildExposures2 as buildExposures, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta2 as computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta2 as computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta2 as computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta2 as computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertLlamaLendMarketsToResponse, convertResupplyMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, convertUsddMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, deriveBorrowTags, deriveSupplyTags, detectInterfaceKinds, dssIlkBytes32, dssKeyParts, dssLenderKey, duration, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, frankencoinKeyParts, frankencoinLenderKey, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, getCachedTermMaxDiscovery, getCachedTermMaxMarket, getCachedTermMaxMarkets, getCoreValidators, getFluidFTokensConverter, getGmxApiHost, getGmxReadContracts, getGmxUserPositions, getHealthFactor, getHypercoreUserPositions, getHypercoreVaultRegistry, getLenderAssets, getLenderPublicData, getLenderPublicDataAll, getLenderPublicDataViaApi, getLenderUserDataMulti, getLenderUserDataResult, getLendersForChain, getLstDelegation, getLstValidators, getLstWithdrawalRegistry, getLstWithdrawalRequests, getMaxAmountClose, getMaxAmountCollateralSwap, getMaxAmountDebtSwap, getMaxAmountOpen, getMergedUserData, getMorphoTypeMarketConverter, getReadFailurePolicy, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getTermProfile, getVaultPublicDataAll, getVaultWithdrawalRequests, hasCritical, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, inverseKeyParts, inverseLenderKey, isFailedCall, isStablecoinSymbol, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi2 as multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, positivePart2 as positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, stampVaultClassification, supplyDescription, supplyFindings, supplyHeadline, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, termMaxApiBase, borrowNif as termMaxBorrowNif, curveApr as termMaxCurveApr, curveAprNumber as termMaxCurveAprNumber, daysToMaturity as termMaxDaysToMaturity, lendNif as termMaxLendNif, mintGtFeeRatio as termMaxMintGtFeeRatio, ratioToNumber as termMaxRatioToNumber, ratioToPercent as termMaxRatioToPercent, tickToAprNumber, tickToPrice, toDigest, toTermSheetInput, unflattenLenderData, updateFeedStats, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData };
|
|
66193
66261
|
//# sourceMappingURL=index.js.map
|
|
66194
66262
|
//# sourceMappingURL=index.js.map
|