@1delta/margin-fetcher 5.0.27 → 5.0.29

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
@@ -10726,8 +10726,27 @@ interface EarnMarket {
10726
10726
  /** `AAVE_V3` (a `Lender` key) or `vault.savings` (`vault.<provider>`). */
10727
10727
  venue: string;
10728
10728
  venueKind: EarnVenueKind;
10729
- /** Display label — 'Aave V3', 'Spark', 'Ethena'. */
10729
+ /**
10730
+ * Display label — the curator where one exists, else the protocol.
10731
+ * Kept for consumers that want one string; prefer `protocol` + `curator`
10732
+ * when the two need to be told apart.
10733
+ */
10730
10734
  brand?: string;
10735
+ /**
10736
+ * The PROTOCOL this venue is built on — Morpho, Euler, Silo, Aave V3.
10737
+ *
10738
+ * Load-bearing for vaults: a MetaMorpho vault and an Euler Earn vault both
10739
+ * render as their curator ("Steakhouse Financial", "TelosC Surge"), and
10740
+ * without this nothing on the row says which lending stack the deposit
10741
+ * actually lands in. Two vaults with the same curator on different protocols
10742
+ * are different risk, and two with different curators on the same protocol
10743
+ * share one.
10744
+ *
10745
+ * On the lending half this is the lender itself.
10746
+ */
10747
+ protocol?: EarnProtocol;
10748
+ /** Who RUNS this instance, where the venue is curated. Absent ⇒ uncurated. */
10749
+ curator?: EarnCurator;
10731
10750
  /** Market or vault display name. */
10732
10751
  name?: string;
10733
10752
  /**
@@ -10781,6 +10800,28 @@ interface EarnMarket {
10781
10800
  /** Provider-specific escape hatch. Semantics unchanged from the source. */
10782
10801
  providerMeta?: Record<string, unknown>;
10783
10802
  }
10803
+ interface EarnProtocol {
10804
+ /**
10805
+ * The STABLE family key — `MORPHO_BLUE`, `COMPOUND_V3`, `vault.morpho`.
10806
+ *
10807
+ * Deliberately NOT the row's `venue`: on the lending half that is minted per
10808
+ * market (`MORPHO_BLUE_<32-byte id>`), so it identifies one market rather
10809
+ * than the protocol and cannot be filtered or cached on. This can.
10810
+ */
10811
+ key: string;
10812
+ /**
10813
+ * Display name — `Aave V3`, `Morpho`, `Ethena`.
10814
+ *
10815
+ * What `?protocol=` matches, because a name can be shared where a key
10816
+ * cannot: every `vault.savings` row has one key but names its own protocol.
10817
+ */
10818
+ name: string;
10819
+ }
10820
+ interface EarnCurator {
10821
+ name?: string;
10822
+ /** Legal/brand entity behind the curator, where the registry carries one. */
10823
+ entity?: string;
10824
+ }
10784
10825
  interface EarnAsset {
10785
10826
  /** The underlying the user supplies, lowercased. */
10786
10827
  address: string;
@@ -10970,6 +11011,29 @@ type EarnActionKind = 'deposit' | 'withdraw'
10970
11011
  * `executionFee`, an LST's `validator` — all surface as DATA rather than as
10971
11012
  * tribal knowledge in the integrator's head.
10972
11013
  */
11014
+ /**
11015
+ * One asset a deposit will accept, and what that particular path needs.
11016
+ *
11017
+ * The requirement is PER INPUT, not per action: minting mETH with native ETH
11018
+ * needs `minMETHAmount`, while the same vault's ERC-20 path may need nothing.
11019
+ * A flat `requires` on the action cannot express that, and flattening it to the
11020
+ * union would demand inputs the chosen path never reads.
11021
+ */
11022
+ interface EarnActionInput {
11023
+ /** `'native'` or a lowercased ERC-20 address the mint accepts. */
11024
+ asset: string;
11025
+ symbol?: string;
11026
+ /**
11027
+ * Build shape: `direct` · `wrap` (wrap a base LST already held) ·
11028
+ * `submit-wrap` (native → base → wrapped, two legs) ·
11029
+ * `psm-then-deposit` (swap through a PSM first).
11030
+ */
11031
+ mode?: string;
11032
+ /** Option keys this path REQUIRES. Absent ⇒ none. */
11033
+ needs?: string[];
11034
+ /** Option keys this path accepts but does not require. */
11035
+ optional?: string[];
11036
+ }
10973
11037
  interface EarnCapability {
10974
11038
  action: EarnActionKind;
10975
11039
  /**
@@ -11004,6 +11068,16 @@ interface EarnCapability {
11004
11068
  * serve.
11005
11069
  */
11006
11070
  via?: 'native' | 'swap';
11071
+ /**
11072
+ * Assets this action accepts, where the venue takes more than its primary
11073
+ * one — and what each of those paths needs.
11074
+ *
11075
+ * Present ⇒ the pay-asset picker should be LIMITED to these; absent ⇒ the
11076
+ * venue takes its underlying only. The requirement is per input because it
11077
+ * genuinely differs: minting mETH with native ETH needs `minMETHAmount`,
11078
+ * while another path on the same vault may need nothing.
11079
+ */
11080
+ inputs?: EarnActionInput[];
11007
11081
  }
11008
11082
  /**
11009
11083
  * `/v1/data/earn` response. The shape NEVER changes — a degraded source is
@@ -11069,6 +11143,23 @@ interface EarnAppliedDefaults {
11069
11143
  * the other options vanish from the dropdown.
11070
11144
  */
11071
11145
  interface EarnFacets {
11146
+ /**
11147
+ * The PROTOCOL each row is built on — the axis that groups a MetaMorpho
11148
+ * vault with the Morpho markets it allocates into, rather than scattering it
11149
+ * across curators. `brands` answers "who runs it"; this answers "what is it".
11150
+ */
11151
+ protocols: EarnFacetBucket[];
11152
+ /**
11153
+ * Third parties that RUN an instance of a protocol — Steakhouse Financial,
11154
+ * Gauntlet, TelosC Surge.
11155
+ *
11156
+ * Distinct from `brands`, which is "curator where there is one, else the
11157
+ * protocol" and therefore mixes the two: a brands-fed curator dropdown lists
11158
+ * Ethena, Lido, Fluid and Silo alongside the real curators, none of which
11159
+ * curate anything. Only genuinely curated rows appear here, so an empty
11160
+ * selection is meaningful and the counts are answerable.
11161
+ */
11162
+ curators: EarnFacetBucket[];
11072
11163
  /**
11073
11164
  * Underlying assets by SYMBOL.
11074
11165
  *
@@ -11312,6 +11403,23 @@ interface VaultProviderTraits {
11312
11403
  /** Does exiting cost an unknown amount? Vaults redeem at par; PTs do not. */
11313
11404
  priceRisk: SupplyExitTerms['priceRisk'];
11314
11405
  counterpartyKind: CounterpartyTerms['kind'];
11406
+ /**
11407
+ * Solvency when it is a STRUCTURAL property of the provider — true of every
11408
+ * row it emits, with no curation needed.
11409
+ *
11410
+ * Absent ⇒ the answer varies per vault (or has no honest answer in this
11411
+ * vocabulary) and must come from a curated per-vault classification. The
11412
+ * builder then falls back to `overcollateralized` and marks
11413
+ * `coverage.pending.counterparty`, so an assumed answer is never mistaken for
11414
+ * an assessed one.
11415
+ *
11416
+ * The line between the two is whether the protocol can be reasoned about
11417
+ * without knowing WHICH vault: a MetaMorpho allocator only reaches Morpho
11418
+ * Blue markets, and every one of those requires collateral. A Lagoon vault
11419
+ * can hold literally anything its curator picks — one of the live ones is
11420
+ * institutional credit — so no provider-level answer exists.
11421
+ */
11422
+ solvency?: CounterpartyTerms['solvency'];
11315
11423
  /**
11316
11424
  * Does the provider report a `fee` field, and is it a PERFORMANCE fee on
11317
11425
  * yield? `false` means the provider publishes no fee at all — which must be
@@ -11319,6 +11427,16 @@ interface VaultProviderTraits {
11319
11427
  * "free", and none of these protocols are).
11320
11428
  */
11321
11429
  reportsPerformanceFee: boolean;
11430
+ /**
11431
+ * `true` when the provider reports `fee` as a FRACTION (`0.1` = 10 %) rather
11432
+ * than the percent every other provider uses.
11433
+ *
11434
+ * Exactly one provider does this — `aave-earn`, and its own type says so —
11435
+ * which is precisely why it needs a flag instead of a shared assumption: a
11436
+ * uniform `unit: 'percent'` renders a 10 % curator fee as "0.1 %", a 100×
11437
+ * understatement of the one number on the sheet the curator is paid.
11438
+ */
11439
+ feeIsFraction?: boolean;
11322
11440
  /** Does the provider emit `timelock` / role fields? */
11323
11441
  reportsGovernance: boolean;
11324
11442
  /** Does the provider decompose its backing (`VaultMarketExposure[]`)? */
@@ -11522,30 +11640,28 @@ declare const TERM_ADAPTERS: TermAdapter[];
11522
11640
  declare function resolveAdapter(lender: string): TermAdapter | undefined;
11523
11641
 
11524
11642
  /**
11525
- * Display vocabulary for the earn surface**owned by the server**.
11643
+ * The STABLE family key behind a venue `MORPHO_BLUE_1E9D…` `MORPHO_BLUE`,
11644
+ * `FLUID_1_11` → `FLUID`, `vault.savings` → `vault.savings`.
11526
11645
  *
11527
- * A client must not carry its own copy of any of this. That is not a style
11528
- * preference: every label map shipped in a frontend is a copy of server state
11529
- * that rots silently. When a new exit mode or vault provider is integrated, a
11530
- * client-side `switch` renders it as blank, as "Unknown", or worse, falls into
11531
- * a `default` branch that quietly misdescribes it — and nobody notices until a
11532
- * user acts on the wrong description.
11646
+ * This is the identifier a client can filter and cache on. The venue key
11647
+ * itself cannot serve that purpose on the lending half: it is minted per
11648
+ * market, so `?venue=` needs the exact 32-byte Morpho id and a "Morpho"
11649
+ * filter is unexpressible.
11533
11650
  *
11534
- * Putting the labels here means adding a mode is one change on one side, and
11535
- * every consumer picks it up on the next request.
11536
- *
11537
- * The rule for consumers is simply: **render `label ?? key`**. An unrecognised
11538
- * value then renders as itself, which is honest, rather than as a guess.
11651
+ * Vault venues are already family-shaped (`vault.<provider>`) and pass
11652
+ * through unchanged.
11539
11653
  */
11654
+ declare function venueBrandKey(venue: string): string;
11540
11655
  /**
11541
- * Collapse a venue key to its brand.
11656
+ * Collapse a venue key to its display brand.
11542
11657
  *
11543
11658
  * `MORPHO_BLUE_1E9D…` → `Morpho Blue`; `FLUID_1_11` → `Fluid`;
11544
11659
  * `SKY_1_ETH_A` → `Sky`; `vault.savings` → `Savings`.
11545
11660
  *
11546
- * Falls back to the longest recognised prefix, then to the family key itself
11547
- * never to a guess. An unknown lender renders as its own key, which is terse
11548
- * but true, and adding it to the table later is a pure improvement.
11661
+ * Derived from the `Lender` enum, not from a hand-maintained table, so every
11662
+ * integrated lender is named and a new one is named the day its enum member
11663
+ * lands. An unknown key still renders as its own collapsed family terse but
11664
+ * true, never a guess.
11549
11665
  */
11550
11666
  declare function venueBrand(venue: string): string;
11551
11667
  /** Every dimension the earn surface labels, in one lookup. */
@@ -11632,6 +11748,41 @@ declare function isIlliquid(input: {
11632
11748
  tvlUsd?: number;
11633
11749
  liquidityUsd?: number;
11634
11750
  }): boolean;
11751
+ interface EarnProtocolAndCurator {
11752
+ protocol: {
11753
+ key: string;
11754
+ name: string;
11755
+ };
11756
+ curator?: {
11757
+ name?: string;
11758
+ entity?: string;
11759
+ };
11760
+ }
11761
+ /**
11762
+ * Split a row's identity into the protocol it IS and the curator that runs it.
11763
+ *
11764
+ * **One resolver for both halves of the listing.** The lending half used to
11765
+ * assign `protocol` inline, which meant two definitions of the same idea that
11766
+ * could drift — and did: the lending side set `protocol.key` to the PER-MARKET
11767
+ * venue while the vault side set the stable `vault.<provider>`, so the one
11768
+ * field a client would cache on meant different things depending on the row.
11769
+ *
11770
+ * Four shapes, all real in the data:
11771
+ *
11772
+ * - **curated vault** (Morpho, Euler, Lagoon, Lista, Gearbox) — protocol
11773
+ * fixed by the provider, brand is a third party: `Morpho` +
11774
+ * `Steakhouse Financial`.
11775
+ * - **category vault** (savings, lst) — the brand IS the protocol: `Ethena`,
11776
+ * `Lido`, with no curator. `vault.savings` spans Sky, Ethena and Maple;
11777
+ * reporting Ethena as a "curator of Savings" inverts the two fields that
11778
+ * exist precisely to be told apart.
11779
+ * - **self-branded vault** (Fluid, Silo, Pendle, GMX, and every uncurated
11780
+ * provider) — brand equals the protocol, so a curator would just repeat it.
11781
+ * - **lending market** — the protocol is the lender family. No lender
11782
+ * publishes a curator today; the parameter is still honoured so that when
11783
+ * one does (a curated Morpho Blue market list, say) it needs no new branch.
11784
+ */
11785
+ declare function resolveEarnIdentity(venue: string, brand: string | undefined): EarnProtocolAndCurator;
11635
11786
 
11636
11787
  /**
11637
11788
  * Multiply a formatted (human-unit) amount by a USD price.
@@ -11671,6 +11822,7 @@ interface VaultSourceRow {
11671
11822
  decimals?: number;
11672
11823
  assetDecimals?: number;
11673
11824
  curatorName?: string;
11825
+ curatorEntity?: string;
11674
11826
  /**
11675
11827
  * The vault origin names this `rating`, not `risk`, and uses `level` where
11676
11828
  * pools use `label`. Two shapes for one concept — read both explicitly
@@ -11753,6 +11905,13 @@ declare const FRACTION_RATE_PROVIDERS: ReadonlySet<string>;
11753
11905
  declare const SDK_FRACTION_RATE_PROVIDERS: ReadonlySet<string>;
11754
11906
  /** Per-call overrides for sources that disagree with the origin's conventions. */
11755
11907
  interface EarnVaultNormalizeOptions {
11908
+ /**
11909
+ * Reserved. Term sheets are stamped on the RETURNED PAGE by the worker's
11910
+ * `stampEarnTerms`, not here — building one per row during the merge would
11911
+ * pay for ~1000 sheets to serve 50, and would miss the origin-proxy path
11912
+ * entirely, since those rows never pass through this normalizer.
11913
+ */
11914
+ terms?: 'none' | 'digest' | 'full';
11756
11915
  /**
11757
11916
  * Providers whose rates need `× 100`. Defaults to
11758
11917
  * {@link FRACTION_RATE_PROVIDERS} (empty — the origin already normalized).
@@ -11904,5 +12063,283 @@ declare const PASSTHROUGH_RATE_EPSILON = 0.01;
11904
12063
  * mutation is a real cost for no benefit.
11905
12064
  */
11906
12065
  declare function stampCapabilities(row: EarnMarket): EarnMarket;
12066
+ /**
12067
+ * Every swap-routed provider must also be book-priced.
12068
+ *
12069
+ * The two facts are independent in principle but must agree in practice: a
12070
+ * provider routed through a swap whose traits claim par pricing would emit a
12071
+ * `via: 'swap'` capability while the rest of the surface treated it as a
12072
+ * redeem-at-par vault. Exported so a test can assert it rather than leaving it
12073
+ * as a comment nobody runs.
12074
+ */
12075
+ declare function swapRoutedProvidersArePriceConsistent(): string[];
12076
+ /**
12077
+ * Needs that are a PRICE BOUND rather than a routing choice or a realised
12078
+ * amount.
12079
+ *
12080
+ * `minMETHAmount`, `minRSETHAmountExpected`, `minUsddOut` bound a fill;
12081
+ * `stEthAmount` / `eEthAmount` carry the amount the first leg actually produced
12082
+ * (deterministic — Lido's submit and wrap have no slippage), and `depositPool`
12083
+ * is an address. Only the first class deserves a slippage control.
12084
+ */
12085
+ declare function isBoundNeed(need: string): boolean;
12086
+
12087
+ /**
12088
+ * `EarnPosition` — one row of a user's supply-side portfolio, from either half
12089
+ * of the stack.
12090
+ *
12091
+ * The user half of `/v1/data/earn`. Where `EarnMarket` answers "what can I
12092
+ * deposit into", this answers "what do I hold" — and it is deliberately NOT
12093
+ * symmetric with it, because the two halves of the stack carry positions at
12094
+ * different granularities and flattening that difference would be a lie:
12095
+ *
12096
+ * ```
12097
+ * vault → ONE ROW PER VAULT. A share balance is a standalone position.
12098
+ * lending → ONE ROW PER (chain, lender). A cross-margin account is ONE
12099
+ * position — its markets are legs of a single solvency
12100
+ * calculation, not independent deposits.
12101
+ * ```
12102
+ *
12103
+ * Splitting a cross-margin account into per-market rows is the failure this
12104
+ * shape exists to prevent: it renders a $100 supply against a $90 debt as two
12105
+ * unrelated $100 and $90 rows, publishes a health factor per leg that does not
12106
+ * exist, and lets a UI sum a column that was never additive. The legs are
12107
+ * still present — on {@link EarnLendingPosition.legs}, each pointing back at
12108
+ * its catalogue row — but the ROW is the account.
12109
+ *
12110
+ * See EARN_ENDPOINT_PLAN.md §7.
12111
+ */
12112
+ /**
12113
+ * Row identity. **This is NOT an `earnUid`** and must never be passed to an
12114
+ * action route.
12115
+ *
12116
+ * A vault position's `positionUid` happens to equal its `earnUid` — one vault
12117
+ * is one market is one position. A lending position has no `earnUid` at all:
12118
+ * it spans every market in the account, so no single market uid identifies it.
12119
+ * Its uid is deliberately TWO segments (`<LENDER>:<chainId>`), which
12120
+ * `parseEarnUid` rejects — so a caller that confuses the two fails at the edge
12121
+ * instead of routing a withdrawal to whichever market sorted first.
12122
+ *
12123
+ * To act on a lending position, take the `earnUid` off the individual
12124
+ * {@link EarnPositionLeg}.
12125
+ */
12126
+ type EarnPositionUid = string;
12127
+ /** `AAVE_V3` + `1` → `AAVE_V3:1`. Two segments, by design — see above. */
12128
+ declare function buildLendingPositionUid(lender: string, chainId: string): EarnPositionUid;
12129
+ interface EarnPositionAsset {
12130
+ address: string;
12131
+ symbol?: string;
12132
+ decimals?: number;
12133
+ /** Unit price in USD. `0` ⇒ unpriced, NOT worthless. */
12134
+ priceUsd?: number;
12135
+ }
12136
+ /** Fields both halves carry, so a table can render one row type. */
12137
+ interface EarnPositionBase {
12138
+ positionUid: EarnPositionUid;
12139
+ chainId: string;
12140
+ /** `AAVE_V3` (a `Lender` key) or `vault.savings` (`vault.<provider>`). */
12141
+ venue: string;
12142
+ venueKind: EarnVenueKind;
12143
+ /** Display label — curator where one exists, else protocol. */
12144
+ brand?: string;
12145
+ name?: string;
12146
+ logoURI?: string;
12147
+ /** USD value of everything supplied. */
12148
+ suppliedUsd: number;
12149
+ /** USD value of everything borrowed. Always `0` on the vault half. */
12150
+ borrowedUsd: number;
12151
+ /** `suppliedUsd - borrowedUsd` — what the position is actually worth. */
12152
+ netUsd: number;
12153
+ /**
12154
+ * Net APR on the position AS HELD, in PERCENT — deposit yield less borrow
12155
+ * cost, over `netUsd`. NOT the market's headline rate: a 2x loop on a 4 %
12156
+ * market reads ~8 % here and 4 % on the catalogue row.
12157
+ *
12158
+ * Absent ⇒ not computable, which is not the same as zero.
12159
+ */
12160
+ apr?: number;
12161
+ }
12162
+ /**
12163
+ * One market inside a lending position.
12164
+ *
12165
+ * `earnUid` is the join back to `/v1/data/earn` — present whenever the lender
12166
+ * minted a well-formed `marketUid`, absent rather than reconstructed when it
12167
+ * did not (a rebuilt uid routes to the wrong market for Compound V2 and
12168
+ * Dolomite; see `earnUidFromMarketUid`).
12169
+ */
12170
+ interface EarnPositionLeg {
12171
+ /** Catalogue join key. Absent ⇒ this leg has no addressable market row. */
12172
+ earnUid?: string;
12173
+ marketUid: string;
12174
+ /** Present ⇒ the leg is bound to one loan (fixed-term lenders). */
12175
+ loanId?: string;
12176
+ asset: EarnPositionAsset;
12177
+ /** Which side of the book this leg sits on. */
12178
+ side: 'supply' | 'borrow' | 'both';
12179
+ deposits: string;
12180
+ depositsUsd: number;
12181
+ debt: string;
12182
+ debtUsd: number;
12183
+ collateralEnabled: boolean;
12184
+ /** Max withdrawable in token units, where the lender reports it. */
12185
+ withdrawable?: string;
12186
+ }
12187
+ /** A sub-account within a lender, for the lenders that have more than one. */
12188
+ interface EarnPositionSubAccount {
12189
+ accountId: string;
12190
+ health: number | null;
12191
+ suppliedUsd: number;
12192
+ borrowedUsd: number;
12193
+ netUsd: number;
12194
+ legs: EarnPositionLeg[];
12195
+ }
12196
+ /**
12197
+ * A whole lending account on one lender, on one chain — ONE row however many
12198
+ * markets it touches.
12199
+ */
12200
+ interface EarnLendingPosition extends EarnPositionBase {
12201
+ venueKind: 'lending';
12202
+ lender: string;
12203
+ account: string;
12204
+ /**
12205
+ * Health factor of the account. Only meaningful when the lender is
12206
+ * cross-margin (`subAccounts.length <= 1`); otherwise `null`, with each
12207
+ * sub-account carrying its own. `null` also means "no debt, so no health".
12208
+ */
12209
+ health: number | null;
12210
+ /** `deposits / nav`. `1` ⇒ unlevered, `0` ⇒ not computable. */
12211
+ leverage: number;
12212
+ depositApr: number;
12213
+ borrowApr: number;
12214
+ /**
12215
+ * TRUE when the whole position is one solvency calculation, i.e. this row is
12216
+ * the complete picture. FALSE ⇒ read `subAccounts`, and do not present
12217
+ * `health` as the account's.
12218
+ */
12219
+ crossMargin: boolean;
12220
+ /** Every market leg, flattened across sub-accounts. */
12221
+ legs: EarnPositionLeg[];
12222
+ subAccounts: EarnPositionSubAccount[];
12223
+ /**
12224
+ * Some of this lender's reads did not complete. The legs are real but the
12225
+ * set is a LOWER BOUND — `netUsd`, `apr` and `health` must not be rendered
12226
+ * as fact. Carried straight through from `/lending/user-positions`.
12227
+ */
12228
+ incomplete?: boolean;
12229
+ /** Served from the last complete snapshot, `staleAgeMs` ago. */
12230
+ stale?: boolean;
12231
+ staleAgeMs?: number;
12232
+ }
12233
+ /** A share balance in one vault — a standalone position. */
12234
+ interface EarnVaultPosition extends EarnPositionBase {
12235
+ venueKind: 'vault';
12236
+ /**
12237
+ * The catalogue row. Unlike the lending half this is always present and
12238
+ * always actionable — pass it straight to an earn action route.
12239
+ */
12240
+ earnUid: string;
12241
+ provider: VaultProvider;
12242
+ /** Share-token address. */
12243
+ vault: string;
12244
+ asset: EarnPositionAsset;
12245
+ /** Raw share balance, base units of `shareDecimals`. */
12246
+ sharesRaw: string;
12247
+ shares: string;
12248
+ /** Share balance converted to underlying at the fair share price. */
12249
+ assetsRaw: string;
12250
+ assets: string;
12251
+ /** Share-token decimals. Differs from the asset's for Lagoon. */
12252
+ shareDecimals: number;
12253
+ yieldProfile?: YieldProfile;
12254
+ denomination?: Denomination;
12255
+ /** What the venue pays, PERCENT. */
12256
+ rate?: EarnRate;
12257
+ /** How the money gets out. */
12258
+ exit?: EarnExit;
12259
+ /** Whether it can be entered right now, and why not. */
12260
+ availability?: EarnAvailability;
12261
+ /** What can be done with the position — drives the withdraw CTA. */
12262
+ capabilities?: EarnCapability[];
12263
+ }
12264
+ type EarnPosition = EarnLendingPosition | EarnVaultPosition;
12265
+ declare function isVaultPosition(p: EarnPosition): p is EarnVaultPosition;
12266
+ declare function isLendingPosition(p: EarnPosition): p is EarnLendingPosition;
12267
+ /** Per-source health, so a dead half degrades the list rather than the route. */
12268
+ interface EarnPositionSourceStatus {
12269
+ source: 'lending' | 'vaults';
12270
+ status: 'ok' | 'degraded' | 'failed';
12271
+ /** Rows contributed by this source. */
12272
+ rows: number;
12273
+ /** Present when not `ok`. */
12274
+ error?: string;
12275
+ }
12276
+ interface EarnPositionTotals {
12277
+ suppliedUsd: number;
12278
+ borrowedUsd: number;
12279
+ netUsd: number;
12280
+ /** `netUsd` of the lending half alone. */
12281
+ lendingUsd: number;
12282
+ /** `netUsd` of the vault half alone. */
12283
+ vaultUsd: number;
12284
+ }
12285
+ /**
12286
+ * `/v1/data/earn/positions` response. Same contract as `/v1/data/earn`: the
12287
+ * shape never changes, a degraded source is reported in `sources[]` with
12288
+ * whatever did resolve still served.
12289
+ */
12290
+ interface EarnPositionsResponse {
12291
+ ok: boolean;
12292
+ account: string;
12293
+ chainIds: string[];
12294
+ count: number;
12295
+ /** Always `'percent'`, stamped so no consumer has to guess. */
12296
+ rateUnit: 'percent';
12297
+ items: EarnPosition[];
12298
+ totals: EarnPositionTotals;
12299
+ sources: EarnPositionSourceStatus[];
12300
+ /** Set when any lending entry was `incomplete` — totals are a lower bound. */
12301
+ partial?: boolean;
12302
+ /** Set when any entry was served from a last-known-good snapshot. */
12303
+ stale?: boolean;
12304
+ }
12305
+ /**
12306
+ * `LenderDataEntry` → ONE `EarnLendingPosition`.
12307
+ *
12308
+ * The entry is already aggregated per (chain, lender) by `buildSummaries`, so
12309
+ * this is a projection, not a re-summation — the USD figures come off
12310
+ * `balanceData`, which the summary computed from the same legs. The legs are
12311
+ * flattened purely so a row can show what it is made of.
12312
+ */
12313
+ declare function earnPositionFromLenderEntry(entry: LenderDataEntry): EarnLendingPosition;
12314
+ /** What a caller must supply per vault beyond the cached public metadata. */
12315
+ interface VaultBalanceInput {
12316
+ /** Raw share balance from `balanceOf(account)`. */
12317
+ sharesRaw: bigint;
12318
+ /** Underlying unit price in USD. `0` ⇒ unpriced. */
12319
+ priceUsd?: number;
12320
+ /**
12321
+ * The catalogue row for this vault, where one resolved. Supplies the rate,
12322
+ * the exit and the capabilities — everything about the DEAL, as opposed to
12323
+ * the balance. Absent ⇒ those fields are omitted rather than defaulted; a
12324
+ * missing sheet reads as "unknown", never as "instant, free, 0 %".
12325
+ */
12326
+ market?: EarnMarket;
12327
+ }
12328
+ /**
12329
+ * ERC-4626 convention: `assets = shares * totalAssets / totalSupply`.
12330
+ *
12331
+ * Returns `0n` for an empty vault or zero shares — both safe for display, and
12332
+ * both distinct from an error.
12333
+ */
12334
+ declare function vaultSharesToAssets(sharesRaw: bigint, meta: Pick<VaultLookupEntry, 'totalAssets' | 'totalSupply'>): bigint;
12335
+ /**
12336
+ * `VaultLookupEntry` + a share balance → ONE `EarnVaultPosition`.
12337
+ *
12338
+ * `format` is injected rather than importing viem here so this stays a pure
12339
+ * transform the worker and the tests can both drive; pass `formatUnits`.
12340
+ */
12341
+ declare function earnPositionFromVaultBalance(meta: VaultLookupEntry, chainId: string, input: VaultBalanceInput, format: (value: bigint, decimals: number) => string): EarnVaultPosition;
12342
+ /** Portfolio totals across both halves. */
12343
+ declare function earnPositionTotals(items: EarnPosition[]): EarnPositionTotals;
11907
12344
 
11908
- 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 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, 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, 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 };
12345
+ 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 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, 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 };