@1delta/margin-fetcher 0.0.403 → 0.0.405
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/ccip-5UG36BRY.js +5 -0
- package/dist/{ccip-VFYF2C5F.js.map → ccip-5UG36BRY.js.map} +1 -1
- package/dist/{chunk-Z3MGRQJR.js → chunk-SRWUFRRR.js} +4 -4
- package/dist/{chunk-Z3MGRQJR.js.map → chunk-SRWUFRRR.js.map} +1 -1
- package/dist/index.d.ts +706 -15
- package/dist/index.js +2338 -469
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/ccip-VFYF2C5F.js +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Lender } from '@1delta/lender-registry';
|
|
|
3
3
|
export { isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isMultiMarket, isYLDR } from '@1delta/lender-registry';
|
|
4
4
|
import { DebitData, LenderDebitData, LstAcceptedInput } from '@1delta/calldata-sdk';
|
|
5
5
|
import { RelayProxyConfig } from '@1delta/proxy-fetch';
|
|
6
|
-
import { TermMarketConfig, LiquityBranchConfig, LiquityConfigChain, RiverMarketConfig, RiverConfigChain, RiverChainData, TellerPoolConfig, MorphoTypeVaultEntry } from '@1delta/data-sdk';
|
|
6
|
+
import { TermMarketConfig, LiquityBranchConfig, LiquityConfigChain, RiverMarketConfig, RiverConfigChain, RiverChainData, InverseMarketConfig, InverseConfigChain, InverseChainData, TellerPoolConfig, MorphoTypeVaultEntry } from '@1delta/data-sdk';
|
|
7
7
|
export { MorphoLensAbi } from '@1delta/abis';
|
|
8
8
|
|
|
9
9
|
interface GenericCurrency {
|
|
@@ -329,6 +329,76 @@ interface FixedTermProvider {
|
|
|
329
329
|
/** The single counterparty/venue contract, when there is one (Lista broker, Term servicer). */
|
|
330
330
|
address?: string;
|
|
331
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Origination window for a fixed-term market whose terms are only obtainable
|
|
334
|
+
* during a bounded round rather than continuously (`provider.kind: 'auction'`
|
|
335
|
+
* — Term Finance).
|
|
336
|
+
*
|
|
337
|
+
* This is the difference between "the rate card is empty right now" and "this
|
|
338
|
+
* market is dead": between rounds a Term repo still has a maturity, collateral
|
|
339
|
+
* params and a last-cleared rate, but nothing can be borrowed until the next
|
|
340
|
+
* round is listed. Without it every closed repo renders as an ordinary
|
|
341
|
+
* borrowable market whose action silently cannot be built.
|
|
342
|
+
*
|
|
343
|
+
* `status` is a snapshot at fetch time; the timestamps are raw so a consumer
|
|
344
|
+
* can re-derive it live (and drive a countdown) against a cached response.
|
|
345
|
+
*/
|
|
346
|
+
interface FixedTermAuction {
|
|
347
|
+
/**
|
|
348
|
+
* Round lifecycle at fetch time:
|
|
349
|
+
* - `upcoming` — listed but not yet accepting submissions (`now < startTime`)
|
|
350
|
+
* - `open` — accepting sealed bids/offers (`startTime ≤ now < revealTime`)
|
|
351
|
+
* - `revealing` — submissions closed, prices revealing / clearing pending
|
|
352
|
+
* (`revealTime ≤ now < endTime`)
|
|
353
|
+
* - `closed` — no round is currently listed for this market. Borrowing is
|
|
354
|
+
* unavailable until the next one; lending may still be
|
|
355
|
+
* possible on the secondary repo-token book.
|
|
356
|
+
*/
|
|
357
|
+
status: 'upcoming' | 'open' | 'revealing' | 'closed';
|
|
358
|
+
/**
|
|
359
|
+
* Can a NEW borrow be opened right now? True only inside an open round —
|
|
360
|
+
* Term borrow origination is a sealed bid, so there is no other entry point.
|
|
361
|
+
*
|
|
362
|
+
* Consume this rather than re-deriving from `status`: it is the single flag
|
|
363
|
+
* a borrow CTA should gate on, and it stays correct if more statuses appear.
|
|
364
|
+
* It is NOT the same as `canLend` — see below.
|
|
365
|
+
*/
|
|
366
|
+
canBorrow: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Can a NEW lend position be opened right now? Deliberately decoupled from
|
|
369
|
+
* `canBorrow`: the primary auction is only one of two lend surfaces, and
|
|
370
|
+
* buying repo tokens on the secondary book works between rounds. So a closed
|
|
371
|
+
* round leaves the market lend-only rather than fully inert, and a UI that
|
|
372
|
+
* greys out the whole market would be wrong.
|
|
373
|
+
*/
|
|
374
|
+
canLend: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Seconds until submissions close (`revealTime − now`), or undefined when no
|
|
377
|
+
* round is open. A snapshot — for a live countdown, derive from `revealTime`.
|
|
378
|
+
*/
|
|
379
|
+
secondsUntilClose?: number;
|
|
380
|
+
/**
|
|
381
|
+
* Ready-to-display consequences of this market's origination model, most
|
|
382
|
+
* important first. Mirrors `params.market.teller.implications`: auction
|
|
383
|
+
* mechanics are unusual enough that a UI showing only a rate misleads.
|
|
384
|
+
*/
|
|
385
|
+
implications?: string[];
|
|
386
|
+
/** Round id. Absent when `status: 'closed'`. */
|
|
387
|
+
id?: string;
|
|
388
|
+
/** Submissions open (unix seconds). Absent when `status: 'closed'`. */
|
|
389
|
+
startTime?: number;
|
|
390
|
+
/** Submissions CLOSE / reveal begins (unix seconds). Absent when closed. */
|
|
391
|
+
revealTime?: number;
|
|
392
|
+
/** Round clears (unix seconds). Absent when closed. */
|
|
393
|
+
endTime?: number;
|
|
394
|
+
/**
|
|
395
|
+
* Minimum submission size in loan-token base units (raw). Term rounds carry a
|
|
396
|
+
* real floor (e.g. 1000 USDC) — an amount below it cannot be submitted at all,
|
|
397
|
+
* so it belongs next to the terms rather than surfacing as a failed action.
|
|
398
|
+
*/
|
|
399
|
+
minBorrowAmount?: string;
|
|
400
|
+
minLendAmount?: string;
|
|
401
|
+
}
|
|
332
402
|
/**
|
|
333
403
|
* Canonical fixed-term market descriptor, emitted on `params.market.fixedTerm`
|
|
334
404
|
* for EVERY fixed-rate / fixed-maturity market (Lista brokered + Morpho
|
|
@@ -338,7 +408,7 @@ interface FixedTermProvider {
|
|
|
338
408
|
*/
|
|
339
409
|
interface FixedTermInfo {
|
|
340
410
|
/** Underlying fixed-term protocol shape. */
|
|
341
|
-
model: 'lista' | 'midnight' | 'term' | 'exactly' | 'teller';
|
|
411
|
+
model: 'lista' | 'midnight' | 'term' | 'exactly' | 'teller' | 'termmax';
|
|
342
412
|
/**
|
|
343
413
|
* Single fixed calendar maturity (unix secs). Undefined for rolling-duration
|
|
344
414
|
* menus (Lista) and multi-maturity markets (Exactly — the maturity menu lives
|
|
@@ -367,6 +437,12 @@ interface FixedTermInfo {
|
|
|
367
437
|
earlyRepay: FixedTermEarlyRepay;
|
|
368
438
|
/** Who offers the term (Lista broker vs Midnight order book). */
|
|
369
439
|
provider?: FixedTermProvider;
|
|
440
|
+
/**
|
|
441
|
+
* Origination window, for `provider.kind: 'auction'` markets only (Term
|
|
442
|
+
* Finance). Absent for lenders whose terms are continuously available — a
|
|
443
|
+
* missing `auction` means "no window applies", NOT "closed".
|
|
444
|
+
*/
|
|
445
|
+
auction?: FixedTermAuction;
|
|
370
446
|
}
|
|
371
447
|
/** A Lista loan, attached to its own entry in the positions array. */
|
|
372
448
|
interface ListaTermLoan {
|
|
@@ -2077,7 +2153,7 @@ interface MidnightBookSource {
|
|
|
2077
2153
|
|
|
2078
2154
|
/** Default hosted Midnight API (see @morpho-org/midnight-sdk MidnightApi). */
|
|
2079
2155
|
declare const DEFAULT_MIDNIGHT_API = "https://api.morpho.org/v0/midnight";
|
|
2080
|
-
type FetchLike$
|
|
2156
|
+
type FetchLike$2 = typeof fetch;
|
|
2081
2157
|
/**
|
|
2082
2158
|
* Hosted-API book source. Reads `GET {base}/books/{marketId}` and reduces the
|
|
2083
2159
|
* `asks`/`bids` price levels to a {@link MidnightBookTop}. This is the swappable
|
|
@@ -2086,7 +2162,7 @@ type FetchLike$1 = typeof fetch;
|
|
|
2086
2162
|
declare class ApiBookSource implements MidnightBookSource {
|
|
2087
2163
|
private readonly baseUrl;
|
|
2088
2164
|
private readonly fetchImpl;
|
|
2089
|
-
constructor(baseUrl: string, fetchImpl?: FetchLike$
|
|
2165
|
+
constructor(baseUrl: string, fetchImpl?: FetchLike$2);
|
|
2090
2166
|
getBookTop(marketId: string): Promise<MidnightBookTop | null>;
|
|
2091
2167
|
/**
|
|
2092
2168
|
* Full ladder for a market — every level per side, best-first (unlike
|
|
@@ -2117,7 +2193,7 @@ declare class ApiBookSource implements MidnightBookSource {
|
|
|
2117
2193
|
getOfferMakers(marketId: string, side: 'bids' | 'asks', assets: bigint): Promise<Record<string, string[]>>;
|
|
2118
2194
|
}
|
|
2119
2195
|
/** Build the default (hosted-API) book source for a chain. */
|
|
2120
|
-
declare function createMidnightBookSource(chainId: string, fetchImpl?: FetchLike$
|
|
2196
|
+
declare function createMidnightBookSource(chainId: string, fetchImpl?: FetchLike$2): MidnightBookSource;
|
|
2121
2197
|
|
|
2122
2198
|
/**
|
|
2123
2199
|
* Top-of-book snapshot for a single Term repo, already reduced to best
|
|
@@ -2234,14 +2310,48 @@ interface TermBookSource {
|
|
|
2234
2310
|
getTopAndBook?(config: TermMarketConfig, maxLevels?: number): Promise<{
|
|
2235
2311
|
top: TermBookTop;
|
|
2236
2312
|
book: TermBook;
|
|
2313
|
+
/** Live/upcoming auction round; null when none is listed. */
|
|
2314
|
+
auction: TermAuctionWindow | null;
|
|
2237
2315
|
} | null>;
|
|
2238
2316
|
}
|
|
2317
|
+
/**
|
|
2318
|
+
* The repo's CURRENT primary auction round, when one is listed.
|
|
2319
|
+
*
|
|
2320
|
+
* Term borrow origination is a periodic sealed-bid auction, not a continuous
|
|
2321
|
+
* book: outside the submission window there is nothing to bid on, so a repo
|
|
2322
|
+
* whose auction has cleared is lend-only (buy repo tokens on the secondary
|
|
2323
|
+
* book) until the next round is listed. Timestamps are raw so consumers can
|
|
2324
|
+
* derive a live countdown; `status` is a snapshot at fetch time.
|
|
2325
|
+
*/
|
|
2326
|
+
interface TermAuctionWindow {
|
|
2327
|
+
/** Auction round id (the TermAuction entity id). */
|
|
2328
|
+
id: string;
|
|
2329
|
+
/** Submissions open (unix seconds). */
|
|
2330
|
+
startTime: number;
|
|
2331
|
+
/** Submissions CLOSE and the sealed prices start revealing (unix seconds). */
|
|
2332
|
+
revealTime: number;
|
|
2333
|
+
/** Auction clears (unix seconds). Equal to `revealTime` on current deployments. */
|
|
2334
|
+
endTime: number;
|
|
2335
|
+
/** Minimum bid (borrow) size, loan-token base units (raw string; '0' when unset). */
|
|
2336
|
+
minBidAmount: string;
|
|
2337
|
+
/** Minimum offer (lend) size, loan-token base units (raw string; '0' when unset). */
|
|
2338
|
+
minOfferAmount: string;
|
|
2339
|
+
/** Highest accepted bid rate, WAD (raw string; '0' when unset). */
|
|
2340
|
+
maxBidPriceWad: string;
|
|
2341
|
+
/** Highest accepted offer rate, WAD (raw string; '0' when unset). */
|
|
2342
|
+
maxOfferPriceWad: string;
|
|
2343
|
+
}
|
|
2239
2344
|
/** A Term repo paired with its current top-of-book (null when the fetch failed). */
|
|
2240
2345
|
interface TermMarketRaw {
|
|
2241
2346
|
config: TermMarketConfig;
|
|
2242
2347
|
top: TermBookTop | null;
|
|
2243
2348
|
/** Bounded book slice (top-N levels/side); null/absent when unavailable. */
|
|
2244
2349
|
book?: TermBook | null;
|
|
2350
|
+
/**
|
|
2351
|
+
* The live/upcoming auction round, or null when no round is currently listed
|
|
2352
|
+
* (the common case between auctions — the repo is then lend-only).
|
|
2353
|
+
*/
|
|
2354
|
+
auction?: TermAuctionWindow | null;
|
|
2245
2355
|
}
|
|
2246
2356
|
|
|
2247
2357
|
/**
|
|
@@ -2273,7 +2383,7 @@ declare function convertTermMarketsToResponse(raw: TermMarketRaw[], chainId: str
|
|
|
2273
2383
|
[m: string]: MorphoGeneralPublicResponse;
|
|
2274
2384
|
};
|
|
2275
2385
|
|
|
2276
|
-
type FetchLike = typeof fetch;
|
|
2386
|
+
type FetchLike$1 = typeof fetch;
|
|
2277
2387
|
/**
|
|
2278
2388
|
* GraphQL subgraph source. `getBookTop` derives the fixed APR from the repo's
|
|
2279
2389
|
* latest completed auction clearing price and open-order depth; `getListings`
|
|
@@ -2282,20 +2392,29 @@ type FetchLike = typeof fetch;
|
|
|
2282
2392
|
declare class TermSubgraphSource implements TermBookSource {
|
|
2283
2393
|
private readonly url;
|
|
2284
2394
|
private readonly fetchImpl;
|
|
2285
|
-
constructor(url: string, fetchImpl?: FetchLike);
|
|
2395
|
+
constructor(url: string, fetchImpl?: FetchLike$1);
|
|
2286
2396
|
private gql;
|
|
2287
2397
|
getBookTop(config: TermMarketConfig): Promise<TermBookTop | null>;
|
|
2288
2398
|
/**
|
|
2289
2399
|
* ONE query → the aggregate top (best APR + FULL depth) PLUS a bounded book
|
|
2290
|
-
* slice (top `maxLevels` open orders per side)
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
* clearing APR; the levels
|
|
2400
|
+
* slice (top `maxLevels` open orders per side) PLUS the repo's current
|
|
2401
|
+
* auction round. `asks` = orders selling repo tokens (the secondary LEND
|
|
2402
|
+
* book); `bids` = the rest (borrow side, usually empty — Term borrow is
|
|
2403
|
+
* sealed-bid auction, not a continuous book). Term secondary orders carry no
|
|
2404
|
+
* per-order rate, so every level shares the market's clearing APR; the levels
|
|
2405
|
+
* expose per-order SIZE for filtering.
|
|
2406
|
+
*
|
|
2407
|
+
* Two auction reads, deliberately distinct:
|
|
2408
|
+
* - `cleared` — the latest COMPLETE round, whose clearing price IS the
|
|
2409
|
+
* market's fixed APR (and stays the reference rate between auctions).
|
|
2410
|
+
* - `pending` — rounds not yet complete/cancelled. Only one of these is a
|
|
2411
|
+
* real, actionable round; the rest are abandoned listings the subgraph
|
|
2412
|
+
* never marked complete, filtered out below.
|
|
2295
2413
|
*/
|
|
2296
2414
|
getTopAndBook(config: TermMarketConfig, maxLevels?: number): Promise<{
|
|
2297
2415
|
top: TermBookTop;
|
|
2298
2416
|
book: TermBook;
|
|
2417
|
+
auction: TermAuctionWindow | null;
|
|
2299
2418
|
} | null>;
|
|
2300
2419
|
getListings(config: TermMarketConfig): Promise<TermListing[] | null>;
|
|
2301
2420
|
/**
|
|
@@ -2308,7 +2427,7 @@ declare class TermSubgraphSource implements TermBookSource {
|
|
|
2308
2427
|
getAuctionOrders(config: TermMarketConfig, account: string): Promise<TermAuctionOrders | null>;
|
|
2309
2428
|
}
|
|
2310
2429
|
/** Default Term public-data source for a chain (subgraph via resolved URL). */
|
|
2311
|
-
declare function createTermBookSource(chainId: string, fetchImpl?: FetchLike): TermBookSource;
|
|
2430
|
+
declare function createTermBookSource(chainId: string, fetchImpl?: FetchLike$1): TermBookSource;
|
|
2312
2431
|
|
|
2313
2432
|
/**
|
|
2314
2433
|
* Decoded shapes of the Exactly `Previewer.exactly(account)` aggregate view.
|
|
@@ -2707,6 +2826,107 @@ interface RiverPositionInfo {
|
|
|
2707
2826
|
collateralSurplus: string;
|
|
2708
2827
|
}
|
|
2709
2828
|
|
|
2829
|
+
/**
|
|
2830
|
+
* Per-market snapshot of a FiRM market. Numbers are HUMAN units (the
|
|
2831
|
+
* Inverse API serves human numbers; the on-chain fallback normalizes to
|
|
2832
|
+
* match). `null` marks a value the active source could not provide —
|
|
2833
|
+
* the converter degrades gracefully per field.
|
|
2834
|
+
*/
|
|
2835
|
+
interface InverseMarketRaw {
|
|
2836
|
+
market: InverseMarketConfig;
|
|
2837
|
+
/** Market.totalDebt — DOLA units (human). */
|
|
2838
|
+
totalDebt: number | null;
|
|
2839
|
+
/** DOLA sitting in the Market = instant borrowable ceiling (human). */
|
|
2840
|
+
dolaLiquidity: number | null;
|
|
2841
|
+
/** min(dolaLiquidity, dailyLimit − dailyBorrows) — API only. */
|
|
2842
|
+
leftToBorrow: number | null;
|
|
2843
|
+
/** Collateral price in USD (pessimistic-oracle based). */
|
|
2844
|
+
price: number | null;
|
|
2845
|
+
/** Live borrowPaused (falls back to the metadata snapshot). */
|
|
2846
|
+
borrowPaused: boolean | null;
|
|
2847
|
+
/** Borrows already taken today against `dailyLimit` — API only. */
|
|
2848
|
+
dailyBorrows: number | null;
|
|
2849
|
+
}
|
|
2850
|
+
/** Raw public-data batch for the FiRM deployment (one chain). */
|
|
2851
|
+
interface InverseMarketsRaw {
|
|
2852
|
+
/** The bare lender key, `INVERSE`. */
|
|
2853
|
+
lender: string;
|
|
2854
|
+
config: InverseConfigChain | undefined;
|
|
2855
|
+
chainData: InverseChainData | undefined;
|
|
2856
|
+
/**
|
|
2857
|
+
* DBR price in DOLA — THE fixed borrow APR as a decimal (0.041 =
|
|
2858
|
+
* 4.1%). API-first, metadata snapshot as fallback, `null` if neither
|
|
2859
|
+
* resolves.
|
|
2860
|
+
*/
|
|
2861
|
+
dbrPriceDola: number | null;
|
|
2862
|
+
/** Force-replenish penalty APR in bps (54.75% = 5475) — static read. */
|
|
2863
|
+
replenishmentPriceBps: number | null;
|
|
2864
|
+
markets: InverseMarketRaw[];
|
|
2865
|
+
/** Which source filled the market rows. */
|
|
2866
|
+
source: 'api' | 'chain' | 'none';
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
declare function fetchInverseMarkets(lender: string, chainId: string): Promise<InverseMarketsRaw>;
|
|
2870
|
+
|
|
2871
|
+
/**
|
|
2872
|
+
* Synthesized per-market lender key, e.g.
|
|
2873
|
+
* `INVERSE_63DF5E23DB45A2066508318F172BA45B9CD37035` (= the WETH
|
|
2874
|
+
* market). Address-suffixed (Teller/Exactly convention) — FiRM is
|
|
2875
|
+
* Ethereum-only so the chain id is not part of the key.
|
|
2876
|
+
*/
|
|
2877
|
+
declare function inverseLenderKey(lender: string, market: string): string;
|
|
2878
|
+
/** Recover `{ lender, market }` from a per-market key (or undefined). */
|
|
2879
|
+
declare function inverseKeyParts(key: string): {
|
|
2880
|
+
lender: string;
|
|
2881
|
+
market: string;
|
|
2882
|
+
} | undefined;
|
|
2883
|
+
/**
|
|
2884
|
+
* Map the FiRM batch into the shared `MorphoGeneralPublicResponse`
|
|
2885
|
+
* shape, keyed by `INVERSE_<MARKET_ADDR>` — one key per Market
|
|
2886
|
+
* (collateral).
|
|
2887
|
+
*
|
|
2888
|
+
* Per market:
|
|
2889
|
+
* - COLLATERAL entry: deposit-only; LTV = `collateralFactorBps`;
|
|
2890
|
+
* liquidation penalty = `liquidationIncentiveBps`; the close factor
|
|
2891
|
+
* is `liquidationFactorBps` (a liquidation may only close that
|
|
2892
|
+
* share of the position).
|
|
2893
|
+
* - LOAN entry (DOLA): `totalDebt` = market debt; the borrow rate is
|
|
2894
|
+
* the DBR price (FIXED APR — interest is prepaid in DBR, not
|
|
2895
|
+
* accrued on principal, `rateModel: 'dbr'`); `borrowLiquidity` =
|
|
2896
|
+
* `leftToBorrow` (API: min(dailyLimit headroom, DOLA in market)) or
|
|
2897
|
+
* `dolaLiquidity` in the on-chain fallback. There is NO supply side
|
|
2898
|
+
* — `totalDeposits` on the loan row is always 0 (DOLA is Fed-minted
|
|
2899
|
+
* into markets, not user-deposited).
|
|
2900
|
+
*
|
|
2901
|
+
* The full FiRM descriptor (minDebt, dailyLimit, escrow implementation,
|
|
2902
|
+
* DBR addresses, replenishment penalty) rides in
|
|
2903
|
+
* `params.market.inverse` for the calldata builders + worker-api
|
|
2904
|
+
* resolvers.
|
|
2905
|
+
*/
|
|
2906
|
+
declare function convertInverseMarketsToResponse(raw: InverseMarketsRaw, chainId: string, prices?: {
|
|
2907
|
+
[asset: string]: number;
|
|
2908
|
+
}, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
|
|
2909
|
+
[m: string]: MorphoGeneralPublicResponse;
|
|
2910
|
+
};
|
|
2911
|
+
|
|
2912
|
+
/** Off-chain `Market.predictEscrow(user)`. */
|
|
2913
|
+
declare function predictInverseEscrow(market: Address, escrowImplementation: Address, user: Address): Address;
|
|
2914
|
+
|
|
2915
|
+
/** Per-position FiRM detail attached to the debt row (raw strings). */
|
|
2916
|
+
interface InversePositionInfo {
|
|
2917
|
+
/** Pessimistic-oracle borrow ceiling for the CURRENT collateral (DOLA raw). */
|
|
2918
|
+
creditLimit: string;
|
|
2919
|
+
/** Max collateral withdrawable right now (collateral raw). */
|
|
2920
|
+
withdrawalLimit: string;
|
|
2921
|
+
/** DBR wallet balance (raw) — the prepaid-interest runway. */
|
|
2922
|
+
dbrBalance: string;
|
|
2923
|
+
/** DBR deficit (raw). > 0 ⇒ force-replenishable at 54.75% APR AND
|
|
2924
|
+
* withdrawals are FROZEN until the user buys DBR. */
|
|
2925
|
+
dbrDeficit: string;
|
|
2926
|
+
/** DBR signed balance (raw, may be negative). */
|
|
2927
|
+
dbrSignedBalance: string;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2710
2930
|
/**
|
|
2711
2931
|
* Raw on-chain read for ONE Teller `LenderCommitmentGroup` pool. All amounts are
|
|
2712
2932
|
* raw token base units; `minRateBps` is the pool's min borrow APR in BASIS
|
|
@@ -2839,6 +3059,361 @@ interface TellerDiscovery {
|
|
|
2839
3059
|
declare const getCachedTellerBids: (chainId: string, account: string) => TellerDiscovery | undefined;
|
|
2840
3060
|
declare const buildTellerUserCall: (chainId: string, _lender: string, account: string) => Promise<Call[]>;
|
|
2841
3061
|
|
|
3062
|
+
/**
|
|
3063
|
+
* TermMax public-data types.
|
|
3064
|
+
*
|
|
3065
|
+
* ─── SIDE SEMANTICS, READ THIS FIRST ───────────────────────────────────────
|
|
3066
|
+
* TermMax names its two curves from the MAKER's perspective, and they cross
|
|
3067
|
+
* over relative to what a taker (our user) is doing:
|
|
3068
|
+
*
|
|
3069
|
+
* maker's `lendCurveCuts` → consumed by a taker who BORROWS
|
|
3070
|
+
* maker's `borrowCurveCuts` → consumed by a taker who LENDS
|
|
3071
|
+
*
|
|
3072
|
+
* `ITermMaxOrder.apr()` inherits that naming, so its `lendApr` is our user's
|
|
3073
|
+
* BORROW rate and its `borrowApr` is our user's LEND rate — and the API's
|
|
3074
|
+
* `priceInfo.term.lcft` / `bcft` follow the same convention.
|
|
3075
|
+
*
|
|
3076
|
+
* Every field in this file is named for the TAKER action. The crossing happens
|
|
3077
|
+
* exactly once, at the adapter boundary in `apiClient.ts` / `onchain.ts`, and
|
|
3078
|
+
* nowhere else. If a value ever produces lend > borrow on the same order, the
|
|
3079
|
+
* mapping has been applied twice.
|
|
3080
|
+
* ───────────────────────────────────────────────────────────────────────────
|
|
3081
|
+
*/
|
|
3082
|
+
/**
|
|
3083
|
+
* One segment of an order's piecewise pricing curve (TermMax `CurveCut`).
|
|
3084
|
+
*
|
|
3085
|
+
* `xtReserve` is the LEFT EDGE of the segment's validity interval, not a
|
|
3086
|
+
* quantity. Within a segment the swap solves a constant product over
|
|
3087
|
+
* `(xtReserve + offset, liqSquare_eff / (xtReserve + offset))` where
|
|
3088
|
+
* `liqSquare_eff = liqSquare · daysToMaturity · nif / (365 · 1e8)`.
|
|
3089
|
+
*
|
|
3090
|
+
* This is the TermMax analogue of a Midnight book LEVEL, but continuous rather
|
|
3091
|
+
* than discrete — which is why it cannot reuse `MidnightBookLevel`.
|
|
3092
|
+
*/
|
|
3093
|
+
interface TermMaxCurveSegment {
|
|
3094
|
+
xtReserve: bigint;
|
|
3095
|
+
liqSquare: bigint;
|
|
3096
|
+
/** Signed — shifts the virtual reserve. */
|
|
3097
|
+
offset: bigint;
|
|
3098
|
+
}
|
|
3099
|
+
/** Per-order fee ratios, 1e8-scaled (`0.02e8` = 2%). Fees apply to the INTEREST, not principal. */
|
|
3100
|
+
interface TermMaxFeeConfig {
|
|
3101
|
+
lendTakerFeeRatio: bigint;
|
|
3102
|
+
lendMakerFeeRatio: bigint;
|
|
3103
|
+
borrowTakerFeeRatio: bigint;
|
|
3104
|
+
borrowMakerFeeRatio: bigint;
|
|
3105
|
+
mintGtFeeRatio: bigint;
|
|
3106
|
+
mintGtFeeRef: bigint;
|
|
3107
|
+
}
|
|
3108
|
+
/**
|
|
3109
|
+
* Live state of one maker order, already mapped to taker-side semantics.
|
|
3110
|
+
*
|
|
3111
|
+
* An order can source liquidity beyond its own token balance (from an ERC-4626
|
|
3112
|
+
* `pool`, or by minting fresh FT against the maker's own `gtId`), so
|
|
3113
|
+
* balance-derived depth UNDERSTATES what is actually executable. Prefer the
|
|
3114
|
+
* capacity fields on {@link TermMaxBookTop}, or quote.
|
|
3115
|
+
*/
|
|
3116
|
+
interface TermMaxOrderState {
|
|
3117
|
+
orderAddress: string;
|
|
3118
|
+
marketAddress: string;
|
|
3119
|
+
/** The maker; `makerIsVault` when it is a curated ERC-4626 vault. */
|
|
3120
|
+
makerAddress?: string;
|
|
3121
|
+
makerIsVault?: boolean;
|
|
3122
|
+
/** THE pricing state in V2 (V1 used the real XT balance). */
|
|
3123
|
+
virtualXtReserve: bigint;
|
|
3124
|
+
ftReserve: bigint;
|
|
3125
|
+
xtReserve: bigint;
|
|
3126
|
+
maxXtReserve: bigint;
|
|
3127
|
+
/** Maker's own GT, used to mint FT on demand. 0 = none (it is a sentinel). */
|
|
3128
|
+
gtId: bigint;
|
|
3129
|
+
/** Curve a TAKER LENDS against (TermMax's `borrowCurveCuts`). */
|
|
3130
|
+
takerLendCuts: TermMaxCurveSegment[];
|
|
3131
|
+
/** Curve a TAKER BORROWS against (TermMax's `lendCurveCuts`). */
|
|
3132
|
+
takerBorrowCuts: TermMaxCurveSegment[];
|
|
3133
|
+
feeConfig?: TermMaxFeeConfig;
|
|
3134
|
+
/** Optional ERC-4626 base-yield sink; absent/zero when unset. */
|
|
3135
|
+
pool?: string;
|
|
3136
|
+
/** Executable size caps in USD, as reported upstream. */
|
|
3137
|
+
lendCapacityUsd: number;
|
|
3138
|
+
borrowCapacityUsd: number;
|
|
3139
|
+
/** Executable size caps in debt-token units (human, not raw). */
|
|
3140
|
+
lendCapacityAmount: number;
|
|
3141
|
+
borrowCapacityAmount: number;
|
|
3142
|
+
/** Fee-free mid APRs as fractions (0.055 = 5.5%), taker-side. Display only. */
|
|
3143
|
+
takerLendApr?: number;
|
|
3144
|
+
takerBorrowApr?: number;
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* Best executable rate per side plus aggregate depth for one market — the
|
|
3148
|
+
* direct analogue of `MidnightBookTop`, collapsed across every order.
|
|
3149
|
+
*
|
|
3150
|
+
* "Best" is order-agnostic (we scan all orders): best LEND = highest taker-lend
|
|
3151
|
+
* APR, best BORROW = lowest taker-borrow APR.
|
|
3152
|
+
*/
|
|
3153
|
+
interface TermMaxBookTop {
|
|
3154
|
+
/** Highest taker LEND APR available, as a fraction. Undefined when no order quotes the side. */
|
|
3155
|
+
bestLendApr?: number;
|
|
3156
|
+
/** Lowest taker BORROW APR available, as a fraction. */
|
|
3157
|
+
bestBorrowApr?: number;
|
|
3158
|
+
/** Aggregate executable depth, USD. */
|
|
3159
|
+
lendDepthUsd: number;
|
|
3160
|
+
borrowDepthUsd: number;
|
|
3161
|
+
/** Aggregate executable depth in debt-token units (human). */
|
|
3162
|
+
lendDepthAmount: number;
|
|
3163
|
+
borrowDepthAmount: number;
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* A TermMax market, i.e. one (debtToken, collateral, maturity) tuple.
|
|
3167
|
+
*
|
|
3168
|
+
* Discovered DYNAMICALLY — never read from a static registry. Matured markets
|
|
3169
|
+
* disappear from upstream entirely rather than lingering with a flag, and ~15%
|
|
3170
|
+
* of the book can roll on a single maturity date.
|
|
3171
|
+
*/
|
|
3172
|
+
interface TermMaxMarketConfig {
|
|
3173
|
+
/** Market contract — also the per-market lender-key body. */
|
|
3174
|
+
market: string;
|
|
3175
|
+
/** FT: the zero-coupon bond ERC-20. THE LEND POSITION. */
|
|
3176
|
+
ft: string;
|
|
3177
|
+
/** XT: the complement (`FT + XT = 1` debt token). */
|
|
3178
|
+
xt: string;
|
|
3179
|
+
/** GT: the ERC-721 loan. THE BORROW POSITION (sub-accounts). */
|
|
3180
|
+
gt: string;
|
|
3181
|
+
/** Debt / loan token. */
|
|
3182
|
+
debtToken: string;
|
|
3183
|
+
debtDecimals: number;
|
|
3184
|
+
collateral: string;
|
|
3185
|
+
collateralDecimals: number;
|
|
3186
|
+
/** Display symbol, e.g. `USDC/PT-sUSDE-13AUG2026@16AUG2026`. */
|
|
3187
|
+
symbol?: string;
|
|
3188
|
+
/** Unix seconds. */
|
|
3189
|
+
maturity: number;
|
|
3190
|
+
/** 1e8-scaled, as strings (as upstream reports them). */
|
|
3191
|
+
maxLtv: string;
|
|
3192
|
+
liquidationLtv: string;
|
|
3193
|
+
/** false ⇒ NO liquidation at all, only post-maturity physical delivery. */
|
|
3194
|
+
liquidatable: boolean;
|
|
3195
|
+
/** Post-maturity liquidation window, seconds (7200 on every live market). */
|
|
3196
|
+
liquidationWindowSeconds?: number;
|
|
3197
|
+
/** Contract `getVersion()`: `v2` = "2.0.0", `v2_01` = "2.0.1". Both are V2. */
|
|
3198
|
+
version?: string;
|
|
3199
|
+
/** Market-level fee config (1e8-scaled). */
|
|
3200
|
+
feeConfig?: TermMaxFeeConfig;
|
|
3201
|
+
/** Oracle the protocol itself prices LTV/liquidation against. */
|
|
3202
|
+
oracle?: string;
|
|
3203
|
+
isMatured?: boolean;
|
|
3204
|
+
isEnabled?: boolean;
|
|
3205
|
+
}
|
|
3206
|
+
/** A market paired with its live book state. `top` is null when the fetch failed. */
|
|
3207
|
+
interface TermMaxMarketRaw {
|
|
3208
|
+
config: TermMaxMarketConfig;
|
|
3209
|
+
top: TermMaxBookTop | null;
|
|
3210
|
+
/** Per-order state, best-first by taker rate. Empty when the market has no live orders. */
|
|
3211
|
+
orders: TermMaxOrderState[];
|
|
3212
|
+
}
|
|
3213
|
+
/**
|
|
3214
|
+
* Pluggable TermMax data source — the hosted API today, a self-hosted indexer
|
|
3215
|
+
* or a pure on-chain reader later. Mirrors `MidnightBookSource`.
|
|
3216
|
+
*/
|
|
3217
|
+
interface TermMaxDataSource {
|
|
3218
|
+
/**
|
|
3219
|
+
* Every live market on a chain with its orders, or null when unavailable.
|
|
3220
|
+
* One upstream call per chain on the happy path.
|
|
3221
|
+
*/
|
|
3222
|
+
getChainMarkets(chainId: string): Promise<TermMaxMarketRaw[] | null>;
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
/**
|
|
3226
|
+
* Resolve a TermMax market from the discovery cache, or undefined when it was
|
|
3227
|
+
* never fetched / has gone stale. Callers that need a guaranteed answer should
|
|
3228
|
+
* `await fetchTermMaxMarkets(chainId)` first (or read the market on-chain).
|
|
3229
|
+
*/
|
|
3230
|
+
declare function getCachedTermMaxMarket(chainId: string | number, market: string): TermMaxMarketConfig | undefined;
|
|
3231
|
+
/** All markets cached for a chain (may be empty before the first fetch). */
|
|
3232
|
+
declare function getCachedTermMaxMarkets(chainId: string | number): TermMaxMarketConfig[];
|
|
3233
|
+
/**
|
|
3234
|
+
* Fetch every live TermMax market on a chain, with its order book collapsed to
|
|
3235
|
+
* a best-rate + depth snapshot.
|
|
3236
|
+
*
|
|
3237
|
+
* Returns `[]` (not an error) when the chain has no TermMax deployment
|
|
3238
|
+
* configured, so callers can fan out across chains unconditionally.
|
|
3239
|
+
*
|
|
3240
|
+
* Markets are DISCOVERED, never read from a static list: matured markets vanish
|
|
3241
|
+
* from upstream entirely rather than lingering with a flag, and ~15% of the
|
|
3242
|
+
* book can roll on a single maturity date.
|
|
3243
|
+
*/
|
|
3244
|
+
declare function fetchTermMaxMarkets(chainId: string, source?: TermMaxDataSource): Promise<TermMaxMarketRaw[]>;
|
|
3245
|
+
|
|
3246
|
+
/**
|
|
3247
|
+
* Map fetched TermMax markets into the shared `MorphoGeneralPublicResponse`
|
|
3248
|
+
* shape, keyed by the synthesized `TERMMAX_<MARKET_ADDR>` lender key.
|
|
3249
|
+
*
|
|
3250
|
+
* Each TermMax market is ONE (debt, collateral, maturity) tuple, so it emits
|
|
3251
|
+
* exactly two entries — unlike Midnight, which has several collateral legs per
|
|
3252
|
+
* market:
|
|
3253
|
+
* - LOAN entry: `depositRate` = best taker LEND APR, `variableBorrowRate` =
|
|
3254
|
+
* best taker BORROW APR (already crossed from TermMax's maker-side names in
|
|
3255
|
+
* `apiClient.parseOrder`), plus order-book depth as the liquidity proxy.
|
|
3256
|
+
* - COLLATERAL entry: maxLtv → collateralFactor, liquidationLtv →
|
|
3257
|
+
* borrowCollateralFactor, fixed 10% liquidation penalty.
|
|
3258
|
+
*
|
|
3259
|
+
* Rates are DISPLAY values from the fee-free mid quote. Anything that actually
|
|
3260
|
+
* executes must price off a live quote at build time.
|
|
3261
|
+
*/
|
|
3262
|
+
declare function convertTermMaxMarketsToResponse(raw: TermMaxMarketRaw[], chainId: string, prices?: {
|
|
3263
|
+
[asset: string]: number;
|
|
3264
|
+
}, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
|
|
3265
|
+
[m: string]: MorphoGeneralPublicResponse;
|
|
3266
|
+
};
|
|
3267
|
+
|
|
3268
|
+
/** Hosted TermMax data API (Swagger at `/api-docs`, spec at `/api-docs-json`). */
|
|
3269
|
+
declare const DEFAULT_TERMMAX_API = "https://api.termmax.ts.finance";
|
|
3270
|
+
type FetchLike = typeof fetch;
|
|
3271
|
+
/** Resolve a chain's TermMax API base (config override → hosted default). */
|
|
3272
|
+
declare function termMaxApiBase(chainId: string): string;
|
|
3273
|
+
/**
|
|
3274
|
+
* Hosted-API data source. ONE call per chain — `GET /market/data?chainId=`
|
|
3275
|
+
* returns global config, asset configs, markets, order configs and live order
|
|
3276
|
+
* state together (~240KB on Ethereum).
|
|
3277
|
+
*
|
|
3278
|
+
* This is the swappable seam: a self-hosted indexer or a pure on-chain reader
|
|
3279
|
+
* can implement {@link TermMaxDataSource} later without touching callers.
|
|
3280
|
+
*
|
|
3281
|
+
* Reliability posture: the endpoint is an undocumented app backend (no
|
|
3282
|
+
* versioning or rate-limit statement, `/admin/*` routes on the same host), so
|
|
3283
|
+
* treat it exactly like the Morpho GraphQL API — primary, but the caller keeps
|
|
3284
|
+
* a last-known-good snapshot (see fetchPublic.ts).
|
|
3285
|
+
*/
|
|
3286
|
+
declare class TermMaxApiSource implements TermMaxDataSource {
|
|
3287
|
+
private readonly baseUrl;
|
|
3288
|
+
private readonly fetchImpl;
|
|
3289
|
+
constructor(baseUrl: string, fetchImpl?: FetchLike);
|
|
3290
|
+
getChainMarkets(chainId: string): Promise<TermMaxMarketRaw[] | null>;
|
|
3291
|
+
}
|
|
3292
|
+
/** Default data source for a chain (hosted API, resolved per chain). */
|
|
3293
|
+
declare function createTermMaxDataSource(chainId: string, fetchImpl?: FetchLike): TermMaxDataSource;
|
|
3294
|
+
|
|
3295
|
+
/** TermMax ratio base: `0.01e8` = 1%. */
|
|
3296
|
+
declare const DECIMAL_BASE = 100000000n;
|
|
3297
|
+
/**
|
|
3298
|
+
* Days to maturity, **ceilinged to whole days** — exactly as
|
|
3299
|
+
* `TermMaxOrderV2._daysToMaturity` does it:
|
|
3300
|
+
*
|
|
3301
|
+
* `(maturity - now + SECONDS_IN_DAY - 1) / SECONDS_IN_DAY`
|
|
3302
|
+
*
|
|
3303
|
+
* Reproduce the ceiling or an off-chain quote drifts by up to a full day of
|
|
3304
|
+
* interest against the contract. Returns 0 at/after maturity.
|
|
3305
|
+
*/
|
|
3306
|
+
declare function daysToMaturity(maturity: number, nowSec: number): bigint;
|
|
3307
|
+
/**
|
|
3308
|
+
* Marginal (fee-free) APR implied by a curve at a given reserve, 1e8-scaled —
|
|
3309
|
+
* the same formula `TermMaxOrderV2.apr()` uses:
|
|
3310
|
+
*
|
|
3311
|
+
* `apr = vFt · 1e8 · 365 / (vXt · daysToMaturity)`
|
|
3312
|
+
*
|
|
3313
|
+
* Returns 0n for an empty curve or a matured market. This is a MID PRICE at the
|
|
3314
|
+
* current reserve: it ignores both the taker fee and trade size, so it is for
|
|
3315
|
+
* display and sorting only — never quote against it.
|
|
3316
|
+
*/
|
|
3317
|
+
declare function curveApr(cuts: TermMaxCurveSegment[], virtualXtReserve: bigint, days: bigint): bigint;
|
|
3318
|
+
/** 1e8-scaled ratio → plain fraction (`5_500_000n` → `0.055`). */
|
|
3319
|
+
declare function ratioToNumber(v: bigint): number;
|
|
3320
|
+
/** 1e8-scaled ratio → percent (`5_500_000n` → `5.5`). */
|
|
3321
|
+
declare function ratioToPercent(v: bigint): number;
|
|
3322
|
+
/**
|
|
3323
|
+
* Marginal APR as a fraction for one side, taker-side by construction.
|
|
3324
|
+
*
|
|
3325
|
+
* Pass `takerLendCuts` for the lend rate and `takerBorrowCuts` for the borrow
|
|
3326
|
+
* rate — the maker/taker crossing has already been applied when those fields
|
|
3327
|
+
* were built (see types.ts).
|
|
3328
|
+
*/
|
|
3329
|
+
declare function curveAprNumber(cuts: TermMaxCurveSegment[], virtualXtReserve: bigint, days: bigint): number;
|
|
3330
|
+
/**
|
|
3331
|
+
* Net-interest factor for a taker LEND (`1e8 - lendTakerFeeRatio`).
|
|
3332
|
+
* Guarded so a malformed fee config cannot produce a non-positive factor.
|
|
3333
|
+
*/
|
|
3334
|
+
declare function lendNif(fee?: TermMaxFeeConfig): bigint;
|
|
3335
|
+
/** Net-interest factor for a taker BORROW (`1e8 + borrowTakerFeeRatio`). */
|
|
3336
|
+
declare function borrowNif(fee?: TermMaxFeeConfig): bigint;
|
|
3337
|
+
/**
|
|
3338
|
+
* The GT-mint fee ratio at a given time to maturity, 1e8-scaled — mirrors
|
|
3339
|
+
* `TermMaxMarketV2.mintGtFeeRatio()`:
|
|
3340
|
+
*
|
|
3341
|
+
* `days · feeRatio · feeRef / (365·1e8 + feeRef·days)`
|
|
3342
|
+
*
|
|
3343
|
+
* This is a genuine percentage OF PRINCIPAL charged once at borrow time
|
|
3344
|
+
* (`issueFee = debt · ratio / 1e8`), so it maps onto the cross-protocol
|
|
3345
|
+
* `FixedTermInfo.fees.originationFeePercent`. It is NOT the raw
|
|
3346
|
+
* `feeConfig.mintGtFeeRatio` — prefer reading the contract when you can.
|
|
3347
|
+
*/
|
|
3348
|
+
declare function mintGtFeeRatio(fee: TermMaxFeeConfig | undefined, days: bigint): bigint;
|
|
3349
|
+
/**
|
|
3350
|
+
* TermMax liquidation penalty as a fraction of the repaid debt.
|
|
3351
|
+
*
|
|
3352
|
+
* Protocol constants, not per-market: the liquidator is paid 5% and the
|
|
3353
|
+
* protocol reserve takes 5%, so the borrower loses 10% of the liquidated debt
|
|
3354
|
+
* value. (Loans over $10k can only be liquidated 50% at a time; that is a size
|
|
3355
|
+
* cap, not a penalty, and is modeled as `closeFactor`.)
|
|
3356
|
+
*/
|
|
3357
|
+
declare const TERMMAX_LIQUIDATION_PENALTY = 0.1;
|
|
3358
|
+
declare const TERMMAX_LIQUIDATOR_BONUS = 0.05;
|
|
3359
|
+
/** Partial-liquidation threshold, USD: above it a single call can take at most 50%. */
|
|
3360
|
+
declare const TERMMAX_PARTIAL_LIQUIDATION_THRESHOLD_USD = 10000;
|
|
3361
|
+
declare const TERMMAX_PARTIAL_CLOSE_FACTOR = 0.5;
|
|
3362
|
+
/** Post-maturity liquidation window before physical delivery (`Constants.LIQUIDATION_WINDOW`). */
|
|
3363
|
+
declare const TERMMAX_LIQUIDATION_WINDOW_SECS = 7200;
|
|
3364
|
+
/**
|
|
3365
|
+
* Parse a 1e8-scaled LTV string into a plain fraction (`87500000` → `0.875`).
|
|
3366
|
+
* Returns 0 for missing/garbage input rather than NaN, so a bad config row
|
|
3367
|
+
* degrades to "no collateral value" instead of poisoning the optimizer.
|
|
3368
|
+
*/
|
|
3369
|
+
declare function parseTermMaxLtv(v: string | number | bigint | undefined): number;
|
|
3370
|
+
|
|
3371
|
+
/**
|
|
3372
|
+
* TermMax user data is a DISCOVERY-first, async build — the Teller/Liquity
|
|
3373
|
+
* shape, not the Midnight one.
|
|
3374
|
+
*
|
|
3375
|
+
* Midnight can build synchronously because its positions are keyed
|
|
3376
|
+
* `(marketId, user)`: one fixed slot per user per market, with the market list
|
|
3377
|
+
* coming from a static registry. TermMax has neither property:
|
|
3378
|
+
*
|
|
3379
|
+
* 1. the market list is DYNAMIC (markets churn on every maturity roll and
|
|
3380
|
+
* matured ones vanish upstream), so it must be resolved at call time; and
|
|
3381
|
+
* 2. borrow positions are GT ERC-721 sub-accounts — a user can hold N per
|
|
3382
|
+
* market and the ids are not derivable.
|
|
3383
|
+
*
|
|
3384
|
+
* But it is cheaper than Teller: `TermMaxViewer.getPositionDetails(markets[],
|
|
3385
|
+
* owner)` returns FT/XT/collateral balances AND every GT with its debt and
|
|
3386
|
+
* collateral in ONE call, so discovery and data collapse into a single
|
|
3387
|
+
* multicall entry — no two-phase discovery round-trip. The viewer `try`-guards
|
|
3388
|
+
* each position internally, so one bad loan cannot poison the batch.
|
|
3389
|
+
*
|
|
3390
|
+
* Health is NOT read per GT (`getLiquidationInfo`): it is computed downstream
|
|
3391
|
+
* from LTVs + oracle prices in `createMultiAccountTypeUserState`, exactly as
|
|
3392
|
+
* Midnight does. That keeps this to one call.
|
|
3393
|
+
*/
|
|
3394
|
+
/** Every TermMax market read consumes exactly one viewer call (batched). */
|
|
3395
|
+
declare const TERMMAX_CALLS_PER_ACCOUNT = 1;
|
|
3396
|
+
interface TermMaxDiscovery {
|
|
3397
|
+
/** Markets passed to the viewer, IN ORDER — the parser slices results by index. */
|
|
3398
|
+
markets: TermMaxMarketConfig[];
|
|
3399
|
+
at: number;
|
|
3400
|
+
}
|
|
3401
|
+
/**
|
|
3402
|
+
* The market layout used for the last build on this (chain, account).
|
|
3403
|
+
*
|
|
3404
|
+
* The parser runs as a separate phase, fed only the multicall results, so it
|
|
3405
|
+
* needs the layout the builder chose — the same trick the Teller / Liquity /
|
|
3406
|
+
* Lista-broker caches use.
|
|
3407
|
+
*/
|
|
3408
|
+
declare const getCachedTermMaxDiscovery: (chainId: string, account: string) => TermMaxDiscovery | undefined;
|
|
3409
|
+
/**
|
|
3410
|
+
* Build the user-data call for every live TermMax market on a chain.
|
|
3411
|
+
*
|
|
3412
|
+
* Returns `[]` when the chain has no TermMax deployment, no viewer configured,
|
|
3413
|
+
* or no live markets — callers can fan out unconditionally.
|
|
3414
|
+
*/
|
|
3415
|
+
declare const buildTermMaxUserCall: (chainId: string, _lender: string, account: string) => Promise<Call[]>;
|
|
3416
|
+
|
|
2842
3417
|
type PendleAssetTypes = 'PT' | 'YT' | 'SY' | 'PENDLE_LP';
|
|
2843
3418
|
/**
|
|
2844
3419
|
* Main function to fetch Pendle prices
|
|
@@ -4068,6 +4643,121 @@ type EulerEarnVaults = {
|
|
|
4068
4643
|
[vaultAddress: string]: EulerEarnVault;
|
|
4069
4644
|
};
|
|
4070
4645
|
|
|
4646
|
+
/**
|
|
4647
|
+
* Parsed TermMax curated vault entry.
|
|
4648
|
+
*
|
|
4649
|
+
* TermMax vaults are the CONTINUOUS earn side of a fixed-maturity protocol.
|
|
4650
|
+
* The per-market lend position (buying FT) expires; a vault holds a rolling
|
|
4651
|
+
* book of orders across many maturities and rolls them for the depositor, so
|
|
4652
|
+
* from the outside it behaves like an ordinary ERC-4626 yield vault. Same
|
|
4653
|
+
* relationship Fluid has between its per-vault borrow markets and its fTokens.
|
|
4654
|
+
*
|
|
4655
|
+
* Multiple vaults exist per underlying with different curators (Keyrock, MEV
|
|
4656
|
+
* Capital, Origami and TermMax itself all curate), so the map is keyed by
|
|
4657
|
+
* VAULT ADDRESS —
|
|
4658
|
+
* the `MorphoVaults` / `SiloVaults` / `EulerEarnVaults` convention, not the
|
|
4659
|
+
* key-by-underlying convention Fluid and Gearbox use.
|
|
4660
|
+
*
|
|
4661
|
+
* IMPORTANT — vault assets and lender-side depth are the SAME capital. A
|
|
4662
|
+
* vault's deposits are what appear as lend-side order depth in the TermMax
|
|
4663
|
+
* lender data, so summing "TermMax lender TVL + TermMax vault TVL" double
|
|
4664
|
+
* counts.
|
|
4665
|
+
*/
|
|
4666
|
+
interface TermMaxVault extends VaultClassificationFields {
|
|
4667
|
+
/** Vault (share-token) contract address, lowercased. */
|
|
4668
|
+
address: string;
|
|
4669
|
+
/** Lowercased underlying ERC-20 address (the markets' debt token). */
|
|
4670
|
+
underlying: string;
|
|
4671
|
+
/** Vault share-token symbol, e.g. `TMKR-RLUSD`. */
|
|
4672
|
+
symbol: string;
|
|
4673
|
+
/** Vault share-token name, e.g. `Coinshift rlUSD vault`. */
|
|
4674
|
+
name: string;
|
|
4675
|
+
/** Share-token decimals. */
|
|
4676
|
+
decimals: number;
|
|
4677
|
+
/** Underlying asset decimals — read on-chain, may differ from `decimals`. */
|
|
4678
|
+
assetDecimals: number;
|
|
4679
|
+
/** Total underlying assets held, raw integer as string. */
|
|
4680
|
+
totalAssets: string;
|
|
4681
|
+
/** Total shares minted, raw integer as string. */
|
|
4682
|
+
totalSupply: string;
|
|
4683
|
+
/** Raw `convertToAssets(10**shareDecimals)` — 1 share → X underlying. */
|
|
4684
|
+
convertToAssets: string;
|
|
4685
|
+
/**
|
|
4686
|
+
* Supply APR in percent, **net of the performance fee**.
|
|
4687
|
+
*
|
|
4688
|
+
* TermMax's own formula (`OrderManagerV2`):
|
|
4689
|
+
* `annualizedInterest · (1e8 − performanceFeeRate) / accretingPrincipal`
|
|
4690
|
+
* `annualizedInterest` is GROSS — the fee is taken out of it on accrual
|
|
4691
|
+
* (`_accretingPrincipal += interest − performanceFeeToCurator`), so it must
|
|
4692
|
+
* be netted here to match the README's "net of performance fee" convention.
|
|
4693
|
+
*
|
|
4694
|
+
* Served directly by the API. The on-chain fallback derives it, because
|
|
4695
|
+
* `apr()` AND `accretingPrincipal()` both revert on the deployed 2.0.0
|
|
4696
|
+
* vaults — it substitutes `totalAssets` as the denominator, which is larger
|
|
4697
|
+
* and so understates rather than overstates. The derivation was validated
|
|
4698
|
+
* against the API on both funded Ethereum vaults: 2.579% and 1.449%,
|
|
4699
|
+
* matching to 3 decimals.
|
|
4700
|
+
*/
|
|
4701
|
+
supplyRate: number;
|
|
4702
|
+
/** Extra rewards APR (TMX emissions). 0 on the on-chain fallback, which
|
|
4703
|
+
* cannot see them. */
|
|
4704
|
+
rewardsRate: number;
|
|
4705
|
+
/** `supplyRate + rewardsRate` — what a depositor actually earns. */
|
|
4706
|
+
depositRate: number;
|
|
4707
|
+
/** Performance fee in percent (e.g. `10` = 10%). */
|
|
4708
|
+
fee: number;
|
|
4709
|
+
/** Governance timelock in seconds for curator/guardian config changes. */
|
|
4710
|
+
timelock?: number;
|
|
4711
|
+
/** Curator address, lowercased. */
|
|
4712
|
+
curator?: string;
|
|
4713
|
+
/**
|
|
4714
|
+
* Human-readable curator label.
|
|
4715
|
+
*
|
|
4716
|
+
* ONLY the API carries this — the on-chain surface exposes an address and
|
|
4717
|
+
* nothing else. Do NOT derive it from `name`: the vault literally called
|
|
4718
|
+
* "Coinshift rlUSD vault" is curated by **Keyrock**.
|
|
4719
|
+
*/
|
|
4720
|
+
curatorName?: string;
|
|
4721
|
+
/** Guardian address, lowercased. */
|
|
4722
|
+
guardian?: string;
|
|
4723
|
+
/** Hydrated asset metadata from the provided token list, if any. */
|
|
4724
|
+
asset?: GenericCurrency;
|
|
4725
|
+
/** USD price of one underlying unit, if prices were supplied. */
|
|
4726
|
+
priceUsd?: number;
|
|
4727
|
+
/** `totalAssets / 10^assetDecimals`. */
|
|
4728
|
+
totalAssetsFormatted: number;
|
|
4729
|
+
/** `totalAssetsFormatted * priceUsd`. */
|
|
4730
|
+
totalAssetsUsd: number;
|
|
4731
|
+
/**
|
|
4732
|
+
* Immediately withdrawable underlying, raw integer as string.
|
|
4733
|
+
*
|
|
4734
|
+
* A TermMax vault's capital is committed to maker orders until each order's
|
|
4735
|
+
* maturity, so only part is instantly exitable — the rest needs the curator
|
|
4736
|
+
* to unwind or a maturity to roll. Sourced from the API's `redeemableAmt`
|
|
4737
|
+
* (falling back to `idleFunds`), or the vault's own underlying balance
|
|
4738
|
+
* on-chain. Deliberately NOT `totalAssets`.
|
|
4739
|
+
*/
|
|
4740
|
+
liquidity: string;
|
|
4741
|
+
liquidityFormatted: number;
|
|
4742
|
+
liquidityUsd: number;
|
|
4743
|
+
/** Contract `getVersion()` / API `version`, e.g. `"2.0.0"` / `"v2"`. */
|
|
4744
|
+
version?: string;
|
|
4745
|
+
/** Vault is paused — deposits blocked, existing funds still visible. */
|
|
4746
|
+
isPaused?: boolean;
|
|
4747
|
+
/** Deposit cap in underlying base units (API `capacity`). */
|
|
4748
|
+
supplyCap?: string;
|
|
4749
|
+
/**
|
|
4750
|
+
* The vault's ERC-4626 base-yield pool for idle funds (v2_01 "composable
|
|
4751
|
+
* base yield"). Idle capital earns here instead of sitting dead.
|
|
4752
|
+
*/
|
|
4753
|
+
basePool?: string;
|
|
4754
|
+
}
|
|
4755
|
+
/** Full parsed payload: per-vault-address map. */
|
|
4756
|
+
type TermMaxVaults = {
|
|
4757
|
+
/** Keyed by lowercased vault address. */
|
|
4758
|
+
[vaultAddress: string]: TermMaxVault;
|
|
4759
|
+
};
|
|
4760
|
+
|
|
4071
4761
|
/**
|
|
4072
4762
|
* Validator / delegation dataset for LST deposits.
|
|
4073
4763
|
*
|
|
@@ -5949,7 +6639,7 @@ interface VaultLookupEntry {
|
|
|
5949
6639
|
declare function buildVaultLookup(data: VaultPublicDataAll): Map<string, VaultLookupEntry>;
|
|
5950
6640
|
|
|
5951
6641
|
/** Supported ERC-4626 vault providers. */
|
|
5952
|
-
type VaultProvider = 'fluid' | 'gearbox' | 'morpho' | 'lista' | 'silo' | 'euler-earn' | 'lst' | 'savings' | 'lagoon' | 'aave-earn' | 'upshift' | 'yearn' | 'hypercore' | 'gmx';
|
|
6642
|
+
type VaultProvider = 'fluid' | 'gearbox' | 'morpho' | 'lista' | 'silo' | 'euler-earn' | 'termmax' | 'lst' | 'savings' | 'lagoon' | 'aave-earn' | 'upshift' | 'yearn' | 'hypercore' | 'gmx';
|
|
5953
6643
|
/**
|
|
5954
6644
|
* Per-provider payload returned by `getVaultPublicDataAll`. Each entry is
|
|
5955
6645
|
* present only when the matching provider was requested AND its fetch
|
|
@@ -5966,6 +6656,7 @@ interface VaultPublicDataAll {
|
|
|
5966
6656
|
lista?: MorphoVaults;
|
|
5967
6657
|
silo?: SiloVaults;
|
|
5968
6658
|
'euler-earn'?: EulerEarnVaults;
|
|
6659
|
+
termmax?: TermMaxVaults;
|
|
5969
6660
|
lst?: LstShareTokens;
|
|
5970
6661
|
savings?: SavingsVaults;
|
|
5971
6662
|
lagoon?: LagoonVaults;
|
|
@@ -6755,4 +7446,4 @@ interface FetchTokenBalancesOptions {
|
|
|
6755
7446
|
*/
|
|
6756
7447
|
declare function fetchTokenBalances(chainId: string, account: string, tokens: string[], options?: FetchTokenBalancesOptions): Promise<TokenBalanceResult>;
|
|
6757
7448
|
|
|
6758
|
-
export { type AaveMetadata, type AaveV2Public, type AaveV2UserReserveResponse, type AaveV3Public, type AaveV3UserReserveResponse, type AdditionalYields, ApiBookSource, type AprData, type BalanceData, type BaseLendingPosition, type BasicReserveResponse, type ChainDiagnostic, type ChainLinkResponse, type ChainQuery, type ChainSummary, type CompoundV2Metadata, type CompoundV3Public, type CompoundV3UserReserveResponse, type ConfigEntry, type CoreValidators, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_STALE_REJECT_SECONDS, type Denomination, type DepthMap, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, type EulerEarnVault, type EulerEarnVaults, type EulerV2Metadata, type ExactlyFixedPool, type ExactlyFixedPosition, type ExactlyMarketAccount, type ExactlyMarketsRaw, type ExactlyUserFixedPosition, type ExtraValidationCall, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, 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 GroupAccumulator, HYPERCORE_VAULT_REGISTRY, type HypercoreLockStatus, type HypercoreUserPositionsOptions, type HypercoreVault, type HypercoreVaultPosition, type HypercoreVaultRegistryEntry, type HypercoreVaults, type HypercoreVaultsFetchOptions, IDLE_MARKET_ID, INTERFACE_IDS, type InitMetadata, type InitPublic, type InitUserReserveResponse, type InterfaceKind, LAGOON_API_URL, LAGOON_CHAIN_IDS, type LagoonApiVault, type LagoonSyncMode, type LagoonVault, type LagoonVaults, 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 LiquityBranchRaw, type LiquityDiscoveredTrove, type LiquityDiscovery, type LiquityMarketsRaw, type LiquitySpInfo, type LiquityTroveInfo, type ListaMarketOverrides, type LoopPostTradeMetrics, type LstDelegation, type LstDelegationKind, type LstValidator, type LstWithdrawalFetchOptions, type LstWithdrawalRegistryEntry, type LstWithdrawalRequest, type LstWithdrawalRequestsByLst, type LstWithdrawalStatus, MORPHO_LENS, MaxParamThresholds, type MergedUserData, type MidnightBook, type MidnightBookLevel, type MidnightBookSource, type ModeBase, type MorphoMarketOverrides, type MorphoSubgraphProxyConfig, type MorphoUserMarketBalance, type MorphoUserReserveResponse, type MorphoVault, type MorphoVaults, type MulticallRpcBatch, type NumberMap, type OracleDiagnostics, type OraclePriceEntry, type OraclePricesResult, type OutlierGuardConfig, type ParsedBalanceData, type ParsedResponse, type ParsedUserBalance, type PermissionParams, type PoolData, type PoolWithMeta, type PortfolioSummary, type PortfolioTotals, type PostTradeMetrics, type PreparedCall, type PreparedMergedMulticallParams, type PreparedMergedRpcCalls, type PreparedTokenBalanceRpcCalls, type PreparedUserDataRpcCalls, type PriceDerivation, type PriceSelection, type ProtocolParams, type ProviderOptions, type RawRpcBatch, type RawRpcCall, type RawRpcResponse, type RiverMarketRaw, type RiverMarketsRaw, type RiverPositionInfo, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, type SelectPricesOptions, type SiloVault, type SiloVaults, type StCeloValidatorGroup, type StaleFeedEntry, type StructuredOraclePrices, type SubAccountSummary, type SumerPositionInput, type SummaryAprData, type SummaryBalanceData, TELLER_CALLS_PER_BID, type TellerDiscoveredBid, type TellerDiscovery, type TellerMarketsRaw, type TellerPoolRaw, type TermAuctionOrder, type TermAuctionOrders, type TermBookSource, type TermBookTop, type TermListing, type TermMarketRaw, TermSubgraphSource, 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 UserApr, type UserConfig, type UserData, type UserDataResult, type UserLendingPosition, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, type VaultAprResult, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultPublicDataAll, type VaultPublicDataResult, type VaultYieldSeries, type VaultYieldSnapshot, type YDaemonVault, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, type YearnVault, type YearnVaultKind, type YearnVaults, type YieldProfile, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachPricesToFlashLiquidity, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertExactlyMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, detectInterfaceKinds, encodeBalanceFetcherCalldata, exactlyLenderKey, exactlyMarketFromLenderKey, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, fuseLenderData, generateLendingPools, getAavesForChain, getAssetConfig, getBalanceForMarketUid, getBorrowCapacity, getCachedLiquityTroves, getCachedTellerBids, 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, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getVaultPublicDataAll, getVaultWithdrawalRequests, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTokenBalanceResult, positivePart, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveDerivation, resolveStCeloDepositGroup, riverKeyParts, riverLenderKey, selectAssetGroupPrices, stampVaultClassification, tellerBpsToPercent, tellerImpliedLtv, tellerLenderKey, tellerPoolFromLenderKey, termLenderKey, tickToAprNumber, tickToPrice, unflattenLenderData, updateFeedStats };
|
|
7449
|
+
export { type AaveMetadata, type AaveV2Public, type AaveV2UserReserveResponse, type AaveV3Public, type AaveV3UserReserveResponse, type AdditionalYields, ApiBookSource, type AprData, type BalanceData, type BaseLendingPosition, type BasicReserveResponse, type ChainDiagnostic, type ChainLinkResponse, type ChainQuery, type ChainSummary, type CompoundV2Metadata, type CompoundV3Public, type CompoundV3UserReserveResponse, type ConfigEntry, type CoreValidators, DEFAULT_MIDNIGHT_API, DEFAULT_OUTLIER_GUARD, DEFAULT_STALE_REJECT_SECONDS, DEFAULT_TERMMAX_API, type Denomination, type DepthMap, EMPTY_BALANCE, type EModeAssets, type EModeData, type EModeResult, type EulerEarnVault, type EulerEarnVaults, type EulerV2Metadata, type ExactlyFixedPool, type ExactlyFixedPosition, type ExactlyMarketAccount, type ExactlyMarketsRaw, type ExactlyUserFixedPosition, type ExtraValidationCall, type FeedObservation, type FeedStat, type FeedStatsMap, type FeedTimestampMap, type FetchListaVaultsFromChainOptions, type FetchMorphoVaultsFromChainOptions, type FetchOraclePricesOptions, type FetchTokenBalancesOptions, type FlattenPriorityConfig, type FluidFToken, type FluidFTokens, 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 GroupAccumulator, HYPERCORE_VAULT_REGISTRY, type HypercoreLockStatus, type HypercoreUserPositionsOptions, type HypercoreVault, type HypercoreVaultPosition, type HypercoreVaultRegistryEntry, type HypercoreVaults, type HypercoreVaultsFetchOptions, IDLE_MARKET_ID, INTERFACE_IDS, type InitMetadata, type InitPublic, type InitUserReserveResponse, type InterfaceKind, type InverseMarketRaw, type InverseMarketsRaw, type InversePositionInfo, LAGOON_API_URL, LAGOON_CHAIN_IDS, type LagoonApiVault, type LagoonSyncMode, type LagoonVault, type LagoonVaults, 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 LiquityBranchRaw, type LiquityDiscoveredTrove, type LiquityDiscovery, type LiquityMarketsRaw, type LiquitySpInfo, type LiquityTroveInfo, type ListaMarketOverrides, type LoopPostTradeMetrics, type LstDelegation, type LstDelegationKind, type LstValidator, type LstWithdrawalFetchOptions, type LstWithdrawalRegistryEntry, type LstWithdrawalRequest, type LstWithdrawalRequestsByLst, type LstWithdrawalStatus, MORPHO_LENS, MaxParamThresholds, type MergedUserData, type MidnightBook, type MidnightBookLevel, type MidnightBookSource, type ModeBase, type MorphoMarketOverrides, type MorphoSubgraphProxyConfig, type MorphoUserMarketBalance, type MorphoUserReserveResponse, type MorphoVault, type MorphoVaults, type MulticallRpcBatch, type NumberMap, type OracleDiagnostics, type OraclePriceEntry, type OraclePricesResult, type OutlierGuardConfig, type ParsedBalanceData, type ParsedResponse, type ParsedUserBalance, type PermissionParams, type PoolData, type PoolWithMeta, type PortfolioSummary, type PortfolioTotals, type PostTradeMetrics, type PreparedCall, type PreparedMergedMulticallParams, type PreparedMergedRpcCalls, type PreparedTokenBalanceRpcCalls, type PreparedUserDataRpcCalls, type PriceDerivation, type PriceSelection, type ProtocolParams, type ProviderOptions, type RawRpcBatch, type RawRpcCall, type RawRpcResponse, type RiverMarketRaw, type RiverMarketsRaw, type RiverPositionInfo, STABLECOIN_SYMBOLS, STCELO_MANAGER_ADDRESS, type SelectPricesOptions, type SiloVault, type SiloVaults, type StCeloValidatorGroup, type StaleFeedEntry, type StructuredOraclePrices, type SubAccountSummary, type SumerPositionInput, type SummaryAprData, type SummaryBalanceData, 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, type TellerDiscoveredBid, type TellerDiscovery, type TellerMarketsRaw, type TellerPoolRaw, type TermAuctionOrder, type TermAuctionOrders, type TermBookSource, type TermBookTop, type TermListing, type TermMarketRaw, TermMaxApiSource, type TermMaxBookTop, type TermMaxCurveSegment, type TermMaxDataSource, type TermMaxDiscovery, type TermMaxFeeConfig, type TermMaxMarketConfig, type TermMaxMarketRaw, type TermMaxOrderState, TermSubgraphSource, 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 UserApr, type UserConfig, type UserData, type UserDataResult, type UserLendingPosition, VAULT_SHARE_PRICE_PROBE, VOLATILE_VAULT_OVERRIDES, type VaultAprResult, type VaultClassification, type VaultClassificationFields, type VaultLookupEntry, type VaultMarketExposure, type VaultProvider, type VaultPublicDataAll, type VaultPublicDataResult, type VaultYieldSeries, type VaultYieldSnapshot, type YDaemonVault, YEARN_CHAIN_IDS, YEARN_YDAEMON_BASE, type YearnVault, type YearnVaultKind, type YearnVaults, type YieldProfile, accountDepositListKey, accountWithdrawalListKey, appendSnapshot, applyPositionDelta, attachPricesToFlashLiquidity, buildFluidFTokensCall, buildLiquityUserCall, buildLoopResult, buildMorphoTypeCall, buildMorphoTypeUserCallWithLens, buildPortfolioTotals, buildSumerAccumulators, buildSummaries, buildTellerUserCall, buildTermMaxUserCall, buildVaultLookup, calculateLeverage, calculateNetApr, calculateOverallNetApr, calculateWeightedAverage, classifyFreshness, classifyReliability, classifyVault, collectFeedObservations, computeBorrowDelta, computeCloseTradeDeltas, computeCollateralSwapDeltas, computeDebtSwapDeltas, computeDepositDelta, computeEModeAnalysis, computeOpenTradeDeltas, computePostTradeMetrics, computeRepayDelta, computeSumerBorrowDelta, computeSumerDepositDelta, computeSumerRepayDelta, computeSumerWaterfall, computeSumerWithdrawDelta, computeVaultApr, computeWithdrawDelta, computeZapTradeDeltas, consensusReference, convertExactlyMarketsToResponse, convertInverseMarketsToResponse, convertLenderUserDataResult, convertLiquityMarketsToResponse, convertRiverMarketsToResponse, convertTellerMarketsToResponse, convertTermMarketsToResponse, convertTermMaxMarketsToResponse, createMarketUid, createMidnightBookSource, createMulticallRpcCall, createRawRpcCalls, createTermBookSource, createTermMaxDataSource, decodeListaMarkets, decodeMarkets, decodePackedListaUserDataset, decodePackedMorphoUserDataset, detectInterfaceKinds, encodeBalanceFetcherCalldata, exactlyLenderKey, exactlyMarketFromLenderKey, exactlyPairLtv, exactlyPenaltyRateToAprPercent, exactlyWadRateToPercent, feedKeyOf, feedStatKey, fetchDolomiteAccountNumbers, fetchEulerEarnVaults, fetchEulerEarnVaultsFromSubgraph, fetchEulerSubAccountIndexes, fetchExactlyMarkets, fetchFlashLiquidityForChain, fetchFluidFTokens, fetchGeneralYields, fetchGeneralYieldsByMarketUid, fetchGmxExecutionFees, fetchGmxTickerPrices, fetchGmxVaults, fetchHypercoreVaults, fetchInverseMarkets, fetchLagoonApiVaults, fetchLagoonVaults, fetchLiquityMarkets, fetchListaVaultsFromChain, fetchMorphoUserBalances, fetchMorphoUserPositionMarkets, fetchMorphoVaults, fetchMorphoVaultsFromApi, fetchMorphoVaultsFromChain, fetchOraclePrices, fetchPendlePrices, fetchRiverMarkets, fetchSiloVaults, fetchTellerMarkets, fetchTermMarkets, fetchTermMaxMarkets, fetchTokenBalances, fetchTokenMetadata, fetchUpshiftApiVaults, fetchUpshiftVaults, fetchYearnApiVaults, fetchYearnVaults, filterActiveLenders, filterLendersByProtocol, 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, getResolvedDolomiteAccountNumbers, getStCeloValidatorGroups, getSubAccountAddress, getSubAccountIndex, getVaultPublicDataAll, getVaultWithdrawalRequests, hasEulerEarnVaultSubgraph, hasLagoonVaults, hasMorphoPositionIndex, hasMorphoUserApi, hasMorphoUserSubgraph, hasUpshiftVaults, hasYearnVaults, inverseKeyParts, inverseLenderKey, isStablecoinSymbol, isYearnV3, keysFromMaps, lenderApiOnly, lenderFamily, liquityCandidateTroveIds, liquityKeyParts, liquityLenderKey, multicall3Abi, nanTo, needsLenderApproval, needsTokenApproval, noOpResult, normalizeToBytes, parseBalanceFetcherResult, parseMergedResult, parseMulticallRpcResponses, parseRawRpcBatchResponses, parseRawRpcResponses, parseTermMaxLtv, parseTokenBalanceResult, positivePart, predictInverseEscrow, prepareLenderUserDataRpcCalls, prepareMergedMulticallParams, prepareMergedRpcCalls, prepareMulticallInputs, prepareTokenBalanceRpcCalls, priceGlvVaults, priceGmMarkets, probeAaveFeedTimestamps, pruneFeedStats, readVaultSharePrices, rejectOutliers as rejectPriceOutliers, resolveDerivation, resolveStCeloDepositGroup, riverKeyParts, riverLenderKey, selectAssetGroupPrices, stampVaultClassification, 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, unflattenLenderData, updateFeedStats };
|