@1delta/margin-fetcher 5.0.28 → 5.0.30

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 CHANGED
@@ -6874,6 +6874,26 @@ interface RateTerms {
6874
6874
  label?: string;
6875
6875
  };
6876
6876
  compounding: Open<'per-second' | 'per-block' | 'none' | 'unknown'>;
6877
+ /**
6878
+ * Seconds a FRESH deposit earns NOTHING before the rate starts applying.
6879
+ *
6880
+ * A warm-up, and it is a different fact from every other delay on a sheet.
6881
+ * `SupplyExitTerms.cooldownSecs` is how long your money is STUCK;
6882
+ * `GovernanceTerms.timelockSecs` is how long you have to react to someone
6883
+ * changing the deal. This is neither: the money is free to leave at any
6884
+ * moment, and the deal is not changing — you simply do not earn yet. Putting
6885
+ * it in either of the other two would describe a lock that does not exist.
6886
+ *
6887
+ * The reason it needs a field rather than a sentence: with it absent, a
6888
+ * headline reading "Variable 3.5 % · withdraw any time" is composed of two
6889
+ * true halves that together mislead, because a stay shorter than the warm-up
6890
+ * realises exactly ZERO. Frankencoin's savings module is the case that forced
6891
+ * it (`INTEREST_DELAY` = 3 days, and a top-up re-weights the whole position's
6892
+ * clock pro-rata rather than only the new money).
6893
+ *
6894
+ * Absent ⇒ the rate applies from the first block, which is the norm.
6895
+ */
6896
+ warmupSecs?: number;
6877
6897
  source: Open<'utilization-curve' | 'orderbook' | 'auction' | 'governance' | 'borrower' | 'oracle' | 'api' | 'derived'>;
6878
6898
  /** Is the rate locked for the life of the position? */
6879
6899
  isLocked: boolean;
@@ -6965,6 +6985,21 @@ interface FeeTerm {
6965
6985
  payee?: Open<'protocol' | 'lenders' | 'liquidator' | 'curator' | 'gas-refund'>;
6966
6986
  /** Governance-mutable ⇒ this is a snapshot; re-verify before quoting. */
6967
6987
  mutable?: boolean;
6988
+ /**
6989
+ * Protocol-enforced CEILING on `value`, same `unit`. Only meaningful
6990
+ * alongside `mutable: true`, and it is what makes that flag actionable: a
6991
+ * mutable fee with no stated bound reads as unlimited discretion, when the
6992
+ * contract may in fact refuse anything above a hard constant.
6993
+ *
6994
+ * Morpho Blue is the case — its market parameters cannot be changed at all,
6995
+ * but the owner may set a fee on interest up to a `MAX_FEE` of 25 %. "The fee
6996
+ * can change" and "the fee can change, but never above 25 %, and nothing else
6997
+ * about this market can change" are very different sentences, and only the
6998
+ * second one is true.
6999
+ *
7000
+ * Absent ⇒ no cap is known. NOT the same as "uncapped".
7001
+ */
7002
+ cap?: number;
6968
7003
  /** Only resolvable at action time (Exactly discount, TermMax curve price). */
6969
7004
  indicative?: boolean;
6970
7005
  /** Decaying/scheduled fees (Apyx: 3.40 % → 0 over 20 days). */
@@ -7063,16 +7098,29 @@ interface LiquidationPenaltyTerm {
7063
7098
  * This is the term users most often misread, because the effect ("your
7064
7099
  * collateral can be taken") sounds like a governance power or a liquidation
7065
7100
  * when on every lender we serve it is neither: it is a permissionless
7066
- * arbitrage that defends the stablecoin's peg. Spelling out WHO can trigger
7101
+ * arbitrage that defends the stablecoin's peg.
7102
+ *
7103
+ * **The per-lender answers are audited in CDP_REDEMPTION_TERMS.md.** Read it
7104
+ * before filling this block for a new CDP: the fields below vary INDEPENDENTLY
7105
+ * across protocols, and copying Liquity V2's answers — the best-documented CDP,
7106
+ * and therefore the one that gets copied — has already produced three wrong
7107
+ * sheets. Spelling out WHO can trigger
7067
7108
  * it, WHEN it pays them to, WHICH positions are hit and WHAT the borrower can
7068
7109
  * do about it turns an alarming sentence into an actionable one.
7069
7110
  */
7070
7111
  interface RedemptionTerms {
7071
7112
  /**
7072
- * WHO can trigger it.
7073
- * - `permissionless-arbitrage` — any holder of the debt token, any time.
7074
- * Nobody targets you personally and no vote is involved.
7113
+ * WHO can trigger it — a statement about PERMISSION, not about frequency.
7114
+ *
7115
+ * - `permissionless-arbitrage` any holder of the debt token can call it,
7116
+ * without a vote and without targeting anyone personally.
7075
7117
  * - `governance` / `protocol` — reserved; nothing uses these today.
7118
+ *
7119
+ * Read together with {@link driver}, which says when it actually PAYS. The two
7120
+ * are independent and conflating them overstates the risk: on every lender we
7121
+ * serve the call is open at any block, but under `below-peg` it is only
7122
+ * profitable while the stablecoin trades under target, so redemptions arrive
7123
+ * in bursts during depegs rather than continuously.
7076
7124
  */
7077
7125
  trigger: Open<'permissionless-arbitrage' | 'governance' | 'protocol'>;
7078
7126
  /**
@@ -7091,10 +7139,18 @@ interface RedemptionTerms {
7091
7139
  */
7092
7140
  order: Open<'lowest-rate-first' | 'pro-rata' | 'lowest-collateral-ratio'>;
7093
7141
  /**
7094
- * Does the borrower end up down in USD terms? On the Liquity family the
7095
- * redemption fee stays IN the trove as extra collateral, so the borrower is
7096
- * roughly USD-neutral — what they lose is COLLATERAL EXPOSURE, not value.
7097
- * Saying "you can lose your collateral" without this overstates it.
7142
+ * Does the borrower end up down in USD terms? On Liquity V2 in NORMAL
7143
+ * operation the redemption fee stays IN the trove as extra collateral, so the
7144
+ * borrower is roughly USD-neutral — what they lose is COLLATERAL EXPOSURE,
7145
+ * not value. Saying "you can lose your collateral" without this overstates it.
7146
+ *
7147
+ * **Do not copy that answer to another protocol without checking where the
7148
+ * fee goes.** It is a property of Liquity's specific mechanism, not of
7149
+ * redemptions generally: Resupply writes the collateral off across the pair
7150
+ * with half the fee going to the protocol and nothing credited back, and a
7151
+ * shut-down Liquity branch pays the redeemer a 2 % bonus out of the
7152
+ * borrower's collateral. ABSENT means we have not established it, which is
7153
+ * the honest state for anything but the two cases above.
7098
7154
  */
7099
7155
  valueImpact?: Open<'usd-neutral' | 'loss'>;
7100
7156
  /** What the borrower can actually do. Absent ⇒ nothing. */
@@ -7790,6 +7846,22 @@ interface SavingsVault extends VaultClassificationFields {
7790
7846
  * instant leg at all.
7791
7847
  */
7792
7848
  withdrawFeeBps?: number;
7849
+ /**
7850
+ * Seconds a FRESH deposit earns nothing before the rate applies.
7851
+ *
7852
+ * Distinct from every withdrawal delay on this type: the money is free to
7853
+ * leave the whole time, it simply does not earn yet. Frankencoin's savings
7854
+ * modules stamp a new account 3 days forward (`INTEREST_DELAY`), and a
7855
+ * top-up re-weights the whole position's clock pro-rata. Surfaces as
7856
+ * `termSheet.supply.rate.warmupSecs`.
7857
+ */
7858
+ yieldWarmupSeconds?: number;
7859
+ /** `linear` when the accrual does not compound on its own; absent ⇒
7860
+ * compounding, which is right for any growing share price. */
7861
+ accrual?: 'linear' | 'compounding';
7862
+ /** `false` when a deposit needs NO ERC-20 approval (Frankencoin's modules
7863
+ * are registered minters and already hold an implicit infinite allowance). */
7864
+ needsDepositApproval?: boolean;
7793
7865
  /** Whether the instant leg is enabled at all — some assets are
7794
7866
  * queue-only. When `false`, `liquidity` is `0` regardless of the
7795
7867
  * protocol's inventory and `withdrawFeeBps` is unreachable. */
@@ -10726,8 +10798,27 @@ interface EarnMarket {
10726
10798
  /** `AAVE_V3` (a `Lender` key) or `vault.savings` (`vault.<provider>`). */
10727
10799
  venue: string;
10728
10800
  venueKind: EarnVenueKind;
10729
- /** Display label — 'Aave V3', 'Spark', 'Ethena'. */
10801
+ /**
10802
+ * Display label — the curator where one exists, else the protocol.
10803
+ * Kept for consumers that want one string; prefer `protocol` + `curator`
10804
+ * when the two need to be told apart.
10805
+ */
10730
10806
  brand?: string;
10807
+ /**
10808
+ * The PROTOCOL this venue is built on — Morpho, Euler, Silo, Aave V3.
10809
+ *
10810
+ * Load-bearing for vaults: a MetaMorpho vault and an Euler Earn vault both
10811
+ * render as their curator ("Steakhouse Financial", "TelosC Surge"), and
10812
+ * without this nothing on the row says which lending stack the deposit
10813
+ * actually lands in. Two vaults with the same curator on different protocols
10814
+ * are different risk, and two with different curators on the same protocol
10815
+ * share one.
10816
+ *
10817
+ * On the lending half this is the lender itself.
10818
+ */
10819
+ protocol?: EarnProtocol;
10820
+ /** Who RUNS this instance, where the venue is curated. Absent ⇒ uncurated. */
10821
+ curator?: EarnCurator;
10731
10822
  /** Market or vault display name. */
10732
10823
  name?: string;
10733
10824
  /**
@@ -10781,6 +10872,28 @@ interface EarnMarket {
10781
10872
  /** Provider-specific escape hatch. Semantics unchanged from the source. */
10782
10873
  providerMeta?: Record<string, unknown>;
10783
10874
  }
10875
+ interface EarnProtocol {
10876
+ /**
10877
+ * The STABLE family key — `MORPHO_BLUE`, `COMPOUND_V3`, `vault.morpho`.
10878
+ *
10879
+ * Deliberately NOT the row's `venue`: on the lending half that is minted per
10880
+ * market (`MORPHO_BLUE_<32-byte id>`), so it identifies one market rather
10881
+ * than the protocol and cannot be filtered or cached on. This can.
10882
+ */
10883
+ key: string;
10884
+ /**
10885
+ * Display name — `Aave V3`, `Morpho`, `Ethena`.
10886
+ *
10887
+ * What `?protocol=` matches, because a name can be shared where a key
10888
+ * cannot: every `vault.savings` row has one key but names its own protocol.
10889
+ */
10890
+ name: string;
10891
+ }
10892
+ interface EarnCurator {
10893
+ name?: string;
10894
+ /** Legal/brand entity behind the curator, where the registry carries one. */
10895
+ entity?: string;
10896
+ }
10784
10897
  interface EarnAsset {
10785
10898
  /** The underlying the user supplies, lowercased. */
10786
10899
  address: string;
@@ -11102,6 +11215,23 @@ interface EarnAppliedDefaults {
11102
11215
  * the other options vanish from the dropdown.
11103
11216
  */
11104
11217
  interface EarnFacets {
11218
+ /**
11219
+ * The PROTOCOL each row is built on — the axis that groups a MetaMorpho
11220
+ * vault with the Morpho markets it allocates into, rather than scattering it
11221
+ * across curators. `brands` answers "who runs it"; this answers "what is it".
11222
+ */
11223
+ protocols: EarnFacetBucket[];
11224
+ /**
11225
+ * Third parties that RUN an instance of a protocol — Steakhouse Financial,
11226
+ * Gauntlet, TelosC Surge.
11227
+ *
11228
+ * Distinct from `brands`, which is "curator where there is one, else the
11229
+ * protocol" and therefore mixes the two: a brands-fed curator dropdown lists
11230
+ * Ethena, Lido, Fluid and Silo alongside the real curators, none of which
11231
+ * curate anything. Only genuinely curated rows appear here, so an empty
11232
+ * selection is meaningful and the counts are answerable.
11233
+ */
11234
+ curators: EarnFacetBucket[];
11105
11235
  /**
11106
11236
  * Underlying assets by SYMBOL.
11107
11237
  *
@@ -11221,6 +11351,30 @@ interface VaultTermInput {
11221
11351
  redemptionDiscountBps?: number;
11222
11352
  /** `fee-or-queued` vaults only — is the instant leg switched on at all? */
11223
11353
  instantRedeemEnabled?: boolean;
11354
+ /**
11355
+ * Seconds a fresh deposit earns nothing (Frankencoin `INTEREST_DELAY`).
11356
+ * NOT a withdrawal lock — see `RateTerms.warmupSecs`.
11357
+ */
11358
+ yieldWarmupSeconds?: number;
11359
+ /**
11360
+ * Does the accrual COMPOUND, or is it linear?
11361
+ *
11362
+ * Defaults to compounding, which is right for any vault whose share price
11363
+ * grows continuously. Frankencoin's savings module is linear
11364
+ * (`Δticks × saved / 1e6 / 365 days`) and only compounds when someone
11365
+ * happens to call `refresh`, so labelling it per-second would imply an APY
11366
+ * ~2 % relative above what it pays.
11367
+ */
11368
+ accrual?: 'linear' | 'compounding';
11369
+ /**
11370
+ * Does a deposit need an ERC-20 approval?
11371
+ *
11372
+ * Defaults to true — nearly every vault pulls with `transferFrom`. False for
11373
+ * Frankencoin's savings modules, whose underlying grants a registered minter
11374
+ * an implicit infinite allowance, so the deposit route emits no approval and
11375
+ * a sheet claiming one would contradict the envelope beside it.
11376
+ */
11377
+ needsDepositApproval?: boolean;
11224
11378
  isMintable?: boolean;
11225
11379
  /** Raw base units. `undefined` = uncapped, `'0'` = full. */
11226
11380
  depositCapacity?: string;
@@ -11582,30 +11736,28 @@ declare const TERM_ADAPTERS: TermAdapter[];
11582
11736
  declare function resolveAdapter(lender: string): TermAdapter | undefined;
11583
11737
 
11584
11738
  /**
11585
- * Display vocabulary for the earn surface**owned by the server**.
11739
+ * The STABLE family key behind a venue `MORPHO_BLUE_1E9D…` `MORPHO_BLUE`,
11740
+ * `FLUID_1_11` → `FLUID`, `vault.savings` → `vault.savings`.
11586
11741
  *
11587
- * A client must not carry its own copy of any of this. That is not a style
11588
- * preference: every label map shipped in a frontend is a copy of server state
11589
- * that rots silently. When a new exit mode or vault provider is integrated, a
11590
- * client-side `switch` renders it as blank, as "Unknown", or worse, falls into
11591
- * a `default` branch that quietly misdescribes it — and nobody notices until a
11592
- * user acts on the wrong description.
11742
+ * This is the identifier a client can filter and cache on. The venue key
11743
+ * itself cannot serve that purpose on the lending half: it is minted per
11744
+ * market, so `?venue=` needs the exact 32-byte Morpho id and a "Morpho"
11745
+ * filter is unexpressible.
11593
11746
  *
11594
- * Putting the labels here means adding a mode is one change on one side, and
11595
- * every consumer picks it up on the next request.
11596
- *
11597
- * The rule for consumers is simply: **render `label ?? key`**. An unrecognised
11598
- * value then renders as itself, which is honest, rather than as a guess.
11747
+ * Vault venues are already family-shaped (`vault.<provider>`) and pass
11748
+ * through unchanged.
11599
11749
  */
11750
+ declare function venueBrandKey(venue: string): string;
11600
11751
  /**
11601
- * Collapse a venue key to its brand.
11752
+ * Collapse a venue key to its display brand.
11602
11753
  *
11603
11754
  * `MORPHO_BLUE_1E9D…` → `Morpho Blue`; `FLUID_1_11` → `Fluid`;
11604
11755
  * `SKY_1_ETH_A` → `Sky`; `vault.savings` → `Savings`.
11605
11756
  *
11606
- * Falls back to the longest recognised prefix, then to the family key itself
11607
- * never to a guess. An unknown lender renders as its own key, which is terse
11608
- * but true, and adding it to the table later is a pure improvement.
11757
+ * Derived from the `Lender` enum, not from a hand-maintained table, so every
11758
+ * integrated lender is named and a new one is named the day its enum member
11759
+ * lands. An unknown key still renders as its own collapsed family terse but
11760
+ * true, never a guess.
11609
11761
  */
11610
11762
  declare function venueBrand(venue: string): string;
11611
11763
  /** Every dimension the earn surface labels, in one lookup. */
@@ -11642,6 +11794,28 @@ interface EarnMarketLabelInput {
11642
11794
  * indistinguishable from an isolated pair with 1.
11643
11795
  */
11644
11796
  collateralSymbols?: string[];
11797
+ /**
11798
+ * The LENDER's own name for this market, as `lenderInfo.name` —
11799
+ * `Morpho cbBTC-USDC 86`, `TermMax RLUSD / USPC — 2026-10-25`,
11800
+ * `Aave V4 Etherfi`, or just `Aave V3` for a shared pool.
11801
+ *
11802
+ * Preferred over the derived pair because it carries what a derived pair
11803
+ * cannot: the **LLTV** that separates three otherwise identical
11804
+ * `USDC · vs WBTC` Morpho markets, the **maturity** on a fixed-term market,
11805
+ * and the **instance** on a multi-spoke deployment.
11806
+ */
11807
+ lenderMarketName?: string;
11808
+ /**
11809
+ * The row's venue key, used to strip the part of the lender's name that the
11810
+ * brand already states.
11811
+ *
11812
+ * The VENUE and not the brand string, because a brand override can be
11813
+ * SHORTER than the name it has to cancel: `FLUX_FINANCE` displays as "Flux",
11814
+ * so stripping by the brand alone leaves `Flux Finance` → "Finance" and the
11815
+ * row reads "USDT · Finance". Both the display brand and the family key
11816
+ * contribute words.
11817
+ */
11818
+ venue?: string;
11645
11819
  /** The fetcher's own name, used as the fallback. */
11646
11820
  fallbackName?: string;
11647
11821
  }
@@ -11654,8 +11828,27 @@ interface EarnMarketLabelInput {
11654
11828
  * "Loan USDC". The identity lives in the relationship between the legs, and
11655
11829
  * neither leg's name can express it.
11656
11830
  *
11657
- * **The collateral is named exactly when the market is ISOLATED**, i.e. exactly
11658
- * one collateral pairs with it:
11831
+ * Three sources, in descending order of what they can express:
11832
+ *
11833
+ * **1. The lender's own market name**, once the brand prefix is stripped. This
11834
+ * wins where it exists because it carries what nothing derived can — the LLTV
11835
+ * (`cbBTC-USDC 86`), the maturity (`RLUSD / USPC — 2026-10-25`), the spoke
11836
+ * (`Etherfi`). Three Morpho markets on the very same pair differ ONLY by LLTV,
11837
+ * so a pair-derived label leaves them identical and reproduces the same
11838
+ * complaint one step later.
11839
+ *
11840
+ * The asset is prefixed only when the name does not already state it:
11841
+ *
11842
+ * ```
11843
+ * 'Morpho cbBTC-USDC 86' + USDC → 'cbBTC-USDC 86' name already says USDC
11844
+ * 'Aave V4 Etherfi' + weETH → 'weETH · Etherfi' name does not
11845
+ * 'Compound USDC' + USDC → (nothing to add — falls through)
11846
+ * 'Aave V3' + WETH → (nothing to add — falls through)
11847
+ * ```
11848
+ *
11849
+ * **2. The derived pair**, when the lender publishes no name — 12 Fluid and 4
11850
+ * Silo V3 rows on chain 1 today. **The collateral is named exactly when the
11851
+ * market is ISOLATED**, i.e. exactly one collateral pairs with it:
11659
11852
  *
11660
11853
  * ```
11661
11854
  * 1 collateral → 'USDC · vs wstETH' the collateral IS the identity
@@ -11666,6 +11859,10 @@ interface EarnMarketLabelInput {
11666
11859
  * Derived, never configured. No table says "Morpho is isolated, Aave is not" —
11667
11860
  * the pair count says it, so a newly integrated isolated lender labels itself
11668
11861
  * correctly with no code change here.
11862
+ *
11863
+ * **3. The asset alone**, which is the right answer for a shared pool: the
11864
+ * brand renders beside it, and picking one of thirty collaterals would assert
11865
+ * something false.
11669
11866
  */
11670
11867
  declare function earnMarketLabel(input: EarnMarketLabelInput): string;
11671
11868
  /**
@@ -11692,6 +11889,41 @@ declare function isIlliquid(input: {
11692
11889
  tvlUsd?: number;
11693
11890
  liquidityUsd?: number;
11694
11891
  }): boolean;
11892
+ interface EarnProtocolAndCurator {
11893
+ protocol: {
11894
+ key: string;
11895
+ name: string;
11896
+ };
11897
+ curator?: {
11898
+ name?: string;
11899
+ entity?: string;
11900
+ };
11901
+ }
11902
+ /**
11903
+ * Split a row's identity into the protocol it IS and the curator that runs it.
11904
+ *
11905
+ * **One resolver for both halves of the listing.** The lending half used to
11906
+ * assign `protocol` inline, which meant two definitions of the same idea that
11907
+ * could drift — and did: the lending side set `protocol.key` to the PER-MARKET
11908
+ * venue while the vault side set the stable `vault.<provider>`, so the one
11909
+ * field a client would cache on meant different things depending on the row.
11910
+ *
11911
+ * Four shapes, all real in the data:
11912
+ *
11913
+ * - **curated vault** (Morpho, Euler, Lagoon, Lista, Gearbox) — protocol
11914
+ * fixed by the provider, brand is a third party: `Morpho` +
11915
+ * `Steakhouse Financial`.
11916
+ * - **category vault** (savings, lst) — the brand IS the protocol: `Ethena`,
11917
+ * `Lido`, with no curator. `vault.savings` spans Sky, Ethena and Maple;
11918
+ * reporting Ethena as a "curator of Savings" inverts the two fields that
11919
+ * exist precisely to be told apart.
11920
+ * - **self-branded vault** (Fluid, Silo, Pendle, GMX, and every uncurated
11921
+ * provider) — brand equals the protocol, so a curator would just repeat it.
11922
+ * - **lending market** — the protocol is the lender family. No lender
11923
+ * publishes a curator today; the parameter is still honoured so that when
11924
+ * one does (a curated Morpho Blue market list, say) it needs no new branch.
11925
+ */
11926
+ declare function resolveEarnIdentity(venue: string, brand: string | undefined): EarnProtocolAndCurator;
11695
11927
 
11696
11928
  /**
11697
11929
  * Multiply a formatted (human-unit) amount by a USD price.
@@ -11731,6 +11963,7 @@ interface VaultSourceRow {
11731
11963
  decimals?: number;
11732
11964
  assetDecimals?: number;
11733
11965
  curatorName?: string;
11966
+ curatorEntity?: string;
11734
11967
  /**
11735
11968
  * The vault origin names this `rating`, not `risk`, and uses `level` where
11736
11969
  * pools use `label`. Two shapes for one concept — read both explicitly
@@ -11922,6 +12155,16 @@ interface PoolSourceRow {
11922
12155
  score?: number | string;
11923
12156
  label?: string;
11924
12157
  };
12158
+ /**
12159
+ * The lender's own identity for this market — `{ key, name, logoURI }`.
12160
+ * `name` is the best market label available (`Morpho cbBTC-USDC 86`), and is
12161
+ * populated for every lender family in the live listing.
12162
+ */
12163
+ lenderInfo?: {
12164
+ key?: string;
12165
+ name?: string;
12166
+ logoURI?: string;
12167
+ };
11925
12168
  supplyCap?: number | string;
11926
12169
  caps?: {
11927
12170
  supplyCap?: number | string;
@@ -11941,6 +12184,36 @@ interface PoolSourceRow {
11941
12184
  };
11942
12185
  [key: string]: unknown;
11943
12186
  }
12187
+ /**
12188
+ * Collateral symbols per venue, derived from the listing ITSELF.
12189
+ *
12190
+ * An isolated market is a (collateral, loan) pair, but the fetcher emits it as
12191
+ * TWO rows — `Collateral cbBTC` and `Loan USDC` — each naming only its own leg.
12192
+ * The pairing is nonetheless recoverable without any extra fetch, because both
12193
+ * legs share the per-market venue key (`MORPHO_BLUE_<id>`, `FLUID_1_11`).
12194
+ * Grouping by venue and keeping the collateral-enabled symbols reconstructs
12195
+ * exactly the input `earnMarketLabel` needs.
12196
+ *
12197
+ * Verified against the live chain-1 listing (1,823 rows): 329 Morpho venues,
12198
+ * 264 of them a clean 2-row pair; Fluid 97, Silo 55, Resupply 13, Frankencoin
12199
+ * 11 the same shape. Shared pools land on the other side of the same rule —
12200
+ * Gearbox averages 3.5 collaterals per pool, a Compound III comet ~10, Aave V3
12201
+ * ~13 — so they are named by asset alone, which is correct.
12202
+ *
12203
+ * `collateralActive` is published by EVERY lender family in that listing (zero
12204
+ * undefined), so there is no flag-absent fallback to get wrong.
12205
+ *
12206
+ * **Pass the WHOLE scope's rows, not a page.** Given a page, a shared pool
12207
+ * looks isolated and gets a confidently wrong "vs" label — worse than no
12208
+ * label, because it names one arbitrary collateral of thirty.
12209
+ *
12210
+ * Keyed by (chain, venue) rather than venue alone: a per-market key is only
12211
+ * chain-unique when the lender bakes an id into it, and `AAVE_V3` is the same
12212
+ * string on 20 chains. Cross-chain merging would not produce a wrong pairing
12213
+ * (the count only grows, so a market degrades to its plain name) but the key
12214
+ * costs nothing and removes the question.
12215
+ */
12216
+ declare function collateralSymbolsByVenue(rows: readonly PoolSourceRow[], fallbackChainId?: string): Map<string, string[]>;
11944
12217
  /**
11945
12218
  * Normalize one origin pool row.
11946
12219
  *
@@ -11951,9 +12224,14 @@ interface PoolSourceRow {
11951
12224
  * A wrong term sheet is a display bug; a wrong uid routes a deposit to the
11952
12225
  * wrong market. Drop the row and let the caller log it.
11953
12226
  *
11954
- * See EARN_ENDPOINT_PLAN.md §3.2.
12227
+ * `venueCollaterals` is the whole map from {@link collateralSymbolsByVenue} —
12228
+ * the row is looked up here so a caller cannot key it wrong. Omitting it is
12229
+ * legal and falls back to the fetcher's own name, which is how 300 rows came to
12230
+ * read "Loan USDC" in production.
12231
+ *
12232
+ * See EARN_ENDPOINT_PLAN.md §3.2 and §4.1.
11955
12233
  */
11956
- declare function earnMarketFromPool(row: PoolSourceRow, fallbackChainId?: string): EarnMarket | undefined;
12234
+ declare function earnMarketFromPool(row: PoolSourceRow, fallbackChainId?: string, venueCollaterals?: ReadonlyMap<string, string[]>): EarnMarket | undefined;
11957
12235
  /**
11958
12236
  * Below this (in percent) a venue's own yield is treated as nothing.
11959
12237
  *
@@ -11992,4 +12270,320 @@ declare function swapRoutedProvidersArePriceConsistent(): string[];
11992
12270
  */
11993
12271
  declare function isBoundNeed(need: string): boolean;
11994
12272
 
11995
- 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 BuildVaultTermSheetOptions, 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, EARN_DESCRIPTIONS, EARN_LABELS, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, EXACTLY_LENDER_KEY, type EarnActionInput, type EarnActionKind, type EarnAmount, type EarnAppliedDefaults, type EarnAsset, type EarnAvailability, type EarnCapability, type EarnExclusions, type EarnExit, type EarnFacetBucket, type EarnFacets, type EarnGating, type EarnLabelDimension, type EarnMarket, type EarnMarketLabelInput, type EarnRate, type EarnRateSource, type EarnRefs, type EarnResponse, type EarnRisk, type EarnShareToken, type EarnSourceStatus, type EarnVaultNormalizeOptions, type EarnVenueKind, type EarnVocabulary, 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, FRACTION_RATE_PROVIDERS, type FeeTerm, type FeeWhen, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchPendlePtOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, type FrankencoinMarketRaw, type FrankencoinMarketsRaw, type FrankencoinPositionInfo, type FraxlendPairRaw, type FraxlendPairsRaw, 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, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, type ParsedBalanceData, type ParsedEarnUid, type ParsedLendingEarnUid, type ParsedResponse, type ParsedUserBalance, type ParsedVaultEarnUid, type PendleApiAsset, type PendleApiMarket, type PendleApiMarketDetails, type PendlePtMarket, type PendlePtMarkets, type PermissionKind, type PermissionParams, type PoolData, type PoolSourceRow, 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, SDK_FRACTION_RATE_PROVIDERS, 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_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, type ValidationResult, type VaultAprResult, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultProviderTraits, type VaultPublicDataAll, type VaultPublicDataResult, type VaultSourceRow, type VaultTermInput, 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, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, 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, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnUidFromMarketUid, earnVenueKind, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, 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, hasPendleMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLiveMarket as isLivePendleMarket, isStablecoinSymbol, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseEarnUid, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampVaultClassification, stampVaultTermSheets, supplyDescription, supplyFindings, supplyHeadline, swapRoutedProvidersArePriceConsistent, 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, toVaultTermInput, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand };
12273
+ /**
12274
+ * `EarnPosition` — one row of a user's supply-side portfolio, from either half
12275
+ * of the stack.
12276
+ *
12277
+ * The user half of `/v1/data/earn`. Where `EarnMarket` answers "what can I
12278
+ * deposit into", this answers "what do I hold" — and it is deliberately NOT
12279
+ * symmetric with it, because the two halves of the stack carry positions at
12280
+ * different granularities and flattening that difference would be a lie:
12281
+ *
12282
+ * ```
12283
+ * vault → ONE ROW PER VAULT. A share balance is a standalone position.
12284
+ * lending → ONE ROW PER (chain, lender). A cross-margin account is ONE
12285
+ * position — its markets are legs of a single solvency
12286
+ * calculation, not independent deposits.
12287
+ * ```
12288
+ *
12289
+ * Splitting a cross-margin account into per-market rows is the failure this
12290
+ * shape exists to prevent: it renders a $100 supply against a $90 debt as two
12291
+ * unrelated $100 and $90 rows, publishes a health factor per leg that does not
12292
+ * exist, and lets a UI sum a column that was never additive. The legs are
12293
+ * still present — on {@link EarnLendingPosition.legs}, each pointing back at
12294
+ * its catalogue row — but the ROW is the account.
12295
+ *
12296
+ * See EARN_ENDPOINT_PLAN.md §7.
12297
+ */
12298
+ /**
12299
+ * Row identity. **This is NOT an `earnUid`** and must never be passed to an
12300
+ * action route.
12301
+ *
12302
+ * A vault position's `positionUid` happens to equal its `earnUid` — one vault
12303
+ * is one market is one position. A lending position has no `earnUid` at all:
12304
+ * it spans every market in the account, so no single market uid identifies it.
12305
+ * Its uid is deliberately TWO segments (`<LENDER>:<chainId>`), which
12306
+ * `parseEarnUid` rejects — so a caller that confuses the two fails at the edge
12307
+ * instead of routing a withdrawal to whichever market sorted first.
12308
+ *
12309
+ * To act on a lending position, take the `earnUid` off the individual
12310
+ * {@link EarnPositionLeg}.
12311
+ */
12312
+ type EarnPositionUid = string;
12313
+ /** `AAVE_V3` + `1` → `AAVE_V3:1`. Two segments, by design — see above. */
12314
+ declare function buildLendingPositionUid(lender: string, chainId: string): EarnPositionUid;
12315
+ interface EarnPositionAsset {
12316
+ address: string;
12317
+ symbol?: string;
12318
+ decimals?: number;
12319
+ /** Unit price in USD. `0` ⇒ unpriced, NOT worthless. */
12320
+ priceUsd?: number;
12321
+ /**
12322
+ * Token icon, where the lender metadata resolved one.
12323
+ *
12324
+ * Carried on the leg so a consumer does not need a token list loaded just to
12325
+ * label a position it was already handed — the address alone identifies
12326
+ * nothing to a reader.
12327
+ */
12328
+ logoURI?: string;
12329
+ }
12330
+ /** Fields both halves carry, so a table can render one row type. */
12331
+ interface EarnPositionBase {
12332
+ positionUid: EarnPositionUid;
12333
+ chainId: string;
12334
+ /** `AAVE_V3` (a `Lender` key) or `vault.savings` (`vault.<provider>`). */
12335
+ venue: string;
12336
+ venueKind: EarnVenueKind;
12337
+ /** Display label — curator where one exists, else protocol. */
12338
+ brand?: string;
12339
+ name?: string;
12340
+ logoURI?: string;
12341
+ /** USD value of everything supplied. */
12342
+ suppliedUsd: number;
12343
+ /** USD value of everything borrowed. Always `0` on the vault half. */
12344
+ borrowedUsd: number;
12345
+ /** `suppliedUsd - borrowedUsd` — what the position is actually worth. */
12346
+ netUsd: number;
12347
+ /**
12348
+ * Net APR on the position AS HELD, in PERCENT — deposit yield less borrow
12349
+ * cost, over `netUsd`. NOT the market's headline rate: a 2x loop on a 4 %
12350
+ * market reads ~8 % here and 4 % on the catalogue row.
12351
+ *
12352
+ * Absent ⇒ not computable, which is not the same as zero.
12353
+ */
12354
+ apr?: number;
12355
+ }
12356
+ /**
12357
+ * One market inside a lending position.
12358
+ *
12359
+ * `earnUid` is the join back to `/v1/data/earn` — present whenever the lender
12360
+ * minted a well-formed `marketUid`, absent rather than reconstructed when it
12361
+ * did not (a rebuilt uid routes to the wrong market for Compound V2 and
12362
+ * Dolomite; see `earnUidFromMarketUid`).
12363
+ */
12364
+ interface EarnPositionLeg {
12365
+ /** Catalogue join key. Absent ⇒ this leg has no addressable market row. */
12366
+ earnUid?: string;
12367
+ marketUid: string;
12368
+ /** Present ⇒ the leg is bound to one loan (fixed-term lenders). */
12369
+ loanId?: string;
12370
+ asset: EarnPositionAsset;
12371
+ /**
12372
+ * Which side of the book this leg sits on.
12373
+ *
12374
+ * **`'none'` is the common case and the important one**: lenders report every
12375
+ * market the account is CONFIGURED in, not just the ones it holds something
12376
+ * in — an Aave V4 account with one USDC debt reports ten legs, nine of them
12377
+ * empty. Marking them here rather than letting each consumer re-derive it is
12378
+ * what stops a UI rendering nine empty markets as nine positions, which is
12379
+ * indistinguishable from nine real ones at a glance.
12380
+ *
12381
+ * Empty legs are KEPT rather than dropped — "markets this account is set up
12382
+ * in" is a real question — but nothing may present them as holdings.
12383
+ */
12384
+ side: 'supply' | 'borrow' | 'both' | 'none';
12385
+ deposits: string;
12386
+ depositsUsd: number;
12387
+ debt: string;
12388
+ debtUsd: number;
12389
+ collateralEnabled: boolean;
12390
+ /** Max withdrawable in token units, where the lender reports it. */
12391
+ withdrawable?: string;
12392
+ }
12393
+ /**
12394
+ * The three legs of a position's yield, each already expressed over NAV and in
12395
+ * PERCENT, so they simply add.
12396
+ *
12397
+ * **They are separate fields upstream and none of them contains another.**
12398
+ * `aprData.apr` is `(depositInterest − borrowInterest) / nav` — market interest
12399
+ * ONLY. `rewardApr` and `intrinsicApr` are computed alongside it over the same
12400
+ * denominator and are omitted from it entirely. Reading `aprData.apr` as "the
12401
+ * net APR" is therefore wrong for exactly the positions where it matters most:
12402
+ * a levered carry trade borrows a cheap asset to hold a yield-bearing one, so
12403
+ * the market leg is the COST side and the asset's own yield — the entire
12404
+ * reason for the trade — lands in `intrinsicApr`. A 22x sDOLA/crvUSD loop
12405
+ * reports about −74 % on the market leg alone and a large positive number once
12406
+ * the collateral's own yield is counted.
12407
+ *
12408
+ * Kept as a breakdown rather than folded into one number so that a headline can
12409
+ * never quietly become un-inspectable: emissions can stop, and an intrinsic
12410
+ * yield is a different promise from an interest rate.
12411
+ */
12412
+ interface EarnAprBreakdown {
12413
+ /** Deposit interest less borrow interest, over NAV. */
12414
+ market: number;
12415
+ /** Incentive emissions, over NAV. Can stop. */
12416
+ rewards: number;
12417
+ /**
12418
+ * The yield the ASSETS carry themselves (sDOLA, sfrxUSD, an LST) net of the
12419
+ * yield accruing on whatever was borrowed, over NAV.
12420
+ */
12421
+ intrinsic: number;
12422
+ }
12423
+ /** A sub-account within a lender, for the lenders that have more than one. */
12424
+ interface EarnPositionSubAccount {
12425
+ accountId: string;
12426
+ health: number | null;
12427
+ suppliedUsd: number;
12428
+ borrowedUsd: number;
12429
+ netUsd: number;
12430
+ legs: EarnPositionLeg[];
12431
+ }
12432
+ /**
12433
+ * A whole lending account on one lender, on one chain — ONE row however many
12434
+ * markets it touches.
12435
+ */
12436
+ interface EarnLendingPosition extends EarnPositionBase {
12437
+ venueKind: 'lending';
12438
+ lender: string;
12439
+ account: string;
12440
+ /**
12441
+ * Health factor of the account. Only meaningful when the lender is
12442
+ * cross-margin (`subAccounts.length <= 1`); otherwise `null`, with each
12443
+ * sub-account carrying its own. `null` also means "no debt, so no health".
12444
+ */
12445
+ health: number | null;
12446
+ /** `deposits / nav`. `1` ⇒ unlevered, `0` ⇒ not computable. */
12447
+ leverage: number;
12448
+ /**
12449
+ * What `apr` is made of. `market + rewards + intrinsic === apr`, so a
12450
+ * consumer can show the split without re-deriving it — and can see when a
12451
+ * headline rests entirely on emissions or entirely on collateral yield.
12452
+ */
12453
+ aprBreakdown: EarnAprBreakdown;
12454
+ /** MARKET deposit interest only — see `aprBreakdown` for the other legs. */
12455
+ depositApr: number;
12456
+ /** MARKET borrow interest only, as a positive cost. */
12457
+ borrowApr: number;
12458
+ /**
12459
+ * TRUE when the whole position is one solvency calculation, i.e. this row is
12460
+ * the complete picture. FALSE ⇒ read `subAccounts`, and do not present
12461
+ * `health` as the account's.
12462
+ */
12463
+ crossMargin: boolean;
12464
+ /** Every market leg, flattened across sub-accounts. */
12465
+ legs: EarnPositionLeg[];
12466
+ subAccounts: EarnPositionSubAccount[];
12467
+ /**
12468
+ * Some of this lender's reads did not complete. The legs are real but the
12469
+ * set is a LOWER BOUND — `netUsd`, `apr` and `health` must not be rendered
12470
+ * as fact. Carried straight through from `/lending/user-positions`.
12471
+ */
12472
+ incomplete?: boolean;
12473
+ /** Served from the last complete snapshot, `staleAgeMs` ago. */
12474
+ stale?: boolean;
12475
+ staleAgeMs?: number;
12476
+ }
12477
+ /** A share balance in one vault — a standalone position. */
12478
+ interface EarnVaultPosition extends EarnPositionBase {
12479
+ venueKind: 'vault';
12480
+ /**
12481
+ * The catalogue row. Unlike the lending half this is always present and
12482
+ * always actionable — pass it straight to an earn action route.
12483
+ */
12484
+ earnUid: string;
12485
+ provider: VaultProvider;
12486
+ /** Share-token address. */
12487
+ vault: string;
12488
+ asset: EarnPositionAsset;
12489
+ /** Raw share balance, base units of `shareDecimals`. */
12490
+ sharesRaw: string;
12491
+ shares: string;
12492
+ /** Share balance converted to underlying at the fair share price. */
12493
+ assetsRaw: string;
12494
+ assets: string;
12495
+ /** Share-token decimals. Differs from the asset's for Lagoon. */
12496
+ shareDecimals: number;
12497
+ yieldProfile?: YieldProfile;
12498
+ denomination?: Denomination;
12499
+ /** What the venue pays, PERCENT. */
12500
+ rate?: EarnRate;
12501
+ /** How the money gets out. */
12502
+ exit?: EarnExit;
12503
+ /** Whether it can be entered right now, and why not. */
12504
+ availability?: EarnAvailability;
12505
+ /** What can be done with the position — drives the withdraw CTA. */
12506
+ capabilities?: EarnCapability[];
12507
+ }
12508
+ type EarnPosition = EarnLendingPosition | EarnVaultPosition;
12509
+ declare function isVaultPosition(p: EarnPosition): p is EarnVaultPosition;
12510
+ declare function isLendingPosition(p: EarnPosition): p is EarnLendingPosition;
12511
+ /** Per-source health, so a dead half degrades the list rather than the route. */
12512
+ interface EarnPositionSourceStatus {
12513
+ source: 'lending' | 'vaults';
12514
+ status: 'ok' | 'degraded' | 'failed';
12515
+ /** Rows contributed by this source. */
12516
+ rows: number;
12517
+ /** Present when not `ok`. */
12518
+ error?: string;
12519
+ }
12520
+ interface EarnPositionTotals {
12521
+ suppliedUsd: number;
12522
+ borrowedUsd: number;
12523
+ netUsd: number;
12524
+ /** `netUsd` of the lending half alone. */
12525
+ lendingUsd: number;
12526
+ /** `netUsd` of the vault half alone. */
12527
+ vaultUsd: number;
12528
+ }
12529
+ /**
12530
+ * `/v1/data/earn/positions` response. Same contract as `/v1/data/earn`: the
12531
+ * shape never changes, a degraded source is reported in `sources[]` with
12532
+ * whatever did resolve still served.
12533
+ */
12534
+ interface EarnPositionsResponse {
12535
+ ok: boolean;
12536
+ account: string;
12537
+ chainIds: string[];
12538
+ count: number;
12539
+ /** Always `'percent'`, stamped so no consumer has to guess. */
12540
+ rateUnit: 'percent';
12541
+ items: EarnPosition[];
12542
+ totals: EarnPositionTotals;
12543
+ sources: EarnPositionSourceStatus[];
12544
+ /** Set when any lending entry was `incomplete` — totals are a lower bound. */
12545
+ partial?: boolean;
12546
+ /** Set when any entry was served from a last-known-good snapshot. */
12547
+ stale?: boolean;
12548
+ }
12549
+ /**
12550
+ * `LenderDataEntry` → ONE `EarnLendingPosition`.
12551
+ *
12552
+ * The entry is already aggregated per (chain, lender) by `buildSummaries`, so
12553
+ * this is a projection, not a re-summation — the USD figures come off
12554
+ * `balanceData`, which the summary computed from the same legs. The legs are
12555
+ * flattened purely so a row can show what it is made of.
12556
+ */
12557
+ declare function earnPositionFromLenderEntry(entry: LenderDataEntry): EarnLendingPosition;
12558
+ /** What a caller must supply per vault beyond the cached public metadata. */
12559
+ interface VaultBalanceInput {
12560
+ /** Raw share balance from `balanceOf(account)`. */
12561
+ sharesRaw: bigint;
12562
+ /** Underlying unit price in USD. `0` ⇒ unpriced. */
12563
+ priceUsd?: number;
12564
+ /**
12565
+ * The catalogue row for this vault, where one resolved. Supplies the rate,
12566
+ * the exit and the capabilities — everything about the DEAL, as opposed to
12567
+ * the balance. Absent ⇒ those fields are omitted rather than defaulted; a
12568
+ * missing sheet reads as "unknown", never as "instant, free, 0 %".
12569
+ */
12570
+ market?: EarnMarket;
12571
+ }
12572
+ /**
12573
+ * ERC-4626 convention: `assets = shares * totalAssets / totalSupply`.
12574
+ *
12575
+ * Returns `0n` for an empty vault or zero shares — both safe for display, and
12576
+ * both distinct from an error.
12577
+ */
12578
+ declare function vaultSharesToAssets(sharesRaw: bigint, meta: Pick<VaultLookupEntry, 'totalAssets' | 'totalSupply'>): bigint;
12579
+ /**
12580
+ * `VaultLookupEntry` + a share balance → ONE `EarnVaultPosition`.
12581
+ *
12582
+ * `format` is injected rather than importing viem here so this stays a pure
12583
+ * transform the worker and the tests can both drive; pass `formatUnits`.
12584
+ */
12585
+ declare function earnPositionFromVaultBalance(meta: VaultLookupEntry, chainId: string, input: VaultBalanceInput, format: (value: bigint, decimals: number) => string): EarnVaultPosition;
12586
+ /** Portfolio totals across both halves. */
12587
+ declare function earnPositionTotals(items: EarnPosition[]): EarnPositionTotals;
12588
+
12589
+ 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 BuildVaultTermSheetOptions, 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, EARN_DESCRIPTIONS, EARN_LABELS, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, EXACTLY_LENDER_KEY, type EarnActionInput, type EarnActionKind, type EarnAmount, type EarnAppliedDefaults, type EarnAprBreakdown, type EarnAsset, type EarnAvailability, type EarnCapability, type EarnCurator, type EarnExclusions, type EarnExit, type EarnFacetBucket, type EarnFacets, type EarnGating, type EarnLabelDimension, type EarnLendingPosition, type EarnMarket, type EarnMarketLabelInput, type EarnPosition, type EarnPositionAsset, type EarnPositionBase, type EarnPositionLeg, type EarnPositionSourceStatus, type EarnPositionSubAccount, type EarnPositionTotals, type EarnPositionUid, type EarnPositionsResponse, type EarnProtocol, type EarnProtocolAndCurator, type EarnRate, type EarnRateSource, type EarnRefs, type EarnResponse, type EarnRisk, type EarnShareToken, type EarnSourceStatus, type EarnVaultNormalizeOptions, type EarnVaultPosition, type EarnVenueKind, type EarnVocabulary, 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, FRACTION_RATE_PROVIDERS, type FeeTerm, type FeeWhen, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchPendlePtOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, type FrankencoinMarketRaw, type FrankencoinMarketsRaw, type FrankencoinPositionInfo, type FraxlendPairRaw, type FraxlendPairsRaw, 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, PASSTHROUGH_RATE_EPSILON, PENDLE_ASSETS_URL, PENDLE_CHAIN_IDS, PENDLE_MARKETS_URL, type ParsedBalanceData, type ParsedEarnUid, type ParsedLendingEarnUid, type ParsedResponse, type ParsedUserBalance, type ParsedVaultEarnUid, type PendleApiAsset, type PendleApiMarket, type PendleApiMarketDetails, type PendlePtMarket, type PendlePtMarkets, type PermissionKind, type PermissionParams, type PoolData, type PoolSourceRow, 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, SDK_FRACTION_RATE_PROVIDERS, 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_PROVIDER_PROFILE, VAULT_PROVIDER_TRAITS, VAULT_SHARE_PRICE_PROBE, VAULT_VENUE_PREFIX, VOLATILE_VAULT_OVERRIDES, type ValidationResult, type VaultAprResult, type VaultBalanceInput, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultProviderTraits, type VaultPublicDataAll, type VaultPublicDataResult, type VaultSourceRow, type VaultTermInput, 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, buildLendingPositionUid, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildTermSheet, buildTermSheetsForGroup, buildVaultEarnUid, buildVaultLookup, buildVaultTermSheet, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, clearPendleMarketsCache, collateralSymbolsByVenue, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertDssMarketsToResponse, convertExactlyMarketsToResponse, convertFrankencoinMarketsToResponse, convertFraxlendPairsToResponse, 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, earnDescription, earnLabel, earnMarketFromPool, earnMarketFromVault, earnMarketLabel, earnPositionFromLenderEntry, earnPositionFromVaultBalance, earnPositionTotals, earnUidFromMarketUid, earnVenueKind, encodeBalanceFetcherCalldata, enrichTermSheet, enrichmentIndexFromRows, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feePhrase, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchDssMarkets, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchFrankencoinMarkets, fetchFraxlendPairs, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchLlamaLendMarkets, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendleApiAssets, fetchPendleApiMarkets, fetchPendlePrices, fetchPendlePtMarkets, fetchResupplyMarkets, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchUsddMarkets, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, finalizeInfo, findingsFor, formatRaw, frankencoinKeyParts, frankencoinLenderKey, fraxlendAssetPerCollateral, fraxlendKeyParts, fraxlendLenderKey, 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, hasPendleMarkets, hasUpshiftVaults, hasYearnVaults, ilkToKeySegment, implausibleRatePercent, inverseKeyParts, inverseLenderKey, isBoundNeed, isFailedCall, isIlliquid, isLendingPosition, isLiveMarket as isLivePendleMarket, isStablecoinSymbol, isVaultPosition, isVaultVenue, isYearnV3, keySegmentToIlk, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, llamaLendKeyParts, llamaLendLenderKey, mergeDeep, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseEarnUid, parseMergedResult, parseMulticallRpcResponses, parseExpirySeconds as parsePendleExpirySeconds, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, pct, assetKey as pendleAssetKey, positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, rankFindings, ratePercent, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveAdapter, resolveDerivation, resolveEarnIdentity, resolveStCeloDepositGroup, resolveVaultProfileId, resupplyKeyParts, resupplyLenderKey, resupplyMarketLabel, riverKeyParts, riverLenderKey, selectAssetGroupPrices, shortDate, splitChainScopedAddress as splitPendleChainScopedAddress, stampCapabilities, stampVaultClassification, stampVaultTermSheets, supplyDescription, supplyFindings, supplyHeadline, swapRoutedProvidersArePriceConsistent, 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, toVaultTermInput, tryParseEarnUid, unflattenLenderData, updateFeedStats, usdValue, usddIlkBytes32, usddKeyParts, usddLenderKey, validateTermSheet, validateTermSheets, validateUserData, vaultSharesToAssets, vaultTermInputFromEarnMarket, vaultTermInputFromSourceRow, vaultTraits, vaultVenue, venueBrand, venueBrandKey };