@1delta/margin-fetcher 0.0.328 → 0.0.330

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.
Files changed (91) hide show
  1. package/dist/index.d.ts +13 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2365 -254
  4. package/dist/index.js.map +1 -1
  5. package/dist/lending/public-data/exactly/convertPublic.d.ts +30 -0
  6. package/dist/lending/public-data/exactly/convertPublic.d.ts.map +1 -0
  7. package/dist/lending/public-data/exactly/convertPublic.test.d.ts +2 -0
  8. package/dist/lending/public-data/exactly/convertPublic.test.d.ts.map +1 -0
  9. package/dist/lending/public-data/exactly/fetchPublic.d.ts +13 -0
  10. package/dist/lending/public-data/exactly/fetchPublic.d.ts.map +1 -0
  11. package/dist/lending/public-data/exactly/index.d.ts +5 -0
  12. package/dist/lending/public-data/exactly/index.d.ts.map +1 -0
  13. package/dist/lending/public-data/exactly/math.d.ts +30 -0
  14. package/dist/lending/public-data/exactly/math.d.ts.map +1 -0
  15. package/dist/lending/public-data/exactly/types.d.ts +80 -0
  16. package/dist/lending/public-data/exactly/types.d.ts.map +1 -0
  17. package/dist/lending/public-data/fetchLenderAll.d.ts.map +1 -1
  18. package/dist/lending/public-data/fetchLenderExt.d.ts.map +1 -1
  19. package/dist/lending/public-data/liquity/convertPublic.d.ts +42 -0
  20. package/dist/lending/public-data/liquity/convertPublic.d.ts.map +1 -0
  21. package/dist/lending/public-data/liquity/convertPublic.test.d.ts +2 -0
  22. package/dist/lending/public-data/liquity/convertPublic.test.d.ts.map +1 -0
  23. package/dist/lending/public-data/liquity/fetchPublic.d.ts +15 -0
  24. package/dist/lending/public-data/liquity/fetchPublic.d.ts.map +1 -0
  25. package/dist/lending/public-data/liquity/index.d.ts +4 -0
  26. package/dist/lending/public-data/liquity/index.d.ts.map +1 -0
  27. package/dist/lending/public-data/liquity/types.d.ts +33 -0
  28. package/dist/lending/public-data/liquity/types.d.ts.map +1 -0
  29. package/dist/lending/public-data/midnight/apiClient.d.ts +9 -0
  30. package/dist/lending/public-data/midnight/apiClient.d.ts.map +1 -1
  31. package/dist/lending/public-data/midnight/convertPublic.d.ts.map +1 -1
  32. package/dist/lending/public-data/midnight/fetchPublic.d.ts +6 -4
  33. package/dist/lending/public-data/midnight/fetchPublic.d.ts.map +1 -1
  34. package/dist/lending/public-data/midnight/types.d.ts +12 -0
  35. package/dist/lending/public-data/midnight/types.d.ts.map +1 -1
  36. package/dist/lending/public-data/river/convertPublic.d.ts +36 -0
  37. package/dist/lending/public-data/river/convertPublic.d.ts.map +1 -0
  38. package/dist/lending/public-data/river/convertPublic.test.d.ts +2 -0
  39. package/dist/lending/public-data/river/convertPublic.test.d.ts.map +1 -0
  40. package/dist/lending/public-data/river/fetchPublic.d.ts +11 -0
  41. package/dist/lending/public-data/river/fetchPublic.d.ts.map +1 -0
  42. package/dist/lending/public-data/river/index.d.ts +4 -0
  43. package/dist/lending/public-data/river/index.d.ts.map +1 -0
  44. package/dist/lending/public-data/river/types.d.ts +30 -0
  45. package/dist/lending/public-data/river/types.d.ts.map +1 -0
  46. package/dist/lending/public-data/term/apiClient.d.ts +36 -0
  47. package/dist/lending/public-data/term/apiClient.d.ts.map +1 -0
  48. package/dist/lending/public-data/term/convertPublic.d.ts +21 -0
  49. package/dist/lending/public-data/term/convertPublic.d.ts.map +1 -0
  50. package/dist/lending/public-data/term/convertPublic.test.d.ts +2 -0
  51. package/dist/lending/public-data/term/convertPublic.test.d.ts.map +1 -0
  52. package/dist/lending/public-data/term/fetchPublic.d.ts +14 -0
  53. package/dist/lending/public-data/term/fetchPublic.d.ts.map +1 -0
  54. package/dist/lending/public-data/term/index.d.ts +6 -0
  55. package/dist/lending/public-data/term/index.d.ts.map +1 -0
  56. package/dist/lending/public-data/term/math.d.ts +24 -0
  57. package/dist/lending/public-data/term/math.d.ts.map +1 -0
  58. package/dist/lending/public-data/term/types.d.ts +77 -0
  59. package/dist/lending/public-data/term/types.d.ts.map +1 -0
  60. package/dist/lending/user-data/abis.d.ts.map +1 -1
  61. package/dist/lending/user-data/exactly/userCallBuild.d.ts +10 -0
  62. package/dist/lending/user-data/exactly/userCallBuild.d.ts.map +1 -0
  63. package/dist/lending/user-data/exactly/userCallParse.d.ts +43 -0
  64. package/dist/lending/user-data/exactly/userCallParse.d.ts.map +1 -0
  65. package/dist/lending/user-data/fetch-balances/parse.d.ts.map +1 -1
  66. package/dist/lending/user-data/fetch-balances/prepare.d.ts.map +1 -1
  67. package/dist/lending/user-data/liquity/userCall.test.d.ts +2 -0
  68. package/dist/lending/user-data/liquity/userCall.test.d.ts.map +1 -0
  69. package/dist/lending/user-data/liquity/userCallBuild.d.ts +30 -0
  70. package/dist/lending/user-data/liquity/userCallBuild.d.ts.map +1 -0
  71. package/dist/lending/user-data/liquity/userCallParse.d.ts +54 -0
  72. package/dist/lending/user-data/liquity/userCallParse.d.ts.map +1 -0
  73. package/dist/lending/user-data/river/userCall.test.d.ts +2 -0
  74. package/dist/lending/user-data/river/userCall.test.d.ts.map +1 -0
  75. package/dist/lending/user-data/river/userCallBuild.d.ts +16 -0
  76. package/dist/lending/user-data/river/userCallBuild.d.ts.map +1 -0
  77. package/dist/lending/user-data/river/userCallParse.d.ts +24 -0
  78. package/dist/lending/user-data/river/userCallParse.d.ts.map +1 -0
  79. package/dist/lending/user-data/term/userCall.test.d.ts +2 -0
  80. package/dist/lending/user-data/term/userCall.test.d.ts.map +1 -0
  81. package/dist/lending/user-data/term/userCallBuild.d.ts +21 -0
  82. package/dist/lending/user-data/term/userCallBuild.d.ts.map +1 -0
  83. package/dist/lending/user-data/term/userCallParse.d.ts +18 -0
  84. package/dist/lending/user-data/term/userCallParse.d.ts.map +1 -0
  85. package/dist/types/lender/morpho-types.d.ts +38 -1
  86. package/dist/types/lender/morpho-types.d.ts.map +1 -1
  87. package/dist/types/lenderTypes.d.ts +26 -6
  88. package/dist/types/lenderTypes.d.ts.map +1 -1
  89. package/dist/utils/index.d.ts +1 -1
  90. package/dist/utils/index.d.ts.map +1 -1
  91. package/package.json +9 -9
@@ -0,0 +1,30 @@
1
+ import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
2
+ import { AdditionalYields, GenericTokenList } from '../../../types';
3
+ import type { ExactlyMarketsRaw } from './types';
4
+ /** Synthesized per-market lender key, e.g. `EXACTLY_<MARKET_ADDRESS_HEX_UPPER>`. */
5
+ export declare function exactlyLenderKey(market: string): string;
6
+ /** Recover the Market address from an `EXACTLY_<HEX>` lender key (or undefined). */
7
+ export declare function exactlyMarketFromLenderKey(lender: string): string | undefined;
8
+ /**
9
+ * Map the on-chain Previewer batch into the shared `MorphoGeneralPublicResponse`
10
+ * shape (identical to Midnight/Term), keyed by `EXACTLY_<MARKET_ADDRESS>` — one
11
+ * key per asset Market (NOT per maturity; the maturity menu is the market's
12
+ * `params.market.terms[]`, `termId` = maturity timestamp).
13
+ *
14
+ * Per market:
15
+ * - the LOAN entry carries the FLOATING rates (`depositRate` /
16
+ * `variableBorrowRate`) plus the best live fixed borrow APR on
17
+ * `stableBorrowRate`; its own asset is also collateral (self-pair
18
+ * adjustFactor²) since Exactly is cross-margin;
19
+ * - one COLLATERAL entry per SIBLING market (cross-margin: any entered market
20
+ * collateralizes any borrow) with pairwise LTV = adjF_coll × adjF_borrow
21
+ * (multiplicative, Dolomite-style) and the Auditor liquidation bonus;
22
+ * - `params.market.fixedTerm` = `{ model: 'exactly', earlyRepay: 'discount',
23
+ * fees.latePenaltyApr }` — see the wrapper README for the repay mechanics.
24
+ */
25
+ export declare function convertExactlyMarketsToResponse(raw: ExactlyMarketsRaw, chainId: string, prices?: {
26
+ [asset: string]: number;
27
+ }, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
28
+ [m: string]: MorphoGeneralPublicResponse;
29
+ };
30
+ //# sourceMappingURL=convertPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAWnE,OAAO,KAAK,EAAwB,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAItE,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7E;AAgBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CAiN9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=convertPublic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.test.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/convertPublic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { ExactlyMarketsRaw } from './types';
2
+ /**
3
+ * Fetch all Exactly market data for a chain — FULLY ON-CHAIN (no API, no
4
+ * indexer): a single `Previewer.exactly(address(0))` eth_call returns every
5
+ * market with its fixed pools (maturities + rates + liquidity), floating side,
6
+ * prices and risk params; a second call reads the Auditor liquidation bonus.
7
+ * The account-scoped fields are zero for the zero address and ignored.
8
+ *
9
+ * Returns `{ markets: [], liquidationIncentive: null }` when the chain has no
10
+ * Exactly config or the read fails (the converter then emits nothing).
11
+ */
12
+ export declare function fetchExactlyMarkets(chainId: string): Promise<ExactlyMarketsRaw>;
13
+ //# sourceMappingURL=fetchPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/fetchPublic.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAwB,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEtE;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAgC5B"}
@@ -0,0 +1,5 @@
1
+ export { fetchExactlyMarkets } from './fetchPublic';
2
+ export { convertExactlyMarketsToResponse, exactlyLenderKey, exactlyMarketFromLenderKey, } from './convertPublic';
3
+ export { exactlyWadRateToPercent, exactlyUsdPrice, exactlyPenaltyRateToAprPercent, exactlyFloatingDepositAprPercent, exactlyPairLtv, } from './math';
4
+ export type { ExactlyFixedPool, ExactlyFixedPosition, ExactlyMarketAccount, ExactlyMarketsRaw, } from './types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EACL,+BAA+B,EAC/B,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,8BAA8B,EAC9B,gCAAgC,EAChC,cAAc,GACf,MAAM,QAAQ,CAAA;AACf,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,30 @@
1
+ /** Exactly rate/scale helpers. All on-chain rates are WAD (1e18) fractions. */
2
+ /** WAD annualized rate → percent (0.0547e18 → 5.47). */
3
+ export declare function exactlyWadRateToPercent(rate: bigint | undefined): number;
4
+ /** WAD 1e18-scaled USD price → USD number. */
5
+ export declare function exactlyUsdPrice(usdPrice: bigint | undefined): number;
6
+ /**
7
+ * WAD per-second late-repay `penaltyRate` → annualized percent. The penalty
8
+ * accrues linearly per second on OVERDUE fixed debt (principal + fee) from
9
+ * maturity until repaid, ON TOP of the owed amount. E.g. the live value
10
+ * 52083333333/s ≈ 164%/yr ≈ 0.45%/day.
11
+ */
12
+ export declare function exactlyPenaltyRateToAprPercent(penaltyRatePerSecond: bigint | undefined): number;
13
+ /**
14
+ * Approximate floating DEPOSIT APR: borrow-rate income spread over deposits,
15
+ * with utilization measured over BOTH floating debt and the backup lent into
16
+ * fixed pools (fixed borrowers draw on floating liquidity and pay at least
17
+ * comparable rates, so backup principal earns too — a market whose borrowing
18
+ * is all fixed would otherwise display 0%). Still a lower-bound approximation
19
+ * (ignores the earnings-accumulator drip and backup-fee premium); exact yield
20
+ * needs the accumulator model.
21
+ */
22
+ export declare function exactlyFloatingDepositAprPercent(floatingBorrowRate: bigint | undefined, floatingDebt: bigint | undefined, floatingBackupBorrowed: bigint | undefined, floatingAssets: bigint | undefined): number;
23
+ /**
24
+ * Effective pairwise LTV between two Exactly markets. Exactly health is
25
+ * Σ(collateral × adjustFactor_c) ≥ Σ(debt / adjustFactor_b), so the max
26
+ * borrow of market B against collateral in market A is adjF_A × adjF_B —
27
+ * MULTIPLICATIVE adjust factors (same convention as Dolomite premiums).
28
+ */
29
+ export declare function exactlyPairLtv(collateralAdjustFactor: bigint | undefined, borrowAdjustFactor: bigint | undefined): number;
30
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/math.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAK/E,wDAAwD;AACxD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGxE;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,oBAAoB,EAAE,MAAM,GAAG,SAAS,GACvC,MAAM,CAGR;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,kBAAkB,EAAE,MAAM,GAAG,SAAS,EACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,sBAAsB,EAAE,MAAM,GAAG,SAAS,EAC1C,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,sBAAsB,EAAE,MAAM,GAAG,SAAS,EAC1C,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,MAAM,CAKR"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Decoded shapes of the Exactly `Previewer.exactly(account)` aggregate view.
3
+ * Field names/order mirror the on-chain struct (verified IDENTICAL on Optimism
4
+ * and Base). All rates are WAD-scaled ANNUALIZED fractions (1e18 = 100%/yr),
5
+ * `usdPrice` is 1e18-scaled USD, token amounts are raw base units.
6
+ */
7
+ export interface ExactlyFixedPool {
8
+ /** unix seconds */
9
+ maturity: bigint;
10
+ /** total fixed borrows at this maturity (raw asset units) */
11
+ borrowed: bigint;
12
+ /** total fixed deposits at this maturity (raw asset units) */
13
+ supplied: bigint;
14
+ /** borrowable liquidity at this maturity incl. floating backup (raw) */
15
+ available: bigint;
16
+ /** WAD fixed-pool utilization */
17
+ utilization: bigint;
18
+ /** WAD annualized fixed DEPOSIT rate at the current pool state */
19
+ depositRate: bigint;
20
+ /** WAD annualized fixed BORROW rate floor (rate for a minimal borrow) */
21
+ minBorrowRate: bigint;
22
+ /** deposit size that would capture the pool's unassigned earnings (raw) */
23
+ optimalDeposit: bigint;
24
+ }
25
+ export interface ExactlyFixedPosition {
26
+ maturity: bigint;
27
+ /** current exit value: withdraw-now (deposits) / repay-now (borrows), raw.
28
+ * Includes the early-exit discount and, when overdue, the late penalty. */
29
+ previewValue: bigint;
30
+ position: {
31
+ principal: bigint;
32
+ fee: bigint;
33
+ };
34
+ }
35
+ export interface ExactlyMarketAccount {
36
+ market: string;
37
+ symbol: string;
38
+ decimals: number;
39
+ asset: string;
40
+ assetName: string;
41
+ assetSymbol: string;
42
+ usdPrice: bigint;
43
+ /** WAD per-second late-repayment penalty rate */
44
+ penaltyRate: bigint;
45
+ /** WAD collateral/borrow adjust factor (multiplicative, like Dolomite premiums) */
46
+ adjustFactor: bigint;
47
+ maxFuturePools: number;
48
+ reserveFactor: bigint;
49
+ fixedPools: readonly ExactlyFixedPool[];
50
+ /** WAD annualized floating borrow rate */
51
+ floatingBorrowRate: bigint;
52
+ /** WAD floating utilization */
53
+ floatingUtilization: bigint;
54
+ floatingAssets: bigint;
55
+ floatingDebt: bigint;
56
+ floatingBackupBorrowed: bigint;
57
+ floatingAvailableAssets: bigint;
58
+ totalFloatingBorrowAssets: bigint;
59
+ totalFloatingDepositAssets: bigint;
60
+ totalFloatingBorrowShares: bigint;
61
+ totalFloatingDepositShares: bigint;
62
+ isCollateral: boolean;
63
+ maxBorrowAssets: bigint;
64
+ floatingBorrowShares: bigint;
65
+ floatingBorrowAssets: bigint;
66
+ floatingDepositShares: bigint;
67
+ floatingDepositAssets: bigint;
68
+ fixedDepositPositions: readonly ExactlyFixedPosition[];
69
+ fixedBorrowPositions: readonly ExactlyFixedPosition[];
70
+ }
71
+ /** Raw public-data batch: one Previewer pass + the Auditor liquidation bonus. */
72
+ export interface ExactlyMarketsRaw {
73
+ markets: ExactlyMarketAccount[];
74
+ /** WAD fractions: liquidator bonus + lenders share (null if the read failed) */
75
+ liquidationIncentive: {
76
+ liquidator: bigint;
77
+ lenders: bigint;
78
+ } | null;
79
+ }
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/exactly/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAA;IAChB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB;gFAC4E;IAC5E,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACvC,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,+BAA+B;IAC/B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,uBAAuB,EAAE,MAAM,CAAA;IAC/B,yBAAyB,EAAE,MAAM,CAAA;IACjC,0BAA0B,EAAE,MAAM,CAAA;IAClC,yBAAyB,EAAE,MAAM,CAAA;IACjC,0BAA0B,EAAE,MAAM,CAAA;IAElC,YAAY,EAAE,OAAO,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,qBAAqB,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACtD,oBAAoB,EAAE,SAAS,oBAAoB,EAAE,CAAA;CACtD;AAED,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,oBAAoB,EAAE,CAAA;IAC/B,gFAAgF;IAChF,oBAAoB,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchLenderAll.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAOtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA4DtD,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAY,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAC3C,sCAAoC,KACnC,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAgEnC,CAAA"}
1
+ {"version":3,"file":"fetchLenderAll.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAOtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA2EtD,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAY,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAC3C,sCAAoC,KACnC,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAgEnC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchLenderExt.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderExt.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAY9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA8CtD,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,EACD,yBAAuB,KACtB,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAqMnC,CAAA"}
1
+ {"version":3,"file":"fetchLenderExt.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderExt.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAoB9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA6FtD,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,EACD,yBAAuB,KACtB,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAqMnC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
2
+ import { AdditionalYields, GenericTokenList } from '../../../types';
3
+ import type { LiquityMarketsRaw } from './types';
4
+ /** Synthesized per-branch lender key, e.g. `LIQUITY_V2_1` (= wstETH branch). */
5
+ export declare function liquityLenderKey(lender: string, collIndex: number): string;
6
+ /**
7
+ * Recover `{ lender, collIndex }` from a per-branch key (or undefined for a
8
+ * bare deployment key / non-family key). Fork brands share no prefix, so this
9
+ * matches against the family list.
10
+ */
11
+ export declare function liquityKeyParts(key: string): {
12
+ lender: string;
13
+ collIndex: number;
14
+ } | undefined;
15
+ /**
16
+ * Map one deployment's on-chain branch batch into the shared
17
+ * `MorphoGeneralPublicResponse` shape (identical to Midnight/Term/Exactly),
18
+ * keyed by `<LENDER>_<COLL_INDEX>` — one key per collateral branch.
19
+ *
20
+ * Per branch:
21
+ * - the COLLATERAL entry (branch coll token): totals = branch collateral;
22
+ * LTV = 1/MCR (a trove is liquidatable below ICR = MCR), liquidation
23
+ * penalty = the SP-offset penalty; borrowing disabled;
24
+ * - the LOAN entry (the deployment's stable token): `totalDebt` = branch
25
+ * debt (incl. accrued interest), `totalDeposits` = the branch Stability
26
+ * Pool ("earn" side), `depositRate` = SP APR (spYieldSplit × Σ debt·rate /
27
+ * SP size), `variableBorrowRate` = branch average user-set rate. The
28
+ * ACTUAL borrow rate is per-trove user-set — bounds + averages live in
29
+ * `params.market` (`minAnnualInterestRate` / `maxAnnualInterestRate` /
30
+ * `avgBorrowRate`, WAD strings). BOLD-side deposits do NOT collateralize.
31
+ * - `borrowLiquidity` = mintable headroom: collateral value / MCR − debt,
32
+ * additionally capped by the branch debt cap on forks that have one.
33
+ *
34
+ * All fork deviations ride in from metadata via `raw.config` / `raw.branch` —
35
+ * nothing here is deployment-specific.
36
+ */
37
+ export declare function convertLiquityMarketsToResponse(raw: LiquityMarketsRaw, chainId: string, prices?: {
38
+ [asset: string]: number;
39
+ }, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
40
+ [m: string]: MorphoGeneralPublicResponse;
41
+ };
42
+ //# sourceMappingURL=convertPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/convertPublic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMnD;AAkBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA4O9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=convertPublic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.test.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/convertPublic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { LiquityMarketsRaw } from './types';
2
+ /**
3
+ * Fetch all branch data of ONE Liquity-family deployment — FULLY ON-CHAIN via
4
+ * one retrying multicall (no API/indexer; the optional api.liquity.org stats
5
+ * endpoint is display enrichment only and is NOT fetched here, so a dead API
6
+ * can never break the data path). Branch addresses + fork deviation params
7
+ * come from lender-metadata (`liquityConfig`/`liquityMarkets`, keyed
8
+ * lender → chain). `multicallRetryUniversal` rotates RPCs on failure.
9
+ *
10
+ * Price: `lastGoodPrice` (view) — updated on every borrower op, so fresh on
11
+ * any active branch. (`fetchPrice` would be exact but returns a tuple and is
12
+ * nonpayable; revisit if quiet-fork staleness ever matters.)
13
+ */
14
+ export declare function fetchLiquityMarkets(lender: string, chainId: string): Promise<LiquityMarketsRaw>;
15
+ //# sourceMappingURL=fetchPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/fetchPublic.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAgBlE;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAsD5B"}
@@ -0,0 +1,4 @@
1
+ export { fetchLiquityMarkets } from './fetchPublic';
2
+ export { convertLiquityMarketsToResponse, liquityLenderKey, liquityKeyParts, } from './convertPublic';
3
+ export type { LiquityBranchRaw, LiquityMarketsRaw } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EACL,+BAA+B,EAC/B,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,33 @@
1
+ import type { LiquityBranchConfig, LiquityConfigChain } from '@1delta/data-sdk';
2
+ /**
3
+ * Raw per-branch on-chain snapshot of a Liquity-family deployment. All bigints
4
+ * are raw WAD/base units straight from the multicall; `null` marks a failed
5
+ * (allowFailure) read — the converter degrades gracefully per field.
6
+ */
7
+ export interface LiquityBranchRaw {
8
+ branch: LiquityBranchConfig;
9
+ /** TroveManager.getEntireBranchDebt() — total branch debt incl. accrued interest */
10
+ entireDebt: bigint | null;
11
+ /** TroveManager.getEntireBranchColl() — total branch collateral */
12
+ entireColl: bigint | null;
13
+ /** TroveManager.shutdownTime() — 0 while the branch is live */
14
+ shutdownTime: bigint | null;
15
+ /** ActivePool.aggRecordedDebt() — recorded aggregate debt (interest accrual base) */
16
+ aggRecordedDebt: bigint | null;
17
+ /** ActivePool.aggWeightedDebtSum() — Σ debt·rate (1e36 scale): drives avg rate + SP APR */
18
+ aggWeightedDebtSum: bigint | null;
19
+ /** StabilityPool.getTotalBoldDeposits() — the branch "earn" pool size */
20
+ spDeposits: bigint | null;
21
+ /** PriceFeed price, 1e18 USD (fetchPrice preferred, lastGoodPrice fallback) */
22
+ collPrice: bigint | null;
23
+ /** SortedTroves.getSize() — live (non-zombie) trove count */
24
+ troveCount: bigint | null;
25
+ }
26
+ /** Raw public-data batch for ONE deployment (lender) on one chain. */
27
+ export interface LiquityMarketsRaw {
28
+ /** The deployment's bare lender key, e.g. `LIQUITY_V2` — keys the config row. */
29
+ lender: string;
30
+ config: LiquityConfigChain | undefined;
31
+ branches: LiquityBranchRaw[];
32
+ }
33
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE/E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,oFAAoF;IACpF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,qFAAqF;IACrF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,2FAA2F;IAC3F,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,yEAAyE;IACzE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,+EAA+E;IAC/E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACtC,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC7B"}
@@ -23,6 +23,15 @@ export declare class ApiBookSource implements MidnightBookSource {
23
23
  * APR (from tick + TTM) and applies count/size filters.
24
24
  */
25
25
  getBook(marketId: string): Promise<MidnightBook | null>;
26
+ /**
27
+ * ONE fetch → the full-depth aggregate top + a bounded best-first ladder slice
28
+ * (top `maxLevels` per side). Same `/books/{marketId}` call as `getBookTop`, so
29
+ * the public batch captures a chunk of the book for free (no extra request).
30
+ */
31
+ getTopAndBook(marketId: string, maxLevels?: number): Promise<{
32
+ top: MidnightBookTop;
33
+ book: MidnightBook;
34
+ } | null>;
26
35
  /**
27
36
  * Maker addresses per price level, keyed by tick string. `getBook` levels are
28
37
  * aggregated by tick and carry NO maker (a level can be several makers), so
@@ -1 +1 @@
1
- {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/apiClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAOxE,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAgED;;;;GAIG;AACH,qBAAa,aAAc,YAAW,kBAAkB;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;gBAEzB,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,SAAiB;IAWnD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAmBnE;;;;;;;OAOG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAgC7D;;;;;;;OAOG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAuBrC;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,SAAiB,GAC3B,kBAAkB,CAEpB"}
1
+ {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/apiClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAOxE,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAgED;;;;GAIG;AACH,qBAAa,aAAc,YAAW,kBAAkB;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;gBAEzB,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,SAAiB;IAWnD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAmBnE;;;;;;;OAOG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAgC7D;;;;OAIG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAK,GACb,OAAO,CAAC;QAAE,GAAG,EAAE,eAAe,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,CAAC;IA0C/D;;;;;;;OAOG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAuBrC;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,SAAiB,GAC3B,kBAAkB,CAEpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAenE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAchD,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,iBAAiB,EAAE,EACxB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA2O9C;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAenE,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,SAAS,CAAA;AAcnE,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,iBAAiB,EAAE,EACxB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA2P9C;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,13 +1,15 @@
1
1
  import type { MidnightBookSource, MidnightMarketRaw } from './types';
2
2
  /**
3
- * Fetch the current top-of-book for every configured Midnight market on a chain.
3
+ * Fetch the current top-of-book + a bounded book chunk for every configured
4
+ * Midnight market on a chain.
4
5
  *
5
6
  * Public data = static market config (from `midnightMarkets` registry) + live
6
7
  * order-book rates/depth (from the book source). No RPC is required for the
7
8
  * public view: LLTVs / maturities / decimals come from config, rates from the
8
- * API. Returns one entry per configured market (with `top: null` only when its
9
- * book fetch failed AND no recent snapshot is cached — the converter still emits
10
- * the market with zeroed rates in that case).
9
+ * API. The aggregate best rate + FULL depth live on `top`; `book` carries the
10
+ * best `MIDNIGHT_BOOK_LEVELS` levels per side for downstream filtering. Both are
11
+ * null only when the book fetch failed AND no recent snapshot is cached (the
12
+ * converter still emits the market with zeroed rates in that case).
11
13
  */
12
14
  export declare function fetchMidnightMarkets(chainId: string, source?: MidnightBookSource): Promise<MidnightMarketRaw[]>;
13
15
  //# sourceMappingURL=fetchPublic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/fetchPublic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAElB,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAuChB;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,kBAAsD,GAC7D,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgB9B"}
1
+ {"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/fetchPublic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,kBAAkB,EAElB,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAwDhB;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,kBAAsD,GAC7D,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqB9B"}
@@ -53,10 +53,22 @@ export interface MidnightBookSource {
53
53
  * provides it for the live "all offers" endpoint.
54
54
  */
55
55
  getBook?(marketId: string): Promise<MidnightBook | null>;
56
+ /**
57
+ * ONE fetch: the full-depth aggregate {@link MidnightBookTop} PLUS a bounded
58
+ * best-first ladder slice (top `maxLevels` per side). Same `/books/{id}` call
59
+ * as `getBookTop`/`getBook` — the public batch uses this so it gets the top
60
+ * AND a chunk of the book without a second request. Optional (stubs may omit).
61
+ */
62
+ getTopAndBook?(marketId: string, maxLevels?: number): Promise<{
63
+ top: MidnightBookTop;
64
+ book: MidnightBook;
65
+ } | null>;
56
66
  }
57
67
  /** A Midnight market paired with its current top-of-book (null when the book fetch failed). */
58
68
  export interface MidnightMarketRaw {
59
69
  config: MidnightMarketConfig;
60
70
  top: MidnightBookTop | null;
71
+ /** Bounded best-first ladder slice (top-N levels/side); null/absent when unavailable. */
72
+ book?: MidnightBook | null;
61
73
  }
62
74
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,0FAA0F;AAC1F,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oDAAoD;IACpD,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,IAAI,EAAE,iBAAiB,EAAE,CAAA;IACzB,qGAAqG;IACrG,IAAI,EAAE,iBAAiB,EAAE,CAAA;CAC1B;AAED,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IAC7D;;;;OAIG;IACH,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;CACzD;AAED,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,GAAG,EAAE,eAAe,GAAG,IAAI,CAAA;CAC5B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/midnight/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,0FAA0F;AAC1F,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oDAAoD;IACpD,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,IAAI,EAAE,iBAAiB,EAAE,CAAA;IACzB,qGAAqG;IACrG,IAAI,EAAE,iBAAiB,EAAE,CAAA;CAC1B;AAED,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IAC7D;;;;OAIG;IACH,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IACxD;;;;;OAKG;IACH,aAAa,CAAC,CACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,GAAG,EAAE,eAAe,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;CAChE;AAED,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,GAAG,EAAE,eAAe,GAAG,IAAI,CAAA;IAC3B,yFAAyF;IACzF,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;CAC3B"}
@@ -0,0 +1,36 @@
1
+ import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
2
+ import { AdditionalYields, GenericTokenList } from '../../../types';
3
+ import type { RiverMarketsRaw } from './types';
4
+ /** Synthesized per-TroveManager lender key, e.g. `RIVER_2`. */
5
+ export declare function riverLenderKey(lender: string, index: number): string;
6
+ /** Recover `{ lender, index }` from a per-market key (or undefined). */
7
+ export declare function riverKeyParts(key: string): {
8
+ lender: string;
9
+ index: number;
10
+ } | undefined;
11
+ /**
12
+ * Map one River deployment's on-chain batch into the shared
13
+ * `MorphoGeneralPublicResponse` shape, keyed by `RIVER_<TM_INDEX>` — one key
14
+ * per TroveManager (collateral market).
15
+ *
16
+ * Per market:
17
+ * - COLLATERAL entry: totals = market collateral; LTV = 1/MCR; the
18
+ * "liquidation penalty" is approximated as MCR − 1 (V1-style liquidation
19
+ * hands the SP the WHOLE trove collateral, so the borrower's max loss at
20
+ * liquidation ≈ the ICR buffer — there is no fixed penalty parameter);
21
+ * - LOAN entry (satUSD): `totalDebt` = market debt; the interest rate is
22
+ * PROTOCOL-SET (currently 0% → `variableBorrowRate` 0); the one-off
23
+ * decaying-baseRate MINT FEE is NOT an APR and therefore lives in
24
+ * `params.market.river.mintFeeRate` (WAD string), not in the rate fields;
25
+ * `borrowLiquidity` = min(coll·price/MCR − debt, maxSystemDebt − debt).
26
+ * - The single per-chain StabilityPool ("earn") is attached to market
27
+ * index 0 ONLY (its loan-row `totalDeposits`); other markets report 0 so
28
+ * chain aggregates do not double-count. SP yield is 0 while the protocol
29
+ * rate is 0% (SP earns liquidation gains + OSHI emissions only).
30
+ */
31
+ export declare function convertRiverMarketsToResponse(raw: RiverMarketsRaw, chainId: string, prices?: {
32
+ [asset: string]: number;
33
+ }, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
34
+ [m: string]: MorphoGeneralPublicResponse;
35
+ };
36
+ //# sourceMappingURL=convertPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAK/C;AAkBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA6M9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=convertPublic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.test.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/convertPublic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { RiverMarketsRaw } from './types';
2
+ /**
3
+ * Fetch all market data of ONE River deployment — FULLY ON-CHAIN via one
4
+ * retrying multicall (no API/indexer). TroveManager list + owner-mutable
5
+ * params come from lender-metadata (`riverConfig`/`riverMarkets`, keyed
6
+ * lender → chain); this fetch reads the LIVE totals + current mint-fee rate +
7
+ * oracle price. `fetchPrice` is nonpayable but simulates fine under the
8
+ * multicall eth_call (same trick as Liquity).
9
+ */
10
+ export declare function fetchRiverMarkets(lender: string, chainId: string): Promise<RiverMarketsRaw>;
11
+ //# sourceMappingURL=fetchPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/fetchPublic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAA;AAW9D;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAyD1B"}
@@ -0,0 +1,4 @@
1
+ export { fetchRiverMarkets } from './fetchPublic';
2
+ export { convertRiverMarketsToResponse, riverLenderKey, riverKeyParts, } from './convertPublic';
3
+ export type { RiverMarketRaw, RiverMarketsRaw } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EACL,6BAA6B,EAC7B,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { RiverChainData, RiverConfigChain, RiverMarketConfig } from '@1delta/data-sdk';
2
+ /**
3
+ * Raw per-TroveManager on-chain snapshot of a River deployment. All bigints
4
+ * are raw units straight from the multicall; `null` marks a failed
5
+ * (allowFailure) read — the converter degrades gracefully per field.
6
+ */
7
+ export interface RiverMarketRaw {
8
+ market: RiverMarketConfig;
9
+ /** TroveManager.getEntireSystemDebt() — total market debt incl. redistribution */
10
+ entireDebt: bigint | null;
11
+ /** TroveManager.getEntireSystemColl() */
12
+ entireColl: bigint | null;
13
+ /** TroveManager.getBorrowingRateWithDecay() — the CURRENT one-off mint-fee rate (WAD) */
14
+ mintFeeRate: bigint | null;
15
+ /** TroveManager.fetchPrice() — oracle price, 1e18 USD (nonpayable, simulated) */
16
+ price: bigint | null;
17
+ /** TroveManager.getTroveOwnersCount() */
18
+ troveCount: bigint | null;
19
+ }
20
+ /** Raw public-data batch for ONE River deployment (lender) on one chain. */
21
+ export interface RiverMarketsRaw {
22
+ /** The deployment's bare lender key, `RIVER`. */
23
+ lender: string;
24
+ config: RiverConfigChain | undefined;
25
+ chainData: RiverChainData | undefined;
26
+ /** Single per-chain StabilityPool size (diamond facet). */
27
+ spDeposits: bigint | null;
28
+ markets: RiverMarketRaw[];
29
+ }
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAEzB;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,iBAAiB,CAAA;IACzB,kFAAkF;IAClF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,yFAAyF;IACzF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iFAAiF;IACjF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,yCAAyC;IACzC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACpC,SAAS,EAAE,cAAc,GAAG,SAAS,CAAA;IACrC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B"}
@@ -0,0 +1,36 @@
1
+ import type { TermMarketConfig } from '@1delta/data-sdk';
2
+ import type { TermBook, TermBookSource, TermBookTop, TermListing } from './types';
3
+ /** Default Ormi core subgraph endpoints (org 05e9a4e2-…) by chainId. */
4
+ export declare const TERM_SUBGRAPH_BY_CHAIN: Record<string, string>;
5
+ type FetchLike = typeof fetch;
6
+ /** Resolve a chain's Term subgraph URL (override/config → per-chain default → ''). */
7
+ export declare function termApiBaseUrl(chainId: string): string;
8
+ /**
9
+ * GraphQL subgraph source. `getBookTop` derives the fixed APR from the repo's
10
+ * latest completed auction clearing price and open-order depth; `getListings`
11
+ * returns the open secondary-market repo-token orders.
12
+ */
13
+ export declare class TermSubgraphSource implements TermBookSource {
14
+ private readonly url;
15
+ private readonly fetchImpl;
16
+ constructor(url: string, fetchImpl?: FetchLike);
17
+ private gql;
18
+ getBookTop(config: TermMarketConfig): Promise<TermBookTop | null>;
19
+ /**
20
+ * ONE query → the aggregate top (best APR + FULL depth) PLUS a bounded book
21
+ * slice (top `maxLevels` open orders per side). `asks` = orders selling repo
22
+ * tokens (the secondary LEND book); `bids` = the rest (borrow side, usually
23
+ * empty — Term borrow is sealed-bid auction, not a continuous book). Term
24
+ * secondary orders carry no per-order rate, so every level shares the market's
25
+ * clearing APR; the levels expose per-order SIZE for filtering.
26
+ */
27
+ getTopAndBook(config: TermMarketConfig, maxLevels?: number): Promise<{
28
+ top: TermBookTop;
29
+ book: TermBook;
30
+ } | null>;
31
+ getListings(config: TermMarketConfig): Promise<TermListing[] | null>;
32
+ }
33
+ /** Default Term public-data source for a chain (subgraph via resolved URL). */
34
+ export declare function createTermBookSource(chainId: string, fetchImpl?: FetchLike): TermBookSource;
35
+ export {};
36
+ //# sourceMappingURL=apiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/term/apiClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EACV,QAAQ,EAER,cAAc,EACd,WAAW,EACX,WAAW,EACZ,MAAM,SAAS,CAAA;AAchB,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMzD,CAAA;AAOD,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAeD;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;gBAEzB,GAAG,EAAE,MAAM,EAAE,SAAS,GAAE,SAAiB;YAOvC,GAAG;IAwBX,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAIvE;;;;;;;OAOG;IACG,aAAa,CACjB,MAAM,EAAE,gBAAgB,EACxB,SAAS,SAAK,GACb,OAAO,CAAC;QAAE,GAAG,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAwEjD,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;CA8B3E;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,SAAiB,GAAG,cAAc,CAElG"}
@@ -0,0 +1,21 @@
1
+ import type { TermMarketConfig } from '@1delta/data-sdk';
2
+ import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
3
+ import { AdditionalYields, GenericTokenList } from '../../../types';
4
+ import type { TermMarketRaw } from './types';
5
+ /** Synthesized per-market lender key, e.g. `TERM_FINANCE_<TERM_REPO_ID_HEX_UPPER>`. */
6
+ export declare function termLenderKey(termRepoId: string): string;
7
+ /**
8
+ * Map fetched Term repos into the shared `MorphoGeneralPublicResponse` shape
9
+ * (identical to Midnight), keyed by the synthesized `TERM_FINANCE_<id>` lender
10
+ * key. One LOAN entry carries the fixed rates (`variableBorrowRate` = auction
11
+ * borrow APR, `depositRate` = lend APR) + order-book depth as liquidity; one
12
+ * COLLATERAL entry per leg carries the maintenance-ratio → collateralFactor +
13
+ * liquidated-damages → penalty. `params.market.fixedTerm.model = 'term'`.
14
+ */
15
+ export declare function convertTermMarketsToResponse(raw: TermMarketRaw[], chainId: string, prices?: {
16
+ [asset: string]: number;
17
+ }, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
18
+ [m: string]: MorphoGeneralPublicResponse;
19
+ };
20
+ export type { TermMarketConfig };
21
+ //# sourceMappingURL=convertPublic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/term/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAMnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGxD;AAOD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,aAAa,EAAE,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAA2E,EAC9F,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CAyL9C;AAED,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=convertPublic.test.d.ts.map