@1delta/margin-fetcher 0.0.242 → 0.0.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +533 -21
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/fetchLender.d.ts.map +1 -1
- package/dist/lending/public-data/gearbox/index.d.ts +3 -0
- package/dist/lending/public-data/gearbox/index.d.ts.map +1 -0
- package/dist/lending/public-data/gearbox/publicCallBuild.d.ts +17 -0
- package/dist/lending/public-data/gearbox/publicCallBuild.d.ts.map +1 -0
- package/dist/lending/public-data/gearbox/publicCallParse.d.ts +27 -0
- package/dist/lending/public-data/gearbox/publicCallParse.d.ts.map +1 -0
- package/dist/lending/user-data/abis.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/parse.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/prepare.d.ts.map +1 -1
- package/dist/lending/user-data/gearbox/index.d.ts +3 -0
- package/dist/lending/user-data/gearbox/index.d.ts.map +1 -0
- package/dist/lending/user-data/gearbox/userCallBuild.d.ts +19 -0
- package/dist/lending/user-data/gearbox/userCallBuild.d.ts.map +1 -0
- package/dist/lending/user-data/gearbox/userCallParse.d.ts +25 -0
- package/dist/lending/user-data/gearbox/userCallParse.d.ts.map +1 -0
- package/dist/prices/oracle-prices/fetchOraclePrices.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/gearbox.d.ts +601 -0
- package/dist/prices/oracle-prices/fetchers/gearbox.d.ts.map +1 -0
- package/dist/prices/oracle-prices/fetchers/index.d.ts +2 -1
- package/dist/prices/oracle-prices/fetchers/index.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts +9 -0
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/marketName.d.ts.map +1 -1
- package/dist/vaults/gearbox/fetchPublic.d.ts +23 -0
- package/dist/vaults/gearbox/fetchPublic.d.ts.map +1 -0
- package/dist/vaults/gearbox/index.d.ts +5 -0
- package/dist/vaults/gearbox/index.d.ts.map +1 -0
- package/dist/vaults/gearbox/publicCallBuild.d.ts +14 -0
- package/dist/vaults/gearbox/publicCallBuild.d.ts.map +1 -0
- package/dist/vaults/gearbox/publicCallParse.d.ts +13 -0
- package/dist/vaults/gearbox/publicCallParse.d.ts.map +1 -0
- package/dist/vaults/gearbox/types.d.ts +61 -0
- package/dist/vaults/gearbox/types.d.ts.map +1 -0
- package/dist/vaults/index.d.ts +1 -0
- package/dist/vaults/index.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
import type { FetcherResult, OraclePriceEntry, ParseContext } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Meta shape — empty placeholder; the pool + CM list is discovered lazily
|
|
4
|
+
* from the DataCompressor response in `parse`, so no call-time metadata
|
|
5
|
+
* is needed.
|
|
6
|
+
*/
|
|
7
|
+
export interface GearboxV3QueryMeta {
|
|
8
|
+
_: never[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build multicall calls for Gearbox V3 oracle prices.
|
|
12
|
+
*
|
|
13
|
+
* Uses `DataCompressorV3.getPoolsV3List()` — the same call powering the
|
|
14
|
+
* public-data fetcher. Each pool embeds its `creditManagers[]`, and each
|
|
15
|
+
* CM its `collateralTokens[]`. We emit one oracle price entry per
|
|
16
|
+
* (CM, token) pair so downstream normalizers can attribute prices to the
|
|
17
|
+
* correct isolated lender key.
|
|
18
|
+
*
|
|
19
|
+
* Gearbox's `PriceOracleV3.getPrice(token)` returns USD with 8 decimals,
|
|
20
|
+
* so we have no base-token dependency — prices resolve straight from
|
|
21
|
+
* `context.usdPrices` which is populated by upstream Aave/Chainlink
|
|
22
|
+
* fetchers.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getGearboxV3Calls(chainId: string): FetcherResult<GearboxV3QueryMeta>[];
|
|
25
|
+
/**
|
|
26
|
+
* Parse Gearbox V3 oracle results — emit per-(CM, token) entries.
|
|
27
|
+
*
|
|
28
|
+
* For each pool, for each CreditManager, we emit:
|
|
29
|
+
* - one "base" entry for the pool's underlying with `staticBase: true`
|
|
30
|
+
* - one collateral entry per `collateralTokens[i]` with `priceUSD`
|
|
31
|
+
* resolved from `context.usdPrices`
|
|
32
|
+
*
|
|
33
|
+
* Targets are the per-CM lender keys synthesized by `gearboxV3LenderKey`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function parseGearboxV3Results(data: any[], _meta: GearboxV3QueryMeta, context: ParseContext): OraclePriceEntry[];
|
|
36
|
+
export declare function getGearboxV3Abi(): readonly [{
|
|
37
|
+
readonly inputs: readonly [];
|
|
38
|
+
readonly name: "getPoolsV3List";
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly components: readonly [{
|
|
41
|
+
readonly name: "addr";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "underlying";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "dieselToken";
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "symbol";
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "name";
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "baseInterestIndex";
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "availableLiquidity";
|
|
60
|
+
readonly type: "uint256";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "expectedLiquidity";
|
|
63
|
+
readonly type: "uint256";
|
|
64
|
+
}, {
|
|
65
|
+
readonly name: "totalBorrowed";
|
|
66
|
+
readonly type: "uint256";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "totalDebtLimit";
|
|
69
|
+
readonly type: "uint256";
|
|
70
|
+
}, {
|
|
71
|
+
readonly components: readonly [{
|
|
72
|
+
readonly name: "creditManager";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "borrowed";
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "limit";
|
|
79
|
+
readonly type: "uint256";
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "availableToBorrow";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}];
|
|
84
|
+
readonly name: "creditManagerDebtParams";
|
|
85
|
+
readonly type: "tuple[]";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "totalAssets";
|
|
88
|
+
readonly type: "uint256";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "totalSupply";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "supplyRate";
|
|
94
|
+
readonly type: "uint256";
|
|
95
|
+
}, {
|
|
96
|
+
readonly name: "baseInterestRate";
|
|
97
|
+
readonly type: "uint256";
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "dieselRate_RAY";
|
|
100
|
+
readonly type: "uint256";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "withdrawFee";
|
|
103
|
+
readonly type: "uint256";
|
|
104
|
+
}, {
|
|
105
|
+
readonly name: "lastBaseInterestUpdate";
|
|
106
|
+
readonly type: "uint256";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "baseInterestIndexLU";
|
|
109
|
+
readonly type: "uint256";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "version";
|
|
112
|
+
readonly type: "uint256";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "poolQuotaKeeper";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "gauge";
|
|
118
|
+
readonly type: "address";
|
|
119
|
+
}, {
|
|
120
|
+
readonly components: readonly [{
|
|
121
|
+
readonly name: "token";
|
|
122
|
+
readonly type: "address";
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "rate";
|
|
125
|
+
readonly type: "uint16";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "quotaIncreaseFee";
|
|
128
|
+
readonly type: "uint16";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "totalQuoted";
|
|
131
|
+
readonly type: "uint96";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "limit";
|
|
134
|
+
readonly type: "uint96";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "isActive";
|
|
137
|
+
readonly type: "bool";
|
|
138
|
+
}];
|
|
139
|
+
readonly name: "quotas";
|
|
140
|
+
readonly type: "tuple[]";
|
|
141
|
+
}, {
|
|
142
|
+
readonly components: readonly [{
|
|
143
|
+
readonly name: "zapper";
|
|
144
|
+
readonly type: "address";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "tokenIn";
|
|
147
|
+
readonly type: "address";
|
|
148
|
+
}, {
|
|
149
|
+
readonly name: "tokenOut";
|
|
150
|
+
readonly type: "address";
|
|
151
|
+
}];
|
|
152
|
+
readonly name: "zappers";
|
|
153
|
+
readonly type: "tuple[]";
|
|
154
|
+
}, {
|
|
155
|
+
readonly components: readonly [{
|
|
156
|
+
readonly name: "interestModel";
|
|
157
|
+
readonly type: "address";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "version";
|
|
160
|
+
readonly type: "uint256";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "U_1";
|
|
163
|
+
readonly type: "uint16";
|
|
164
|
+
}, {
|
|
165
|
+
readonly name: "U_2";
|
|
166
|
+
readonly type: "uint16";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "R_base";
|
|
169
|
+
readonly type: "uint16";
|
|
170
|
+
}, {
|
|
171
|
+
readonly name: "R_slope1";
|
|
172
|
+
readonly type: "uint16";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "R_slope2";
|
|
175
|
+
readonly type: "uint16";
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "R_slope3";
|
|
178
|
+
readonly type: "uint16";
|
|
179
|
+
}, {
|
|
180
|
+
readonly name: "isBorrowingMoreU2Forbidden";
|
|
181
|
+
readonly type: "bool";
|
|
182
|
+
}];
|
|
183
|
+
readonly name: "lirm";
|
|
184
|
+
readonly type: "tuple";
|
|
185
|
+
}, {
|
|
186
|
+
readonly name: "isPaused";
|
|
187
|
+
readonly type: "bool";
|
|
188
|
+
}];
|
|
189
|
+
readonly name: "result";
|
|
190
|
+
readonly type: "tuple[]";
|
|
191
|
+
}];
|
|
192
|
+
readonly stateMutability: "view";
|
|
193
|
+
readonly type: "function";
|
|
194
|
+
}, {
|
|
195
|
+
readonly inputs: readonly [];
|
|
196
|
+
readonly name: "getCreditManagersV3List";
|
|
197
|
+
readonly outputs: readonly [{
|
|
198
|
+
readonly components: readonly [{
|
|
199
|
+
readonly name: "addr";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "name";
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
}, {
|
|
205
|
+
readonly name: "cfVersion";
|
|
206
|
+
readonly type: "uint256";
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "creditFacade";
|
|
209
|
+
readonly type: "address";
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "creditConfigurator";
|
|
212
|
+
readonly type: "address";
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "underlying";
|
|
215
|
+
readonly type: "address";
|
|
216
|
+
}, {
|
|
217
|
+
readonly name: "pool";
|
|
218
|
+
readonly type: "address";
|
|
219
|
+
}, {
|
|
220
|
+
readonly name: "totalDebt";
|
|
221
|
+
readonly type: "uint256";
|
|
222
|
+
}, {
|
|
223
|
+
readonly name: "totalDebtLimit";
|
|
224
|
+
readonly type: "uint256";
|
|
225
|
+
}, {
|
|
226
|
+
readonly name: "baseBorrowRate";
|
|
227
|
+
readonly type: "uint256";
|
|
228
|
+
}, {
|
|
229
|
+
readonly name: "minDebt";
|
|
230
|
+
readonly type: "uint256";
|
|
231
|
+
}, {
|
|
232
|
+
readonly name: "maxDebt";
|
|
233
|
+
readonly type: "uint256";
|
|
234
|
+
}, {
|
|
235
|
+
readonly name: "availableToBorrow";
|
|
236
|
+
readonly type: "uint256";
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "collateralTokens";
|
|
239
|
+
readonly type: "address[]";
|
|
240
|
+
}, {
|
|
241
|
+
readonly components: readonly [{
|
|
242
|
+
readonly name: "targetContract";
|
|
243
|
+
readonly type: "address";
|
|
244
|
+
}, {
|
|
245
|
+
readonly name: "adapter";
|
|
246
|
+
readonly type: "address";
|
|
247
|
+
}];
|
|
248
|
+
readonly name: "adapters";
|
|
249
|
+
readonly type: "tuple[]";
|
|
250
|
+
}, {
|
|
251
|
+
readonly name: "liquidationThresholds";
|
|
252
|
+
readonly type: "uint256[]";
|
|
253
|
+
}, {
|
|
254
|
+
readonly name: "isDegenMode";
|
|
255
|
+
readonly type: "bool";
|
|
256
|
+
}, {
|
|
257
|
+
readonly name: "degenNFT";
|
|
258
|
+
readonly type: "address";
|
|
259
|
+
}, {
|
|
260
|
+
readonly name: "forbiddenTokenMask";
|
|
261
|
+
readonly type: "uint256";
|
|
262
|
+
}, {
|
|
263
|
+
readonly name: "maxEnabledTokensLength";
|
|
264
|
+
readonly type: "uint8";
|
|
265
|
+
}, {
|
|
266
|
+
readonly name: "feeInterest";
|
|
267
|
+
readonly type: "uint16";
|
|
268
|
+
}, {
|
|
269
|
+
readonly name: "feeLiquidation";
|
|
270
|
+
readonly type: "uint16";
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "liquidationDiscount";
|
|
273
|
+
readonly type: "uint16";
|
|
274
|
+
}, {
|
|
275
|
+
readonly name: "feeLiquidationExpired";
|
|
276
|
+
readonly type: "uint16";
|
|
277
|
+
}, {
|
|
278
|
+
readonly name: "liquidationDiscountExpired";
|
|
279
|
+
readonly type: "uint16";
|
|
280
|
+
}, {
|
|
281
|
+
readonly components: readonly [{
|
|
282
|
+
readonly name: "token";
|
|
283
|
+
readonly type: "address";
|
|
284
|
+
}, {
|
|
285
|
+
readonly name: "rate";
|
|
286
|
+
readonly type: "uint16";
|
|
287
|
+
}, {
|
|
288
|
+
readonly name: "quotaIncreaseFee";
|
|
289
|
+
readonly type: "uint16";
|
|
290
|
+
}, {
|
|
291
|
+
readonly name: "totalQuoted";
|
|
292
|
+
readonly type: "uint96";
|
|
293
|
+
}, {
|
|
294
|
+
readonly name: "limit";
|
|
295
|
+
readonly type: "uint96";
|
|
296
|
+
}, {
|
|
297
|
+
readonly name: "isActive";
|
|
298
|
+
readonly type: "bool";
|
|
299
|
+
}];
|
|
300
|
+
readonly name: "quotas";
|
|
301
|
+
readonly type: "tuple[]";
|
|
302
|
+
}, {
|
|
303
|
+
readonly components: readonly [{
|
|
304
|
+
readonly name: "interestModel";
|
|
305
|
+
readonly type: "address";
|
|
306
|
+
}, {
|
|
307
|
+
readonly name: "version";
|
|
308
|
+
readonly type: "uint256";
|
|
309
|
+
}, {
|
|
310
|
+
readonly name: "U_1";
|
|
311
|
+
readonly type: "uint16";
|
|
312
|
+
}, {
|
|
313
|
+
readonly name: "U_2";
|
|
314
|
+
readonly type: "uint16";
|
|
315
|
+
}, {
|
|
316
|
+
readonly name: "R_base";
|
|
317
|
+
readonly type: "uint16";
|
|
318
|
+
}, {
|
|
319
|
+
readonly name: "R_slope1";
|
|
320
|
+
readonly type: "uint16";
|
|
321
|
+
}, {
|
|
322
|
+
readonly name: "R_slope2";
|
|
323
|
+
readonly type: "uint16";
|
|
324
|
+
}, {
|
|
325
|
+
readonly name: "R_slope3";
|
|
326
|
+
readonly type: "uint16";
|
|
327
|
+
}, {
|
|
328
|
+
readonly name: "isBorrowingMoreU2Forbidden";
|
|
329
|
+
readonly type: "bool";
|
|
330
|
+
}];
|
|
331
|
+
readonly name: "lirm";
|
|
332
|
+
readonly type: "tuple";
|
|
333
|
+
}, {
|
|
334
|
+
readonly name: "isPaused";
|
|
335
|
+
readonly type: "bool";
|
|
336
|
+
}];
|
|
337
|
+
readonly name: "result";
|
|
338
|
+
readonly type: "tuple[]";
|
|
339
|
+
}];
|
|
340
|
+
readonly stateMutability: "view";
|
|
341
|
+
readonly type: "function";
|
|
342
|
+
}, {
|
|
343
|
+
readonly inputs: readonly [{
|
|
344
|
+
readonly name: "borrower";
|
|
345
|
+
readonly type: "address";
|
|
346
|
+
}, {
|
|
347
|
+
readonly components: readonly [{
|
|
348
|
+
readonly name: "token";
|
|
349
|
+
readonly type: "address";
|
|
350
|
+
}, {
|
|
351
|
+
readonly name: "callData";
|
|
352
|
+
readonly type: "bytes";
|
|
353
|
+
}];
|
|
354
|
+
readonly name: "priceUpdates";
|
|
355
|
+
readonly type: "tuple[]";
|
|
356
|
+
}];
|
|
357
|
+
readonly name: "getCreditAccountsByBorrower";
|
|
358
|
+
readonly outputs: readonly [{
|
|
359
|
+
readonly components: readonly [{
|
|
360
|
+
readonly name: "isSuccessful";
|
|
361
|
+
readonly type: "bool";
|
|
362
|
+
}, {
|
|
363
|
+
readonly name: "priceFeedsNeeded";
|
|
364
|
+
readonly type: "address[]";
|
|
365
|
+
}, {
|
|
366
|
+
readonly name: "addr";
|
|
367
|
+
readonly type: "address";
|
|
368
|
+
}, {
|
|
369
|
+
readonly name: "borrower";
|
|
370
|
+
readonly type: "address";
|
|
371
|
+
}, {
|
|
372
|
+
readonly name: "creditManager";
|
|
373
|
+
readonly type: "address";
|
|
374
|
+
}, {
|
|
375
|
+
readonly name: "cmName";
|
|
376
|
+
readonly type: "string";
|
|
377
|
+
}, {
|
|
378
|
+
readonly name: "creditFacade";
|
|
379
|
+
readonly type: "address";
|
|
380
|
+
}, {
|
|
381
|
+
readonly name: "underlying";
|
|
382
|
+
readonly type: "address";
|
|
383
|
+
}, {
|
|
384
|
+
readonly name: "debt";
|
|
385
|
+
readonly type: "uint256";
|
|
386
|
+
}, {
|
|
387
|
+
readonly name: "cumulativeIndexLastUpdate";
|
|
388
|
+
readonly type: "uint256";
|
|
389
|
+
}, {
|
|
390
|
+
readonly name: "cumulativeQuotaInterest";
|
|
391
|
+
readonly type: "uint128";
|
|
392
|
+
}, {
|
|
393
|
+
readonly name: "accruedInterest";
|
|
394
|
+
readonly type: "uint256";
|
|
395
|
+
}, {
|
|
396
|
+
readonly name: "accruedFees";
|
|
397
|
+
readonly type: "uint256";
|
|
398
|
+
}, {
|
|
399
|
+
readonly name: "totalDebtUSD";
|
|
400
|
+
readonly type: "uint256";
|
|
401
|
+
}, {
|
|
402
|
+
readonly name: "totalValue";
|
|
403
|
+
readonly type: "uint256";
|
|
404
|
+
}, {
|
|
405
|
+
readonly name: "totalValueUSD";
|
|
406
|
+
readonly type: "uint256";
|
|
407
|
+
}, {
|
|
408
|
+
readonly name: "twvUSD";
|
|
409
|
+
readonly type: "uint256";
|
|
410
|
+
}, {
|
|
411
|
+
readonly name: "enabledTokensMask";
|
|
412
|
+
readonly type: "uint256";
|
|
413
|
+
}, {
|
|
414
|
+
readonly name: "healthFactor";
|
|
415
|
+
readonly type: "uint256";
|
|
416
|
+
}, {
|
|
417
|
+
readonly name: "baseBorrowRate";
|
|
418
|
+
readonly type: "uint256";
|
|
419
|
+
}, {
|
|
420
|
+
readonly name: "aggregatedBorrowRate";
|
|
421
|
+
readonly type: "uint256";
|
|
422
|
+
}, {
|
|
423
|
+
readonly components: readonly [{
|
|
424
|
+
readonly name: "token";
|
|
425
|
+
readonly type: "address";
|
|
426
|
+
}, {
|
|
427
|
+
readonly name: "balance";
|
|
428
|
+
readonly type: "uint256";
|
|
429
|
+
}, {
|
|
430
|
+
readonly name: "isForbidden";
|
|
431
|
+
readonly type: "bool";
|
|
432
|
+
}, {
|
|
433
|
+
readonly name: "isEnabled";
|
|
434
|
+
readonly type: "bool";
|
|
435
|
+
}, {
|
|
436
|
+
readonly name: "isQuoted";
|
|
437
|
+
readonly type: "bool";
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "quota";
|
|
440
|
+
readonly type: "uint256";
|
|
441
|
+
}, {
|
|
442
|
+
readonly name: "quotaRate";
|
|
443
|
+
readonly type: "uint16";
|
|
444
|
+
}, {
|
|
445
|
+
readonly name: "quotaCumulativeIndexLU";
|
|
446
|
+
readonly type: "uint256";
|
|
447
|
+
}];
|
|
448
|
+
readonly name: "balances";
|
|
449
|
+
readonly type: "tuple[]";
|
|
450
|
+
}, {
|
|
451
|
+
readonly name: "since";
|
|
452
|
+
readonly type: "uint64";
|
|
453
|
+
}, {
|
|
454
|
+
readonly name: "cfVersion";
|
|
455
|
+
readonly type: "uint256";
|
|
456
|
+
}, {
|
|
457
|
+
readonly name: "expirationDate";
|
|
458
|
+
readonly type: "uint40";
|
|
459
|
+
}, {
|
|
460
|
+
readonly name: "activeBots";
|
|
461
|
+
readonly type: "address[]";
|
|
462
|
+
}];
|
|
463
|
+
readonly name: "result";
|
|
464
|
+
readonly type: "tuple[]";
|
|
465
|
+
}];
|
|
466
|
+
readonly stateMutability: "nonpayable";
|
|
467
|
+
readonly type: "function";
|
|
468
|
+
}, {
|
|
469
|
+
readonly inputs: readonly [{
|
|
470
|
+
readonly name: "_creditAccount";
|
|
471
|
+
readonly type: "address";
|
|
472
|
+
}, {
|
|
473
|
+
readonly components: readonly [{
|
|
474
|
+
readonly name: "token";
|
|
475
|
+
readonly type: "address";
|
|
476
|
+
}, {
|
|
477
|
+
readonly name: "callData";
|
|
478
|
+
readonly type: "bytes";
|
|
479
|
+
}];
|
|
480
|
+
readonly name: "priceUpdates";
|
|
481
|
+
readonly type: "tuple[]";
|
|
482
|
+
}];
|
|
483
|
+
readonly name: "getCreditAccountData";
|
|
484
|
+
readonly outputs: readonly [{
|
|
485
|
+
readonly components: readonly [{
|
|
486
|
+
readonly name: "isSuccessful";
|
|
487
|
+
readonly type: "bool";
|
|
488
|
+
}, {
|
|
489
|
+
readonly name: "priceFeedsNeeded";
|
|
490
|
+
readonly type: "address[]";
|
|
491
|
+
}, {
|
|
492
|
+
readonly name: "addr";
|
|
493
|
+
readonly type: "address";
|
|
494
|
+
}, {
|
|
495
|
+
readonly name: "borrower";
|
|
496
|
+
readonly type: "address";
|
|
497
|
+
}, {
|
|
498
|
+
readonly name: "creditManager";
|
|
499
|
+
readonly type: "address";
|
|
500
|
+
}, {
|
|
501
|
+
readonly name: "cmName";
|
|
502
|
+
readonly type: "string";
|
|
503
|
+
}, {
|
|
504
|
+
readonly name: "creditFacade";
|
|
505
|
+
readonly type: "address";
|
|
506
|
+
}, {
|
|
507
|
+
readonly name: "underlying";
|
|
508
|
+
readonly type: "address";
|
|
509
|
+
}, {
|
|
510
|
+
readonly name: "debt";
|
|
511
|
+
readonly type: "uint256";
|
|
512
|
+
}, {
|
|
513
|
+
readonly name: "cumulativeIndexLastUpdate";
|
|
514
|
+
readonly type: "uint256";
|
|
515
|
+
}, {
|
|
516
|
+
readonly name: "cumulativeQuotaInterest";
|
|
517
|
+
readonly type: "uint128";
|
|
518
|
+
}, {
|
|
519
|
+
readonly name: "accruedInterest";
|
|
520
|
+
readonly type: "uint256";
|
|
521
|
+
}, {
|
|
522
|
+
readonly name: "accruedFees";
|
|
523
|
+
readonly type: "uint256";
|
|
524
|
+
}, {
|
|
525
|
+
readonly name: "totalDebtUSD";
|
|
526
|
+
readonly type: "uint256";
|
|
527
|
+
}, {
|
|
528
|
+
readonly name: "totalValue";
|
|
529
|
+
readonly type: "uint256";
|
|
530
|
+
}, {
|
|
531
|
+
readonly name: "totalValueUSD";
|
|
532
|
+
readonly type: "uint256";
|
|
533
|
+
}, {
|
|
534
|
+
readonly name: "twvUSD";
|
|
535
|
+
readonly type: "uint256";
|
|
536
|
+
}, {
|
|
537
|
+
readonly name: "enabledTokensMask";
|
|
538
|
+
readonly type: "uint256";
|
|
539
|
+
}, {
|
|
540
|
+
readonly name: "healthFactor";
|
|
541
|
+
readonly type: "uint256";
|
|
542
|
+
}, {
|
|
543
|
+
readonly name: "baseBorrowRate";
|
|
544
|
+
readonly type: "uint256";
|
|
545
|
+
}, {
|
|
546
|
+
readonly name: "aggregatedBorrowRate";
|
|
547
|
+
readonly type: "uint256";
|
|
548
|
+
}, {
|
|
549
|
+
readonly components: readonly [{
|
|
550
|
+
readonly name: "token";
|
|
551
|
+
readonly type: "address";
|
|
552
|
+
}, {
|
|
553
|
+
readonly name: "balance";
|
|
554
|
+
readonly type: "uint256";
|
|
555
|
+
}, {
|
|
556
|
+
readonly name: "isForbidden";
|
|
557
|
+
readonly type: "bool";
|
|
558
|
+
}, {
|
|
559
|
+
readonly name: "isEnabled";
|
|
560
|
+
readonly type: "bool";
|
|
561
|
+
}, {
|
|
562
|
+
readonly name: "isQuoted";
|
|
563
|
+
readonly type: "bool";
|
|
564
|
+
}, {
|
|
565
|
+
readonly name: "quota";
|
|
566
|
+
readonly type: "uint256";
|
|
567
|
+
}, {
|
|
568
|
+
readonly name: "quotaRate";
|
|
569
|
+
readonly type: "uint16";
|
|
570
|
+
}, {
|
|
571
|
+
readonly name: "quotaCumulativeIndexLU";
|
|
572
|
+
readonly type: "uint256";
|
|
573
|
+
}];
|
|
574
|
+
readonly name: "balances";
|
|
575
|
+
readonly type: "tuple[]";
|
|
576
|
+
}, {
|
|
577
|
+
readonly name: "since";
|
|
578
|
+
readonly type: "uint64";
|
|
579
|
+
}, {
|
|
580
|
+
readonly name: "cfVersion";
|
|
581
|
+
readonly type: "uint256";
|
|
582
|
+
}, {
|
|
583
|
+
readonly name: "expirationDate";
|
|
584
|
+
readonly type: "uint40";
|
|
585
|
+
}, {
|
|
586
|
+
readonly name: "activeBots";
|
|
587
|
+
readonly type: "address[]";
|
|
588
|
+
}];
|
|
589
|
+
readonly name: "result";
|
|
590
|
+
readonly type: "tuple";
|
|
591
|
+
}];
|
|
592
|
+
readonly stateMutability: "nonpayable";
|
|
593
|
+
readonly type: "function";
|
|
594
|
+
}];
|
|
595
|
+
/** Gearbox V3 Oracle Fetcher module */
|
|
596
|
+
export declare const gearboxV3Fetcher: {
|
|
597
|
+
getCalls: typeof getGearboxV3Calls;
|
|
598
|
+
parse: typeof parseGearboxV3Results;
|
|
599
|
+
getAbi: typeof getGearboxV3Abi;
|
|
600
|
+
};
|
|
601
|
+
//# sourceMappingURL=gearbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gearbox.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/gearbox.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAA;AAEjB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,CAAC,EAAE,KAAK,EAAE,CAAA;CACX;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,kBAAkB,CAAC,EAAE,CAiBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,YAAY,GACpB,gBAAgB,EAAE,CAsEpB;AAED,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE9B;AAED,uCAAuC;AACvC,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { aaveFetcher, getAaveCalls, parseAaveResults, getAaveAbi } from './aave';
|
|
2
|
-
export { morphoFetcher, getMorphoCalls, parseMorphoResults, getMorphoAbi, fetchMorphoGraphQLPrices, type MorphoMarketOverrides, type MorphoFetcherContext, } from './morpho';
|
|
2
|
+
export { morphoFetcher, getMorphoCalls, parseMorphoResults, getMorphoAbi, fetchMorphoGraphQLPrices, morphoApiAvailable, type MorphoMarketOverrides, type MorphoFetcherContext, } from './morpho';
|
|
3
3
|
export { compoundV2Fetcher, getCompoundV2Calls, parseCompoundV2Results, getCompoundV2Abi, } from './compoundV2';
|
|
4
4
|
export { compoundV3Fetcher, getCompoundV3Calls, parseCompoundV3Results, getCompoundV3Abi, } from './compoundV3';
|
|
5
5
|
export { listaFetcher, getListaCalls, parseListaResults, getListaAbi, type ListaMarketOverrides, type ListaFetcherContext, } from './lista';
|
|
@@ -8,4 +8,5 @@ export { aaveV4Fetcher, getAaveV4Calls, parseAaveV4Results, getAaveV4Abi, } from
|
|
|
8
8
|
export { siloV2Fetcher, getSiloV2Calls, parseSiloV2Results, getSiloV2Abi, } from './siloV2';
|
|
9
9
|
export { siloV3Fetcher, getSiloV3Calls, parseSiloV3Results, getSiloV3Abi, } from './siloV3';
|
|
10
10
|
export { fluidFetcher, getFluidCalls, parseFluidResults, getFluidAbi, type FluidQueryMeta, } from './fluid';
|
|
11
|
+
export { gearboxV3Fetcher, getGearboxV3Calls, parseGearboxV3Results, getGearboxV3Abi, type GearboxV3QueryMeta, } from './gearbox';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AACjB,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"}
|
|
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,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AACjB,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"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { MorphoQueryMeta, MorphoMarketOverride, FetcherResult, OraclePriceEntry, ParseContext } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the Morpho GraphQL API is available for a given chain.
|
|
4
|
+
* Some chains are not indexed by the Morpho API.
|
|
5
|
+
*
|
|
6
|
+
* Callers use this to classify chains into two strict modes:
|
|
7
|
+
* - available → API only (ignore overrides)
|
|
8
|
+
* - unavailable → on-chain from overrides only (skip API)
|
|
9
|
+
*/
|
|
10
|
+
export declare function morphoApiAvailable(chainId: string): boolean;
|
|
2
11
|
/**
|
|
3
12
|
* Market overrides for extending Morpho markets beyond JSON data
|
|
4
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/morpho.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/morpho.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAA;AAQjB;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ3D;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAAA;CAC1C,CAAA;AAyBD;;;GAGG;AACH,UAAU,iBAAiB;IACzB,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B;AAgCD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,qBAAqB,CAAA;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,oBAAoB,GAC7B,aAAa,CAAC,iBAAiB,CAAC,EAAE,CA6BpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,GACpB,gBAAgB,EAAE,CAgEpB;AAED;;GAEG;AACH,wBAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;GAE3B;AA+CD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CA4DpC;AA+JD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;CAIzB,CAAA"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createMarketUid } from './marketUid';
|
|
2
2
|
export { lenderShortName } from './marketName';
|
|
3
|
-
export { isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isLista, isAaveV3Type, isAaveV2Type, isYLDR, isAaveV32Type, isAaveType, isCompoundV2Type, isVenusType, isSumerType, isTectonicType, isBenqiType, isMultiMarket, isEulerType, isAaveV4Type, isSiloV2Type, isSiloV3Type, isFluid, } from '@1delta/lender-registry';
|
|
3
|
+
export { isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isLista, isAaveV3Type, isAaveV2Type, isYLDR, isAaveV32Type, isAaveType, isCompoundV2Type, isVenusType, isSumerType, isTectonicType, isBenqiType, isMultiMarket, isEulerType, isAaveV4Type, isSiloV2Type, isSiloV3Type, isFluid, isGearboxV3, } from '@1delta/lender-registry';
|
|
4
4
|
export declare const ENABLED_EULER_V2_CHAINS: string[];
|
|
5
5
|
export declare const getLendersForChain: (c: string) => string[];
|
|
6
6
|
/** Filter lenders by protocol list */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,WAAW,GACZ,MAAM,yBAAyB,CAAA;AAgChC,eAAO,MAAM,uBAAuB,EAAE,MAAM,EAgB3C,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,aAiF3C,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,GAClC,YAAY,MAAM,EAAE,EACpB,eAAe,MAAM,EAAE,KACtB,MAAM,EAmBR,CAAA;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB;;CAS5B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,kBAAiB,MAAuB,KACvC,MAAM,EAOR,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketName.d.ts","sourceRoot":"","sources":["../../src/utils/marketName.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marketName.d.ts","sourceRoot":"","sources":["../../src/utils/marketName.ts"],"names":[],"mappings":"AAgDA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAItD"}
|