@1delta/margin-fetcher 0.0.331 → 0.0.332

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.
@@ -29,7 +29,7 @@ export interface FluidLiquidityTokenState {
29
29
  * data[0] = VaultEntireData[] (VaultResolver.getVaultsEntireData)
30
30
  * data[1] = OverallTokenData[] (LiquidityResolver.getAllOverallTokensData)
31
31
  *
32
- * Emits one bucket per vault under lender key `FLUID_<vaultId>` (mirrors the
32
+ * Emits one bucket per vault under lender key `FLUID_<chainId>_<vaultId>` (mirrors the
33
33
  * Morpho Blue pattern of one lender per isolated market).
34
34
  *
35
35
  * fTokens are NOT handled here — they are standalone ERC-4626 vaults on the
@@ -1,5 +1,5 @@
1
1
  import type { TermMarketConfig } from '@1delta/data-sdk';
2
- import type { TermBook, TermBookSource, TermBookTop, TermListing } from './types';
2
+ import type { TermAuctionOrders, TermBook, TermBookSource, TermBookTop, TermListing } from './types';
3
3
  /** Default Ormi core subgraph endpoints (org 05e9a4e2-…) by chainId. */
4
4
  export declare const TERM_SUBGRAPH_BY_CHAIN: Record<string, string>;
5
5
  type FetchLike = typeof fetch;
@@ -29,6 +29,14 @@ export declare class TermSubgraphSource implements TermBookSource {
29
29
  book: TermBook;
30
30
  } | null>;
31
31
  getListings(config: TermMarketConfig): Promise<TermListing[] | null>;
32
+ /**
33
+ * A user's primary-auction offers + bids for a repo. Offers/bids link to an
34
+ * `auction`, which links to a `term` (the repo) — so we filter by the
35
+ * submitter AND the nested `auction_.term`. The revealed price is 0 (Bytes
36
+ * `unrevealed*Price` still sealed) until the reveal window; `active` marks
37
+ * submissions whose auction is neither complete nor cancelled.
38
+ */
39
+ getAuctionOrders(config: TermMarketConfig, account: string): Promise<TermAuctionOrders | null>;
32
40
  }
33
41
  /** Default Term public-data source for a chain (subgraph via resolved URL). */
34
42
  export declare function createTermBookSource(chainId: string, fetchImpl?: FetchLike): TermBookSource;
@@ -1 +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"}
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,EAEV,iBAAiB,EACjB,QAAQ,EAER,cAAc,EACd,WAAW,EACX,WAAW,EACZ,MAAM,SAAS,CAAA;AAchB,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASzD,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;YAQvC,GAAG;IA2BX,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;IAyEjD,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAiC1E;;;;;;OAMG;IACG,gBAAgB,CACpB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAgErC;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,SAAiB,GAC3B,cAAc,CAEhB"}
@@ -2,5 +2,5 @@ export { fetchTermMarkets } from './fetchPublic';
2
2
  export { convertTermMarketsToResponse, termLenderKey } from './convertPublic';
3
3
  export { TermSubgraphSource, createTermBookSource, termApiBaseUrl, } from './apiClient';
4
4
  export { termMaintenanceRatioToLtv, termLiquidatedDamagesToPenalty, termDiscountRateToAprPct, } from './math';
5
- export type { TermBook, TermBookLevel, TermBookSource, TermBookTop, TermListing, TermMarketRaw, } from './types';
5
+ export type { TermAuctionOrder, TermAuctionOrders, TermBook, TermBookLevel, TermBookSource, TermBookTop, TermListing, TermMarketRaw, } from './types';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/term/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,QAAQ,CAAA;AACf,YAAY,EACV,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/term/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,QAAQ,CAAA;AACf,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAA"}
@@ -47,6 +47,49 @@ export interface TermListing {
47
47
  /** Effective discount rate in percent, if the source provides it. */
48
48
  discountRatePct?: number;
49
49
  }
50
+ /**
51
+ * One PRIMARY-auction submission by a user (the sealed-bid book that has no
52
+ * instant-settle counterpart): `offer` = a lend commitment, `bid` = a borrow
53
+ * commitment. Only surfaces AFTER the on-chain entity exists (i.e. locked) —
54
+ * the pre-image price stays sealed (`revealed=false`) until the reveal window.
55
+ * The `active` flag marks submissions whose auction is still running (awaiting
56
+ * reveal/clearing, so still cancellable/actionable); once the auction clears,
57
+ * `assignedAmount` is how much was filled into a position.
58
+ */
59
+ export interface TermAuctionOrder {
60
+ /** Subgraph entity id (the offer/bid id). */
61
+ id: string;
62
+ side: 'offer' | 'bid';
63
+ /** Auction (offer/bid locker round) this submission belongs to. */
64
+ auctionId: string;
65
+ /** Submitter address (offeror for offers, bidder for bids). */
66
+ account: string;
67
+ /** Submitted amount, purchase(loan)-token base units (raw string). */
68
+ amount: string;
69
+ /** Same amount decimal-scaled to loan-token assets (human number). */
70
+ assets: number;
71
+ /** Amount assigned when the auction cleared, base units (raw; 0 while pending). */
72
+ assignedAmount: string;
73
+ /** Still locked in the auction locker. */
74
+ locked: boolean;
75
+ /** True once the sealed price has been revealed (revealed price > 0). */
76
+ revealed: boolean;
77
+ /** Revealed annualized rate (WAD, raw string) or null while still sealed. */
78
+ revealedPriceWad: string | null;
79
+ /** Auction still open — not complete and not cancelled (actionable). */
80
+ active: boolean;
81
+ auctionComplete: boolean;
82
+ auctionCancelled: boolean;
83
+ /** Reveal window opens (unix seconds). */
84
+ revealTime: number;
85
+ /** Auction closes / clears (unix seconds). */
86
+ auctionEndTime: number;
87
+ }
88
+ /** A user's primary-auction submissions for one repo, split by side. */
89
+ export interface TermAuctionOrders {
90
+ offers: TermAuctionOrder[];
91
+ bids: TermAuctionOrder[];
92
+ }
50
93
  /**
51
94
  * Pluggable Term public-data source. The hosted subgraph is the source today;
52
95
  * an on-chain reader could implement the same interface later. All methods
@@ -57,6 +100,12 @@ export interface TermBookSource {
57
100
  getBookTop(config: TermMarketConfig): Promise<TermBookTop | null>;
58
101
  /** Active secondary listings for a repo, or null when unavailable. */
59
102
  getListings?(config: TermMarketConfig): Promise<TermListing[] | null>;
103
+ /**
104
+ * A user's PRIMARY-auction submissions (offers + bids) for a repo — the
105
+ * sealed-bid book that has no continuous/instant surface. Returns null when
106
+ * no subgraph is configured. Prices stay sealed until reveal.
107
+ */
108
+ getAuctionOrders?(config: TermMarketConfig, account: string): Promise<TermAuctionOrders | null>;
60
109
  /**
61
110
  * ONE query → the aggregate top PLUS a bounded book slice (top `maxLevels`
62
111
  * per side). The public batch uses this so it captures a chunk of the order
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/term/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAA;IACvB,4EAA4E;IAC5E,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAA;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,IAAI,EAAE,aAAa,EAAE,CAAA;CACtB;AAED,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CA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,EAAE,CAAA;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACjE,sEAAsE;IACtE,WAAW,CAAC,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAAA;IACrE;;;;OAIG;IACH,gBAAgB,CAAC,CACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACpC;;;;OAIG;IACH,aAAa,CAAC,CACZ,MAAM,EAAE,gBAAgB,EACxB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,GAAG,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;CACxD;AAED,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,gBAAgB,CAAA;IACxB,GAAG,EAAE,WAAW,GAAG,IAAI,CAAA;IACvB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CACvB"}
@@ -40,7 +40,8 @@ export interface FetchOraclePricesOptions {
40
40
  /**
41
41
  * Only run these fetcher groups. Useful for debugging individual protocols.
42
42
  * Values: 'aave', 'compoundV2', 'compoundV3', 'lista', 'eulerV2', 'aaveV4',
43
- * 'morpho', 'midnight', 'siloV2', 'siloV3', 'fluid'.
43
+ * 'morpho', 'midnight', 'exactly', 'term', 'liquity', 'river', 'siloV2',
44
+ * 'siloV3', 'fluid'.
44
45
  * If omitted, all fetchers run.
45
46
  */
46
47
  onlyFetchers?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"fetchOraclePrices.d.ts","sourceRoot":"","sources":["../../../src/prices/oracle-prices/fetchOraclePrices.ts"],"names":[],"mappings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MAAM,EAAE,CAAA;CACxB;AA2KD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,CAAC,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,EAC9C,KAAK,GAAE,cAAmB,EAC1B,OAAO,SAAI,EACX,SAAS,GAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAqB,EAChE,YAAY,UAAO,EACnB,UAAU,GAAE,WAAgB,EAC5B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,yBAAyB,SAAO,EAChC,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAo5B7B"}
@@ -0,0 +1,420 @@
1
+ import { FetcherResult, OraclePriceEntry, ParseContext } from '../types';
2
+ /**
3
+ * Exactly oracle price fetcher.
4
+ *
5
+ * Exactly is a fixed-rate/fixed-maturity POOL protocol (Optimism + Base). Its
6
+ * `Previewer.exactly(account)` view returns every market with a `usdPrice`
7
+ * field — a DIRECT USD price (1e18-scaled) sourced from the market's own
8
+ * Chainlink price feed (the same oracle Exactly liquidates against). So unlike
9
+ * Morpho/Midnight (whose oracles return collateral priced in the loan asset and
10
+ * need a second-pass USD derivation), Exactly prices are direct USD and belong
11
+ * in PASS 1 — they feed the shared `usdPrices` map for every Exactly asset.
12
+ *
13
+ * Why a dedicated fetcher (not cross-protocol flattening): Exactly lists assets
14
+ * no other protocol on its chains prices (e.g. cbXRP on Base), so without this
15
+ * their markets would have no oracle price. It also uses Exactly's own feed for
16
+ * the assets other protocols DO cover, which is the correct oracle for risk.
17
+ *
18
+ * One `Previewer.exactly(address(0))` call per chain returns the whole set, so
19
+ * the fetcher emits a single call and the parser fans the result out to one
20
+ * entry per market asset, keyed under `EXACTLY_<market>`.
21
+ */
22
+ /** Grouped metadata: the previewer answering the single aggregate call. */
23
+ interface ExactlyChainMeta {
24
+ previewer: string;
25
+ }
26
+ /** Build the (single) multicall call for Exactly oracle prices. */
27
+ export declare function getExactlyCalls(chainId: string): FetcherResult<ExactlyChainMeta>[];
28
+ /**
29
+ * Parse the aggregate `Previewer.exactly` result into direct-USD price entries.
30
+ *
31
+ * `data[0]` is the decoded `MarketAccount[]`. Each carries `market`, `asset`
32
+ * and `usdPrice` (1e18-scaled USD). One entry per market asset, priced in USD,
33
+ * keyed under the per-market `EXACTLY_<market>` lender so the marketUids join
34
+ * the Exactly lending data emitted by `convertExactlyMarketsToResponse`.
35
+ */
36
+ export declare function parseExactlyResults(data: any[], _meta: ExactlyChainMeta, context: ParseContext): OraclePriceEntry[];
37
+ /** ABI for the Exactly oracle call (the Previewer aggregate view). */
38
+ export declare function getExactlyAbi(): readonly [{
39
+ readonly type: "function";
40
+ readonly name: "exactly";
41
+ readonly stateMutability: "view";
42
+ readonly inputs: readonly [{
43
+ readonly name: "account";
44
+ readonly type: "address";
45
+ }];
46
+ readonly outputs: readonly [{
47
+ readonly name: "data";
48
+ readonly type: "tuple[]";
49
+ readonly components: readonly [{
50
+ readonly name: "market";
51
+ readonly type: "address";
52
+ }, {
53
+ readonly name: "symbol";
54
+ readonly type: "string";
55
+ }, {
56
+ readonly name: "decimals";
57
+ readonly type: "uint8";
58
+ }, {
59
+ readonly name: "asset";
60
+ readonly type: "address";
61
+ }, {
62
+ readonly name: "assetName";
63
+ readonly type: "string";
64
+ }, {
65
+ readonly name: "assetSymbol";
66
+ readonly type: "string";
67
+ }, {
68
+ readonly name: "interestRateModel";
69
+ readonly type: "tuple";
70
+ readonly components: readonly [{
71
+ readonly name: "id";
72
+ readonly type: "address";
73
+ }, {
74
+ readonly name: "parameters";
75
+ readonly type: "tuple";
76
+ readonly components: readonly [{
77
+ readonly name: "minRate";
78
+ readonly type: "uint256";
79
+ }, {
80
+ readonly name: "naturalRate";
81
+ readonly type: "uint256";
82
+ }, {
83
+ readonly name: "maxUtilization";
84
+ readonly type: "uint256";
85
+ }, {
86
+ readonly name: "naturalUtilization";
87
+ readonly type: "uint256";
88
+ }, {
89
+ readonly name: "growthSpeed";
90
+ readonly type: "uint256";
91
+ }, {
92
+ readonly name: "sigmoidSpeed";
93
+ readonly type: "uint256";
94
+ }, {
95
+ readonly name: "spreadFactor";
96
+ readonly type: "uint256";
97
+ }, {
98
+ readonly name: "maturitySpeed";
99
+ readonly type: "uint256";
100
+ }, {
101
+ readonly name: "timePreference";
102
+ readonly type: "int256";
103
+ }, {
104
+ readonly name: "fixedAllocation";
105
+ readonly type: "uint256";
106
+ }, {
107
+ readonly name: "maxRate";
108
+ readonly type: "uint256";
109
+ }];
110
+ }];
111
+ }, {
112
+ readonly name: "usdPrice";
113
+ readonly type: "uint256";
114
+ }, {
115
+ readonly name: "penaltyRate";
116
+ readonly type: "uint256";
117
+ }, {
118
+ readonly name: "adjustFactor";
119
+ readonly type: "uint256";
120
+ }, {
121
+ readonly name: "maxFuturePools";
122
+ readonly type: "uint8";
123
+ }, {
124
+ readonly name: "reserveFactor";
125
+ readonly type: "uint256";
126
+ }, {
127
+ readonly name: "fixedPools";
128
+ readonly type: "tuple[]";
129
+ readonly components: readonly [{
130
+ readonly name: "maturity";
131
+ readonly type: "uint256";
132
+ }, {
133
+ readonly name: "borrowed";
134
+ readonly type: "uint256";
135
+ }, {
136
+ readonly name: "supplied";
137
+ readonly type: "uint256";
138
+ }, {
139
+ readonly name: "available";
140
+ readonly type: "uint256";
141
+ }, {
142
+ readonly name: "utilization";
143
+ readonly type: "uint256";
144
+ }, {
145
+ readonly name: "depositRate";
146
+ readonly type: "uint256";
147
+ }, {
148
+ readonly name: "minBorrowRate";
149
+ readonly type: "uint256";
150
+ }, {
151
+ readonly name: "optimalDeposit";
152
+ readonly type: "uint256";
153
+ }];
154
+ }, {
155
+ readonly name: "rewardRates";
156
+ readonly type: "tuple[]";
157
+ readonly components: readonly [{
158
+ readonly name: "asset";
159
+ readonly type: "address";
160
+ }, {
161
+ readonly name: "assetName";
162
+ readonly type: "string";
163
+ }, {
164
+ readonly name: "assetSymbol";
165
+ readonly type: "string";
166
+ }, {
167
+ readonly name: "usdPrice";
168
+ readonly type: "uint256";
169
+ }, {
170
+ readonly name: "borrow";
171
+ readonly type: "uint256";
172
+ }, {
173
+ readonly name: "floatingDeposit";
174
+ readonly type: "uint256";
175
+ }, {
176
+ readonly name: "maturities";
177
+ readonly type: "uint256[]";
178
+ }];
179
+ }, {
180
+ readonly name: "floatingBorrowRate";
181
+ readonly type: "uint256";
182
+ }, {
183
+ readonly name: "floatingUtilization";
184
+ readonly type: "uint256";
185
+ }, {
186
+ readonly name: "floatingAssets";
187
+ readonly type: "uint256";
188
+ }, {
189
+ readonly name: "floatingDebt";
190
+ readonly type: "uint256";
191
+ }, {
192
+ readonly name: "floatingBackupBorrowed";
193
+ readonly type: "uint256";
194
+ }, {
195
+ readonly name: "floatingAvailableAssets";
196
+ readonly type: "uint256";
197
+ }, {
198
+ readonly name: "totalFloatingBorrowAssets";
199
+ readonly type: "uint256";
200
+ }, {
201
+ readonly name: "totalFloatingDepositAssets";
202
+ readonly type: "uint256";
203
+ }, {
204
+ readonly name: "totalFloatingBorrowShares";
205
+ readonly type: "uint256";
206
+ }, {
207
+ readonly name: "totalFloatingDepositShares";
208
+ readonly type: "uint256";
209
+ }, {
210
+ readonly name: "isCollateral";
211
+ readonly type: "bool";
212
+ }, {
213
+ readonly name: "maxBorrowAssets";
214
+ readonly type: "uint256";
215
+ }, {
216
+ readonly name: "floatingBorrowShares";
217
+ readonly type: "uint256";
218
+ }, {
219
+ readonly name: "floatingBorrowAssets";
220
+ readonly type: "uint256";
221
+ }, {
222
+ readonly name: "floatingDepositShares";
223
+ readonly type: "uint256";
224
+ }, {
225
+ readonly name: "floatingDepositAssets";
226
+ readonly type: "uint256";
227
+ }, {
228
+ readonly name: "fixedDepositPositions";
229
+ readonly type: "tuple[]";
230
+ readonly components: readonly [{
231
+ readonly name: "maturity";
232
+ readonly type: "uint256";
233
+ }, {
234
+ readonly name: "previewValue";
235
+ readonly type: "uint256";
236
+ }, {
237
+ readonly name: "position";
238
+ readonly type: "tuple";
239
+ readonly components: readonly [{
240
+ readonly name: "principal";
241
+ readonly type: "uint256";
242
+ }, {
243
+ readonly name: "fee";
244
+ readonly type: "uint256";
245
+ }];
246
+ }];
247
+ }, {
248
+ readonly name: "fixedBorrowPositions";
249
+ readonly type: "tuple[]";
250
+ readonly components: readonly [{
251
+ readonly name: "maturity";
252
+ readonly type: "uint256";
253
+ }, {
254
+ readonly name: "previewValue";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly name: "position";
258
+ readonly type: "tuple";
259
+ readonly components: readonly [{
260
+ readonly name: "principal";
261
+ readonly type: "uint256";
262
+ }, {
263
+ readonly name: "fee";
264
+ readonly type: "uint256";
265
+ }];
266
+ }];
267
+ }, {
268
+ readonly name: "claimableRewards";
269
+ readonly type: "tuple[]";
270
+ readonly components: readonly [{
271
+ readonly name: "asset";
272
+ readonly type: "address";
273
+ }, {
274
+ readonly name: "assetName";
275
+ readonly type: "string";
276
+ }, {
277
+ readonly name: "assetSymbol";
278
+ readonly type: "string";
279
+ }, {
280
+ readonly name: "amount";
281
+ readonly type: "uint256";
282
+ }];
283
+ }];
284
+ }];
285
+ }, {
286
+ readonly type: "function";
287
+ readonly name: "previewBorrowAtMaturity";
288
+ readonly stateMutability: "view";
289
+ readonly inputs: readonly [{
290
+ readonly name: "market";
291
+ readonly type: "address";
292
+ }, {
293
+ readonly name: "maturity";
294
+ readonly type: "uint256";
295
+ }, {
296
+ readonly name: "assets";
297
+ readonly type: "uint256";
298
+ }];
299
+ readonly outputs: readonly [{
300
+ readonly name: "";
301
+ readonly type: "tuple";
302
+ readonly components: readonly [{
303
+ readonly name: "maturity";
304
+ readonly type: "uint256";
305
+ }, {
306
+ readonly name: "assets";
307
+ readonly type: "uint256";
308
+ }, {
309
+ readonly name: "utilization";
310
+ readonly type: "uint256";
311
+ }];
312
+ }];
313
+ }, {
314
+ readonly type: "function";
315
+ readonly name: "previewDepositAtMaturity";
316
+ readonly stateMutability: "view";
317
+ readonly inputs: readonly [{
318
+ readonly name: "market";
319
+ readonly type: "address";
320
+ }, {
321
+ readonly name: "maturity";
322
+ readonly type: "uint256";
323
+ }, {
324
+ readonly name: "assets";
325
+ readonly type: "uint256";
326
+ }];
327
+ readonly outputs: readonly [{
328
+ readonly name: "";
329
+ readonly type: "tuple";
330
+ readonly components: readonly [{
331
+ readonly name: "maturity";
332
+ readonly type: "uint256";
333
+ }, {
334
+ readonly name: "assets";
335
+ readonly type: "uint256";
336
+ }, {
337
+ readonly name: "utilization";
338
+ readonly type: "uint256";
339
+ }];
340
+ }];
341
+ }, {
342
+ readonly type: "function";
343
+ readonly name: "previewRepayAtMaturity";
344
+ readonly stateMutability: "view";
345
+ readonly inputs: readonly [{
346
+ readonly name: "market";
347
+ readonly type: "address";
348
+ }, {
349
+ readonly name: "maturity";
350
+ readonly type: "uint256";
351
+ }, {
352
+ readonly name: "positionAssets";
353
+ readonly type: "uint256";
354
+ }, {
355
+ readonly name: "borrower";
356
+ readonly type: "address";
357
+ }];
358
+ readonly outputs: readonly [{
359
+ readonly name: "";
360
+ readonly type: "tuple";
361
+ readonly components: readonly [{
362
+ readonly name: "maturity";
363
+ readonly type: "uint256";
364
+ }, {
365
+ readonly name: "assets";
366
+ readonly type: "uint256";
367
+ }, {
368
+ readonly name: "utilization";
369
+ readonly type: "uint256";
370
+ }];
371
+ }];
372
+ }, {
373
+ readonly type: "function";
374
+ readonly name: "previewWithdrawAtMaturity";
375
+ readonly stateMutability: "view";
376
+ readonly inputs: readonly [{
377
+ readonly name: "market";
378
+ readonly type: "address";
379
+ }, {
380
+ readonly name: "maturity";
381
+ readonly type: "uint256";
382
+ }, {
383
+ readonly name: "positionAssets";
384
+ readonly type: "uint256";
385
+ }, {
386
+ readonly name: "owner";
387
+ readonly type: "address";
388
+ }];
389
+ readonly outputs: readonly [{
390
+ readonly name: "";
391
+ readonly type: "tuple";
392
+ readonly components: readonly [{
393
+ readonly name: "maturity";
394
+ readonly type: "uint256";
395
+ }, {
396
+ readonly name: "assets";
397
+ readonly type: "uint256";
398
+ }, {
399
+ readonly name: "utilization";
400
+ readonly type: "uint256";
401
+ }];
402
+ }];
403
+ }, {
404
+ readonly type: "function";
405
+ readonly name: "auditor";
406
+ readonly stateMutability: "view";
407
+ readonly inputs: readonly [];
408
+ readonly outputs: readonly [{
409
+ readonly name: "";
410
+ readonly type: "address";
411
+ }];
412
+ }];
413
+ /** Exactly Oracle Fetcher module. */
414
+ export declare const exactlyFetcher: {
415
+ getCalls: typeof getExactlyCalls;
416
+ parse: typeof parseExactlyResults;
417
+ getAbi: typeof getExactlyAbi;
418
+ };
419
+ export {};
420
+ //# sourceMappingURL=exactly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exactly.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/exactly.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAA;AAIjB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,2EAA2E;AAC3E,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAUnC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,YAAY,GACpB,gBAAgB,EAAE,CAmCpB;AAED,sEAAsE;AACtE,wBAAgB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE5B;AAED,qCAAqC;AACrC,eAAO,MAAM,cAAc;;;;CAI1B,CAAA"}
@@ -1,6 +1,10 @@
1
1
  export { aaveFetcher, getAaveCalls, parseAaveResults, getAaveAbi } from './aave';
2
2
  export { morphoFetcher, getMorphoCalls, parseMorphoResults, getMorphoAbi, fetchMorphoGraphQLPrices, morphoApiAvailable, morphoApiIncomplete, type MorphoMarketOverrides, type MorphoFetcherContext, } from './morpho';
3
3
  export { midnightFetcher, getMidnightCalls, parseMidnightResults, getMidnightAbi, } from './midnight';
4
+ export { exactlyFetcher, getExactlyCalls, parseExactlyResults, getExactlyAbi, } from './exactly';
5
+ export { termFetcher, getTermCalls, parseTermResults, getTermAbi, } from './term';
6
+ export { liquityFetcher, getLiquityCalls, parseLiquityResults, getLiquityAbi, } from './liquity';
7
+ export { riverFetcher, getRiverCalls, parseRiverResults, getRiverAbi, } from './river';
4
8
  export { compoundV2Fetcher, getCompoundV2Calls, parseCompoundV2Results, getCompoundV2Abi, } from './compoundV2';
5
9
  export { compoundV3Fetcher, getCompoundV3Calls, parseCompoundV3Results, getCompoundV3Abi, } from './compoundV3';
6
10
  export { listaFetcher, getListaCalls, parseListaResults, getListaAbi, type ListaMarketOverrides, type ListaFetcherContext, } from './lista';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gB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,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAChF,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,cAAc,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { FetcherResult, OraclePriceEntry, ParseContext } from '../types';
2
+ interface LiquityBranchMeta {
3
+ lender: string;
4
+ chainId: string;
5
+ collIndex: number;
6
+ collToken: string;
7
+ /** Stable/debt token (pegged to 1). Emitted once per branch. */
8
+ debtToken?: string;
9
+ }
10
+ /** Build one `lastGoodPrice()` call per branch across every family deployment. */
11
+ export declare function getLiquityCalls(chainId: string): FetcherResult<LiquityBranchMeta>[];
12
+ /**
13
+ * Parse a branch's `lastGoodPrice` into direct-USD entries: the collateral at
14
+ * its on-chain USD price, and the stablecoin pegged to $1. Both keyed under the
15
+ * per-branch `<DEPLOYMENT>_<chain>_<collIndex>` lender so the marketUids join
16
+ * the Liquity lending data.
17
+ */
18
+ export declare function parseLiquityResults(data: any[], meta: LiquityBranchMeta, context: ParseContext): OraclePriceEntry[];
19
+ /** ABI for the Liquity oracle call (`lastGoodPrice`). */
20
+ export declare function getLiquityAbi(): readonly [{
21
+ readonly type: "function";
22
+ readonly name: "fetchPrice";
23
+ readonly stateMutability: "nonpayable";
24
+ readonly inputs: readonly [];
25
+ readonly outputs: readonly [{
26
+ readonly name: "";
27
+ readonly type: "uint256";
28
+ }, {
29
+ readonly name: "";
30
+ readonly type: "bool";
31
+ }];
32
+ }, {
33
+ readonly type: "function";
34
+ readonly name: "lastGoodPrice";
35
+ readonly stateMutability: "view";
36
+ readonly inputs: readonly [];
37
+ readonly outputs: readonly [{
38
+ readonly name: "";
39
+ readonly type: "uint256";
40
+ }];
41
+ }];
42
+ /** Liquity-family Oracle Fetcher module. */
43
+ export declare const liquityFetcher: {
44
+ getCalls: typeof getLiquityCalls;
45
+ parse: typeof parseLiquityResults;
46
+ getAbi: typeof getLiquityAbi;
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=liquity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquity.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/liquity.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAA;AA0BjB,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,iBAAiB,CAAC,EAAE,CA4BpC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,GACpB,gBAAgB,EAAE,CA2CpB;AAED,yDAAyD;AACzD,wBAAgB,aAAa;;;;;;;;;;;;;;;;;;;;;GAE5B;AAED,4CAA4C;AAC5C,eAAO,MAAM,cAAc;;;;CAI1B,CAAA"}