@1delta/margin-fetcher 0.0.330 → 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.
Files changed (31) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +450 -22
  4. package/dist/index.js.map +1 -1
  5. package/dist/lending/public-data/fluid/publicCallParse.d.ts +1 -1
  6. package/dist/lending/public-data/liquity/convertPublic.d.ts +13 -6
  7. package/dist/lending/public-data/liquity/convertPublic.d.ts.map +1 -1
  8. package/dist/lending/public-data/river/convertPublic.d.ts +10 -4
  9. package/dist/lending/public-data/river/convertPublic.d.ts.map +1 -1
  10. package/dist/lending/public-data/term/apiClient.d.ts +9 -1
  11. package/dist/lending/public-data/term/apiClient.d.ts.map +1 -1
  12. package/dist/lending/public-data/term/index.d.ts +1 -1
  13. package/dist/lending/public-data/term/index.d.ts.map +1 -1
  14. package/dist/lending/public-data/term/types.d.ts +49 -0
  15. package/dist/lending/public-data/term/types.d.ts.map +1 -1
  16. package/dist/lending/user-data/exactly/userCallParse.d.ts.map +1 -1
  17. package/dist/lending/user-data/liquity/userCallParse.d.ts +1 -1
  18. package/dist/lending/user-data/river/userCallParse.d.ts +1 -1
  19. package/dist/prices/oracle-prices/fetchOraclePrices.d.ts +2 -1
  20. package/dist/prices/oracle-prices/fetchOraclePrices.d.ts.map +1 -1
  21. package/dist/prices/oracle-prices/fetchers/exactly.d.ts +420 -0
  22. package/dist/prices/oracle-prices/fetchers/exactly.d.ts.map +1 -0
  23. package/dist/prices/oracle-prices/fetchers/index.d.ts +4 -0
  24. package/dist/prices/oracle-prices/fetchers/index.d.ts.map +1 -1
  25. package/dist/prices/oracle-prices/fetchers/liquity.d.ts +49 -0
  26. package/dist/prices/oracle-prices/fetchers/liquity.d.ts.map +1 -0
  27. package/dist/prices/oracle-prices/fetchers/river.d.ts +269 -0
  28. package/dist/prices/oracle-prices/fetchers/river.d.ts.map +1 -0
  29. package/dist/prices/oracle-prices/fetchers/term.d.ts +59 -0
  30. package/dist/prices/oracle-prices/fetchers/term.d.ts.map +1 -0
  31. package/package.json +4 -4
@@ -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,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,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"}
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"}